Support Forum
For some reason, when I use Tabs, I get an input field for each tab
This is my function
function wcd_blocklayout_register_meta_boxes( $meta_boxes ) {
$prefix = 'wcd-blocklayout-';
$meta_boxes[] = array (
'title' => esc_html__( 'Block Layouts', 'wcd' ),
'id' => 'wcd-block-layouts',
'post_types' => array(
0 => 'wcd_blocklayout',
),
'context' => 'after_title',
'priority' => 'high',
'fields' => array(
array (
'id' => $prefix . '',
),
array (
'id' => $prefix . 'block',
'name' => esc_html__( 'Block', 'wcd' ),
'type' => 'select',
'placeholder' => esc_html__( 'Select an Item', 'wcd' ),
'clone' => 1,
'add_button' => esc_html__( 'Add another block', 'wcd' ),
'tab' => 'settings-tab',
),
array (
'id' => $prefix . '',
),
array (
'id' => $prefix . 'post_type',
'name' => esc_html__( 'Post Type', 'wcd' ),
'type' => 'select',
'placeholder' => esc_html__( 'Select an Item', 'wcd' ),
'options' => array(
'posts' => esc_html__( 'posts', 'wcd' ),
'pages' => esc_html__( 'pages', 'wcd' ),
),
'clone' => 1,
'required' => 1,
'add_button' => esc_html__( 'Add Location Rule', 'wcd' ),
'tab' => 'display-tab',
),
array (
'id' => $prefix . 'exclude',
'name' => esc_html__( 'Exclude Post Type', 'wcd' ),
'type' => 'select',
'placeholder' => esc_html__( 'Select an Item', 'wcd' ),
'options' => array(
'posts' => esc_html__( 'posts', 'wcd' ),
'pages' => esc_html__( 'pages', 'wcd' ),
),
'clone' => 1,
'add_button' => esc_html__( 'Add Exclusion Rule', 'wcd' ),
'tab' => 'display-tab',
),
array (
'id' => $prefix . '',
),
array (
'id' => $prefix . 'notes',
'type' => 'textarea',
'name' => esc_html__( 'Internal Notes', 'wcd' ),
'tab' => 'notes-tab',
),
),
'tab_style' => 'default',
'tab_wrapper' => true,
'text_domain' => 'wcd',
'tabs' => array(
'settings-tab' => array(
'label' => 'Settings',
'icon' => 'dashicons-admin-generic',
),
'display-tab' => array(
'label' => 'Display Rules',
'icon' => 'dashicons-admin-tools',
),
'notes-tab' => array(
'label' => 'Internal Notes',
'icon' => 'dashicons-edit',
),
),
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'wcd_blocklayout_register_meta_boxes' );