WordPress.org

Make WordPress Core

Ticket #15963: avoid-notice-on-orphaned-pages.15963.diff

File avoid-notice-on-orphaned-pages.15963.diff, 748 bytes (added by filosofo, 4 years ago)
  • wp-includes/post.php

     
    32573257                $page = get_page($page); 
    32583258        $uri = $page->post_name; 
    32593259 
    3260         // A page cannot be it's own parent. 
     3260        // A page cannot be its own parent. 
    32613261        if ( $page->post_parent == $page->ID ) 
    32623262                return $uri; 
    32633263 
    3264         while ($page->post_parent != 0) { 
    3265                 $page = get_page($page->post_parent); 
     3264        while ( 
     3265                $page->post_parent != 0 && 
     3266                ( $page = get_page( $page->post_parent ) ) 
     3267        ) { 
    32663268                $uri = $page->post_name . "/" . $uri; 
    32673269        } 
    32683270 
     
    52295231} 
    52305232add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); 
    52315233 
    5232 ?> 
    5233  No newline at end of file 
     5234?>