From 48ceecafc78a4dd91a7ba6a636f5307084c44fc5 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 10 Oct 2015 05:45:27 +0000 Subject: [PATCH] Template: Pass the `$post` parameter to the `the_permalink` filter. Props chriscct7. Fixes #34234. See #23882. git-svn-id: https://develop.svn.wordpress.org/trunk@35002 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index bfa9a53f9f..542ba1c7a4 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -19,10 +19,12 @@ function the_permalink( $post = 0 ) { * Filter the display of the permalink for the current post. * * @since 1.5.0 + * @since 4.4.0 Added the `$post` parameter. * - * @param string $permalink The permalink for the current post. + * @param string $permalink The permalink for the current post. + * @param int|WP_Post $post Post ID, WP_Post object, or 0. Default 0. */ - echo esc_url( apply_filters( 'the_permalink', get_permalink( $post ) ) ); + echo esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) ); } /**