PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.6
Yatra – Travel Booking & Tour Operator Software v3.0.6
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 / app / Shortcodes / TripShortcode.php

TripShortcode.php in Yatra – Travel Booking & Tour Operator Software 3.0.6, at app/Shortcodes/TripShortcode.php

64 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Yatra\Shortcodes;
6
7 /**
8 * Trip Shortcode
9 *
10 * Displays trips with various filtering options using trip-listing-card.php template
11 */
12 class TripShortcode extends BaseShortcode
13 {
14 public function __construct()
15 {
16 parent::__construct('yatra_tour', [
17 'order' => 'asc',
18 'featured' => '0',
19 'featured_priority' => '',
20 'per_page' => '10',
21 'category' => '',
22 'destination' => '',
23 'activity' => '',
24 'difficulty' => '',
25 'price_min' => '',
26 'price_max' => '',
27 'duration_min' => '',
28 'duration_max' => '',
29 'search' => '',
30 'columns' => '3',
31 'show_pagination' => 'yes',
32 'title' => 'Our Trips'
33 ]);
34 }
35
36 /**
37 * Register the shortcode
38 */
39 public function register(): void
40 {
41 // Register both shortcode tags
42 add_shortcode('yatra_tour', [$this, 'render']);
43 add_shortcode('yatra_trip', [$this, 'render']);
44 }
45
46 /**
47 * Render the trip shortcode content
48 */
49 protected function renderContent(array $atts): string
50 {
51 // Use the shared BlockDataService method
52 return \Yatra\Services\BlockDataService::renderTrip($atts);
53 }
54
55 /**
56 * Get trips using Yatra's service
57 */
58 public function getTrips(array $atts): array
59 {
60 return \Yatra\Services\BlockDataService::getTripListingForShortcode($atts);
61 }
62
63 }
64