On this page
do_action( "{$old_status}_to_{$new_status}", WP_Post $post )
Fires when a post is transitioned from one status to another.
Description
The dynamic portions of the hook name, $new_status and $old_status, refer to the old and new post statuses, respectively.
Possible hook names include:
draft_to_publishpublish_to_trashpending_to_draft
Parameters
$postWP_Post-
Post object.
Source
File: wp-includes/post.php. View all references
do_action( "{$old_status}_to_{$new_status}", $post );
Related
Used By
| Used By | Description |
|---|---|
| wp_transition_post_status() wp-includes/post.php | Fires actions related to the transitioning of a post’s status. |
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/old_status_to_new_status