Filter hook 'post_type_archive_title'

in WP Core File wp-includes/general-template.php at line 1539

View Source

post_type_archive_title

Filter Hook
Description
Filters the post type archive title.

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 1539

Hook Parameters

Type Name Description
string $post_type_name Post type 'name' label.
string $post_type Post type.

Usage Examples

Basic Usage
<?php
// Hook into post_type_archive_title
add_filter('post_type_archive_title', 'my_custom_filter', 10, 2);

function my_custom_filter($post_type_name, $post_type) {
    // Your custom filtering logic here
    return $post_type_name;
}

Source Code Context

wp-includes/general-template.php:1539 - How this hook is used in WordPress core
<?php
1534  	 * @since 3.1.0
1535  	 *
1536  	 * @param string $post_type_name Post type 'name' label.
1537  	 * @param string $post_type      Post type.
1538  	 */
1539  	$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );
1540  
1541  	if ( $display ) {
1542  		echo $prefix . $title;
1543  	} else {
1544  		return $prefix . $title;

PHP Documentation

<?php
/**
	 * Filters the post type archive title.
	 *
	 * @since 3.1.0
	 *
	 * @param string $post_type_name Post type 'name' label.
	 * @param string $post_type      Post type.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.