get_page_uri [ WordPress Function ]
get_page_uri ( $page )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Builds URI for a page.
Sub pages will be in the "directory" under the parent page post name.
Source
<?php
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.
if ( $page->post_parent == $page->ID )
return $uri;
while ($page->post_parent != 0) {
$page = get_page($page->post_parent);
$uri = $page->post_name . "/" . $uri;
}
return $uri;
}
?>
Examples [ wp-snippets.com ]
Top Google Search Results
- Function Reference/get page uri « WordPress Codex
Description. Builds URI for a page. Sub pages will be in the "directory" under the parent page post name. Usage. <?php get_page_uri( $page_id ) ?> ...
codex.wordpress.org - #3390 (Better get_page_uri) – WordPress Trac
I posted this ticket for trunk, but I figured I'd duplicate it here as well. This patch replaces get_page_uri with a version that only executes 1 general query instead ...
core.trac.wordpress.org - get_page_uri (WordPress Function) - WPSeek.com
WordPress lookup for get_page_uri, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - get_page_uri | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_page_uri($page) { if ( ! is_object($page) ) $page = get_page($page) ; $uri = $page->post_name; // A page cannot be it's own ...
hitchhackerguide.com