Hi there, I'd like to make a restaurant menu with metabox group.
This the first big group clone with one single category title
Title Category - ie. Salads
And this items clone also.
Title Salad - ie. Ceaser Salad
Description Salad - ie. Lettuce, rockets ...
Price - 9.99
Title Salad 2 - ie. Tomato Salad
Description Salad - ie. Lettuce, rockets ...
Price - 8.99
$meta_boxes[] = array(
'title' => __( 'the tile' ),
'pages' => array( 'page' ),
'context' => 'normal',
'priority' => 'high',
'show' => array(
'relation' => 'OR',
'template' => array( 'page-menu.php' ),
),
'fields' => array(
array(
'id' => $prefix . 'menu_cat_group',
'name' => 'Group',
'desc' => 'Menu Categorie',
'type' => 'group', //Here the big group clone
'clone' => true,
'fields' => array(
array(
'name' => 'Menu category title',
'id' => $prefix . 'menu_cat_title',
'desc' => 'Create a menu mother category',//one main category title Salads
'type' => 'text',
'columns'=> 12,
'clone' => false,
),
array(
'id' => $prefix . 'menu_cat_desc',
'type' => 'group', //The second clone group
'clone' => true,
'fields' => array(
array(
'name' => 'Item title', //ie. Ceaser Salad
'id' => $prefix . 'menu_item_description',
'desc' => 'Item title here',
'columns'=> 4,
'type' => 'text',
),
array(
'name' => 'Description',
'id' => $prefix . 'menu_item_description',
'desc' => 'Describe your item here',
'columns'=> 4,
'type' => 'textarea',
),
array(
'name' => 'Price',
'id' => $prefix . 'menu_item_price',
'desc' => 'Display the price here',
'columns'=> 4,
'type' => 'text',
),
),
),
),
),
),
);