|
@@ 99-105 (lines=7) @@
|
| 96 |
|
*/ |
| 97 |
|
|
| 98 |
|
public static function get( $cache_key, $custom_key = false, $query_args = array() ) { |
| 99 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 100 |
|
if ( ! $custom_key ) { |
| 101 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
$option = get_option( $cache_key ); |
| 108 |
|
|
|
@@ 141-147 (lines=7) @@
|
| 138 |
|
*/ |
| 139 |
|
|
| 140 |
|
public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) { |
| 141 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 142 |
|
if ( ! $custom_key ) { |
| 143 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
$option_value = array( |
| 150 |
|
'data' => $data, |