From 7c940061fd28e3d82a0b705de7d3044ee3edf220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Thu, 28 Nov 2013 05:24:09 +0000 Subject: [PATCH] Pass the post type to the `post_type_archive_title` filter for better context. Adds lovely docs. props DrewAPicture. fixes #25605. Built from https://develop.svn.wordpress.org/trunk@26457 git-svn-id: http://core.svn.wordpress.org/trunk@26355 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 07bfc840b1..28613f1cd9 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -714,7 +714,15 @@ function post_type_archive_title( $prefix = '', $display = true ) { $post_type = reset( $post_type ); $post_type_obj = get_post_type_object( $post_type ); - $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name ); + /** + * Filter the post type archive title. + * + * @since 3.1.0 + * + * @param string $post_type_name Post type 'name' label. + * @param string $post_type Post type. + */ + $title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type ); if ( $display ) echo $prefix . $title;