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
33 lines
1.6 KiB
PHP
33 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Large attraction feature card. Args: $post_id.
|
|
*/
|
|
defined( 'ABSPATH' ) || exit;
|
|
$post_id = isset( $post_id ) ? absint( $post_id ) : get_the_ID();
|
|
if ( ! $post_id ) {
|
|
return;
|
|
}
|
|
$permalink = get_permalink( $post_id );
|
|
$price = get_post_meta( $post_id, '_vc_price_from', true );
|
|
$currency = get_post_meta( $post_id, '_vc_currency', true );
|
|
$rating = get_post_meta( $post_id, '_vc_rating', true );
|
|
$destinations = get_the_terms( $post_id, 'viator_destination' );
|
|
$destination = ( ! empty( $destinations ) && ! is_wp_error( $destinations ) ) ? $destinations[0]->name : '';
|
|
?>
|
|
<a class="vc-attraction vc-reveal" href="<?php echo esc_url( $permalink ); ?>">
|
|
<span class="vc-attraction__media">
|
|
<?php echo vc_tour_image_html( $post_id, 'vc-attraction__img' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
<span class="vc-attraction__scrim"></span>
|
|
</span>
|
|
<?php if ( '' !== $price ) : ?>
|
|
<span class="vc-attraction__badge"><span><?php echo esc_html__( 'From', 'viator-collector' ); ?></span> <?php echo esc_html( vc_money( $price, $currency ) ); ?></span>
|
|
<?php endif; ?>
|
|
<span class="vc-attraction__body">
|
|
<?php if ( $destination ) : ?><span class="vc-attraction__place"><?php echo esc_html( $destination ); ?></span><?php endif; ?>
|
|
<span class="vc-attraction__title"><?php echo esc_html( get_the_title( $post_id ) ); ?></span>
|
|
<?php if ( '' !== $rating ) : ?>
|
|
<span class="vc-attraction__rating"><?php echo vc_render_stars( $rating ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <strong><?php echo esc_html( $rating ); ?></strong></span>
|
|
<?php endif; ?>
|
|
</span>
|
|
</a>
|