WPMU Hook for archive or deactivate blog?

Question

I am trying to automatically clear the blog’s cache when it is Archived (or Deactivated is fine) in a Multisite install. This is useful for anyone using a caching program like WP Super Cache as an archived or deactivated the blog will still show until the cache is cleared.

I have tried:

add_action( 'archive_blog', 'wp_clear_cache_custom' );
add_action( 'unarchive_blog', 'wp_clear_cache_custom');

And:

add_action( 'archive_blog', 'wp_clear_cache_custom_archive', 10, 1 );
add_action( 'unarchive_blog', 'wp_clear_cache_custom_archive', 10, 1 );

With the function:

function wp_clear_cache_custom() {
        global $wpdb;
        wp_cache_clear_cache( $wpdb->blogid );
}

This same setup works fine for clearing the cache when a theme is changed, etc. but not for blog status changes.

Any help is much appreciated.

This page seemed to be close but no dice:
Perform action on WPMU blog deletion

0
, Neverending Woes 9 years 2014-01-03T15:15:08-05:00 0 Answers 75 views 0

Leave an answer

Browse
Browse