Support » Plugin: MP6 » Using MP6 icons for a custom post type

  • Resolved theMikeD

    (@themiked)


    Hi there,

    I have a custom post type that is set up and working, and currently set to use the “Pages” icon using this code:

    add_action('admin_head', 'md_set_tips_icon',1);
    function md_set_tips_icon() {
        global $post_type; ?>
    	<style>
    		<?php if (($_GET['post_type'] == 'md_tips') || ($post_type == 'md_tips')) : ?>
    	#icon-edit { background:transparent url('<?php echo get_bloginfo('wpurl');?>/wp-admin/images/icons32.png') no-repeat -312px -5px; }
    	<?php endif; ?>
    
    	#adminmenu #menu-posts-md_tips div.wp-menu-image{background:transparent url('<?php echo get_bloginfo('wpurl');?>/wp-admin/images/menu.png') no-repeat scroll -151px -33px;}
    	#adminmenu #menu-posts-md_tips:hover div.wp-menu-image, #adminmenu #menu-posts-gallery.wp-has-current-submenu div.wp-menu-image{background:transparent url('<?php echo get_bloginfo('wpurl');?>/wp-admin/images/menu.png') no-repeat scroll -151px -1px;}
    	</style>
        <?php
    }

    This works fine. However with MP6 active, the icon in use is not being changed to the MP6 one.

    I wrote a simple function to detect if MP6 is active:

    function md_is_mp6_active( ) {
        return in_array( 'mp6', (array) get_option( 'active_plugins', array() ) );
    }

    which works fine. But I don’t see how to change the icons. So I guess I have two questions.

    First, is there a way to do this such that the CPT icon is changed by the MP6 plugin automatically?

    If not, how can I use the MP6 icons with my CPT? All advice is most welcome.

    …Mike

    http://wordpress.org/plugins/mp6/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using MP6 icons for a custom post type’ is closed to new replies.