Use the set_object_terms
hook,
http://adambrown.info/p/wp_hooks/hook/set_object_terms?version=3.4&file=wp-includes/taxonomy.php
It should be fired when a post or page is modified.
Here is the code that fires it:
do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids);
You can thus check against the $object_id and taxonomy, and flush your transient cache and regenerate as needed.
Specifically, clear the term caches of the term IDs in $tt_ids
and $old_tt_ids
Related Posts:
- Reset all transients on post or page save
- Check for update vs new post on save_post action
- How to avoid infinite loop in save_post callback
- $update is always true in save_post
- Action hook ‘save_post’ triggered when deleting posts
- get post meta before it is updated (during SAVE_POST)
- save_post action firing before I publish / save the post
- save_post action only when creating a new post
- Check if value has changed on save_post
- Minimum Word Count Before A Post Can Be Made Pending Review
- update_post_meta() not working in save_post
- How do I save each option in a multiple select menu as it’s own meta_key + meta_value pair?
- Update post on save
- Post meta checkbox becomes unchecked occasionally
- Return code from save_post action?
- update_post_meta not working in save_post
- save_post only saves meta data on second save
- Get Post ID with insert/edit link
- How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
- Why save_post_$(custom_post_type) is fired even if I am not already saving a post?
- Set the value of custom field when post is published or updated
- pass error to admin_notices on “quick edit”/save_post action
- save_post requiere at least one uploaded file to be published
- Get $_POST & $_REQUEST values before adding/updating post
- How can I create a new user account while creating a new post, and then set that new user as the author of that new post?
- Validate post checking if child term is assigned
- Clear cache on post of one type when something happens to post of other type
- Why not fire the save_post event?
- WordPress 4.9.8 doesn’t save if content has style=”
- Using PODS data with save_post
- Cant’t delete my custom posts
- where does this $post_id come from?
- Update current WP post every 3 minutes [closed]
- Changing new post to “pending” on publish – but “Publish failed” – why?
- update_post_meta not working in foreach
- Save post in another table
- Strange bug on post/page save
- draft_to_pending action doesn’t seem to fire
- What action to use for when a post is saved / published, with a caveat
- Custom wp_editor doesn’t update post_content
- Save custom value to main content of post
- Check for page template on save_post hook
- Access NEW/UPDATED post values in save_post() callback function
- save button grayed out randomly
- Post editor doesn’t save embed media [closed]
- How to get a post meta value and pass that to update_option when a post is created or updated?
- WordPress save meta data : Displaying the word Array when selected
- Save current post using custom save button
- Connection Reset on post/page save
- Meta data not saved on save_post
- Insert/Update DB table when making new post or update older one
- Prevent Page/Post From Being Created based on Pages/Posts per User per Time Unit
- How to debug | Some times the “Save Draft” button seems to spin but does not actually save
- My custom title gets duplicated at every save or post update
- Use save_post to generate file on wordpress
- Detect, if post is saved manually or programmatically in save_post-hook
- Check if new post or update before save_post action
- Why would I get a “Trying to access array offset on value of type bool” warning when using “metadata_exists()” in save_post?
- Are transients garbage collected?
- Why does save_post action fire when creating a new post?
- what is correct way to hook when update post
- Add validation and error handling when saving custom fields?
- Using save_post to replace the post’s title
- How does object caching work?
- Passing error/warning messages from a meta box to “admin_notices”
- Prevent post from being published if custom fields not filled
- Should I use Transient API to store HTML String, or Object?
- Will it break my site if I delete all transient records in wp_options table?
- When should I be using the Transients API?
- Metabox with checkbox is not updating
- Is get_option() faster than accessing get_transient()?
- Cache remote (HTTP) request with Transients API
- Is there any danger in deleting all transients?
- Force post slug to be auto generated from title on save
- Set custom messages for post update/save
- Return $post_id when DOING_AUTOSAVE?
- Best practices for using the transients API
- Are transients private or public?
- Why are transients cleared prematurely?
- Execute action after post is saved with all related post_meta records (data)
- update_post_meta and update_field ony working when saving the post
- Using transients in conjunction with memcached
- Get a list of existing transients
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- trigger save_post event programmatically
- Unable to prevent function using save_post firing twice
- wp-cron.php – How are WP’s Cron transients removed?
- Why won’t my metabox data save?
- Do WordPress’ cron’s clean up expired transients?
- Storing posts social counters by using transient api
- Using a wildcard with delete_transient()
- Does set_transient() overwrite/update transient option with same key?
- What’s the case against transient-ing almost everything that’s mostly static?
- How to force function to run as the last one when saving the post?
- Custom post type save_post action not firing
- Does using set_transient() function can lead to MySQL problems?
- Retrieve 1st image in post and set it as featured image, when post is saved/updated
- Disable the post save process completely
- Fallback when Transient API fails
- Submitting posts from the front end – sanitizing data