Recent

ProclassPro only

Pro

Class to load all the pro features.

Namespace: WebberZone\Contextual_Related_Posts\Pro
Source: includes/pro/class-pro.php line 22

Methods

__construct()

Constructor

Line: 161

public function __construct(  );

cap_cache_time()

Cap the cache lifetime to the granularity of the recency reference date.

A recency-boosted ordering is computed against a reference date supplied by PHP, so a cached result set has to be refreshed as often as that date moves or the ordering goes stale. Query arguments are passed through by CRP’s cache callers so shortcode and block overrides are capped using their effective settings too.

Since: 4.5.0
Line: 234

public function cap_cache_time( $cache_time, $post_id = ..., $key = ..., $args = ... ): int;
Type Name Description
int $cache_time Time until expiration in seconds. 0 means no expiration.
int $post_id Post ID.
string $key Cache key.
array $args Query arguments used to resolve the cache lifetime.

Returns: int — Capped cache time in seconds.

free_hooks() static

Hooks run when on the free plan.

Since: 3.5.0
Line: 252

static public function free_hooks(  );

update_shortcode_defaults()

Update the shortcode defaults.

Since: 3.5.0
Line: 264

public function update_shortcode_defaults( $defaults ): array;
Type Name Description
array $defaults Default shortcode settings.

Returns: array — Updated shortcode settings.

short_circuit()

Shortcode circuit.

Since: 3.5.0
Line: 288

public function short_circuit( $short_circuit, $post, $args ): bool;
Type Name Description
bool $short_circuit Short circuit flag.
\WP_Post $post Post object.
array $args Arguments array.

Returns: bool — True if short circuit is enabled.

update_fulltext_indexes() static

Update the fulltext indexes.

Since: 3.5.0
Line: 323

static public function update_fulltext_indexes( $indexes ): array;
Type Name Description
array $indexes Array of indexes.

Returns: array — Updated array of indexes.

uninstall_pro() static

Uninstall the pro plugin features.

Since: 3.5.0
Line: 334

static public function uninstall_pro(  );

delete_data() static

Delete plugin data.

Since: 3.5.0
Line: 362

static public function delete_data(  );

add_tracking_parameters()

Add tracking parameters to related post URLs.

Since: 4.0.0
Line: 385

public function add_tracking_parameters( $url, $result, $args ): string;
Type Name Description
string $url The post URL.
\WP_Post $result The post object.
array $args Arguments array.

Returns: string — Modified URL with tracking parameters.