Make WordPress Core

Changeset 37345


Ignore:
Timestamp:
05/02/2016 06:28:04 PM (8 years ago)
Author:
ericlewis
Message:

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.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r37342 r37345  
    44294429 *
    44304430 * @since 1.5.0
    4431  *
    4432  * @param WP_Post|object|int $page Page object or page ID.
     4431 * @since 4.6.0 The $page parameter is optional.
     4432 *
     4433 * @param WP_Post|object|int $page Optional. Page ID or WP_Post object. Default is global $post.
    44334434 * @return string|false Page URI, false on error.
    44344435 */
    4435 function get_page_uri( $page ) {
     4436function get_page_uri( $page = 0 ) {
    44364437    if ( ! $page instanceof WP_Post ) {
    44374438        $page = get_post( $page );
Note: See TracChangeset for help on using the changeset viewer.