Improve function description for `wp_transition_post_status()`.

The documentation should make it clear that the function does not modify the
post object in the database, but only fires hooks related to the transition.

Props AramZS.
Fixes #33014.

git-svn-id: https://develop.svn.wordpress.org/trunk@33296 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2015-07-16 14:34:42 +00:00
parent 51e2bc173d
commit cddbfd2727
1 changed files with 5 additions and 2 deletions

View File

@ -4009,11 +4009,14 @@ function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $appe
}
/**
* Transition the post status of a post.
* 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.
* the save. This function fires a number of action hooks related to that transition:
* the generic 'transition_post_status' action, as well as the dynamic hooks
* `"{$old_status}_to_{$new_status}"` and `"{$new_status}_{$post->post_type}"`. 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