post_type_archive_title
Filters the post type archive title.
Usage
add_filter( 'post_type_archive_title', 'wp_kama_post_type_archive_title_filter', 10, 2 );
/**
* Function for `post_type_archive_title` filter-hook.
*
* @param string $post_type_name Post type 'name' label.
* @param string $post_type Post type.
*
* @return string
*/
function wp_kama_post_type_archive_title_filter( $post_type_name, $post_type ){
// filter...
return $post_type_name;
}
- $post_type_name(string)
- Post type 'name' label.
- $post_type(string)
- Post type.
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
post_type_archive_title
wp-includes/general-template.php 1545
$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );