Automattic\WooCommerce\Internal\AddressProvider

AbstractAutomatticAddressProvider::get_cached_optionprivateWC 1.0

Gets the cached option.

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

Хуков нет.

Возвращает

Разное|null. The cached option.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_cached_option( $key );
$key(строка) (обязательный)
The key of the option.

Код AbstractAutomatticAddressProvider::get_cached_option() WC 10.3.6

private function get_cached_option( $key ) {
	$data = get_option( $this->id . '_' . $key );
	if ( is_array( $data ) && isset( $data['data'] ) ) {
		if ( ! self::is_expired( $data ) ) {
			return $data['data'];
		}
		$this->delete_cached_option( $key );
	}
	return null;
}