tribe_get_cost( null|int $post_id = null, bool $with_currency_symbol = false )
Get an event’s cost
Contents
Parameters
- $post_id
-
(null|int) (Optional) (optional)
Default value: null
- $with_currency_symbol
-
(bool) (Optional) Include the currency symbol
Default value: false
Return
(string) Cost of the event.
Source
File: src/functions/template-tags/general.php
function tribe_get_cost( $post_id = null, $with_currency_symbol = false ) {
$tribe_ecp = Tribe__Events__Main::instance();
$post_id = Tribe__Events__Main::postIdHelper( $post_id );
$cost_utils = tribe( 'tec.cost-utils' );
$cost = $cost_utils->get_formatted_event_cost( $post_id, $with_currency_symbol );
return apply_filters( 'tribe_get_cost', $cost, $post_id, $with_currency_symbol );
}