rating) ? intval($testimonial->rating) : 5;
for ($i = 1; $i <= 5; $i++):
echo $i <= $rating ? '★' : '☆';
endfor;
?>
author_name) ? $testimonial->author_name : __('Anonymous', 'yatra');
$initials = implode('', array_map(function($word) { return strtoupper(substr($word, 0, 1)); }, explode(' ', $author_name)));
echo esc_html(substr($initials, 0, 2));
?>
trip_date) ? $testimonial->trip_date : '';
$location = !empty($testimonial->location) ? $testimonial->location : '';
if ($trip_date && $location) {
echo esc_html(sprintf(__('Traveled %s in %s', 'yatra'), $trip_date, $location));
} elseif ($trip_date) {
echo esc_html(sprintf(__('Traveled %s', 'yatra'), $trip_date));
} elseif ($location) {
echo esc_html(sprintf(__('Traveled in %s', 'yatra'), $location));
} else {
echo esc_html__('Verified Traveler', 'yatra');
}
?>