Advertisement
Guest User

Untitled

a guest
Feb 11th, 2018
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.47 KB | None | 0 0
  1. <?php
  2. add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
  3. function your_prefix_register_meta_boxes( $meta_boxes ) {
  4.     $meta_boxes[] = array (
  5.       'id' => 'question',
  6.       'title' => 'Question',
  7.       'pages' =>   array (
  8.          'question',
  9.       ),
  10.       'context' => 'after_title',
  11.       'priority' => 'high',
  12.       'autosave' => false,
  13.       'fields' =>   array (
  14.         array (
  15.           'id' => 'post_4',
  16.           'type' => 'post',
  17.           'name' => 'Post',
  18.           'post_type' => 'post',
  19.           'field_type' => 'select_advanced',
  20.         ),
  21.          
  22.         array (
  23.           'id' => 'textarea_bchoa_question_text',
  24.           'type' => 'textarea',
  25.           'name' => 'Question',
  26.           'desc' => 'Please enter any additional content here - be as descriptive as you like.',
  27.           'rows' => '3',
  28.         ),
  29.          
  30.         array (
  31.           'id' => 'checkbox_bchoa_notification',
  32.           'name' => 'Notification',
  33.           'type' => 'checkbox',
  34.           'desc' => 'Check this box if you want to be notified of responses',
  35.           'std' => 1,
  36.         ),
  37.          
  38.         array (
  39.           'id' => 'divider_3',
  40.           'type' => 'divider',
  41.           'name' => 'Divider',
  42.         ),
  43.       ),
  44.       'validation' => [
  45.         'rules' => [
  46.           'post_title' => [
  47.             'required'   => true,
  48.             'minlength' => 5,
  49.           ],
  50.         ],
  51.       ],
  52.     );
  53.  
  54.     return $meta_boxes;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement