I agree. This functionality is needed.
To have something like: ‘menu_icon’ => plugins_url(‘/img/my_icon.png’, __FILE__) as part of the $args array.
yes…. please please please….
I just added this to my functions.php file:
// Add new Custom Post Type icons
add_action( 'admin_head', 'cpt_icons' );
function cpt_icons() {
?> <!--escape the regular php dillimeter to allow for regular html below-->
<style type="text/css" media="screen">
#menu-posts-cptnamegoeshere .wp-menu-image {
background: url(<?php bloginfo('url') ?>/wp-content/themes/cpt-icons/iconsmall.png) no-repeat 6px !important;
}
.icon32-posts-cptnamegoeshere {
background: url(<?php bloginfo('url') ?>/wp-content/themes/cpt-icons/iconlarge.png) no-repeat !important;
}
</style>
<?php }
?>
Then create 2 different png files in the /wp-content/themes/cpt-icons/
folder and name them: iconsmall.png and iconlarge.png.
the small icon should be 16×16 pixels and the large one 36×36 pixels.
Please remember to change the css classnames to your custom posttype.
So if you have a cpt called “projects” cahnge it to:
#menu-posts-projects
this doesn’t work.
“unexpected token rparen found”.
How fix it ?
Worked…
thanks very much.
frafra85, not sure where that is coming from. I don’t believe that “rparen” is part of the plugin code.
Regarding the menu icon support, noted that down and will get it in the roadmap.