%2$s%3$s', ($taxonomy), ucwords($taxonomy), $terms ); // WPCS: XSS OK. } // /* translators: used between list items, there is a space after the comma. */ // $tags_list = get_the_tag_list('', __(', ', 'yatra')); // if ($tags_list) { // printf( // /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */ // '%1$s%2$s %3$s', // yatra_get_icon_svg('tag', 16), // __('Tags:', 'yatra'), // $tags_list // ); // WPCS: XSS OK. // } } } if (!function_exists('yatra_entry_header')) { function yatra_entry_header() { ?>
%s', _x('Featured', 'post', 'yatra')); } if (is_singular()) : the_title('

', '

'); else : the_title(sprintf('

', esc_url(get_permalink())), '

'); endif; ?>
0) { $yatra_tour_meta_regular_price_string = '' . $yatra_tour_meta_regular_price_string . '  ' . $currency_symbol . $yatra_tour_meta_sales_price;; } $yatra_tour_meta_tour_fixed_departure = get_post_meta($post_id, 'yatra_tour_meta_tour_fixed_departure', true); if ((boolean)$yatra_tour_meta_tour_fixed_departure && !is_null($yatra_tour_meta_tour_fixed_departure)) { $tour_duration = '{{yatra_tour_meta_tour_start_date}} to {{yatra_tour_meta_tour_end_date}}'; } else { $tour_duration = '{{yatra_tour_meta_tour_duration_days}} days and {{yatra_tour_meta_tour_duration_nights}} nights'; } $meta_frontend = array( array( 'icon' => 'fa fa-user', 'text' => '{{yatra_tour_meta_price_per}}', 'title' => __('Price Per', 'yatra') ), array( 'icon' => 'fa fa-user-circle', 'text' => '{{yatra_tour_meta_group_size}}', 'title' => __('Group Size', 'yatra') ), array( 'icon' => 'fa fa-clock-o', 'text' => $tour_duration, 'title' => __('Duration', 'yatra') ), ); if (!empty($yatra_tour_meta_tour_country)) { $country_string = ''; foreach ($yatra_tour_meta_tour_country as $country_item) { $country = yatra_get_countries($country_item); $country_string .= $country . ', '; } $country_string = trim($country_string, ', '); $meta_frontend[] = array( 'icon' => 'fa fa-map', 'text' => $country_string, 'title' => __('Country', 'yatra') ); } return apply_filters( 'yatra_entry_meta_frontend', $meta_frontend ); } } if (!function_exists('yatra_entry_meta_options')) { function yatra_entry_meta_options($post_id = 0) { $post_id = $post_id > 0 ? $post_id : get_the_id(); $meta_frontend = yatra_entry_meta_for_frontend_archive($post_id); $list = ''; foreach ($meta_frontend as $value) { $icon = isset($value['icon']) ? $value['icon'] : ''; $text = isset($value['text']) ? $value['text'] : ''; $title = isset($value['title']) ? $value['title'] : ''; preg_match_all("~\{\{\s*(.*?)\s*\}\}~", $text, $matches); $matches = isset($matches[1]) ? $matches[1] : array(); foreach ($matches as $match) { $text_id = sanitize_text_field($match); $text_option = get_post_meta($post_id, $text_id, true); $text = str_replace('{{' . $match . '}}', $text_option, $text); } $list .= '
  •  ' . esc_html($title) . ': ' . ($text) . '
  • '; } echo ''; } } if (!function_exists('yatra_tour_tab_configurations')) { function yatra_tour_tab_configurations() { $tab_config = array( 'overview' => array( 'label' => __('Overview', 'yatra'), 'icon' => 'fa fa-atom', 'options' => array( 'overview_label' => array( 'name' => 'overview_label', 'title' => __('Label Text', 'yatra'), 'type' => 'text', 'default' => __('Overview', 'yatra'), ), 'overview_description' => array( 'name' => 'overview_description', 'title' => __('Overview Description', 'yatra'), 'type' => 'textarea', 'editor' => true ) ), ), 'itinerary' => array( 'label' => __('Itinerary', 'yatra'), 'icon' => 'fa fa-gopuram', 'options' => array( 'itinerary_label' => array( 'name' => 'itinerary_label', 'title' => __('Label', 'yatra'), 'type' => 'text', 'default' => __('Itinerary', 'yatra'), ), 'itinerary_repeator' => array( 'name' => 'itinerary_repeator', 'type' => 'repeator', 'options' => array( array( 'itinerary_heading' => array( 'name' => 'itinerary_heading', 'title' => __('Heading', 'yatra'), 'type' => 'text', 'default' => __('Day {index} ', 'yatra'), 'class' => 'mb-repeator-heading-input', ), 'itinerary_title' => array( 'name' => 'itinerary_title', 'title' => __('Title', 'yatra'), 'type' => 'text', ), 'itinerary_details' => array( 'name' => 'itinerary_details', 'title' => __('Details', 'yatra'), 'type' => 'textarea', 'editor' => true ) ) ) ) ) ), 'cost_info' => array( 'label' => __('Cost Info', 'yatra'), 'icon' => 'fa fa-dollar-sign', 'options' => array( 'cost_info_label' => array( 'name' => 'cost_info_label', 'title' => __('Label', 'yatra'), 'type' => 'text', 'default' => __('Cost Info', 'yatra'), ), 'cost_info_price_includes_title' => array( 'name' => 'cost_info_price_includes_title', 'title' => __('Price includes title', 'yatra'), 'type' => 'text', 'default' => __('Price includes', 'yatra'), ), 'cost_info_price_includes_description' => array( 'name' => 'cost_info_price_includes_description', 'title' => __('Price include description', 'yatra'), 'type' => 'textarea', 'description' => __('Type enter to show in new list.', 'yatra'), 'editor' => true ), 'cost_info_price_excludes_title' => array( 'name' => 'cost_info_price_excludes_title', 'title' => __('Price excludes title', 'yatra'), 'type' => 'text', 'default' => __('Price excludes', 'yatra'), ), 'cost_info_price_excludes_description' => array( 'name' => 'cost_info_price_excludes_description', 'title' => __('Price excludes description', 'yatra'), 'type' => 'textarea', 'description' => __('Type enter to show in new list.', 'yatra'), 'editor' => true ) ), ), 'faq' => array( 'label' => __('FAQ', 'yatra'), 'icon' => 'fa fa-comment-dots', 'options' => array( 'faq_label' => array( 'name' => 'faq_label', 'title' => __('Label', 'yatra'), 'type' => 'text', 'default' => __('FAQ', 'yatra'), ), 'faq_repeator' => array( 'name' => 'faq_repeator', 'type' => 'repeator', 'options' => array( array( 'faq_heading' => array( 'name' => 'faq_heading', 'title' => __('FAQ Heading', 'yatra'), 'type' => 'text', 'default' => __('FAQ {index} ', 'yatra'), 'class' => 'mb-repeator-heading-input' ), 'faq_description' => array( 'name' => 'faq_description', 'title' => __('Description', 'yatra'), 'type' => 'textarea', 'editor' => true ) ) ) ) ) ), 'map' => array( 'label' => __('Map', 'yatra'), 'icon' => 'fa fa-directions', 'options' => array( 'map_label' => array( 'name' => 'map_label', 'title' => __('Label', 'yatra'), 'type' => 'text', 'default' => __('Map', 'yatra'), ), 'yatra_tour_meta_map_content' => array( 'name' => 'yatra_tour_meta_map_content', 'title' => __('Map Content', 'yatra'), 'type' => 'textarea', 'editor' => true, 'allow-html' => true ) ), ), 'gallery' => array( 'label' => __('Gallery', 'yatra'), 'icon' => 'fa fa-images', 'options' => array( 'gallery_label' => array( 'name' => 'gallery_label', 'title' => __('Label', 'yatra'), 'type' => 'text', 'default' => __('Gallery', 'yatra'), ), 'yatra_tour_meta_gallery' => array( 'name' => 'yatra_tour_meta_gallery', 'title' => __('Gallery', 'yatra'), 'type' => 'gallery', ) ), ), ); return apply_filters('yatra_tour_tab_configurations', $tab_config); } } if (!function_exists('yatra_tour_attribute_type_options')) { function yatra_tour_attribute_type_options() { $tour_attributes = array( 'text_field' => array( 'label' => __('Text Field', 'yatra'), 'options' => array( 'content' => array( 'name' => 'content', 'title' => __('Content', 'yatra'), 'placeholder' => __('Default value for text field.', 'yatra'), 'description' => __('Default value for text field.', 'yatra'), 'type' => 'text', ) ), ), 'number_field' => array( 'label' => __('Number Field', 'yatra'), 'options' => array( 'content' => array( 'name' => 'content', 'title' => __('Default value for number field.', 'yatra'), 'placeholder' => __('Default value for number field.', 'yatra'), 'description' => __('Default value for number field.', 'yatra'), 'type' => 'number', ) ), ), 'textarea_field' => array( 'label' => __('Textarea Field', 'yatra'), 'options' => array( 'content' => array( 'name' => 'content', 'title' => __('Default value for textarea field.', 'yatra'), 'placeholder' => __('Default value for textarea field.', 'yatra'), 'description' => __('Default value for textarea field.', 'yatra'), 'type' => 'textarea', ) ), ), 'shortcode_field' => array( 'label' => __('Shortcode Field', 'yatra'), 'options' => array( 'shortcode' => array( 'name' => 'shortcode', 'title' => __('Shortcode', 'yatra'), 'placeholder' => __('Default value for text field.', 'yatra'), 'description' => __('Default value for text field.', 'yatra'), 'type' => 'shortcode', 'wrap_class' => 'yatra-left', ) ), ), /* 'dropdown_field' => array( 'label' => __('Dropdown Field', 'yatra'), 'options' => array( 'content' => array( 'name' => 'content', 'title' => __('Default value for select(drop-down) field. Enter drop-down values separated by commas.', 'yatra'), 'placeholder' => __('Default value for select(drop-down) field. Enter drop-down values separated by commas.', 'yatra'), 'description' => __('Default value for select(drop-down) field. Enter drop-down values separated by commas.', 'yatra'), 'type' => 'textarea', ) ), )*/ ); return apply_filters('yatra_tour_attribute_type_options', $tour_attributes); } } if (!function_exists('yatra_tour_attributes_list')) { function yatra_tour_attributes_list() { $terms = get_terms(array( 'taxonomy' => 'attributes', 'hide_empty' => false )); $fields = array(); $number_of_tour_attributes = apply_filters('number_of_tour_attributes', 5); foreach ($terms as $term_key => $term_value) { if (isset($term_value->term_id)) { $fields[$term_value->term_id] = $term_value->name; if (count($fields) === $number_of_tour_attributes && $number_of_tour_attributes !== -1) { break; } } } return $fields; } } if (!function_exists('yatra_tour_attributes')) { function yatra_tour_attributes() { $tour_attributes = array( array( 'name' => 'tour_attributes', 'title' => sprintf(__('Tour Attributes', 'yatra')), 'type' => 'select', 'options' => yatra_tour_attributes_list(), ), array( 'name' => 'add_tour_attribute', 'type' => 'button', 'default' => sprintf(__('Add New', 'yatra')), ) ); return apply_filters('yatra_tour_attributes', $tour_attributes); } } if (!function_exists('yatra_tour_general_configurations')) { function yatra_tour_general_configurations() { $countries = yatra_get_countries(); $tour_options = array( 'yatra_tour_meta_tour_fixed_departure' => array( 'name' => 'yatra_tour_meta_tour_fixed_departure', 'title' => esc_html__('Fixed Departure', 'yatra'), 'type' => 'switch', //'wrap_class' => 'yatra-right', //'row_end' => true, ), 'yatra_tour_meta_tour_start_date' => array( 'name' => 'yatra_tour_meta_tour_start_date', 'title' => esc_html__('Start Date', 'yatra'), 'description' => esc_html__('Start Date', 'yatra'), 'type' => 'date', // 'wrap_class' => 'yatra-left', 'extra_attributes' => array( 'placeholder' => __('Tour Start Date', 'yatra'), ), 'visibility_condition' => array( 'yatra_tour_meta_tour_fixed_departure' => true ) //'row_start' => true, ), 'yatra_tour_meta_tour_end_date' => array( 'name' => 'yatra_tour_meta_tour_end_date', 'title' => esc_html__('End Date', 'yatra'), 'description' => esc_html__('End Date', 'yatra'), 'type' => 'date', // 'wrap_class' => 'yatra-left', 'extra_attributes' => array( 'placeholder' => __('Tour End Date', 'yatra'), ), 'visibility_condition' => array( 'yatra_tour_meta_tour_fixed_departure' => true ) //'row_start' => true, ), 'yatra_tour_meta_tour_duration_days' => array( 'name' => 'yatra_tour_meta_tour_duration_days', 'title' => esc_html__('Tour Duration Days', 'yatra'), 'description' => esc_html__('Total duration days for this tour', 'yatra'), 'type' => 'number', // 'wrap_class' => 'yatra-left', 'extra_attributes' => array( 'placeholder' => __('Number of days', 'yatra'), ), 'visibility_condition' => array( 'yatra_tour_meta_tour_fixed_departure' => false ) //'row_start' => true, ), 'yatra_tour_meta_tour_duration_nights' => array( 'name' => 'yatra_tour_meta_tour_duration_nights', 'title' => esc_html__('Tour Duration Nights', 'yatra'), 'type' => 'number', //'wrap_class' => 'yatra-right', 'extra_attributes' => array( 'placeholder' => __('Number of nights', 'yatra'), ), 'visibility_condition' => array( 'yatra_tour_meta_tour_fixed_departure' => false ) ///'row_end' => true, ), 'yatra_tour_meta_tour_country' => array( 'name' => 'yatra_tour_meta_tour_country', 'title' => esc_html__('Country', 'yatra'), 'type' => 'select', //'wrap_class' => 'yatra-left', 'extra_attributes' => array( 'placeholder' => __('Country', 'yatra'), ), 'options' => $countries, 'default' => 'NP', 'is_multiple' => true, 'select2' => true, //'row_start' => true, ), 'yatra_tour_meta_tour_featured' => array( 'name' => 'yatra_tour_meta_tour_featured', 'title' => esc_html__('Feature this tour', 'yatra'), 'type' => 'switch', //'wrap_class' => 'yatra-right', //'row_end' => true, ), 'yatra_tour_meta_tour_tabs_ordering' => array( 'name' => 'yatra_tour_meta_tour_tabs_ordering', 'type' => 'hidden', ), ); return apply_filters('yatra_tour_general_configurations', $tour_options); } } if (!function_exists('yatra_tour_pricing_configurations')) { function yatra_tour_pricing_configurations() { $currency = get_option('yatra_currency'); $currency_symbols = yatra_get_currency_symbols($currency); $tour_options = array( 'yatra_tour_meta_price_per' => array( 'name' => 'yatra_tour_meta_price_per', 'title' => __('Price Per', 'yatra'), 'type' => 'select', //'wrap_class' => 'yatra-left', //'row_start' => true, 'options' => array( 'person' => __('Person', 'yatra'), 'group' => __('Group', 'yatra') ), ), 'yatra_tour_meta_group_size' => array( 'name' => 'yatra_tour_meta_group_size', 'title' => __('Group Size', 'yatra'), 'type' => 'number', //'wrap_class' => 'yatra-right', 'extra_attributes' => array( 'placeholder' => __('Group Size', 'yatra'), ), 'conditional_and_display' => array(array('yatra_tour_meta_price_per', '=', 'group')), // 'row_end' => true, ), 'yatra_tour_meta_regular_price' => array( 'name' => 'yatra_tour_meta_regular_price', 'title' => sprintf(__('Tour Price- Regular (%s)', 'yatra'), $currency_symbols), 'type' => 'number', //'wrap_class' => 'yatra-left', 'extra_attributes' => array( 'placeholder' => sprintf(__('Tour Price - Regular (%s)', 'yatra'), $currency_symbols), ), //'row_start' => true, ), 'yatra_tour_meta_sales_price' => array( 'name' => 'yatra_tour_meta_sales_price', 'title' => sprintf(__('Tour Price- Sales Price (%s)', 'yatra'), $currency_symbols), 'type' => 'number', //'wrap_class' => 'yatra-right', 'extra_attributes' => array( 'placeholder' => sprintf(__('Tour Price - Sales Price (%s). Leave it empty if you do not want to show sales price.', 'yatra'), $currency_symbols), ), //'row_end' => true, ), ); return apply_filters('yatra_tour_general_configurations', $tour_options); } } if (!function_exists('yatra_frontend_tabs_config')) { function yatra_frontend_tabs_config() { $post_id = get_the_ID(); $yatra_tour_meta_tour_tabs_ordering = get_post_meta($post_id, 'yatra_tour_meta_tour_tabs_ordering', true); $yatra_tour_meta_tour_tabs_ordering_array = explode(',', $yatra_tour_meta_tour_tabs_ordering); $configs = yatra_tour_tab_configurations(); $config_array_keys = array_keys($configs); $array_diff = array_diff($config_array_keys, $yatra_tour_meta_tour_tabs_ordering_array); $final_ordered_config_keys = $yatra_tour_meta_tour_tabs_ordering_array; if (count($array_diff) > 0) { $final_ordered_config_keys = array_merge($yatra_tour_meta_tour_tabs_ordering_array, $array_diff); } $frontend_tabs_config = array(); $active_tab_config = ''; foreach ($final_ordered_config_keys as $config) { if (isset($configs[$config])) { $setting = $configs[$config]; $label = get_post_meta($post_id, $config . '_label', true); $label = empty($label) ? $setting['label'] : $label; $frontend_tabs_config [$config] = $label; } } return apply_filters('frontend_tabs_configurations', $frontend_tabs_config); } } if (!function_exists('yatra_frontend_tabs')) { function yatra_frontend_tabs() { global $post; $frontend_tabs_config = yatra_frontend_tabs_config(); $yatra_tour_tab_configurations = yatra_tour_tab_configurations(); ?>
    $tab_content) { ?>
    0) { ?> aria-hidden="true" >
    'fa fa-map', 'text' => $country_string, 'title' => __('Country', 'yatra') ); } $price_string = $currency_symbol . absint($yatra_tour_meta_regular_price); if ($yatra_tour_meta_sales_price > 0) { $price_string = '' . $price_string . '  ' . $currency_symbol . $yatra_tour_meta_sales_price; } if(!$attribute_only) { ?>

    Days Nights
    0) { echo '

    ' . __('Attributes', 'yatra') . '

    '; $yatra_tour_attribute_type_options = yatra_tour_attribute_type_options(); ?> $content) { $term = get_term($term_id); $field_key = get_term_meta($term_id, 'attribute_field_type', true); $field = isset($yatra_tour_attribute_type_options[$field_key]) ? $yatra_tour_attribute_type_options[$field_key] : array(); $field_option = isset($field['options']) ? $field['options'] : array(); if (isset($term->name)) { ?>
    name) ?> $content_value) { $type = isset($field_option[$content_key]['type']) ? $field_option[$content_key]['type'] : ''; $value = ''; if (count($field_option) > 0) { switch ($type) { case "text": $value = esc_html($content_value); break; case "textarea": $value = esc_html($content_value); break; case "number": $value = absint($content_value); break; case "shortcode": $value = do_shortcode($content_value); break; } echo '

    ' . ($value) . '

    '; } } ?>
    'fa fa-map', 'text' => $country_string, 'title' => __('Country', 'yatra') ); } $price_string = $currency_symbol . absint($yatra_tour_meta_regular_price); if ($yatra_tour_meta_sales_price > 0) { $price_string = '' . $price_string . '  ' . $currency_symbol . $yatra_tour_meta_sales_price; } $tour_duration_string = ''; if ('' != $yatra_tour_meta_tour_duration_days) { $tour_duration_string = absint($yatra_tour_meta_tour_duration_days) . ' Days '; } if ('' != $yatra_tour_meta_tour_duration_nights) { $tour_duration_string .= absint($yatra_tour_meta_tour_duration_nights) . ' Nights '; } if ($yatra_tour_meta_tour_fixed_departure) { $tour_duration_string = $yatra_tour_meta_tour_start_date . ' to ' . $yatra_tour_meta_tour_end_date; } $additional_info = array( 'price_per' => ucwords($yatra_tour_meta_price_per), 'group_size' => $yatra_tour_meta_group_size, 'price' => $price_string, 'tour_duration' => $tour_duration_string, 'country' => $country_string ); return $additional_info; } }