Forgive me, I'm a newb.
I have the Meta Box plugin and just purchased the Include/Exclude plugin so I can show the custom meta boxes on the home page only.
Here is my code:
<?php
add_filter( 'rwmb_meta_boxes', 'meta_box_include_exclude_demo_register' );
/**
* Register meta boxes
*
* @param array $meta_boxes
*
* @return array
*/
function meta_box_include_exclude_demo_register( $meta_boxes )
{
// 1st meta box
$meta_boxes[] = array(
// Meta box id, UNIQUE per meta box. Optional since 4.1.5
'id' => 'meta-decoy-101',
// Meta box title - Will appear at the drag and drop handle bar. Required.
'title' => __( 'Decoy 101', 'meta-decoy-101' ),
// 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(
// List of page templates. Can be array or comma separated. Optional.
'template' => array( 'page-home.php' ),
),
// List of meta fields
'fields' => array(
/// WYSIWYG/RICH TEXT EDITOR
array(
// 'name' => __( 'WYSIWYG / Rich Text Editor', 'your-prefix' ),
'id' => "meta-decoy-101-content",
'type' => 'wysiwyg',
// Set the 'raw' parameter to TRUE to prevent data being passed through wpautop() on save
'raw' => false,
// Editor settings, see wp_editor() function: look4wp.com/wp_editor
'options' => array(
'textarea_rows' => 10,
'teeny' => true,
'media_buttons' => false,
),
),
),
);
return $meta_boxes;
}
/**
* Manual check for including meta box
* You can check ANY conditions here
*
* @param $meta_box
*
* @return bool
*/
function manual_include( $meta_box )
{
if ( $meta_box['title'] == 'Include Meta Box' )
return true;
return false;
}
It's not showing up when I go to Edit Page for the Home Page. The home page is set to use the page-home.php template.