Automattic\WooCommerce\Internal\AddressProvider
AbstractAutomatticAddressProvider::get_cached_option
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() 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;
}