Automattic\WooCommerce\Internal\AddressProvider

AbstractAutomatticAddressProvider::get_cached_optionprivateWC 1.0

Gets the cached option.

Method of the class: AbstractAutomatticAddressProvider{}

No Hooks.

Returns

Mixed|null. The cached option.

Usage

// private - for code of main (parent) class only
$result = $this->get_cached_option( $key );
$key(string) (required)
The key of the option.

AbstractAutomatticAddressProvider::get_cached_option() code WC 10.3.3

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;
}