|
@@ 129-135 (lines=7) @@
|
| 126 |
|
* @return mixed |
| 127 |
|
*/ |
| 128 |
|
public static function get( $cache_key, $custom_key = false, $query_args = array() ) { |
| 129 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 130 |
|
if ( ! $custom_key ) { |
| 131 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
$option = get_option( $cache_key ); |
| 138 |
|
|
|
@@ 170-176 (lines=7) @@
|
| 167 |
|
* @return mixed |
| 168 |
|
*/ |
| 169 |
|
public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) { |
| 170 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 171 |
|
if ( ! $custom_key ) { |
| 172 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 176 |
|
} |
| 177 |
|
|
| 178 |
|
$option_value = array( |
| 179 |
|
'data' => $data, |