From aba14233d9f2de247cf1246fa83f56a57b611499 Mon Sep 17 00:00:00 2001 From: Eric Lewis Date: Mon, 2 May 2016 18:29:29 +0000 Subject: [PATCH] Posts: Allow `get_page_uri()` to be called without a $page argument. `get_page_uri()` can now be called without an argument, which will return the page URI for the current post in the loop. Props pollett. Fixes #26284. Built from https://develop.svn.wordpress.org/trunk@37345 git-svn-id: http://core.svn.wordpress.org/trunk@37311 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 520d89bf01..00d1e0c098 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4428,11 +4428,12 @@ function _page_traverse_name( $page_id, &$children, &$result ){ * Sub pages will be in the "directory" under the parent page post name. * * @since 1.5.0 + * @since 4.6.0 The $page parameter is optional. * - * @param WP_Post|object|int $page Page object or page ID. + * @param WP_Post|object|int $page Optional. Page ID or WP_Post object. Default is global $post. * @return string|false Page URI, false on error. */ -function get_page_uri( $page ) { +function get_page_uri( $page = 0 ) { if ( ! $page instanceof WP_Post ) { $page = get_post( $page ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index fe45e850b2..67f07dfd14 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37344'; +$wp_version = '4.6-alpha-37345'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.