post_type_archive_link
Filters the post type archive permalink.
Usage
add_filter( 'post_type_archive_link', 'wp_kama_post_type_archive_link_filter', 10, 2 );
/**
* Function for `post_type_archive_link` filter-hook.
*
* @param string $link The post type archive permalink.
* @param string $post_type Post type name.
*
* @return string
*/
function wp_kama_post_type_archive_link_filter( $link, $post_type ){
// filter...
return $link;
}
- $link(string)
- The post type archive permalink.
- $post_type(string)
- Post type name.
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
post_type_archive_link
wp-includes/link-template.php 1348
return apply_filters( 'post_type_archive_link', $link, $post_type );
wp-includes/link-template.php 1321
return apply_filters( 'post_type_archive_link', $link, $post_type );