Custom Fields
Support MB Admin Columns No Admin Columns Showing

  • This topic has 15 replies, 4 voices, and was last updated 6 months ago by Pau.
  • Creator
  • #15302
    Resolved SLG Marketing

    I've tried adding some admin columns to a CPT but they won't output at all. What am I doing wrong?

     public function generateMetaBox($meta_boxes){
            // General
                'title'=>'General Person Settings',
                'post_types' => 'people',
                'context'    => 'normal',
                'priority'   => 'high',
                'fields'=> array(
                        'name'  =>  'Job Title',
                        'id'    =>  'people_jobtitle',
                        'type'  =>  'text',
                        'desc'=>'TODO: help text',
                        'admin_columns' => 'after title'
                        'name'=>'Year Joined',
                        'desc'=>'TODO: help text',
                        'min'   =>  1980,
                        'max'   =>  date('Y'),
                        'admin_columns' => true,
            return $meta_boxes;
Viewing 10 replies - 1 through 10 (of 15 total)
  • Author
  • #15307
    Anh Tran

    I know this is a stupid question, but have you activated the MB Admin Columns extension? Some users forget to do this.

    SLG Marketing

    It's being loaded as an MU plugin. I'll try moving it to the normal plugin folder.

    SLG Marketing

    I just tried it as a normal plugin, I am getting the same issue.

    SLG Marketing

    Is there any further debug information you need on this?


    Did anyone ever find anything on this issue?
    I'm having similar issues at the moment, and it looks like it's related to the id in the main array ('general' in this example).
    On my setup it seems that only fields from an array where the 'id' is equal to the post-type slug are presented in the admin columns. But this is something recent, because I know quite certain that the field showed up a few months ago.

    Any thoughts?



    SLG Marketing


    I didn't get any feedback from the devs which was a little disappointing.

    My own research indicates that it is caused by the order that custom post types are loaded. I haven't looked at this for ages so I'll spin up a test site and do some more digging.

    SLG Marketing

    I have figured this out, you need to have an execution order greater than the default of 10 on the metabox rwmb_meta_boxes filter.

    add_filter( 'rwmb_meta_boxes', [$this,'generateMetaBox']);


    add_filter( 'rwmb_meta_boxes', [$this,'generateMetaBox'],20);
    Anh Tran

    Hi guys, sorry for not following up the thread. I think the solution above should work. Please let me know if you have any trouble with that.



    the order definitely does influence the appearance of the admin columns, but only the highest one remains visible. Our website had multiple calls to
    add_filter( 'rwmb_meta_boxes', function($metabox){$metabox[]=[....]}, 20);
    (one for each post-type)

    If I add both
    add_filter( 'rwmb_meta_boxes', function($metabox){$metabox[]=[....]}, 20);
    add_filter( 'rwmb_meta_boxes', function($metabox){$metabox[]=[....]}, 21);
    all fields function properly, except the admin columns: only the admin columns in the highest one do appear.

    SLG Marketing

    What order are you loading in your CPTs?

    We load ours from MU plugins which has a higher execution order than ones in the theme or the normal plugin folder.

Viewing 10 replies - 1 through 10 (of 15 total)
  • You must be logged in to reply to this topic.