Languages: English • 日本語 (Add your language)
Builds and returns a URI for a page from a page id.
If the page has parents, those are prepended to the URI to provide a full path. For example, a third level page might return a URI like this:
top-level-page/sub-page/current-page
<?php get_page_uri( $page_id ); ?>
<?php $page_id = 5; $uri = get_page_uri($page_id); echo '<a href="'. $uri .'">The Page</a>'; ?>
This function will return a "slug" style URI regardless of whether "pretty" Permalinks are configured.
Since: 1.5.0
get_page_uri() is located in wp-includes/post.php
.
Page Tags: get_all_page_ids(), get_ancestors(), get_page(), get_page_link(), get_page_by_path(), get_page_by_title(), get_page_children(), get_page_hierarchy(), get_page_uri(), get_pages(), is_page(), page_uri_index(), wp_list_pages(), wp_page_menu()