Using DashIcons in conjunction with $wp_admin_bar->add_menu()
-
Hey all,
I’m just updating a couple of plugins to make them compatible with 3.8 and the new (ugly?) admin area, and I’ve hit a brick wall with the Admin Bar and the new DashIcons.
Take the example below – does anyone know how I’d amend this so that I can include my chosen DashIcon next to the text link?
$wp_admin_bar->add_menu(array('id' => 'charts', 'title' => __('Charts'), 'href' => admin_url('/admin.php?page=charts'))); if(current_user_can('create_charts')) : $wp_admin_bar->add_menu(array('parent' => 'charts', 'id' => 'add-chart', 'title' => __('Add Chart'), 'href' => admin_url('/admin.php?page=add-chart'))); endif;
I’ve tried the following CSS, but all that does is push the text underneath the icon, as opposed to show before it (almost like there is a width issue). Also the icon is not the correct size.
#wpadminbar #wp-admin-bar-charts:before{ font-family: "dashicons" !important; content: "\f185" !important; }
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Using DashIcons in conjunction with $wp_admin_bar->add_menu()’ is closed to new replies.