|
@@ 203-209 (lines=7) @@
|
| 200 |
|
* @return mixed |
| 201 |
|
*/ |
| 202 |
|
public static function get( $cache_key, $custom_key = false, $query_args = array() ) { |
| 203 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 204 |
|
if ( ! $custom_key ) { |
| 205 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 209 |
|
} |
| 210 |
|
|
| 211 |
|
$option = get_option( $cache_key ); |
| 212 |
|
|
|
@@ 244-250 (lines=7) @@
|
| 241 |
|
* @return mixed |
| 242 |
|
*/ |
| 243 |
|
public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) { |
| 244 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 245 |
|
if ( ! $custom_key ) { |
| 246 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 247 |
|
} |
| 248 |
|
|
| 249 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 250 |
|
} |
| 251 |
|
|
| 252 |
|
$option_value = array( |
| 253 |
|
'data' => $data, |