You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often use custom post types and output them to a page. Would be great to be able to purge that page when a custom post is updated / added, i.e.: identical to the way the index page is purged when a new default post is created / updated.
The text was updated successfully, but these errors were encountered:
Using the save_post_{$post_type} hook, which is fired whenever that custom post type is created or updated (see docs), you can add something like the following to your theme's functions.php file, or to a MU-Plugin, to clear the cache for a given page whenever a post with that custom post type is saved:
You'll want to change 5 to the ID of the Page/Post whose cache you'd like to clear when that custom post type is saved, and you'll want to change my-custom-post-type to the actual name of your Custom Post Type.
I often use custom post types and output them to a page. Would be great to be able to purge that page when a custom post is updated / added, i.e.: identical to the way the index page is purged when a new default post is created / updated.
The text was updated successfully, but these errors were encountered: