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(
/* translators: 1: trip date, 2: location name. */
__('Traveled %1$s in %2$s', 'yatra'),
$trip_date,
$location
));
} elseif ($trip_date) {
echo esc_html(sprintf(
/* translators: %s: trip date. */
__('Traveled %s', 'yatra'),
$trip_date
));
} elseif ($location) {
echo esc_html(sprintf(
/* translators: %s: location name. */
__('Traveled in %s', 'yatra'),
$location
));
} else {
echo esc_html__('Verified Traveler', 'yatra');
}
?>