From fd56fd356340a5b842c974ccba3ce69b737cbacc Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 11 Oct 2012 17:36:59 +0000 Subject: [PATCH] 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: http://core.svn.wordpress.org/trunk@22189 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 37e1057e98..bcec81b7f0 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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 ); } /**