Tribe__Events__Main::maybe_set_currency_position_with_post( boolean $reverse_position, int $post_id )

Set the currency position from tribe_events meta data if available


Parameters

$reverse_position

(boolean) (Required) Whether to reverse the location of the currency symbol

$post_id

(int) (Required) Post ID


Top ↑

Return

(boolean)


Top ↑

Source

File: src/Tribe/Main.php

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

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

			// 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 $reverse_position;
			}

			$reverse_position = tribe_get_event_meta( $post_id, '_EventCurrencyPosition', true );
			$reverse_position = ( 'suffix' === $reverse_position );

			return $reverse_position;
		}