Filters the permalink for a post of a custom post type.
Parameters
$post_link
string- The post’s permalink.
$post
WP_Post- The post in question.
$leavename
bool- Whether to keep the post name.
$sample
bool- Is it a sample permalink.
Source
return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
External Link for custom post type using meta field and post format ( Link ).
Example migrated from Codex:
Append the query string for the custom post type ‘my_custom_post_type’ permalink URLs ( uses add_query_arg() and get_post_type() ):