Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'rwmb_meta_boxes', 'dv_register_meta_boxes' );
- function dv_register_meta_boxes( $meta_boxes ) {
- $prefix = 'dv_';
- $meta_boxes[] = array (
- 'title' => esc_html__( 'Voyage Details', 'discovery' ),
- 'id' => 'voyage-details',
- 'post_types' => array(
- 0 => 'voyage',
- ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array (
- 'id' => $prefix . 'tour_grid_label',
- 'type' => 'text',
- 'name' => esc_html__( 'Tour Grid Label:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour label for grid display. Example "20% Off or New 2019".', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_grid_duration',
- 'type' => 'text',
- 'name' => esc_html__( 'Tour Grid Duration:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour duration.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_grid_price',
- 'type' => 'text',
- 'name' => esc_html__( 'Tour Grid Price:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour grid price.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_grid_excerpt',
- 'type' => 'textarea',
- 'name' => esc_html__( 'Tour Grid Excerpt:', 'discovery' ),
- 'desc' => esc_html__( 'Enter a specific excerpt that will show up on tour grid display.', 'discovery' ),
- ),
- array (
- 'id' => $prefix . 'voyage_dates_heading',
- 'type' => 'heading',
- 'desc' => esc_html__( 'Enter available departure dates along with tour details. To add a new date select the "Add New Tour Dates" button.', 'discovery' ),
- 'name' => esc_html__( 'Voyage Dates', 'discovery' ),
- ),
- array (
- 'id' => $prefix . 'tour_dates',
- 'type' => 'group',
- 'fields' => array(
- array (
- 'id' => $prefix . 'tour_booking_page',
- 'type' => 'post',
- 'post_type' => 'product',
- 'name' => esc_html__( 'Tour Booking Page:', 'discovery' ),
- ),
- array (
- 'id' => $prefix . 'tour_heading',
- 'type' => 'text',
- 'name' => esc_html__( 'Tour Heading:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour heading.', 'discovery' ),
- 'size' => 100,
- 'columns' => 12,
- ),
- array (
- 'id' => $prefix . 'tour_date',
- 'type' => 'text',
- 'name' => esc_html__( 'Date:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour date.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_price',
- 'type' => 'text',
- 'name' => esc_html__( 'Price:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour price.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_availability',
- 'type' => 'text',
- 'name' => esc_html__( 'Availability:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour availability.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_group_size',
- 'type' => 'text',
- 'name' => esc_html__( 'Group Size:', 'discovery' ),
- 'desc' => esc_html__( 'Enter max group size.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_duration',
- 'type' => 'text',
- 'name' => esc_html__( 'Duration:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour duration. Example "10 Days / 9 Nights".', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_begins_ends',
- 'type' => 'text',
- 'name' => esc_html__( 'Begins, Ends In:', 'discovery' ),
- 'desc' => esc_html__( 'Enter where the tour begins, and ends.', 'discovery' ),
- 'size' => 60,
- 'columns' => 6,
- ),
- array (
- 'id' => $prefix . 'tour_reservation_page',
- 'type' => 'post',
- 'name' => esc_html__( 'Reservation Page:', 'discovery' ),
- 'desc' => esc_html__( 'Select the tour reservation page.', 'discovery' ),
- 'post_type' => array(
- 0 => 'page',
- ),
- 'field_type' => 'select_advanced',
- ),
- array (
- 'id' => $prefix . 'tour_description',
- 'type' => 'textarea',
- 'name' => esc_html__( 'Tour Description:', 'discovery' ),
- 'desc' => esc_html__( 'Enter tour description.', 'discovery' ),
- ),
- ),
- 'clone' => 1,
- 'sort_clone' => 1,
- 'default_state' => 'expanded',
- 'add_button' => esc_html__( 'Add New Tour Dates', 'discovery' ),
- 'columns' => 12,
- 'collapsible' => true,
- 'group_title' => 'Tour Date {#}',
- ),
- ),
- 'text_domain' => 'discovery',
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement