PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 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 All 84 releases
← All changes | app/Core/Handlers/TripPageHandler.php +10 -11 3.0.2.9 → 3.0.16 View file →
@@ -5,9 +5,8 @@
5 5 namespace Yatra\Core\Handlers;
6 6
7 7 use Yatra\Controllers\SingleTripController;
8 8 use Yatra\Core\Assets\TripAssetManager;
9 -use Yatra\Core\Template\TemplateRenderer;
10 9 use Yatra\Services\SettingsService;
11 10
12 11 /**
13 12 * Trip Page Handler
@@ -37,8 +36,17 @@
37 36 // Set up global trip object for template compatibility
38 37 global $trip;
39 38 $trip = $trip_data;
40 39
40 + // Configure $wp_query + virtual WP_Post so FSE block themes resolve the
41 + // singular template (not 404.html) and render the site header normally.
42 + $this->setupPageEnvironment('singular', [
43 + 'title' => (string) ($trip->title ?? $trip->name ?? ''),
44 + 'object_id' => (int) ($trip->id ?? 0),
45 + 'post_type' => 'page',
46 + 'post_name' => $trip_slug,
47 + ]);
48 +
41 49 // Set up query vars for backward compatibility
42 50 $this->setQueryVars([
43 51 'yatra_trip_id' => $trip->id,
44 52 'yatra_trip' => $trip,
@@ -45,16 +53,7 @@
45 53 'yatra_trip_slug' => $trip_slug,
46 54 'yatra_page' => $route_data['base'] ?? SettingsService::getTripBase(),
47 55 ]);
48 56
49 - // Create asset manager and render template
50 - $asset_manager = new TripAssetManager();
51 - $template_path = TemplateRenderer::getTemplatePath('single-trip');
52 -
53 - // Render template with global $trip already set
54 - if (!TemplateRenderer::render($template_path, [], $asset_manager)) {
55 - return false;
56 - }
57 -
58 - return true;
57 + return $this->selectTemplate('single-trip', new TripAssetManager(), 'trip');
59 58 }
60 59 }