save_post_{$type} hook flakiness?
-
I have a hook save_post_recipe that works well most of the time.
Among other things, the hook automatically updates post categories based on some post_meta fields of the post.
If I click on “update” manually, it works fine.
But, after a week or two, something is modifying the post without running my save_post hook, and it changes the post_categories.
My current solution a huge for loop that I run every once in a while that goes through the whole database, and calls wp_update_post on every post, which takes a while (thousands of posts) and is annoying, because visitors see that the recipes are categorized incorrectly, and are wondering why our data doesn’t work.
I am now outputting to a file whenever my code is called, and I’ve just proven that my hooked code isn’t even running, but the data is changing somehow.
How can a post be saved without have the save_post_XXX hook be called?
- The topic ‘save_post_{$type} hook flakiness?’ is closed to new replies.