Advertisement
Guest User

Untitled

a guest
Oct 1st, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.71 KB | None | 0 0
  1. <?php
  2. add_filter( 'rwmb_meta_boxes', 'dv_register_meta_boxes' );
  3.  
  4. function dv_register_meta_boxes( $meta_boxes ) {
  5.     $prefix = 'dv_';
  6.  
  7.     $meta_boxes[] = array (
  8.         'title' => esc_html__( 'Voyage Details', 'discovery' ),
  9.         'id' => 'voyage-details',
  10.         'post_types' => array(
  11.             0 => 'voyage',
  12.         ),
  13.         'context' => 'normal',
  14.         'priority' => 'high',
  15.         'fields' => array(
  16.             array (
  17.                 'id' => $prefix . 'tour_grid_label',
  18.                 'type' => 'text',
  19.                 'name' => esc_html__( 'Tour Grid Label:', 'discovery' ),
  20.                 'desc' => esc_html__( 'Enter tour label for grid display. Example "20% Off or New 2019".', 'discovery' ),
  21.                 'size' => 60,
  22.                 'columns' => 6,
  23.             ),
  24.             array (
  25.                 'id' => $prefix . 'tour_grid_duration',
  26.                 'type' => 'text',
  27.                 'name' => esc_html__( 'Tour Grid Duration:', 'discovery' ),
  28.                 'desc' => esc_html__( 'Enter tour duration.', 'discovery' ),
  29.                 'size' => 60,
  30.                 'columns' => 6,
  31.             ),
  32.             array (
  33.                 'id' => $prefix . 'tour_grid_price',
  34.                 'type' => 'text',
  35.                 'name' => esc_html__( 'Tour Grid Price:', 'discovery' ),
  36.                 'desc' => esc_html__( 'Enter tour grid price.', 'discovery' ),
  37.                 'size' => 60,
  38.                 'columns' => 6,
  39.             ),
  40.             array (
  41.                 'id' => $prefix . 'tour_grid_excerpt',
  42.                 'type' => 'textarea',
  43.                 'name' => esc_html__( 'Tour Grid Excerpt:', 'discovery' ),
  44.                 'desc' => esc_html__( 'Enter a specific excerpt that will show up on tour grid display.', 'discovery' ),
  45.             ),
  46.             array (
  47.                 'id' => $prefix . 'voyage_dates_heading',
  48.                 'type' => 'heading',
  49.                 'desc' => esc_html__( 'Enter available departure dates along with tour details. To add a new date select the "Add New Tour Dates" button.', 'discovery' ),
  50.                 'name' => esc_html__( 'Voyage Dates', 'discovery' ),
  51.             ),
  52.             array (
  53.                 'id' => $prefix . 'tour_dates',
  54.                 'type' => 'group',
  55.                 'fields' => array(
  56.                     array (
  57.                         'id' => $prefix . 'tour_booking_page',
  58.                         'type' => 'post',
  59.                         'post_type' => 'product',
  60.                         'name' => esc_html__( 'Tour Booking Page:', 'discovery' ),
  61.                     ),
  62.                     array (
  63.                         'id' => $prefix . 'tour_heading',
  64.                         'type' => 'text',
  65.                         'name' => esc_html__( 'Tour Heading:', 'discovery' ),
  66.                         'desc' => esc_html__( 'Enter tour heading.', 'discovery' ),
  67.                         'size' => 100,
  68.                         'columns' => 12,
  69.                     ),
  70.                     array (
  71.                         'id' => $prefix . 'tour_date',
  72.                         'type' => 'text',
  73.                         'name' => esc_html__( 'Date:', 'discovery' ),
  74.                         'desc' => esc_html__( 'Enter tour date.', 'discovery' ),
  75.                         'size' => 60,
  76.                         'columns' => 6,
  77.                     ),
  78.                     array (
  79.                         'id' => $prefix . 'tour_price',
  80.                         'type' => 'text',
  81.                         'name' => esc_html__( 'Price:', 'discovery' ),
  82.                         'desc' => esc_html__( 'Enter tour price.', 'discovery' ),
  83.                         'size' => 60,
  84.                         'columns' => 6,
  85.                     ),
  86.                     array (
  87.                         'id' => $prefix . 'tour_availability',
  88.                         'type' => 'text',
  89.                         'name' => esc_html__( 'Availability:', 'discovery' ),
  90.                         'desc' => esc_html__( 'Enter tour availability.', 'discovery' ),
  91.                         'size' => 60,
  92.                         'columns' => 6,
  93.                     ),
  94.                     array (
  95.                         'id' => $prefix . 'tour_group_size',
  96.                         'type' => 'text',
  97.                         'name' => esc_html__( 'Group Size:', 'discovery' ),
  98.                         'desc' => esc_html__( 'Enter max group size.', 'discovery' ),
  99.                         'size' => 60,
  100.                         'columns' => 6,
  101.                     ),
  102.                     array (
  103.                         'id' => $prefix . 'tour_duration',
  104.                         'type' => 'text',
  105.                         'name' => esc_html__( 'Duration:', 'discovery' ),
  106.                         'desc' => esc_html__( 'Enter tour duration. Example "10 Days / 9 Nights".', 'discovery' ),
  107.                         'size' => 60,
  108.                         'columns' => 6,
  109.                     ),
  110.                     array (
  111.                         'id' => $prefix . 'tour_begins_ends',
  112.                         'type' => 'text',
  113.                         'name' => esc_html__( 'Begins, Ends In:', 'discovery' ),
  114.                         'desc' => esc_html__( 'Enter where the tour begins, and ends.', 'discovery' ),
  115.                         'size' => 60,
  116.                         'columns' => 6,
  117.                     ),
  118.                     array (
  119.                         'id' => $prefix . 'tour_reservation_page',
  120.                         'type' => 'post',
  121.                         'name' => esc_html__( 'Reservation Page:', 'discovery' ),
  122.                         'desc' => esc_html__( 'Select the tour reservation page.', 'discovery' ),
  123.                         'post_type' => array(
  124.                             0 => 'page',
  125.                         ),
  126.                         'field_type' => 'select_advanced',
  127.                     ),
  128.                     array (
  129.                         'id' => $prefix . 'tour_description',
  130.                         'type' => 'textarea',
  131.                         'name' => esc_html__( 'Tour Description:', 'discovery' ),
  132.                         'desc' => esc_html__( 'Enter tour description.', 'discovery' ),
  133.                     ),
  134.                 ),
  135.                 'clone' => 1,
  136.                 'sort_clone' => 1,
  137.                 'default_state' => 'expanded',
  138.                 'add_button' => esc_html__( 'Add New Tour Dates', 'discovery' ),
  139.                 'columns' => 12,
  140.                 'collapsible' => true,
  141.                 'group_title' => 'Tour Date {#}',
  142.             ),
  143.         ),
  144.         'text_domain' => 'discovery',
  145.     );
  146.  
  147.     return $meta_boxes;
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement