WordPress.org

Ready to get started?Download WordPress

Forums

Codepress Admin Columns
[resolved] Use the admin_body_class properly (Bug fix in your plugin included) (2 posts)

  1. SilbinaryWolf
    Member
    Posted 1 year ago #

    I recently got a complaint that my "Ultimate Metabox Tabs" plugin was incompatible with your plugin.

    This is due to the fact that your "admin_body_class" hook was used incorrectly, below is a patch for your function in "codepress-admin-columns.php"

    You need to pass the original classes through the return.

    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;
    	}

    Cheers, Jake.

    http://wordpress.org/extend/plugins/codepress-admin-columns/

  2. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for spotting that. I will include a fix in next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic