For plugin development if I intend to update a post outside of the query and after so many days based on a category what is the appropriate hook to use?
Through research from the query "wp modify post hook" I get first result of Plugin API/Action Reference with a list of actions run during a request but I'm stuck on which to use:
pre_get_posts
: This hook is called after the query variable object is created, but before the actual query is run I only intend to update the categories and the loop will never be called so is this the best approach?- edit_post : Fires once an existing post has been updated. Not much listed but I'm looking for the posts that fit the above parameters and this states after it's been updated.
Through SE sites I see:
- How can I edit post data before it is saved? but that seems to mention before the initial post creation I'm looking to modify after a given time.
- Wordpress hook before inserting post into database is before the post initial creation.
- Wordpress post save/edit post hook shows after the post has been saved.
So which hook should I use to manipulate a post outside of the query based on if a post has a category?