WC_Helper_Options::get()public staticWC 1.0

Get an option by key

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

Хуков нет.

Возвращает

Разное. An option or the default.

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

$result = WC_Helper_Options::get( $key, $default );
$key(строка) (обязательный)
The key to fetch.
$default(разное)
The default option to return if the key does not exist.
По умолчанию: false

Заметки

  • Смотрите: self::update

Код WC_Helper_Options::get() WC 8.7.0

public static function get( $key, $default = false ) {
	$options = get_option( self::$option_name, array() );
	if ( is_array( $options ) && array_key_exists( $key, $options ) ) {
		return $options[ $key ];
	}

	return $default;
}