On this page
apply_filters( 'post_type_link', string $post_link, WP_Post $post, bool $leavename, bool $sample )
Filters the permalink for a post of a custom post type.
Parameters
$post_linkstring-
The post's permalink.
$postWP_Post-
The post in question.
$leavenamebool-
Whether to keep the post name.
$samplebool-
Is it a sample permalink.
More Information
post_type_link is a filter applied to the permalink URL for a post or custom post type prior to being returned by the function get_post_permalink() .
Source
File: wp-includes/link-template.php. View all references
return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );
Related
Used By
| Used By | Description |
|---|---|
| get_post_permalink() wp-includes/link-template.php | Retrieves the permalink for a post of a custom post type. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/post_type_link