| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<section class="yatra-trip-section" id="trip-story"> |
| 7 |
<h2 class="yatra-trip-section-title"> |
| 8 |
<?php yatra_render_tab_icon($tab->icon ?? null, 'book', 'yatra-trip-section-title-icon', $tab->label ?? __('Trip Story', 'yatra')); ?> |
| 9 |
<?php echo esc_html(isset($tab->label) ? $tab->label : __('Trip Story', 'yatra')); ?> |
| 10 |
</h2> |
| 11 |
<div class="yatra-trip-story-container"> |
| 12 |
<div class="yatra-trip-story-content"> |
| 13 |
<div class="yatra-trip-story-text"> |
| 14 |
<?php |
| 15 |
$story_content = $trip->getTripStory() ?? ''; |
| 16 |
if (!empty($story_content)) { |
| 17 |
// Use wp_kses_post to allow basic HTML formatting but strip dangerous content |
| 18 |
echo wp_kses_post($story_content); |
| 19 |
} else { |
| 20 |
echo '<p class="yatra-no-content">' . esc_html__('No story available for this trip yet.', 'yatra') . '</p>'; |
| 21 |
} |
| 22 |
?> |
| 23 |
</div> |
| 24 |
</div> |
| 25 |
|
| 26 |
<?php if (!empty($story_content)): ?> |
| 27 |
<div class="yatra-trip-story-meta"> |
| 28 |
<div class="yatra-story-highlight"> |
| 29 |
<?php echo yatra_svg_icon('heart', 'yatra-story-icon'); ?> |
| 30 |
<span><?php echo esc_html__('Crafted with passion for travelers like you', 'yatra'); ?></span> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
<?php endif; ?> |
| 34 |
</div> |
| 35 |
</section> |
| 36 |
|