Tribe__Events__Community__Tickets__Main::get_option( string $option_name, mixed $default = '', bool $force = false )

Get value for a specific option.


Parameters #

$option_name

(string) (Required) Name of option.

$default

(mixed) (Optional) Default value.

Default value: ''

$force

(bool) (Optional)

Default value: false


Top ↑

Return #

(mixed) Results of option query.


Top ↑

Source #

File: src/Tribe/Main.php

	public function get_option( $option_name, $default = '', $force = false ) {
		if ( ! $option_name ) {
			return;
		}

		if ( ! isset( self::$options ) || $force ) {
			self::get_options( $force );
		}

		$option = $default;

		if ( isset( self::$options[ $option_name ] ) ) {
			$option = self::$options[ $option_name ];
		}

		/**
		 * Filter a single option value.
		 *
		 * @since 4.6.2
		 *
		 * @param string $option      Option value.
		 * @param string $default     Default value.
		 * @param string $option_name Name of option.
		 */
		return apply_filters( 'tribe_get_single_option', $option, $default, $option_name );
	}

Top ↑

Changelog #

Changelog
Version Description
4.6.2 Introduced.