Filters the permalink for a post.
Only applies to posts with post_type of ‘post’.
$permalinkstring
$postWP_Post
$leavenamebool
post_link is a filter applied to the permalink URL for a post prior to returning the processed url by the function get_permalink() .
This filter only applies to posts with post_type of ‘post’. For that filter which applies to custom post type look post_type_link.
return apply_filters( 'post_link', $permalink, $post, $leavename );
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/post_link