WordPress.org

Make WordPress Core

Ticket #23154: 23154.2.diff

File 23154.2.diff, 1.4 KB (added by SergeyBiryukov, 12 months ago)
  • wp-admin/includes/class-wp-media-list-table.php

     
    302302                break; 
    303303 
    304304        case 'parent': 
    305                 if ( $post->post_parent > 0 ) { 
    306                         if ( get_post( $post->post_parent ) ) { 
    307                                 $title =_draft_or_post_title( $post->post_parent ); 
    308                         } 
     305                if ( $post->post_parent > 0 && get_post( $post->post_parent ) ) { 
     306                        $title = _draft_or_post_title( $post->post_parent ); 
    309307?> 
    310308                        <td <?php echo $attributes ?>><strong> 
    311309                                <?php if( current_user_can( 'edit_post', $post->post_parent ) ) { ?> 
  • wp-includes/link-template.php

     
    301301        $link = false; 
    302302 
    303303        $post = get_post( $post ); 
     304        $parent = ( $post->post_parent > 0 && $post->post_parent != $post->ID ) ? get_post( $post->post_parent ) : false; 
    304305 
    305         if ( $wp_rewrite->using_permalinks() && ( $post->post_parent > 0 ) && ( $post->post_parent != $post->ID ) ) { 
    306                 $parent = get_post($post->post_parent); 
     306        if ( $wp_rewrite->using_permalinks() && $parent ) { 
    307307                if ( 'page' == $parent->post_type ) 
    308308                        $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front 
    309309                else