WordPress.org

Make WordPress Core

Ticket #22944: 22944.patch

File 22944.patch, 827 bytes (added by SergeyBiryukov, 5 years ago)
  • wp-includes/post.php

     
    30153015 * @param mixed $post Post ID or object. 
    30163016 */ 
    30173017function wp_publish_post( $post ) { 
     3018        global $wpdb; 
     3019 
    30183020        if ( ! $post = get_post( $post ) ) 
    30193021                return; 
     3022 
    30203023        if ( 'publish' == $post->post_status ) 
    30213024                return; 
    30223025 
     3026        $wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) ); 
     3027 
     3028        $old_status = $post->post_status; 
    30233029        $post->post_status = 'publish'; 
    3024         wp_update_post( $post ); 
     3030        wp_transition_post_status( 'publish', $old_status, $post ); 
     3031 
     3032        do_action( 'edit_post', $post->ID, $post ); 
     3033        do_action( 'save_post', $post->ID, $post ); 
     3034        do_action( 'wp_insert_post', $post->ID, $post ); 
    30253035} 
    30263036 
    30273037/**