diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 09d344dd1e8bc..68608d4ceb18a 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -1366,19 +1366,10 @@ function wp_title( $sep = '»', $display = true, $seplocation = '' ) { } // If there's a category or tag. - if ( is_category() || is_tag() ) { + if ( is_category() || is_tag() || is_tax() ) { $title = single_term_title( '', false ); } - // If there's a taxonomy. - if ( is_tax() ) { - $term = get_queried_object(); - if ( $term ) { - $tax = get_taxonomy( $term->taxonomy ); - $title = single_term_title( $tax->labels->name . $t_sep, false ); - } - } - // If there's an author. if ( is_author() && ! is_post_type_archive() ) { $author = get_queried_object(); @@ -1634,10 +1625,12 @@ function single_term_title( $prefix = '', $display = true ) { return; } + $result = apply_filters( 'single_term_title_result', $prefix . $term_name, $term_name, $prefix ); + if ( $display ) { - echo $prefix . $term_name; + echo $result; } else { - return $prefix . $term_name; + return $result; } }