|
@@ 141-147 (lines=7) @@
|
| 138 |
|
*/ |
| 139 |
|
|
| 140 |
|
public static function get( $cache_key, $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 = get_option( $cache_key ); |
| 150 |
|
|
|
@@ 183-189 (lines=7) @@
|
| 180 |
|
*/ |
| 181 |
|
|
| 182 |
|
public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) { |
| 183 |
|
if ( ! self::is_valid_cache_key( $cache_key ) ) { |
| 184 |
|
if ( ! $custom_key ) { |
| 185 |
|
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) ); |
| 186 |
|
} |
| 187 |
|
|
| 188 |
|
$cache_key = self::get_key( $cache_key, $query_args ); |
| 189 |
|
} |
| 190 |
|
|
| 191 |
|
$option_value = array( |
| 192 |
|
'data' => $data, |