In `get_page_uri()`, do not add parent slugs to orphaned pages.
Adds unit test. Props filosofo, MikeHansenMe, MikeHansenMe, chriscct7. Fixes #15963. Built from https://develop.svn.wordpress.org/trunk@34001 git-svn-id: http://core.svn.wordpress.org/trunk@33970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
49b8ccec79
commit
47409875ab
|
@ -4196,7 +4196,10 @@ function get_page_uri( $page ) {
|
|||
$uri = $page->post_name;
|
||||
|
||||
foreach ( $page->ancestors as $parent ) {
|
||||
$uri = get_post( $parent )->post_name . '/' . $uri;
|
||||
$parent = get_post( $parent );
|
||||
if ( 'publish' === $parent->post_status ) {
|
||||
$uri = $parent->post_name . '/' . $uri;
|
||||
}
|
||||
}
|
||||
|
||||
return $uri;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34000';
|
||||
$wp_version = '4.4-alpha-34001';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue