Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.