Tagged: fields add_more metabox
- This topic has 0 replies, 1 voice, and was last updated 5 years, 3 months ago by
trosario.
Viewing 0 reply threads
-
AuthorPosts
-
-
October 23, 2016 at 3:00 pm #7457
trosarioParticipantI have the following field structure, but for some reason the fields will not save correctly. You’ll also notice (in the screenshot) the ‘Menu Addons’ is not properly displayed. It should be show as it’s own grouping. Any ideas?
Here is sample code:
piklist('field', array( 'type' => 'group' ,'field' => 'menu_group' ,'label' => 'Menu Group' ,'description' => 'Menu fields' ,'add_more' => false ,'fields' => array( // category array( 'type' => 'text' ,'field' => 'menu_category' ,'label' => __('Menu Category') ,'required' => false ,'columns' => 8 ,'attributes' => array( 'placeholder' => 'e.g. - Flame Grilled Burgers' ) ) // serving sizes ,array( 'type' => 'select' ,'field' => 'menu_serving_sizes' ,'label' => __('Serving Sizes') ,'choices' => array( 'serving_size_3' => '6oz', 'serving_size_4' => '12oz', 'serving_size_5' => '16oz', 'serving_size_6' => '24oz', 'serving_size_7' => 'Gls', 'serving_size_8' => 'Bottle', 'serving_size_1' => 'Glass 16oz', 'serving_size_2' => 'Growler 32oz | 64oz' ) ,'required' => false ,'columns' => 4 ,'attributes' => array( 'multiple' => 'multiple' ) ) // menu items ,array( 'type' => 'group' ,'field' => 'menu_item_group' ,'label' => __('Menu Items') ,'required' => false ,'add_more' => true ,'fields' => array( array( 'type' => 'text' ,'field' => 'menu_item_name' ,'label' => __('Name') ,'required' => false ,'columns' => 12 ,'attributes' => array( 'placeholder' => 'e.g. - Kingsboro Burger' ) ) ,array( 'type' => 'text' ,'field' => 'menu_item_description' ,'label' => __('Description') ,'required' => false ,'columns' => 12 ,'attributes' => array( 'placeholder' => 'e.g. - Local beef topped with your choice of cheese.' ) ) ,array( 'type' => 'text' ,'field' => 'menu_item_price' ,'label' => __('Price') ,'required' => false ,'columns' => 6 ,'add_more' => true ,'attributes' => array( 'placeholder' => 'e.g. - $12.99' ) ) ) ) // menu addons ,array( 'type' => 'group' ,'field' => 'menu_addon_group' ,'label' => __('Menu Addons') ,'required' => false ,'add_more' => true ,'fields' => array( array( 'type' => 'text' ,'field' => 'menu_addon_name' ,'label' => __('Name') ,'required' => false ,'columns' => 6 ,'attributes' => array( 'placeholder' => 'e.g. - Applewood-Smoked Bacon' ) ) ,array( 'type' => 'text' ,'field' => 'menu_addon_price' ,'label' => __('Price') ,'required' => false ,'columns' => 6 ,'attributes' => array( 'placeholder' => 'e.g. - $1.99' ) ) ) ) ) ));Attachments:
You must be logged in to view attached files.
-
-
AuthorPosts
Viewing 0 reply threads
- You must be logged in to reply to this topic.