Always call get_post() in get_page_uri() to ensure we have a WP_Post object, which lazy-loads the ancestors this function requires.
props dd32 fixes #22883 Unit tests: [1175/tests] git-svn-id: https://develop.svn.wordpress.org/trunk@23208 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
975dbe9b12
commit
d7640fc5d2
@ -3594,8 +3594,8 @@ function _page_traverse_name( $page_id, &$children, &$result ){
|
||||
* @return string Page URI.
|
||||
*/
|
||||
function get_page_uri($page) {
|
||||
if ( ! is_object($page) )
|
||||
$page = get_post( $page );
|
||||
$page = get_post( $page );
|
||||
|
||||
$uri = $page->post_name;
|
||||
|
||||
foreach ( $page->ancestors as $parent ) {
|
||||
|
Loading…
Reference in New Issue
Block a user