Code-Snippets-Functions/Returns information from child Site/Cache Enabler – WordPress Cache
Sebastian Moran c00cf4ecac
Update README.md
Bump WordPress version.
2021-08-10 12:19:14 -06:00
..
cache-enabler.php Clearing Cache Enabler cache via Code Snippet 2019-01-19 10:35:32 +01:00
README.md Update README.md 2021-08-10 12:19:14 -06:00

Purge Cache Enabler WordPress Cache on your Child Sites

Tested version of WordPress 5.8.

This file is a code snippet that is used for Cache Enabler WordPress Cache Plugin By KeyCDN.

Things to do

  1. If your not sure what this does check the Code Snippets Functions Readme
  2. As with all code snippets located in this git, TEST the code snippet on one of your test sites BEFORE sending the code snippet to all your MainWP Child sites!

Code snippet functions help

If you run into any issues or questions please use the MainWP Support page and open a ticket for the fastest response.

Cache Enabler Clearing Cache Tutorial

Clearing Cache Via Third Party's code and example found on the support site of the plugin.

The PHP snippet below can be used to clear the cache via a third party such as a Cron Job for example. The first section initializes the WordPress environment, normally this PHP file should be located in your WordPress root directory. The second if performs the action of completely clearing the cache and with the third if you have the ability to specify which post ID you would like to clear the cache for.

// initilize WordPress environment
if ( !defined('ABSPATH') ) {
	require_once('./wp-load.php');
}

if ( has_action('ce_clear_cache') ) {
    do_action('ce_clear_cache');
}

if ( has_action('ce_clear_post_cache') ) {
    do_action('ce_clear_post_cache', 1111); // post_id
}