WPSEO_Options::get()public staticYoast 1.0

Retrieve a single field from any option for the SEO plugin. Keys are always unique.

Метод класса: WPSEO_Options{}

Хуков нет.

Возвращает

Разное. Returns value if found, $default_value if not.

Использование

$result = WPSEO_Options::get( $key, $default_value );
$key(строка) (обязательный)
The key it should return.
$default_value(разное)
The default value that should be returned if the key isn't set.
По умолчанию: null

Код WPSEO_Options::get() Yoast 22.4

public static function get( $key, $default_value = null ) {
	if ( static::$option_values === null ) {
		static::prime_cache();
	}
	if ( isset( static::$option_values[ $key ] ) ) {
		return static::$option_values[ $key ];
	}

	return $default_value;
}