Make WordPress Core

Ticket #22671: 22671.diff

File 22671.diff, 683 bytes (added by wonderboymusic, 12 years ago)
  • src/wp-includes/post.php

     
    838838                // Inherit status from the parent
    839839                if ( $post->post_parent && ( $post->ID != $post->post_parent ) ) {
    840840                        $parent_post_status = get_post_status( $post->post_parent );
    841                         if ( 'trash' == $parent_post_status ) {
     841                        if ( 'trash' === $parent_post_status ) {
    842842                                return get_post_meta( $post->post_parent, '_wp_trash_meta_status', true );
     843                        } elseif ( 'auto-draft' === $parent_post_status ) {
     844                                return 'publish';
    843845                        } else {
    844846                                return $parent_post_status;
    845847                        }