Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('rwmb_meta_boxes', 'twt_metabox_io_blocks');
- function twt_metabox_io_blocks($meta_boxes) {
- $meta_boxes[] = array(
- 'id' => 'twt-menu-block',
- 'title' => 'TWT Menu Section',
- 'type' => 'block',
- 'icon' => 'editor-table',
- 'category' => 'layout',
- //'context' => 'side',
- 'render_callback' => 'twt_render_menu_block',
- 'supports' => array(
- 'anchor' => false,
- 'customClassName' => true,
- ),
- 'fields' => array(
- array(
- 'name' => 'Featured Photo',
- 'id' => 'featured_photo',
- 'type' => 'single_image',
- ),
- array(
- 'name' => 'Title',
- 'id' => 'title',
- 'type' => 'textarea',
- 'rows' => 2,
- ),
- array(
- 'name' => 'Text After Title (Full Width)',
- 'id' => 'content_after_title',
- 'type' => 'wysiwyg',
- 'options' => array(
- 'textarea_rows' => 4,
- 'teeny' => false,
- ),
- ),
- array(
- 'name' => 'Text Before Menu Items',
- 'id' => 'content_before',
- 'type' => 'wysiwyg',
- 'options' => array(
- 'textarea_rows' => 4,
- 'teeny' => false,
- ),
- ),
- array(
- 'name' => 'Menu Items',
- 'id' => 'menu_items',
- 'type' => 'group',
- 'clone' => true,
- 'sort_clone' => true,
- 'collapsible' => true,
- 'default_state' => 'collapsed',
- 'group_title' => '{name}',
- 'fields' => array(
- array(
- 'name' => 'Dish Name',
- 'id' => 'name',
- 'type' => 'text',
- 'size' => '100'
- ),
- array(
- 'name' => 'Dish Description',
- 'id' => 'desc',
- 'type' => 'textarea',
- 'rows' => 4
- ),
- array(
- 'name' => 'Attributes',
- 'id' => 'attr',
- 'type' => 'checkbox_list',
- 'options' => array(
- 'gf' => 'Gluten Free',
- 'highlight' => 'Highlight (Blue Background)',
- 'half-width' => 'Half Width',
- 'no-br' => 'No Line Break after Name',
- ),
- ),
- ),
- ),
- array(
- 'name' => 'Text After Menu Items',
- 'id' => 'content_after',
- 'type' => 'wysiwyg',
- 'options' => array(
- 'textarea_rows' => 4,
- 'teeny' => false,
- ),
- ),
- array(
- 'name' => 'Attributes',
- 'id' => 'attr',
- 'type' => 'checkbox_list',
- 'options' => array(
- 'half-width-section' => 'Half Width Section',
- ),
- ),
- array(
- 'name' => 'ID',
- 'id' => 'id',
- 'type' => 'text',
- 'desc' => 'for Menu Page Navigation'
- ),
- )
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement