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: http://core.svn.wordpress.org/trunk@23208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-12-27 15:26:05 +00:00
parent f9d07a1928
commit 8d52e9fc68

View File

@ -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 ) {