Purging entire cache on post create/edit/delete
-
Hello. According to the docs this is possible by using the
wpo_purge_cache_hooks
filter but I cannot get it to work. In my functions.php file:add_filter( 'wpo_purge_cache_hooks', function( $actions ) {
$actions[] = 'save_post';
$actions[] = 'wp_trash_post';
return $actions;
} );Also attempted this:
add_action( 'registered_taxonomy', 'tr_purge_entire_cache_after_save_delete' );
function tr_purge_entire_cache_after_save_delete() {
add_filter( 'wpo_purge_cache_hooks', function( $actions ) {
$actions[] = 'save_post';
$actions[] = 'wp_trash_post';
return $actions;
} );
}However it never seems to fire early enough. When I dump the
$purge_on_action
var in thesetup_hooks
function it never includes my new actions, indicating that the filter is not working. Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.