Skip to content

Instantly share code, notes, and snippets.

@wpmudev-sls
Last active August 30, 2019 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/74bf73eb0f0577899ac6aa8500fdc8c6 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/74bf73eb0f0577899ac6aa8500fdc8c6 to your computer and use it in GitHub Desktop.
Clear Cache After Import Property for Plugin WP-Property Importer
<?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