Cache
Admin Columns Class.
Namespace: WebberZone\WFP\Util
Since: 3.1.0
Source: includes/util/class-cache.php line 20
Methods
__construct()
Constructor class.
Since: 3.1.0
Line: 27
public function __construct( );
delete() static
Delete the Followed Posts cache.
Since: 2.4.0
Line: 38
static public function delete( $meta_keys = ... ): int;
| Type | Name | Description |
|---|---|---|
array | $meta_keys | Array of meta keys that hold the cache. |
Returns: int — Number of keys deleted.
get_keys() static
Get the _wherego_cache keys.
Since: 2.4.0
Line: 68
static public function get_keys( $post_id = ... ): array;
| Type | Name | Description |
|---|---|---|
int | $post_id | Post ID. Optional. |
Returns: array — Array of _wherego_cache keys.
delete_by_post() static
Function to delete the cache for a specific post.
Since: 2.4.0
Line: 105
static public function delete_by_post( $post_id = ... );
| Type | Name | Description |
|---|---|---|
mixed | $post_id | Post ID. |
get_key() static
Get the cache key based on a list of parameters.
Since: 2.4.0
Line: 128
static public function get_key( $attr ): string;
| Type | Name | Description |
|---|---|---|
mixed | $attr | Array of attributes typically. |
Returns: string — Cache meta key
set_cache() static
Sets/updates the value of the WFP cache for a post.
Since: 3.0.0
Line: 314
static public function set_cache( $post_id, $key, $value, $expiration = ... ): int|bool;
| Type | Name | Description |
|---|---|---|
int | $post_id | Post ID. |
string | $key | WFP Cache key. |
mixed | $value | Metadata value. Must be serializable if non-scalar. |
int | $expiration | Time until expiration in seconds. Default WFP_CACHE_TIME (one week if not overridden). |
Returns: int|bool — Meta ID if the key didn’t exist, true on successful update,
get_cache() static
Get the value of the WFP cache for a post.
Since: 3.0.0
Line: 350
static public function get_cache( $post_id, $key ): mixed;
| Type | Name | Description |
|---|---|---|
int | $post_id | Post ID. |
string | $key | WFP Cache key. |
Returns: mixed — Value of the WFP cache or false if invalid, expired or unavailable.
delete_cache() static
Delete the value of the WFP cache for a post.
Since: 3.0.0
Line: 383
static public function delete_cache( $post_id, $key ): bool;
| Type | Name | Description |
|---|---|---|
int | $post_id | Post ID. |
string | $key | WFP Cache key. |
Returns: bool — True on success, False on failure.
delete_cache_by_key() static
Delete the value of the WFP cache by cache key.
Since: 3.0.0
Line: 404
static public function delete_cache_by_key( $key ): bool;
| Type | Name | Description |
|---|---|---|
string | $key | WFP Cache key. |
Returns: bool — True on success, False on failure.