Use wp_update_post() rather than wp_insert_post() in wp_publish_post() to avoid stomping of values like categories. props ericmann, fixes #22167. see #21963.

git-svn-id: https://develop.svn.wordpress.org/trunk@22189 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-10-11 17:36:59 +00:00
parent b7a3d32f3d
commit 000f9e6140
1 changed files with 2 additions and 2 deletions

View File

@ -2865,7 +2865,7 @@ function wp_update_post( $postarr = array(), $wp_error = false ) {
* Publish a post by transitioning the post status.
*
* @since 2.1.0
* @uses wp_insert_post()
* @uses wp_update_post()
*
* @param mixed $post Post ID or object.
*/
@ -2876,7 +2876,7 @@ function wp_publish_post( $post ) {
return;
$post->post_status = 'publish';
wp_insert_post( $post );
wp_update_post( $post );
}
/**