Tribe__Events__Main::maybe_set_currency_symbol_with_post( boolean $currency_symbol, int $post_id )

Set the currency symbol from tribe_events meta data if available


Parameters

$currency_symbol

(boolean) (Required) Currency symbol to use

$post_id

(int) (Required) Post ID


Top ↑

Return

(string)


Top ↑

Source

File: src/Tribe/Main.php

		public function maybe_set_currency_symbol_with_post( $currency_symbol, $post_id ) {
			// if the currency symbol is already set, don't alter it
			if ( null !== $currency_symbol ) {
				return $currency_symbol;
			}

			// if there isn't a post id, don't change the symbol
			if ( ! $post_id ) {
				return $currency_symbol;
			}

			// if the post isn't a tribe_events post type, don't alter the symbol
			$post = get_post( $post_id );
			if ( self::POSTTYPE !== $post->post_type ) {
				return $currency_symbol;
			}

			$currency_symbol = tribe_get_event_meta( $post_id, '_EventCurrencySymbol', true );

			return $currency_symbol;
		}