Created
January 4, 2018 05:04
-
-
Save anonymous/7fe47950276998841c29fbff4731f63e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action( 'wp_travel_after_single_title', 'wp_travel_single_excerpt', 1 ); | |
add_action( 'wp_travel_after_single_title', 'wp_travel_single_excerpt_custom', 1 ); | |
function wp_travel_single_excerpt_custom( $post_id ) { | |
if ( ! $post_id ) { | |
return; | |
} | |
$wp_travel_itinerary = new WP_Travel_Itinerary(); | |
?> | |
<div class="trip-short-desc"> | |
<?php the_excerpt(); ?> | |
</div> | |
<div class="wp-travel-trip-meta-info"> | |
<ul> | |
<?php | |
/** | |
* @since 1.0.4 | |
*/ | |
do_action( 'wp_travel_single_itinerary_before_trip_meta_list', $post_id ); | |
?> | |
<li> | |
<div class="travel-info"> | |
<strong class="title"><?php esc_html_e( 'Trip Type', 'wp-travel' ); ?></strong> | |
</div> | |
<div class="travel-info"> | |
<span class="value"> | |
<?php | |
$trip_types_list = $wp_travel_itinerary->get_trip_types_list(); | |
if ( $trip_types_list ) { | |
echo wp_kses( $trip_types_list, wp_travel_allowed_html( array( 'a' ) ) ); | |
} else { | |
echo esc_html( apply_filters( 'wp_travel_default_no_trip_type_text', __( 'No trip type', 'wp-travel' ) ) ); | |
} | |
?> | |
</span> | |
</div> | |
</li> | |
<li> | |
<div class="travel-info"> | |
<strong class="title"><?php esc_html_e( 'Group Size', 'wp-travel' ); ?></strong> | |
</div> | |
<div class="travel-info"> | |
<span class="value"> | |
<?php | |
if ( $group_size = $wp_travel_itinerary->get_group_size() ) { | |
printf( __( '%d pax', 'wp-travel' ), esc_html( $group_size ) ); | |
} else { | |
echo esc_html( apply_filters( 'wp_travel_default_group_size_text', __( 'No Size Limit', 'wp-travel' ) ) ); | |
} | |
?> | |
</span> | |
</div> | |
</li> | |
<?php if ( comments_open() ) : ?> | |
<li> | |
<div class="travel-info"> | |
<strong class="title"><?php esc_html_e( 'Reviews', 'wp-travel' ); ?></strong> | |
</div> | |
<div class="travel-info"> | |
<span class="value"> | |
<?php | |
$count = (int) get_comments_number(); | |
echo '<a href="javascript:void(0)" class="wp-travel-count-info">'; | |
printf( _n( '%s review', '%s reviews', $count, 'wp-travel' ), $count ); | |
echo '</a>'; ?> | |
</span> | |
</div> | |
</li> | |
<?php endif; ?> | |
<?php | |
/** | |
* @since 1.0.4 | |
*/ | |
do_action( 'wp_travel_single_itinerary_after_trip_meta_list', $post_id ); | |
?> | |
</ul> | |
</div> | |
<div class="booking-form"> | |
<div class="wp-travel-booking-wrapper"> | |
<button class="wp-travel-booknow-btn"><?php esc_html_e( 'Book Now', 'wp-travel' ); ?></button> | |
</div> | |
</div> | |
<?php | |
/** | |
* @since 1.0.4 | |
*/ | |
do_action( 'wp_travel_single_after_booknow', $post_id ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment