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/Hooks/UtilsHooks.php +5 -2 3.0.2.6 → 3.0.16 View file →
@@ -38,11 +38,13 @@
38 38
39 39 return;
40 40 }
41 41
42 - // Check if we're on a single trip page
42 + // Check if we're on a single trip page (use query var, not global $trip —
43 + // the booking template also assigns $trip at global scope, which would
44 + // otherwise leak this menu into the booking page admin bar).
43 45 global $trip;
44 - if (!empty($trip) && !empty($trip->id)) {
46 + if (function_exists('yatra_is_single_trip') && yatra_is_single_trip() && !empty($trip) && !empty($trip->id)) {
45 47 // Build the edit URL for the trip
46 48 $edit_url = admin_url('admin.php?page=yatra&subpage=trips&action=edit&id=' . (int) $trip->id);
47 49
48 50 // Add the Edit Trip node
@@ -94,8 +96,9 @@
94 96 'id' => $node_id,
95 97 'title' => $title,
96 98 'href' => $edit_url,
97 99 'meta' => [
100 + /* translators: %s: object type label (e.g. trip, booking). */
98 101 'title' => sprintf(__('Edit this %s in Yatra admin', 'yatra'), $type),
99 102 ],
100 103 ]);
101 104 }