post_type_link filter-hook . WP 3.0.0
Filters the permalink for a post of a custom post type.
Usage
add_filter( 'post_type_link', 'filter_function_name_1760', 10, 4 ); function filter_function_name_1760( $post_link, $post, $leavename, $sample ){ // filter... return $post_link; }
- $post_link(string)
- The post's permalink.
- $post(WP_Post)
- The post in question.
- $leavename(true/false)
- Whether to keep the post name.
- $sample(true/false)
- Is it a sample permalink.
Where the hook is called
post_type_link
wp-includes/link-template.php 298
return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );