Advertisement
Guest User

Untitled

a guest
Nov 26th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.72 KB | None | 0 0
  1. add_action('rwmb_meta_boxes', 'twt_metabox_io_blocks');
  2. function twt_metabox_io_blocks($meta_boxes) {
  3.     $meta_boxes[] = array(
  4.         'id'         => 'twt-menu-block',
  5.         'title'      => 'TWT Menu Section',
  6.         'type'            => 'block',
  7.         'icon'            => 'editor-table',
  8.         'category'        => 'layout',
  9.         //'context'         => 'side',
  10.         'render_callback' => 'twt_render_menu_block',
  11.         'supports' => array(
  12.             'anchor' => false,
  13.             'customClassName' => true,
  14.         ),
  15.         'fields' => array(
  16.             array(
  17.                 'name' => 'Featured Photo',
  18.                 'id'   => 'featured_photo',
  19.                 'type' => 'single_image',
  20.             ),
  21.             array(
  22.                 'name' => 'Title',
  23.                 'id'   => 'title',
  24.                 'type' => 'textarea',
  25.                 'rows' => 2,
  26.             ),
  27.             array(
  28.                 'name' => 'Text After Title (Full Width)',
  29.                 'id'   => 'content_after_title',
  30.                 'type' => 'wysiwyg',
  31.                 'options' => array(
  32.                     'textarea_rows' => 4,
  33.                     'teeny'         => false,
  34.                 ),
  35.             ),
  36.             array(
  37.                 'name' => 'Text Before Menu Items',
  38.                 'id'   => 'content_before',
  39.                 'type' => 'wysiwyg',
  40.                 'options' => array(
  41.                     'textarea_rows' => 4,
  42.                     'teeny'         => false,
  43.                 ),
  44.             ),
  45.             array(
  46.                 'name' => 'Menu Items',
  47.                 'id'   => 'menu_items',
  48.                 'type' => 'group',
  49.                 'clone' => true,
  50.                 'sort_clone' => true,
  51.                 'collapsible' => true,
  52.                 'default_state' => 'collapsed',
  53.                 'group_title' => '{name}',
  54.                 'fields' => array(
  55.                     array(
  56.                         'name' => 'Dish Name',
  57.                         'id'   => 'name',
  58.                         'type' => 'text',
  59.                         'size' => '100'
  60.                     ),
  61.                     array(
  62.                         'name' => 'Dish Description',
  63.                         'id'   => 'desc',
  64.                         'type' => 'textarea',
  65.                         'rows' => 4
  66.                     ),
  67.                     array(
  68.                         'name' => 'Attributes',
  69.                         'id'   => 'attr',
  70.                         'type' => 'checkbox_list',
  71.                         'options' => array(
  72.                             'gf' => 'Gluten Free',
  73.                             'highlight' => 'Highlight (Blue Background)',
  74.                             'half-width' => 'Half Width',
  75.                             'no-br' => 'No Line Break after Name',
  76.                         ),
  77.                     ),
  78.                 ),
  79.             ),
  80.             array(
  81.                 'name' => 'Text After Menu Items',
  82.                 'id'   => 'content_after',
  83.                 'type' => 'wysiwyg',
  84.                 'options' => array(
  85.                     'textarea_rows' => 4,
  86.                     'teeny'         => false,
  87.                 ),
  88.             ),
  89.             array(
  90.                 'name' => 'Attributes',
  91.                 'id'   => 'attr',
  92.                 'type' => 'checkbox_list',
  93.                 'options' => array(
  94.                     'half-width-section' => 'Half Width Section',
  95.                 ),
  96.             ),
  97.             array(
  98.                 'name' => 'ID',
  99.                 'id'   => 'id',
  100.                 'type' => 'text',
  101.                 'desc' => 'for Menu Page Navigation'
  102.             ),
  103.         )
  104.     );
  105.     return $meta_boxes;
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement