Last active
August 30, 2019 04:36
-
-
Save wpmudev-sls/74bf73eb0f0577899ac6aa8500fdc8c6 to your computer and use it in GitHub Desktop.
Clear Cache After Import Property for Plugin WP-Property Importer
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
<?php | |
/** | |
* Plugin Name: [Hummingbird Pro] - Clear Cache After Import Property for Plugin WP-Property Importer | |
* Description: [Hummingbird Pro] - Clear Cache After Import Property for Plugin WP-Property Importer - Required 2.1.0 - 1136047218109817 | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
add_action( 'wpp_xml_import_complete', function(){ | |
if( class_exists( 'Hummingbird\WP_Hummingbird' ) && Hummingbird\Core\Settings::get_setting( 'enabled', 'page_cache' ) ){ | |
Hummingbird\Core\Utils::get_module( 'page_cache' )->clear_cache(); | |
wp_cache_flush(); | |
}elseif( class_exists( 'WP_Hummingbird' ) && WP_Hummingbird_Settings::get_setting( 'enabled', 'page_cache' ) ){ | |
WP_Hummingbird_Utils::get_module( 'page_cache' )->clear_cache(); | |
wp_cache_flush(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment