PluginProbe
Yatra – Travel Booking & Tour Operator Software / 2.2.10
Yatra – Travel Booking & Tour Operator Software v2.2.10
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / core / Shortcodes / Search.php

Search.php in Yatra – Travel Booking & Tour Operator Software 2.2.10, at core/Shortcodes/Search.php

58 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yatra\Core\Shortcodes;
4
5
6 defined('ABSPATH') || exit;
7
8 /**
9 * Shortcode search class.
10 */
11 class Search
12 {
13
14 /**
15 * Get the shortcode content.
16 *
17 * @param array $atts Shortcode attributes.
18 * @return string
19 */
20 public static function get($atts)
21 {
22 return \Yatra_Shortcodes::shortcode_wrapper(array(__CLASS__, 'output'), $atts);
23 }
24
25 /**
26 * Output the shortcode.
27 *
28 * @param array $atts Shortcode attributes.
29 */
30 public static function output($atts)
31 {
32 $search_type = isset($atts['type']) ? sanitize_text_field($atts['type']) : 'advanced';
33
34 $duration = yatra_get_duration_ranges_for_filter();
35
36 $min_days = $duration->min_days ?? 0;
37
38 $max_days = $duration->max_days ?? 0;
39
40 $price = yatra_get_price_ranges_for_filter();
41
42 $min_price = $price->min_price ?? 0;
43
44 $max_price = $price->max_price ?? 0;
45
46 yatra_get_template('parts/advanced-search.php',
47 [
48 'min_price' => $min_price, 'max_price' => $max_price, 'min_days' => $min_days, 'max_days' => $max_days, 'search_type' => $search_type
49 ]
50 );
51 wp_enqueue_script('yatra-search-script');
52 wp_enqueue_style('yatra-search-style');
53
54
55 }
56
57 }
58