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
yatra / templates / partials / single-trip / content-custom.php

content-custom.php in Yatra – Travel Booking & Tour Operator Software 3.0.16, at templates/partials/single-trip/content-custom.php

39 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Single-trip — Custom tab partial.
4 *
5 * Renders a user-defined "custom" frontend tab. Mirrors the structure of the
6 * other content-* partials so the admin-chosen icon and label resolve through
7 * the same `yatra_render_tab_icon()` pipeline (icons.json + IconPicker support).
8 *
9 * Expected vars:
10 * @var object $trip Trip model.
11 * @var object $tab Frontend-tab entry (id, label, icon, custom_content).
12 */
13
14 if (!defined('ABSPATH')) {
15 exit;
16 }
17
18 $tab_id = isset($tab->id) ? (string) $tab->id : 'custom';
19 $tab_label = isset($tab->label) ? (string) $tab->label : __('Section', 'yatra');
20 $tab_icon = $tab->icon ?? null;
21 $custom_content = isset($tab->custom_content) ? (string) $tab->custom_content : '';
22 ?>
23
24 <section class="yatra-trip-section yatra-trip-section-custom" id="<?php echo esc_attr($tab_id); ?>">
25 <h2 class="yatra-trip-section-title">
26 <?php yatra_render_tab_icon($tab_icon, 'book', 'yatra-trip-section-title-icon', $tab_label); ?>
27 <?php echo esc_html($tab_label); ?>
28 </h2>
29 <div class="yatra-custom-content">
30 <?php if ($custom_content !== '') : ?>
31 <?php echo wp_kses_post($custom_content); ?>
32 <?php else : ?>
33 <p class="text-gray-500 text-center py-8">
34 <?php esc_html_e('No custom content available for this section.', 'yatra'); ?>
35 </p>
36 <?php endif; ?>
37 </div>
38 </section>
39