Ultimate Metabox Tabs
[resolved] Incompatibility with Codepress Admin Columns (3 posts)

  1. Sweet Homes
    Posted 2 years ago #

    Hi SilbinaryWolf,

    Ultimate Metabox Tabs don't work with Codepress Admin Columns (VersiĆ³n, last).

    Any stuff?

    Thanks and great plugin.


  2. SilbinaryWolf
    Plugin Author

    Posted 2 years ago #

    Hi Sweet Homes,

    The creator of that plugin has used the admin_body_class hook incorrectly and the error is his/her fault.

    Replace admin_class in codepress-admin-columns.php with:

    function admin_class($classes)
    		global $current_screen;
    		// we dont need the 'edit-' part
    		$screen = str_replace('edit-', '', $current_screen->id);
    		// media library exception
    		if ( $current_screen->base == 'upload' && $current_screen->id == 'upload' ) {
    			$screen = 'media';
    		// link exception
    		if ( $current_screen->base == 'link-manager' && $current_screen->id == 'link-manager' ) {
    			$screen = 'links';
    		// loop the available types
    		foreach ( $this->get_types() as $type => $label ) {			
    			// match against screen or wp-screen
    			if ( $type == $screen || $type == "wp-{$screen}" )
    				return $classes . " cp-{$type}";
    		return $classes;

    I've posted a topic on the support section of his plugin, telling him how to fix it.

    Cheers, Jake.

  3. Tobias Schutter
    Posted 2 years ago #

    You are right. I forgot to return the $classes from that admin_class filter. I will fix it in the next release. Thanks for spotting that!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic