PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.15
Yatra – Travel Booking & Tour Operator Software v3.0.15
3.0.15 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 All 83 releases
yatra / app / Shortcodes / TripShortcode.php

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

68 lines 1.8 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 // Per-instance card layout override. 'inherit' (default) = use the
34 // site-wide Settings → Design "Listing Card Layout".
35 // Also accepts: standard | compact_mobile | compact_all.
36 'card_layout' => 'inherit'
37 ]);
38 }
39
40 /**
41 * Register the shortcode
42 */
43 public function register(): void
44 {
45 // Register both shortcode tags
46 add_shortcode('yatra_tour', [$this, 'render']);
47 add_shortcode('yatra_trip', [$this, 'render']);
48 }
49
50 /**
51 * Render the trip shortcode content
52 */
53 protected function renderContent(array $atts): string
54 {
55 // Use the shared BlockDataService method
56 return \Yatra\Services\BlockDataService::renderTrip($atts);
57 }
58
59 /**
60 * Get trips using Yatra's service
61 */
62 public function getTrips(array $atts): array
63 {
64 return \Yatra\Services\BlockDataService::getTripListingForShortcode($atts);
65 }
66
67 }
68