Skip to content

Instantly share code, notes, and snippets.

@ryandonsullivan
Created July 13, 2012 00:06
Show Gist options
  • Save ryandonsullivan/3101961 to your computer and use it in GitHub Desktop.
Save ryandonsullivan/3101961 to your computer and use it in GitHub Desktop.
Custom Post Icons
function wpsc_tutorial_icons() {
global $post_type;
?>
<style>
<?php if (($_GET['post_type'] == 'tutorial') || ($post_type == 'tutorial')) : ?>
#icon-edit { background:transparent; background-image: url('<?php echo plugins_url('images/tutorial.png', __FILE__) ?>') no-repeat !important; }
<?php endif; ?>
#adminmenu #menu-posts-tutorial div.wp-menu-image{background:transparent; background-image: url('<?php echo plugins_url('images/tutorial.png', __FILE__) ?>') no-repeat !important;}
#adminmenu #menu-posts-tutorial:hover div.wp-menu-image,#adminmenu #menu-posts-tutorial.wp-has-current-submenu div.wp-menu-image{background:transparent; background-image: url('<?php echo plugins_url('images/tutorial.png', __FILE__) ?>') no-repeat !important;}
</style>
<?php
}
add_action('admin_head', 'wpsc_tutorial_icons');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment