wp_transition_post_status ( $new_status, $old_status, $post )
- (string) new_status Transition to this post status.
- (string) old_status Previous post status.
- (WP_Post) post Post data.
- Introduced in WordPress: 2.3.0
- Deprecated in WordPress: —
Fires actions related to the transitioning of a post's status.When a post is saved, the post status is "transitioned" from one status to another,
though this does not always mean the status has actually changed before and after
the save. This function fires a number of action hooks related to that transition:
the generic Array action, as well as the dynamic hooks
Array and Array. Note
that the function does not transition the post object in the database.
For instance: When publishing a post for the first time, the post status may transition
from 'draft' – or some other status – to 'publish'. However, if a post is already
published and is simply being updated, the "old" and "new" statuses may both be 'publish'
before and after the transition.