Used By
Used By | Description |
---|---|
wp-includes/post.php: wp_transition_post_status() | Fires actions related to the transitioning of a post’s status. |
Fires when a post is transitioned from one status to another.
The dynamic portions of the hook name, $new_status
and $post->post_type
, refer to the new post status and post type, respectively.
Please note: When this action is hooked using a particular post status (like ‘publish’, as publish_{$post->post_type}
), it will fire both when a post is first transitioned to that status from something else, as well as upon subsequent post updates (old and new status are both the same).
Therefore, if you are looking to only fire a callback when a post is first transitioned to a status, use the ‘transition_post_status’ hook instead.
(int) Post ID.
(WP_Post) Post object.
File: wp-includes/post.php
Version | Description |
---|---|
2.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/new_status_post-post_type