-
-
Save gbissland/7b49cbbd4e5cdc44f91b99b4a60cada7 to your computer and use it in GitHub Desktop.
Gridpane - WP-Umbrella purge Nginx Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
use WPUmbrella\Core\Collections\CacheCollectionItem; | |
class WPUmbrellaNginxHelper implements CacheCollectionItem | |
{ | |
public static function isAvailable() | |
{ | |
if (!function_exists('is_plugin_active')) { | |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
} | |
return is_plugin_active('nginx-helper/nginx-helper.php') || class_exists('\Nginx_Helper'); | |
} | |
public function clear() | |
{ | |
if (!class_exists('\Nginx_Helper')) { | |
return; | |
} | |
global $nginx_purger; | |
$nginx_purger->purge_all(); | |
} | |
} | |
add_filter('wp_umbrella_cache_compatibilities', 'wpu_add_cache_compatibilities'); | |
function wpu_add_cache_compatibilities($classes) | |
{ | |
$classes[] = '\WPUmbrellaNginxHelper'; | |
return $classes; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Regarding the ability to purge the cache, I can offer you a filter that will add compatibility on our extension with your Nginx system thanks to the code you sent us.
........we do not have knowledge of this system unfortunately. In case you have the possibility to clear the cache via our application and if you add this filter, then it will be taken into account."