From 3012b862af69c836ce93defbe7174d444eeb8dec Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 9 Oct 2015 04:34:24 +0000 Subject: [PATCH] Add `$id` parameter to `the_permalink()`, for consistency with `get_permalink()`. Props johnjamesjacoby, chriscct7. Fixes #23882. Built from https://develop.svn.wordpress.org/trunk@34982 git-svn-id: http://core.svn.wordpress.org/trunk@34947 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 9 ++++++--- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 8573e5322b..ebb1ca67fe 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -10,8 +10,11 @@ * Display the permalink for the current post. * * @since 1.2.0 + * @since 4.4.0 Added `$id` parameter. + * + * @param int|WP_Post $id Optional. Post ID or post object. Default current post. */ -function the_permalink() { +function the_permalink( $id = 0 ) { /** * Filter the display of the permalink for the current post. * @@ -19,7 +22,7 @@ function the_permalink() { * * @param string $permalink The permalink for the current post. */ - echo esc_url( apply_filters( 'the_permalink', get_permalink() ) ); + echo esc_url( apply_filters( 'the_permalink', get_permalink( $id ) ) ); } /** @@ -91,7 +94,7 @@ function permalink_anchor( $mode = 'id' ) { * * @see get_permalink() * - * @param int|WP_Post $id Optional. Post ID or post object. Default is the current post. + * @param int|WP_Post $id Optional. Post ID or post object. Default current post. * @param bool $leavename Optional. Whether to keep post name or page name. Default false. * @return string|false The permalink URL or false if post does not exist. */ diff --git a/wp-includes/version.php b/wp-includes/version.php index deab0a8e6c..219aeff05a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34981'; +$wp_version = '4.4-alpha-34982'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.