mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
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:
parent
b7a3d32f3d
commit
000f9e6140
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user