Cache
Cache class.
Namespace: WebberZone\Top_Ten\Util
Since: 3.3.0
Source: includes/util/class-cache.php line 22
Methods
__construct()
Constructor class.
Since: 3.3.0
Line: 29
public function __construct( );
invalidate() static
Invalidate cached rankings and output after their source data changes.
Since: 4.6.0
Line: 39
static public function invalidate( $blog_id = ... ): void;
| Type | Name | Description |
|---|---|---|
int |
$blog_id |
Site whose data changed, or 0 for all sites. |
Returns: void
invalidate_counts() static
Invalidate the sites identified by a count update.
Since: 4.6.0
Line: 56
static public function invalidate_counts( $post_id = ..., $blog_id = ..., $daily = ..., $blog_ids = ... ): void;
| Type | Name | Description |
|---|---|---|
int |
$post_id |
Post ID, or 0 for a bulk update. |
int |
$blog_id |
Blog ID, or 0 for a bulk update. |
bool |
$daily |
Whether daily counts changed. |
int[] |
$blog_ids |
Sites affected by a bulk update. |
Returns: void
invalidate_set_count() static
Invalidate the site whose count was set.
Since: 4.6.0
Line: 75
static public function invalidate_set_count( $post_id, $count, $blog_id ): void;
| Type | Name | Description |
|---|---|---|
int |
$post_id |
Post ID. |
int |
$count |
Stored count. |
int |
$blog_id |
Site ID. |
Returns: void
invalidate_deleted_counts() static
Invalidate the scope of a count deletion.
Since: 4.6.0
Line: 85
static public function invalidate_deleted_counts( $args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Count deletion arguments. |
Returns: void
invalidate_current_blog() static
Invalidate lists affected by a post change on the current site.
Since: 4.6.0
Line: 94
static public function invalidate_current_blog( ): void;
Returns: void
ajax_clearcache()
Function to clear the Top 10 Cache with Ajax.
Since: 2.2.0
Line: 103
public function ajax_clearcache( );
delete() static
Delete the Top 10 cache.
Since: 2.3.0
Line: 136
static public function delete( $transients = ... ): int;
| Type | Name | Description |
|---|---|---|
array |
$transients |
Array of transients to delete. |
Returns: int — Number of transients deleted.
delete_network() static
Delete the Top 10 cache across all active network sites.
Since: 4.5.0
Line: 171
static public function delete_network( ): int;
Returns: int — Number of transients deleted.
get_keys() static
Get the default meta keys used for the cache
Line: 214
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: 4.2.0
Line: 247
static public function get_key( $attr ): string;
| Type | Name | Description |
|---|---|---|
mixed |
$attr |
Array of attributes typically. |
Returns: string — Cache meta key
get_widget_keys() static
Get the transient names for the Top 10 widgets.
Since: 2.3.0
Line: 454
static public function get_widget_keys( ): array;
Returns: array — Top 10 Cache widget keys.