Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d6c38f86c |
33
inc/integration/class-wp-rocket.php
Normal file
33
inc/integration/class-wp-rocket.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @package ogre-suspension
|
||||
* @author cleverogre
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace Ogre\Suspension\Integration;
|
||||
|
||||
use Ogre\Singleton;
|
||||
use Ogre\Suspension as Plugin;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
final class WPRocket {
|
||||
use Singleton;
|
||||
|
||||
protected function __construct() {
|
||||
add_filter('do_rocket_generate_caching_files', '__return_false');
|
||||
register_activation_hook(Plugin::get_file(), [$this, 'clean_cache']);
|
||||
}
|
||||
|
||||
public function clean_cache() {
|
||||
if (!function_exists('rocket_clean_domain')) return false;
|
||||
|
||||
// Purge entire WP Rocket cache
|
||||
rocket_clean_domain();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
WPRocket::instance();
|
||||
@@ -26,6 +26,7 @@ final class Suspension extends Plugin {
|
||||
'inc/class-redirect.php',
|
||||
'inc/class-admin.php',
|
||||
'inc/class-template.php',
|
||||
'inc/integrations/class-wp-rocket.php',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user