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.

Built from https://develop.svn.wordpress.org/trunk@36094


git-svn-id: http://core.svn.wordpress.org/trunk@36059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-12-26 03:46:28 +00:00
parent 63cc66469b
commit d5d401ad10
2 changed files with 2 additions and 2 deletions

View File

@ -4300,7 +4300,7 @@ function get_page_uri( $page ) {
foreach ( $page->ancestors as $parent ) {
$parent = get_post( $parent );
if ( 'publish' === $parent->post_status ) {
if ( $parent ) {
$uri = $parent->post_name . '/' . $uri;
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36093';
$wp_version = '4.5-alpha-36094';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.