Skip to content

Instantly share code, notes, and snippets.

@hattmarris
Last active August 29, 2015 14:11
Show Gist options
  • Save hattmarris/728aac5dcb0f2f7f4db8 to your computer and use it in GitHub Desktop.
Save hattmarris/728aac5dcb0f2f7f4db8 to your computer and use it in GitHub Desktop.
Create WP dashicon for Custom Post Type within a class
<?php
class CLASSNAME {
public function __construct() {
add_action( 'admin_head', array($this, 'classname_add_menu_icons_styles') );
}
public static function classname_add_menu_icons_styles() {
?>
<style>
#adminmenu .menu-icon-post_type div.wp-menu-image:before {
content: "\f323";
}
</style>
<?php
}
}
$classname = new CLASSNAME();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment