Include Exclude not working

Support MB Include Exclude Include Exclude not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4547
    markfivemarkfive
    Participant

    I've just purchased the extension bundle & include this in my theme folder
    require get_template_directory() . '/meta-box-include-exclude/meta-box-include-exclude.php';

    in the functions.php:

    add_filter( 'rwmb_meta_boxes', 'prefix_include_exclude_demo' );
    function prefix_include_exclude_demo( $meta_boxes )
    {
    	$prefix = 'pre_';
    	$meta_boxes[] = array(
    		'title'   => 'Include Metabox',
    		'include' => array(
    			// List of page templates. Can be array or comma separated. Optional.
    			'template' => array( 'page-about.php' ),
    		),
    		'fields' => array(
    			array(
    				'name' => '',
    				'id'   => 'about_options',
    				'type' => 'text',
    			),
    		),
    	);
    
    	return $meta_boxes;
    }

    it doesn't seem to work on my page template that i've specified, can you guide me what's going wrong?

    Thanks

    #4552
    markfivemarkfive
    Participant

    solved

    // About metabox
    	$meta_boxes[] = array(
    		'id' => 'about_meta',
    		'title' => 'About Page Fields',
    		'post_types' => array('page'),
    		'include' => array(
    			// List of page templates. Can be array or comma separated. Optional.
    			'template'        => array( 'page-about.php' ),
    		),
    		'context' => 'normal',
    		'priority' => 'high',
    
    		'fields' => array(
    			array(
    				'name' => '',
    				'id'   => 'about_meta',
    				'type' => 'text',
    			),
    		),
    
    	);
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Include Exclude not working’ is closed to new replies.