WordPress.org

Make WordPress Core

Ticket #22167: 22167.patch

File 22167.patch, 518 bytes (added by ericmann, 3 years ago)

Replaces wp_insert_post() with wp_update_post() and fixes the issue

  • wp-includes/post.php

     
    28652865 * Publish a post by transitioning the post status. 
    28662866 * 
    28672867 * @since 2.1.0 
    2868  * @uses wp_insert_post() 
     2868 * @uses wp_update_post() 
    28692869 * 
    28702870 * @param mixed $post Post ID or object. 
    28712871 */ 
     
    28762876                return; 
    28772877 
    28782878        $post->post_status = 'publish'; 
    2879         wp_insert_post( $post ); 
     2879        wp_update_post( $post ); 
    28802880} 
    28812881 
    28822882/**