0

Within WordPress 4.6.1, I really like the thumbtack icon that is being used in the admin menus. This is the thumbtack icon (generated in CSS) that I am referring to...

enter image description here

I'm currently using the WordPress API to generate my own menu with the following admin menu hook...

    add_menu_page('Cool Plugin Page', 'Cool Plugin', 'manage_options', 'my_main_menu','my_main_plugin_page', plugins_url('/images/thumbtack-icon.jpg',__FILE__));

So how do I replace the plugins_url() portion within my hook with the same css thumbtack that WordPress is using for the other menu section? When I view source through developer tools, I see it looks like this...

.dashicons-admin-post:before, .dashicons-format-standard:before {
    content: "\f109";
}

1 Answer 1

1

Wordpress uses Dashicons. Basically you would replace your code with this:

add_menu_page('Cool Plugin Page', 'Cool Plugin', 'manage_options', 'my_main_menu','my_main_plugin_page', 'dashicons-admin-post', '');

1
  • 1
    Very nice! This is almost like having font-awesome built into Wordpress! Thank you so much!
    – klewis
    Oct 22, 2016 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.