Files
amir 7ada8860f8 Add viator-collector plugin (Hop On Hop Off front-end reskin)
Consolidate the plugin into the TourWebsite repository (its separate
nested git repo has been removed). Includes the full new-design reskin:
scoped design stylesheet, SVG icon sprite, rebuilt listing/single/section
templates, and homepage hero/FAQ/testimonials shortcodes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4hNL1PSHxXbu94SCenpKj
2026-09-12 21:11:20 +03:30

28 lines
1.0 KiB
PHP

<?php
/**
* Destination card. Args: $term (WP_Term).
*/
defined( 'ABSPATH' ) || exit;
if ( empty( $term ) || ! is_object( $term ) ) {
return;
}
$link = get_term_link( $term );
$link = is_wp_error( $link ) ? '#' : $link;
$image = vc_term_image_url( $term->term_id, $term->taxonomy );
$count = vc_term_tour_count( $term );
?>
<a class="vc-dest-card vc-reveal" href="<?php echo esc_url( $link ); ?>">
<span class="vc-dest-card__media">
<?php if ( $image ) : ?>
<img class="vc-dest-card__img" src="<?php echo esc_url( $image ); ?>" alt="<?php echo esc_attr( $term->name ); ?>" loading="lazy">
<?php else : ?>
<span class="vc-dest-card__placeholder" aria-hidden="true"></span>
<?php endif; ?>
<span class="vc-dest-card__overlay"></span>
</span>
<span class="vc-dest-card__body">
<span class="vc-dest-card__name"><?php echo esc_html( $term->name ); ?></span>
<?php if ( $count ) : ?><span class="vc-dest-card__count"><?php echo esc_html( sprintf( _n( '%d tour', '%d tours', $count, 'viator-collector' ), $count ) ); ?></span><?php endif; ?>
</span>
</a>