PHP Class WPCOM_VIP_Cache_Manager, vip-mu-plugins-public

Datei anzeigen Open project: Automattic/vip-mu-plugins-public Class Usage Examples

Public Methods

Method Description
__construct ( )
build_purge_request ( string $url, string $method ) : array Instead of using this method directly, please use the API functions provided; see api.php.
curl_multi ( $requests )
execute_purges ( )
get_manual_purge_link ( )
init ( )
instance ( )
manual_purge_message ( )
purge_site_cache ( $when = null )
queue_old_permalink_purge ( integer $post_ID, WP_Post $post_after, WP_Post $post_before ) : void Schedule purge of old permalink in case it was changed during post update and only if the post's status was publish before the update
queue_post_purge ( $post_id )
queue_purge_url ( string $url ) : boolean PURGE a single URL
queue_term_purge ( object | integer $term ) : boolean Purge the cache for a terms
queue_terms_purges ( array $ids, string $taxonomy ) Purge the cache for some terms

Protected Methods

Method Description
get_purge_urls_for_term ( object $term ) : array Get all URLs to be purged for a given term

Private Methods

Method Description
can_purge_cache ( )

Method Details

__construct() public method

public __construct ( )

build_purge_request() public method

Instead of using this method directly, please use the API functions provided; see api.php.
public build_purge_request ( string $url, string $method ) : array
$url string A URL to PURGE
$method string
return array

curl_multi() public method

public curl_multi ( $requests )

execute_purges() public method

public execute_purges ( )

get_purge_urls_for_term() protected method

Get all URLs to be purged for a given term
protected get_purge_urls_for_term ( object $term ) : array
$term object A WP term object
return array An array of URLs to be purged

init() public method

public init ( )

instance() public static method

public static instance ( )

manual_purge_message() public method

purge_site_cache() public method

public purge_site_cache ( $when = null )

queue_post_purge() public method

public queue_post_purge ( $post_id )

queue_purge_url() public method

PURGE a single URL
public queue_purge_url ( string $url ) : boolean
$url string The specific URL to purge the cache for
return boolean True on success

queue_term_purge() public method

Purge the cache for a terms
public queue_term_purge ( object | integer $term ) : boolean
$term object | integer A WP Term object, or a term ID
return boolean True on success

queue_terms_purges() public method

Hooks the clean_term_cache action We do not respect requests to clear caches for the entire taxonomy, as this would be potentially hundreds or thousands of PURGE requests.
public queue_terms_purges ( array $ids, string $taxonomy )
$ids array An array of term IDs.
$taxonomy string Taxonomy slug.