← Back
Editing: class-cache-handler.php
<?php namespace GD_cORe\handlers; if ( ! defined( 'ABSPATH' ) ) { exit; } /** * The admin-specific functionality of the plugin. * * * @package GD_cORe * @subpackage GD_cORe/admin */ class Cache extends Main { public function __construct() { } /** * clears WP-Rocket, opcache, Beaver Builder, and MWP caches * * @since 2.8 * @return string * **/ public function spendCache( $ajax = null ) { if ( current_user_can( 'manage_options' ) ) { if ( $ajax ) { check_ajax_referer( 'core_cache_string', 'security' ); } // Clear wp-rocket cache. if ( function_exists( 'rocket_clean_domain' ) ) { rocket_clean_domain(); } // Clear minified CSS and JavaScript files. if ( function_exists( 'rocket_clean_minify' ) ) { rocket_clean_minify(); } opcache_reset(); // clear beaver builder cache if ( class_exists( 'FLBuilderModel' ) ) { \FLBuilderModel::delete_asset_cache_for_all_posts(); } if ( class_exists( 'FLCustomizer' ) ) { \FLCustomizer::refresh_css(); } // clear MWP cache if ( class_exists( 'WPaaS\\Cache_V2' ) ) { $base_actions = new Base_Function(); if ( $ajax ) { echo html_entity_decode( \WPaaS\Cache_V2::get_flush_url() ); wp_die(); } else { $base_actions->redirect( html_entity_decode( \WPaaS\Cache_V2::get_flush_url() ) ); } } } } }
Save File
Cancel