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
This commit is contained in:
parent
ed4b0aee3f
commit
48ceecafc7
@ -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 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user