pre_post_link WordPress Filter Hook
The pre_post_link hook is called before a post is saved to the database. It allows you to modify the post data before it is saved. This hook is useful for validation or making sure certain data is included with the post.
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
- $permalink
(string)The site's permalink structure.
- $post
(WP_Post)The post in question.
- $leavename
(bool)Whether to keep the post name.
Source
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |