On this page
apply_filters( 'pre_post_link', string $permalink, WP_Post $post, bool $leavename )
Filters the permalink structure for a post before token replacement occurs.
Description
Only applies to posts with post_type of ‘post’.
Parameters
$permalinkstring-
The site's permalink structure.
$postWP_Post-
The post in question.
$leavenamebool-
Whether to keep the post name.
Source
File: wp-includes/link-template.php. View all references
$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
Related
Used By
| Used By | Description |
|---|---|
| get_permalink() wp-includes/link-template.php | Retrieves the full permalink for the current post or post ID. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_post_link