Recent

Cache class

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;
TypeNameDescription
array$meta_keysArray 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;
TypeNameDescription
int$post_idPost 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 = ... );
TypeNameDescription
mixed$post_idPost 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;
TypeNameDescription
mixed$attrArray 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;
TypeNameDescription
int$post_idPost ID.
string$keyWFP Cache key.
mixed$valueMetadata value. Must be serializable if non-scalar.
int$expirationTime 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;
TypeNameDescription
int$post_idPost ID.
string$keyWFP 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;
TypeNameDescription
int$post_idPost ID.
string$keyWFP 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;
TypeNameDescription
string$keyWFP Cache key.

Returns: bool — True on success, False on failure.