Using custom function to include a metabox not working at all

Support MB Include Exclude Using custom function to include a metabox not working at all

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3599
    StellarStudiosStellarStudios
    Participant

    In my custom post type declaration, I have the following metabox (as an example)

    $meta_boxes[] = array(
            'id'       => 'description',
            'title' => 'Description',
            'pages'    => array('recipe'),
            'context'  => 'normal',
            'priority' => 'high',
            'include' => array(
                'custom' => 'my_include_field'
            ),
            'fields'   => array(
                array(
                    'id'    => $prefix.'description',
                    'type'  => 'wysiwyg',
                )
            )
        );

    I wrote a function which tests against a setting, but just to try to make it do SOMETHING, I did this

    function my_include_field($meta_box) {
        return false;
    }

    But the box is still showing up in the CPT single post edit.

    #3602
    Anh TranAnh Tran
    Keymaster

    I tested with the same code for page and the meta box is not shown in the edit page. Do you use any other condition elsewhere? Or is the meta box hid by the Screen Options?

    #3611
    StellarStudiosStellarStudios
    Participant

    ...... I feel like a complete moron.
    I forgot to include (and require) the Include Exclude extension in my plugin.
    Wow. Sorry!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Using custom function to include a metabox not working at all’ is closed to new replies.