Reputation:
I have some php which has some links within it which I'd like to style and turn into buttons.
add_action('admin_menu', 'wpso_custom_links_admin_menu');
function wpso_custom_links_admin_menu() {
global $submenu;
$submenu['index.php'][] = array( 'Link One', 'read', 'https://www.example.com/' );
$submenu['index.php'][] = array( 'Link Two', 'read', 'https://asdf.com/' );
}
The issue is that I'm not sure how or where to add a class here in order to style with css.
Upvotes: 2
Views: 380
Reputation: 428
This should do:
add_action('admin_menu', 'wpso_custom_links_admin_menu');
function wpso_custom_links_admin_menu() {
global $submenu;
$submenu['index.php'][] = array( 'Link One', 'read', 'https://www.example.com/', '', 'my-class');
$submenu['index.php'][] = array( 'Link Two', 'read', 'https://asdf.com/', '', 'my-class');
}
Upvotes: 1