WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/26/2015 03:45:28 AM (3 years ago)
Author:
dd32
Message:

Pages: get_page_uri() should return the URI at which the resource being accessed is available at, this may include non-'publish' status posts.

Reverts [34001] and fixes the original issue in #15963 - avoiding a PHP Notice for when the post doesn't exist.

Props tharsheblows.
See #15963.
Fixes #35084.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r36091 r36094  
    43014301    foreach ( $page->ancestors as $parent ) {
    43024302        $parent = get_post( $parent );
    4303         if ( 'publish' === $parent->post_status ) {
     4303        if ( $parent ) {
    43044304            $uri = $parent->post_name . '/' . $uri;
    43054305        }
Note: See TracChangeset for help on using the changeset viewer.