Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2018 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/427cae013130488a403749112a060307 to your computer and use it in GitHub Desktop.
Save anonymous/427cae013130488a403749112a060307 to your computer and use it in GitHub Desktop.
function travel_log_child_formatted_currency(){
global $post;
$post_id = $post->ID;
$trip_price = number_format( wp_travel_get_trip_price( $post_id ), 2 );
$enable_sale = get_post_meta( $post_id, 'wp_travel_enable_sale', true );
$sale_price = wp_travel_get_trip_sale_price( $post_id );
$currency_code = ( isset( $settings['currency'] ) ) ? $settings['currency'] : '';
$currency_symbol = wp_travel_get_currency_symbol( $currency_code );
return sprintf( ' %s %s ', $currency_symbol, $trip_price );
}
add_filter( 'wp_travel_itinerary_price', 'travel_log_child_formatted_currency' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment