Advertisement
longnguyenwp

Untitled

Apr 15th, 2020
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.64 KB | None | 0 0
  1. <?php
  2. add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
  3.  
  4. function your_prefix_register_meta_boxes( $meta_boxes ) {
  5.     $prefix = '';
  6.  
  7.     $meta_boxes[] = array (
  8.         'title' => esc_html__( 'Group', 'text-domain' ),
  9.         'id' => 'group',
  10.         'post_types' => array(
  11.             0 => 'post',
  12.         ),
  13.         'context' => 'normal',
  14.         'priority' => 'high',
  15.         'fields' => array(
  16.             array (
  17.                 'id' => $prefix . 'group',
  18.                 'type' => 'group',
  19.                 'name' => esc_html__( 'Group', 'text-domain' ),
  20.                 'fields' => array(
  21.                     array (
  22.                         'id' => $prefix . 'slider',
  23.                         'type' => 'slider',
  24.                         'name' => esc_html__( 'Slider', 'text-domain' ),
  25.                         'std' => 16,
  26.                         'clone' => 1,
  27.                         'clone_default' => 1,
  28.                     ),
  29.                     array (
  30.                         'id' => $prefix . 'button_group',
  31.                         'name' => esc_html__( 'Button Group', 'text-domain' ),
  32.                         'type' => 'button_group',
  33.                         'std' => array(
  34.                             0 => '3',
  35.                             1 => '4',
  36.                         ),
  37.                         'options' => array(
  38.                             1 => esc_html__( '1', 'text-domain' ),
  39.                             2 => esc_html__( '2', 'text-domain' ),
  40.                             3 => esc_html__( '3', 'text-domain' ),
  41.                             4 => esc_html__( '4', 'text-domain' ),
  42.                         ),
  43.                         'clone' => 1,
  44.                         'inline' => 1,
  45.                         'multiple' => 1,
  46.                         'clone_default' => 1,
  47.                     ),
  48.                     array (
  49.                         'id' => $prefix . 'checkbox',
  50.                         'name' => esc_html__( 'Checkbox', 'text-domain' ),
  51.                         'type' => 'checkbox',
  52.                         'desc' => esc_html__( 'Default Description', 'text-domain' ),
  53.                         'std' => 1,
  54.                     ),
  55.                 ),
  56.                 'clone' => 1,
  57.                 'default_state' => 'expanded',
  58.                 'clone_default' => 1,
  59.                 'collapsible' => true,
  60.             ),
  61.         ),
  62.     );
  63.  
  64.     return $meta_boxes;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement