Hi,
I seem to be having trouble with including metaboxes on a specific category only. I want to be able to show the metabox on posts with the category ID of 94. But it just shows up on all posts. Code is below. Am I doing something wrong?
// Events Posts – /////////////////
$meta_boxes[] = array(
// Meta box id, UNIQUE per meta box. Optional since 4.1.5
'id' => 'current_event_id',
// Meta box title - Will appear at the drag and drop handle bar. Required.
'title' => __( 'Current Event Extra content', 'rwmb' ),
// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
'pages' => array( 'post' ),
// Where the meta box appear: normal (default), advanced, side. Optional.
'context' => 'normal',
// Order of meta box: high (default), low. Optional.
'priority' => 'high',
// Auto save: true, false (default). Optional.
'autosave' => true,
// Register this meta box for posts matched below conditions
'include' => array(
'category' => array( 94 )
),
// List of meta fields
'fields' => array(
// TEXT
array(
// Field name - Will be used as label
'name' => __( 'Ribbon Text', 'meta-box' ),
// Field ID, i.e. the meta key
'id' => "{$prefix}event-ribbon-text",
// Field description (optional)
'desc' => __( 'Enter text for the ribbon e.g Date of event', 'meta-box' ),
'type' => 'text',
),
),
);