Input Fields at top of section when using tabs
- This topic has 6 replies, 2 voices, and was last updated 5 years ago by
Long Nguyen.
-
AuthorPosts
-
April 17, 2020 at 2:07 PM #19091
carassius
ParticipantFor 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' );
April 17, 2020 at 3:57 PM #19096Long Nguyen
ModeratorHi,
Please remove the code (three times)
array ( 'id' => $prefix . '', ),
which renders input fields, see my screenshot https://cl.ly/b9a30d9456eb
April 21, 2020 at 7:54 AM #19169carassius
ParticipantThanks, so that is the builder that output the code for me, so there must be a bug in the builder
April 21, 2020 at 9:40 AM #19173Long Nguyen
ModeratorHi,
I've tested on my site but cannot replicate this issue. Could you please take a screen record when building the tabs with MB Builder? And please make sure the
Tab
field must be added first or stay on the top of list fields, see this screenshot https://cl.ly/567689ec5a0eApril 21, 2020 at 11:45 AM #19177carassius
ParticipantHere is a exported dat file of one I just created
https://gist.github.com/WestCoastDigital/2acd3f0d375e320abe56f4f27c03ef4e
April 21, 2020 at 11:49 AM #19178carassius
ParticipantI realise I cannot use tabs in groups either, which sucks as I was hoping to seperate content from style for each slide
April 21, 2020 at 2:39 PM #19183Long Nguyen
ModeratorHi,
You can use the tab and group as well but when using the Builder, the field tab must be added first. Please see my screen record https://www.loom.com/share/894e1842c81c4f56aaa1d84b75d2bf99
-
AuthorPosts
- You must be logged in to reply to this topic.