Recent

Cache class

Cache

Cache Class.

Namespace: WebberZone\Better_Search\Util
Since: 3.3.0
Source: includes/util/class-cache.php line 21

Methods

__construct()

Constructor class.

Since: 3.3.0
Line: 28

public function __construct(  );

ajax_clearcache()

Function to clear the Better Search Cache with Ajax.

Since: 3.3.0
Line: 37

public function ajax_clearcache(  );

delete() static

Delete the Better Search cache.

Since: 3.3.0
Line: 63

static public function delete( $transients = ..., $network = ... ): int;
TypeNameDescription
array$transientsArray of transients to delete.
bool$networkUse network (site) transient if true, default false.

Returns: int — Number of transients deleted.

get_keys() static

Get the default meta keys used for the cache

Since: 3.3.0
Line: 90

static public function get_keys(  ): array;

Returns: array — Transient meta keys

get_key() static

Get the cache key based on a list of parameters.

Since: 3.3.0
Line: 121

static public function get_key( $attr, $context = ... ): string;
TypeNameDescription
mixed$attrArray of attributes typically.
string$contextContext of the cache key to be set.

Returns: string — Cache meta key

get() static

Get a cached value by key.

Since: 4.2.0
Line: 216

static public function get( $key, $network = ... ): mixed;
TypeNameDescription
string$keyCache key.
bool$networkUse network (site) transient if true, default false.

Returns: mixed — Cached value or false if not found.

set() static

Set a cached value by key.

Since: 4.2.0
Line: 232

static public function set( $key, $value, $ttl = ..., $network = ... ): bool;
TypeNameDescription
string$keyCache key.
mixed$valueValue to cache.
int$ttlTime to live in seconds.
bool$networkUse network (site) transient if true, default false.

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