string $permalink, WP_Post $post, bool $leavename )
Filters the permalink for a post.
Only applies to posts with post_type of ‘post’.
(string) The post's permalink.
(WP_Post) The post in question.
(bool) Whether to keep the post name.
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.