WordPress.org

Make WordPress Core

Ticket #23154: 23154.diff

File 23154.diff, 621 bytes (added by viniciusmassuchetto, 16 months ago)
  • wp-includes/link-template.php

     
    304304 
    305305        if ( $wp_rewrite->using_permalinks() && ( $post->post_parent > 0 ) && ( $post->post_parent != $post->ID ) ) { 
    306306                $parent = get_post($post->post_parent); 
    307                 if ( 'page' == $parent->post_type ) 
     307                if ( $parent && 'page' == $parent->post_type ) 
    308308                        $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front 
    309309                else 
    310310                        $parentlink = get_permalink( $post->post_parent );