Purge Site-Cache after Custom Content Type update/creation
-
Hello,
We use JetEngine from Crocoblock and WPO on our website.
JetEngine offers 2 different types of custom post types that can be created.
With both, WPO does not automatically purge the cache as soon as a post is changed, deleted or added.- JetEngine: Custom Post Types
To clear the cache here, the following function is working (added with code snippets). - JetEngine: Custom Content Types
unfortunately the function above does not work for them.
JetEngine offers the following hooks with which you can probably trigger a Cache Purge:
https://gist.github.com/Crocoblock/a9be7dbb1cb05aa2741aec97757c7f72#hooks
I would like to use this one, which says, do “something” after item updated
add_action(
‘jet-engine/custom-content-types/updated-item/’ . $cct_slug,
function( $item, $prev_item, $item_handler ) {
//do something
},
0,
3
);the “do something” should be a complete Cache Purge.
How do I get this to work?
I found the following code on the WPO FAQ page:// Add a new action that will trigger a cache purge
add_filter( ‘wpo_purge_cache_hooks’, function( $actions ) {
$actions[] = ‘my_custom_action’;
return $actions;
} );But I can’t get the two to work in combination.
Can anyone help? I’m certainly not the first one with this problemThanks
- JetEngine: Custom Post Types
- You must be logged in to reply to this topic.