Ejemplo n.º 1
0
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->location_list_custom_meta_fields = array(array('label' => __('Location', 'bookyourtravel'), 'id' => 'location_list_location_post_id', 'type' => 'post_select', 'post_type' => array('location')));
     $this->location_custom_meta_fields = array(array('label' => __('Is Featured', 'bookyourtravel'), 'desc' => __('Show in lists where only featured items are shown.', 'bookyourtravel'), 'id' => 'location_is_featured', 'type' => 'checkbox'), array('label' => __('Display As Directory?', 'bookyourtravel'), 'desc' => __('Check this option if you want to show list of descendant locations when showing this single location instead of showing what single location page usually shows. Useful for Country locations that than lists all of that country\'s cities.', 'bookyourtravel'), 'id' => 'location_display_as_directory', 'type' => 'checkbox'), array('label' => __('Country', 'bookyourtravel'), 'desc' => __('Country name', 'bookyourtravel'), 'id' => 'location_country', 'type' => 'text'), array('label' => __('Gallery images', 'bookyourtravel'), 'desc' => __('A collection of images to be used in slider/gallery on single page', 'bookyourtravel'), 'id' => 'location_images', 'type' => 'repeatable', 'sanitizer' => array('featured' => 'meta_box_santitize_boolean', 'title' => 'sanitize_text_field', 'desc' => 'wp_kses_data'), 'repeatable_fields' => array(array('label' => __('Image', 'bookyourtravel'), 'id' => 'image', 'type' => 'image'))));
     $location_extra_fields = $byt_theme_globals->get_location_extra_fields();
     foreach ($location_extra_fields as $location_extra_field) {
         $field_is_hidden = isset($location_extra_field['hide']) ? intval($location_extra_field['hide']) : 0;
         if (!$field_is_hidden) {
             $extra_field = null;
             $field_label = isset($location_extra_field['label']) ? $location_extra_field['label'] : '';
             $field_id = isset($location_extra_field['id']) ? $location_extra_field['id'] : '';
             $field_type = isset($location_extra_field['type']) ? $location_extra_field['type'] : '';
             if (!empty($field_label) && !empty($field_id) && !empty($field_type)) {
                 $extra_field = array('label' => $field_label, 'desc' => '', 'id' => 'location_' . $field_id, 'type' => $field_type);
             }
             if ($extra_field) {
                 $this->location_custom_meta_fields[] = $extra_field;
             }
         }
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->enable_cruises = $byt_theme_globals->enable_cruises();
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->enable_accommodations = $byt_theme_globals->enable_accommodations();
     $this->enabled_frontend_content_types = array();
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->enable_cruises = $byt_theme_globals->enable_cruises();
     if ($this->enable_cruises) {
         $this->cabin_type_custom_meta_fields = array(array('label' => __('Max adult count', 'bookyourtravel'), 'desc' => __('How many adults are allowed in the cabin?', 'bookyourtravel'), 'id' => 'cabin_type_max_count', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Max child count', 'bookyourtravel'), 'desc' => __('How many children are allowed in the cabin?', 'bookyourtravel'), 'id' => 'cabin_type_max_child_count', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Bed size', 'bookyourtravel'), 'desc' => __('How big is/are the beds?', 'bookyourtravel'), 'id' => 'cabin_type_bed_size', 'type' => 'text'), array('label' => __('Cabin size', 'bookyourtravel'), 'desc' => __('What is the cabin size (m2)?', 'bookyourtravel'), 'id' => 'cabin_type_room_size', 'type' => 'text'), array('label' => __('Cabin meta information', 'bookyourtravel'), 'desc' => __('What other information applies to this specific cabin type?', 'bookyourtravel'), 'id' => 'cabin_type_meta', 'type' => 'text'), array('label' => __('Facilities', 'bookyourtravel'), 'id' => 'facility', 'type' => 'tax_checkboxes'));
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
Ejemplo n.º 5
0
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->enable_reviews = $byt_theme_globals->enable_reviews();
     if ($this->enable_reviews) {
         $this->review_custom_meta_fields = array(array('label' => __('Likes', 'bookyourtravel'), 'desc' => __('What the user likes about the accommodation', 'bookyourtravel'), 'id' => 'review_likes', 'type' => 'textarea'), array('label' => __('Dislikes', 'bookyourtravel'), 'desc' => __('What the user dislikes about the accommodation', 'bookyourtravel'), 'id' => 'review_dislikes', 'type' => 'textarea'), array('label' => __('Reviewed item', 'bookyourtravel'), 'desc' => '', 'id' => 'review_post_id', 'type' => 'post_select', 'post_type' => array('accommodation', 'tour', 'cruise')), array('label' => __('Cleanliness', 'bookyourtravel'), 'desc' => __('Cleanliness rating', 'bookyourtravel'), 'id' => 'review_cleanliness', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Comfort', 'bookyourtravel'), 'desc' => __('Comfort rating', 'bookyourtravel'), 'id' => 'review_comfort', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Location', 'bookyourtravel'), 'desc' => __('Location rating', 'bookyourtravel'), 'id' => 'review_location', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Staff', 'bookyourtravel'), 'desc' => __('Staff rating', 'bookyourtravel'), 'id' => 'review_staff', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Services', 'bookyourtravel'), 'desc' => __('Services rating', 'bookyourtravel'), 'id' => 'review_services', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Value for money', 'bookyourtravel'), 'desc' => __('Value for money rating', 'bookyourtravel'), 'id' => 'review_value_for_money', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Sleep quality', 'bookyourtravel'), 'desc' => __('Sleep quality rating', 'bookyourtravel'), 'id' => 'review_sleep_quality', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Overall', 'bookyourtravel'), 'desc' => __('Overall rating', 'bookyourtravel'), 'id' => 'review_overall', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Accommodation', 'bookyourtravel'), 'desc' => __('Accommodation rating', 'bookyourtravel'), 'id' => 'review_accommodation', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Transport', 'bookyourtravel'), 'desc' => __('Transport rating', 'bookyourtravel'), 'id' => 'review_transport', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Meals', 'bookyourtravel'), 'desc' => __('Meals rating', 'bookyourtravel'), 'id' => 'review_meals', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Guide', 'bookyourtravel'), 'desc' => __('Guide rating', 'bookyourtravel'), 'id' => 'review_guide', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Program accuracy', 'bookyourtravel'), 'desc' => __('Program accuracy rating', 'bookyourtravel'), 'id' => 'review_program_accuracy', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'));
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->enable_accommodations = $byt_theme_globals->enable_accommodations();
     if ($this->enable_accommodations) {
         $this->user_account_custom_meta_fields = array(array('label' => __('Is partner page?', 'bookyourtravel'), 'desc' => __('If checked, will display partner (front end submit) pages and menus', 'bookyourtravel'), 'id' => 'user_account_is_partner_page', 'type' => 'checkbox'));
         $user_content_types = array();
         $user_content_types[] = array('value' => 'accommodation', 'label' => __('Accommodation', 'bookyourtravel'));
         $user_content_types[] = array('value' => 'vacancy', 'label' => __('Accommodation vacancy', 'bookyourtravel'));
         $user_content_types[] = array('value' => 'room_type', 'label' => __('Room type', 'bookyourtravel'));
         $this->user_content_list_custom_meta_fields = array(array('label' => __('User content type', 'bookyourtravel'), 'id' => 'user_content_type', 'type' => 'select', 'options' => $user_content_types));
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
Ejemplo n.º 7
0
 protected function __construct()
 {
     global $post, $byt_theme_globals;
     $this->enable_car_rentals = $byt_theme_globals->enable_car_rentals();
     if ($this->enable_car_rentals) {
         $transmission_types = array();
         $transmission_types[] = array('value' => 'manual', 'label' => __('Manual transmission', 'bookyourtravel'));
         $transmission_types[] = array('value' => 'auto', 'label' => __('Auto transmission', 'bookyourtravel'));
         $this->car_rental_custom_meta_fields = array(array('label' => __('Is Featured', 'bookyourtravel'), 'desc' => __('Show in lists where only featured items are shown.', 'bookyourtravel'), 'id' => 'car_rental_is_featured', 'type' => 'checkbox'), array('label' => __('Location', 'bookyourtravel'), 'desc' => '', 'id' => 'car_rental_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Gallery images', 'bookyourtravel'), 'desc' => __('A collection of images to be used in slider/gallery on single page', 'bookyourtravel'), 'id' => 'car_rental_images', 'type' => 'repeatable', 'sanitizer' => array('featured' => 'meta_box_santitize_boolean', 'title' => 'sanitize_text_field', 'desc' => 'wp_kses_data'), 'repeatable_fields' => array(array('label' => __('Image', 'bookyourtravel'), 'id' => 'image', 'type' => 'image'))), array('label' => __('Price per day', 'bookyourtravel'), 'desc' => __('What is the car\'s rental price per day?', 'bookyourtravel'), 'id' => 'car_rental_price_per_day', 'type' => 'text'), array('label' => __('Contact email addresses', 'bookyourtravel'), 'desc' => __('Contact email addresses, separate each address with a semi-colon ;', 'bookyourtravel'), 'id' => 'car_rental_contact_email', 'type' => 'text'), array('label' => __('Number of available cars', 'bookyourtravel'), 'desc' => __('What number of cars are available for rent (used for admin purposes to determine availability)?', 'bookyourtravel'), 'id' => 'car_rental_number_of_cars', 'type' => 'text'), array('label' => __('Max count', 'bookyourtravel'), 'desc' => __('How many people are allowed in the car?', 'bookyourtravel'), 'id' => 'car_rental_max_count', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Minimum age', 'bookyourtravel'), 'desc' => __('What is the minimum age of people in the car?', 'bookyourtravel'), 'id' => 'car_rental_min_age', 'type' => 'slider', 'min' => '18', 'max' => '100', 'step' => '1'), array('label' => __('Number of doors', 'bookyourtravel'), 'desc' => __('What is the number of doors the car has?', 'bookyourtravel'), 'id' => 'car_rental_number_of_doors', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Unlimited mileage', 'bookyourtravel'), 'desc' => __('Is there no restriction on mileage covered?', 'bookyourtravel'), 'id' => 'car_rental_is_unlimited_mileage', 'type' => 'checkbox'), array('label' => __('Air-conditioning', 'bookyourtravel'), 'desc' => __('Is there air-conditioning?', 'bookyourtravel'), 'id' => 'car_rental_is_air_conditioned', 'type' => 'checkbox'), array('label' => __('Transmission type', 'bookyourtravel'), 'desc' => __('What is the car\'s transmission type?', 'bookyourtravel'), 'id' => 'car_rental_transmission_type', 'type' => 'select', 'options' => $transmission_types), array('label' => __('Car type', 'bookyourtravel'), 'id' => 'car_type', 'type' => 'tax_select'), array('label' => __('Car rental tag', 'bookyourtravel'), 'id' => 'car_rental_tag', 'type' => 'tax_checkboxes'), array('label' => __('Is for reservation only?', 'bookyourtravel'), 'desc' => __('If this option is checked, then this particular car rental will not be processed via WooCommerce even if WooCommerce is in use.', 'bookyourtravel'), 'id' => 'car_rental_is_reservation_only', 'type' => 'checkbox'));
         global $default_car_rental_extra_fields;
         $car_rental_extra_fields = of_get_option('car_rental_extra_fields');
         if (!is_array($car_rental_extra_fields) || count($car_rental_extra_fields) == 0) {
             $car_rental_extra_fields = $default_car_rental_extra_fields;
         }
         foreach ($car_rental_extra_fields as $car_rental_extra_field) {
             $field_is_hidden = isset($car_rental_extra_field['hide']) ? intval($car_rental_extra_field['hide']) : 0;
             if (!$field_is_hidden) {
                 $extra_field = null;
                 $field_label = isset($car_rental_extra_field['label']) ? $car_rental_extra_field['label'] : '';
                 $field_id = isset($car_rental_extra_field['id']) ? $car_rental_extra_field['id'] : '';
                 $field_type = isset($car_rental_extra_field['type']) ? $car_rental_extra_field['type'] : '';
                 if (!empty($field_label) && !empty($field_id) && !empty($field_type)) {
                     $extra_field = array('label' => $field_label, 'desc' => '', 'id' => 'car_rental_' . $field_id, 'type' => $field_type);
                 }
                 if ($extra_field) {
                     $this->car_rental_custom_meta_fields[] = $extra_field;
                 }
             }
         }
         $sort_by_columns = array();
         $sort_by_columns[] = array('value' => 'title', 'label' => __('Car rental title', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'ID', 'label' => __('Car rental ID', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'date', 'label' => __('Publish date', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'rand', 'label' => __('Random', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'comment_count', 'label' => __('Comment count', 'bookyourtravel'));
         $this->car_rental_list_custom_meta_fields = array(array('label' => __('Car type', 'bookyourtravel'), 'id' => 'car_type', 'type' => 'tax_select'), array('label' => __('Location', 'bookyourtravel'), 'id' => 'car_rental_list_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Car rental tags', 'bookyourtravel'), 'id' => 'car_rental_tag', 'type' => 'tax_checkboxes'), array('label' => __('Sort by field', 'bookyourtravel'), 'id' => 'car_rental_list_sort_by', 'type' => 'select', 'options' => $sort_by_columns), array('label' => __('Sort descending?', 'bookyourtravel'), 'desc' => __('If checked, will sort car rentals in descending order', 'bookyourtravel'), 'id' => 'car_rental_list_sort_descending', 'type' => 'checkbox'));
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
Ejemplo n.º 8
0
 protected function __construct()
 {
     global $byt_theme_globals;
     $this->enable_accommodations = $byt_theme_globals->enable_accommodations();
     $this->enabled_frontend_content_types = array();
     if ($this->enable_accommodations) {
         $this->enabled_frontend_content_types[] = array('value' => 'accommodation', 'label' => __('Accommodation', 'bookyourtravel'));
         $this->enabled_frontend_content_types[] = array('value' => 'room_type', 'label' => __('Room type', 'bookyourtravel'));
         $this->enabled_frontend_content_types[] = array('value' => 'vacancy', 'label' => __('Vacancy', 'bookyourtravel'));
     }
     $page_sidebars = array();
     $page_sidebars[] = array('value' => '', 'label' => __('No sidebar', 'bookyourtravel'));
     $page_sidebars[] = array('value' => 'left', 'label' => __('Left sidebar', 'bookyourtravel'));
     $page_sidebars[] = array('value' => 'right', 'label' => __('Right sidebar', 'bookyourtravel'));
     $page_sidebars[] = array('value' => 'both', 'label' => __('Left and right sidebars', 'bookyourtravel'));
     $this->page_sidebars_custom_meta_fields = array(array('label' => __('Select sidebar positioning', 'bookyourtravel'), 'id' => 'page_sidebar_positioning', 'type' => 'select', 'options' => $page_sidebars));
     $this->user_register_custom_meta_fields = array(array('label' => __('Users can front-end submit?', 'bookyourtravel'), 'desc' => __('Check this box if users registering through this form can use the frontend submit pages to submit content.', 'bookyourtravel'), 'id' => 'user_register_can_frontend_submit', 'type' => 'checkbox'));
     $this->frontend_submit_custom_meta_fields = array(array('label' => __('Content type', 'bookyourtravel'), 'id' => 'frontend_submit_content_type', 'type' => 'select', 'options' => $this->enabled_frontend_content_types));
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
Ejemplo n.º 9
0
 protected function __construct()
 {
     global $byt_room_types_post_type, $post, $byt_theme_globals;
     $this->enable_tours = $byt_theme_globals->enable_tours();
     if ($this->enable_tours) {
         $this->tour_custom_meta_fields = array(array('label' => __('Is Featured', 'bookyourtravel'), 'desc' => __('Show in lists where only featured items are shown.', 'bookyourtravel'), 'id' => 'tour_is_featured', 'type' => 'checkbox'), array('label' => __('Price per group?', 'bookyourtravel'), 'desc' => __('Is price calculated per group? If not then calculations are done per person.', 'bookyourtravel'), 'id' => 'tour_is_price_per_group', 'type' => 'checkbox'), array('label' => __('Location', 'bookyourtravel'), 'desc' => '', 'id' => 'tour_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Gallery images', 'bookyourtravel'), 'desc' => __('A collection of images to be used in slider/gallery on single page', 'bookyourtravel'), 'id' => 'tour_images', 'type' => 'repeatable', 'sanitizer' => array('featured' => 'meta_box_santitize_boolean', 'title' => 'sanitize_text_field', 'desc' => 'wp_kses_data'), 'repeatable_fields' => array(array('label' => __('Image', 'bookyourtravel'), 'id' => 'image', 'type' => 'image'))), array('label' => __('Map code', 'bookyourtravel'), 'desc' => '', 'id' => 'tour_map_code', 'type' => 'textarea'), array('label' => __('Tour type', 'bookyourtravel'), 'id' => 'tour_type', 'type' => 'tax_select'), array('label' => __('Tags', 'bookyourtravel'), 'id' => 'tour_tag', 'type' => 'tax_checkboxes'), array('label' => __('Is for reservation only?', 'bookyourtravel'), 'desc' => __('If this option is checked, then this particular tour will not be processed via WooCommerce even if WooCommerce is in use.', 'bookyourtravel'), 'id' => 'tour_is_reservation_only', 'type' => 'checkbox'), array('label' => __('Availability extra text', 'bookyourtravel'), 'desc' => __('Extra text shown on availability tab above the book now area.', 'bookyourtravel'), 'id' => 'tour_availability_text', 'type' => 'textarea'), array('label' => __('Contact email addresses', 'bookyourtravel'), 'desc' => __('Contact email addresses, separate each address with a semi-colon ;', 'bookyourtravel'), 'id' => 'tour_contact_email', 'type' => 'text'));
         global $default_tour_extra_fields;
         $tour_extra_fields = of_get_option('tour_extra_fields');
         if (!is_array($tour_extra_fields) || count($tour_extra_fields) == 0) {
             $tour_extra_fields = $default_tour_extra_fields;
         }
         foreach ($tour_extra_fields as $tour_extra_field) {
             $field_is_hidden = isset($tour_extra_field['hide']) ? intval($tour_extra_field['hide']) : 0;
             if (!$field_is_hidden) {
                 $extra_field = null;
                 $field_label = isset($tour_extra_field['label']) ? $tour_extra_field['label'] : '';
                 $field_id = isset($tour_extra_field['id']) ? $tour_extra_field['id'] : '';
                 $field_type = isset($tour_extra_field['type']) ? $tour_extra_field['type'] : '';
                 if (!empty($field_label) && !empty($field_id) && !empty($field_type)) {
                     $extra_field = array('label' => $field_label, 'desc' => '', 'id' => 'tour_' . $field_id, 'type' => $field_type);
                 }
                 if ($extra_field) {
                     $this->tour_custom_meta_fields[] = $extra_field;
                 }
             }
         }
         $sort_by_columns = array();
         $sort_by_columns[] = array('value' => 'title', 'label' => __('Tour title', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'ID', 'label' => __('Tour ID', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'date', 'label' => __('Publish date', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'rand', 'label' => __('Random', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'comment_count', 'label' => __('Comment count', 'bookyourtravel'));
         $this->tour_list_custom_meta_fields = array(array('label' => __('Tour type', 'bookyourtravel'), 'id' => 'tour_type', 'type' => 'tax_select'), array('label' => __('Location', 'bookyourtravel'), 'id' => 'tour_list_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Tour tags', 'bookyourtravel'), 'id' => 'tour_tag', 'type' => 'tax_checkboxes'), array('label' => __('Sort by field', 'bookyourtravel'), 'id' => 'tour_list_sort_by', 'type' => 'select', 'options' => $sort_by_columns), array('label' => __('Sort descending?', 'bookyourtravel'), 'desc' => __('If checked, will sort tours in descending order', 'bookyourtravel'), 'id' => 'tour_list_sort_descending', 'type' => 'checkbox'));
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
Ejemplo n.º 10
0
 protected function __construct()
 {
     global $byt_cabin_types_post_type, $post;
     $post_id = 0;
     if (isset($post)) {
         $post_id = $post->ID;
     } else {
         if (isset($_GET['post'])) {
             $post_id = (int) $_GET['post'];
         }
     }
     $cabin_types = array();
     if ($post_id > 0) {
         $cabin_type_query = $byt_cabin_types_post_type->list_cabin_types(null, array('publish'), $post_id);
         if ($cabin_type_query->have_posts()) {
             while ($cabin_type_query->have_posts()) {
                 $cabin_type_query->the_post();
                 global $post;
                 $cabin_types[] = array('value' => $post->ID, 'label' => $post->post_title);
             }
         }
         wp_reset_postdata();
     }
     if (count($cabin_types) == 0) {
         // if cruise has no associated cabin types, list all possible cabin types (for backwards compatibility)
         $cabin_type_query = $byt_cabin_types_post_type->list_cabin_types(null, array('publish'), null);
         if ($cabin_type_query->have_posts()) {
             while ($cabin_type_query->have_posts()) {
                 $cabin_type_query->the_post();
                 global $post;
                 $cabin_types[] = array('value' => $post->ID, 'label' => $post->post_title);
             }
         }
         wp_reset_postdata();
     }
     global $byt_theme_globals;
     $this->enable_cruises = $byt_theme_globals->enable_cruises();
     if ($this->enable_cruises) {
         $this->cruise_custom_meta_fields = array(array('label' => __('Is Featured', 'bookyourtravel'), 'desc' => __('Show in lists where only featured items are shown.', 'bookyourtravel'), 'id' => 'cruise_is_featured', 'type' => 'checkbox'), array('label' => __('Cabin types', 'bookyourtravel'), 'desc' => '', 'id' => 'cabin_types', 'type' => 'post_checkboxes', 'post_type' => array('cabin_type')), array('label' => __('Locations', 'bookyourtravel'), 'desc' => '', 'id' => 'locations', 'type' => 'post_checkboxes', 'post_type' => array('location')), array('label' => __('Price per person?', 'bookyourtravel'), 'desc' => __('Is price calculated per person (adult, child)? If not then calculations are done per cabin.', 'bookyourtravel'), 'id' => 'cruise_is_price_per_person', 'type' => 'checkbox'), array('label' => __('Count children stay free', 'bookyourtravel'), 'desc' => __('How many kids stay free before we charge a fee?', 'bookyourtravel'), 'id' => 'cruise_count_children_stay_free', 'type' => 'slider', 'min' => '1', 'max' => '5', 'step' => '1'), array('label' => __('Is for reservation only?', 'bookyourtravel'), 'desc' => __('If this option is checked, then this particular cruise will not be processed via WooCommerce even if WooCommerce is in use.', 'bookyourtravel'), 'id' => 'cruise_is_reservation_only', 'type' => 'checkbox'), array('label' => __('Facilities', 'bookyourtravel'), 'id' => 'facility', 'type' => 'tax_checkboxes'), array('label' => __('Cruise type', 'bookyourtravel'), 'id' => 'cruise_type', 'type' => 'tax_select'), array('label' => __('Tags', 'bookyourtravel'), 'id' => 'cruise_tag', 'type' => 'tax_checkboxes'), array('label' => __('Gallery images', 'bookyourtravel'), 'desc' => __('A collection of images to be used in slider/gallery on single page', 'bookyourtravel'), 'id' => 'cruise_images', 'type' => 'repeatable', 'sanitizer' => array('featured' => 'meta_box_santitize_boolean', 'title' => 'sanitize_text_field', 'desc' => 'wp_kses_data'), 'repeatable_fields' => array(array('label' => __('Image', 'bookyourtravel'), 'id' => 'image', 'type' => 'image'))), array('label' => __('Availability extra text', 'bookyourtravel'), 'desc' => __('Extra text shown on availability tab above the book now area.', 'bookyourtravel'), 'id' => 'cruise_availability_text', 'type' => 'textarea'), array('label' => __('Contact email addresses', 'bookyourtravel'), 'desc' => __('Contact email addresses, separate each address with a semi-colon ;', 'bookyourtravel'), 'id' => 'cruise_contact_email', 'type' => 'text'));
         global $default_cruise_extra_fields;
         $cruise_extra_fields = of_get_option('cruise_extra_fields');
         if (!is_array($cruise_extra_fields) || count($cruise_extra_fields) == 0) {
             $cruise_extra_fields = $default_cruise_extra_fields;
         }
         foreach ($cruise_extra_fields as $cruise_extra_field) {
             $field_is_hidden = isset($cruise_extra_field['hide']) ? intval($cruise_extra_field['hide']) : 0;
             if (!$field_is_hidden) {
                 $extra_field = null;
                 $field_label = isset($cruise_extra_field['label']) ? $cruise_extra_field['label'] : '';
                 $field_id = isset($cruise_extra_field['id']) ? $cruise_extra_field['id'] : '';
                 $field_type = isset($cruise_extra_field['type']) ? $cruise_extra_field['type'] : '';
                 if (!empty($field_label) && !empty($field_id) && !empty($field_type)) {
                     $extra_field = array('label' => $field_label, 'desc' => '', 'id' => 'cruise_' . $field_id, 'type' => $field_type);
                 }
                 if ($extra_field) {
                     $this->cruise_custom_meta_fields[] = $extra_field;
                 }
             }
         }
         $sort_by_columns = array();
         $sort_by_columns[] = array('value' => 'title', 'label' => __('Cruise title', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'ID', 'label' => __('Cruise ID', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'date', 'label' => __('Publish date', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'rand', 'label' => __('Random', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'comment_count', 'label' => __('Comment count', 'bookyourtravel'));
         $this->cruise_list_custom_meta_fields = array(array('label' => __('Cruise type', 'bookyourtravel'), 'id' => 'cruise_type', 'type' => 'tax_select'), array('label' => __('Cruise tags', 'bookyourtravel'), 'id' => 'cruise_tag', 'type' => 'tax_checkboxes'), array('label' => __('Location', 'bookyourtravel'), 'id' => 'cruise_list_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Sort by field', 'bookyourtravel'), 'id' => 'cruise_list_sort_by', 'type' => 'select', 'options' => $sort_by_columns), array('label' => __('Sort descending?', 'bookyourtravel'), 'desc' => __('If checked, will sort cruises in descending order', 'bookyourtravel'), 'id' => 'cruise_list_sort_descending', 'type' => 'checkbox'));
         // our parent class might
         // contain shared code in its constructor
         parent::__construct();
     }
 }
 protected function __construct()
 {
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }
Ejemplo n.º 12
0
 protected function __construct()
 {
     global $byt_room_types_post_type, $post;
     $post_id = 0;
     if (isset($post)) {
         $post_id = $post->ID;
     } else {
         if (isset($_GET['post'])) {
             $post_id = (int) $_GET['post'];
         }
     }
     $room_types = array();
     $room_type_query = $byt_room_types_post_type->list_room_types(null, array('publish'));
     if ($room_type_query->have_posts()) {
         while ($room_type_query->have_posts()) {
             $room_type_query->the_post();
             global $post;
             $room_types[] = array('value' => $post->ID, 'label' => $post->post_title);
         }
     }
     wp_reset_postdata();
     $check_in_out_times = array();
     $check_in_out_times[] = array('value' => '', 'label' => __('Flexible', 'bookyourtravel'));
     for ($i = 0; $i < 24; $i++) {
         $check_in_out_times[] = array('value' => sprintf("%02s:00", $i), 'label' => sprintf("%02s:00", $i));
     }
     global $byt_theme_globals;
     $this->enable_accommodations = $byt_theme_globals->enable_accommodations();
     if ($this->enable_accommodations) {
         $this->accommodation_custom_meta_fields = array(array('label' => __('Is Featured', 'bookyourtravel'), 'desc' => __('Show in lists where only featured items are shown.', 'bookyourtravel'), 'id' => 'accommodation_is_featured', 'type' => 'checkbox'), array('label' => __('Is Self Catered', 'bookyourtravel'), 'desc' => __('Is the accommodation self-catered or does it provide hotel-style catering?', 'bookyourtravel'), 'id' => 'accommodation_is_self_catered', 'type' => 'checkbox'), array('label' => __('Min days stay', 'bookyourtravel'), 'desc' => __('What is the minimum number of days accommodation can be booked for?', 'bookyourtravel'), 'id' => 'accommodation_min_days_stay', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Max adult count', 'bookyourtravel'), 'desc' => __('How many adults are allowed in the accommodation?', 'bookyourtravel'), 'id' => 'accommodation_max_count', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Max child count', 'bookyourtravel'), 'desc' => __('How many children are allowed in the accommodation?', 'bookyourtravel'), 'id' => 'accommodation_max_child_count', 'type' => 'slider', 'min' => '1', 'max' => '10', 'step' => '1'), array('label' => __('Enabled room types', 'bookyourtravel'), 'desc' => '', 'id' => 'room_types', 'type' => 'checkbox_group', 'options' => $room_types), array('label' => __('Price per person?', 'bookyourtravel'), 'desc' => __('Is price calculated per person (adult, child)? If not then calculations are done per room / per apartment.', 'bookyourtravel'), 'id' => 'accommodation_is_price_per_person', 'type' => 'checkbox'), array('label' => __('Count children stay free', 'bookyourtravel'), 'desc' => __('How many kids stay free before we charge a fee?', 'bookyourtravel'), 'id' => 'accommodation_count_children_stay_free', 'type' => 'slider', 'min' => '1', 'max' => '5', 'step' => '1'), array('label' => __('Is for reservation only?', 'bookyourtravel'), 'desc' => __('If this option is checked, then this particular accommodation will not be processed via WooCommerce even if WooCommerce is in use.', 'bookyourtravel'), 'id' => 'accommodation_is_reservation_only', 'type' => 'checkbox'), array('label' => __('Check-in time', 'bookyourtravel'), 'id' => 'accommodation_check_in_time', 'type' => 'select', 'options' => $check_in_out_times), array('label' => __('Check-out time', 'bookyourtravel'), 'id' => 'accommodation_check_out_time', 'type' => 'select', 'options' => $check_in_out_times), array('label' => __('Star count', 'bookyourtravel'), 'desc' => '', 'id' => 'accommodation_star_count', 'type' => 'slider', 'min' => '1', 'max' => '5', 'step' => '1'), array('label' => __('Facilities', 'bookyourtravel'), 'id' => 'facility', 'type' => 'tax_checkboxes'), array('label' => __('Tags', 'bookyourtravel'), 'id' => 'acc_tag', 'type' => 'tax_checkboxes'), array('label' => __('Accommodation type', 'bookyourtravel'), 'id' => 'accommodation_type', 'type' => 'tax_select'), array('label' => __('Location', 'bookyourtravel'), 'desc' => '', 'id' => 'accommodation_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Gallery images', 'bookyourtravel'), 'desc' => 'A collection of images to be used in slider/gallery on single page', 'id' => 'accommodation_images', 'type' => 'repeatable', 'sanitizer' => array('featured' => 'meta_box_santitize_boolean', 'title' => 'sanitize_text_field', 'desc' => 'wp_kses_data'), 'repeatable_fields' => array(array('label' => __('Image', 'bookyourtravel'), 'id' => 'image', 'type' => 'image'))), array('label' => __('Address', 'bookyourtravel'), 'desc' => '', 'id' => 'accommodation_address', 'type' => 'text'), array('label' => __('Website address', 'bookyourtravel'), 'desc' => '', 'id' => 'accommodation_website_address', 'type' => 'text'), array('label' => __('Availability extra text', 'bookyourtravel'), 'desc' => __('Extra text shown on availability tab above the book now area.', 'bookyourtravel'), 'id' => 'accommodation_availability_text', 'type' => 'textarea'), array('label' => __('Contact email addresses', 'bookyourtravel'), 'desc' => __('Contact email addresses, separate each address with a semi-colon ;', 'bookyourtravel'), 'id' => 'accommodation_contact_email', 'type' => 'text'), array('label' => __('Latitude coordinates', 'bookyourtravel'), 'desc' => __('Latitude coordinates for use with google map (leave blank to not use)', 'bookyourtravel'), 'id' => 'accommodation_latitude', 'type' => 'text'), array('label' => __('Longitude coordinates', 'bookyourtravel'), 'desc' => __('Longitude coordinates for use with google map (leave blank to not use)', 'bookyourtravel'), 'id' => 'accommodation_longitude', 'type' => 'text'));
         global $default_accommodation_extra_fields;
         $accommodation_extra_fields = of_get_option('accommodation_extra_fields');
         if (!is_array($accommodation_extra_fields) || count($accommodation_extra_fields) == 0) {
             $accommodation_extra_fields = $default_accommodation_extra_fields;
         }
         foreach ($accommodation_extra_fields as $accommodation_extra_field) {
             $field_is_hidden = isset($accommodation_extra_field['hide']) ? intval($accommodation_extra_field['hide']) : 0;
             if (!$field_is_hidden) {
                 $extra_field = null;
                 $field_label = isset($accommodation_extra_field['label']) ? $accommodation_extra_field['label'] : '';
                 $field_id = isset($accommodation_extra_field['id']) ? $accommodation_extra_field['id'] : '';
                 $field_type = isset($accommodation_extra_field['type']) ? $accommodation_extra_field['type'] : '';
                 if (!empty($field_label) && !empty($field_id) && !empty($field_type)) {
                     $extra_field = array('label' => $field_label, 'desc' => '', 'id' => 'accommodation_' . $field_id, 'type' => $field_type);
                 }
                 if ($extra_field) {
                     $this->accommodation_custom_meta_fields[] = $extra_field;
                 }
             }
         }
         $catering_types = array();
         $catering_types[] = array('value' => '', 'label' => __('Any', 'bookyourtravel'));
         $catering_types[] = array('value' => 'self-catered', 'label' => __('Self-catered', 'bookyourtravel'));
         $catering_types[] = array('value' => 'hotel', 'label' => __('Hotel-style', 'bookyourtravel'));
         $sort_by_columns = array();
         $sort_by_columns[] = array('value' => 'title', 'label' => __('Accommodation title', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'ID', 'label' => __('Accommodation ID', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'date', 'label' => __('Publish date', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'rand', 'label' => __('Random', 'bookyourtravel'));
         $sort_by_columns[] = array('value' => 'comment_count', 'label' => __('Comment count', 'bookyourtravel'));
         $this->accommodation_list_custom_meta_fields = array(array('label' => __('Catering type', 'bookyourtravel'), 'id' => 'accommodation_list_catering_type', 'type' => 'select', 'options' => $catering_types), array('label' => __('Accomodation type', 'bookyourtravel'), 'id' => 'accommodation_type', 'type' => 'tax_select'), array('label' => __('Accommodation tags', 'bookyourtravel'), 'id' => 'acc_tag', 'type' => 'tax_checkboxes'), array('label' => __('Location', 'bookyourtravel'), 'id' => 'accommodation_list_location_post_id', 'type' => 'post_select', 'post_type' => array('location')), array('label' => __('Sort by field', 'bookyourtravel'), 'id' => 'accommodation_list_sort_by', 'type' => 'select', 'options' => $sort_by_columns), array('label' => __('Sort descending?', 'bookyourtravel'), 'desc' => __('If checked, will sort accommodations in descending order', 'bookyourtravel'), 'id' => 'accommodation_list_sort_descending', 'type' => 'checkbox'));
     }
     // our parent class might
     // contain shared code in its constructor
     parent::__construct();
 }