Handle page hierarchy when showing the sample permalink. props duck_, fixes #12327.

git-svn-id: https://develop.svn.wordpress.org/trunk@14399 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-03 20:10:26 +00:00
parent a7b2ec8515
commit 2fa9643cf2
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -2908,11 +2908,12 @@ function _page_traverse_name( $page_id, &$children, &$result ){
*
* @since 1.5.0
*
* @param int $page_id Page ID.
* @param mixed $page Page object or page ID.
* @return string Page URI.
*/
function get_page_uri($page_id) {
$page = get_page($page_id);
function get_page_uri($page) {
if ( ! is_object($page) )
$page = get_page($page);
$uri = $page->post_name;
// A page cannot be it's own parent.