WordPress.org

Make WordPress Core

Ticket #26667: 26667b.diff

File 26667b.diff, 1.1 KB (added by clifgriffin, 6 years ago)

26667b.diff

  • wp-includes/general-template.php

    diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
    index 7a83579..da23abb 100644
    a b function wp_title($sep = '»', $display = true, $seplocation = '') { 
    587587                        $title = post_type_archive_title( '', false );
    588588        }
    589589
    590         // If there's a category or tag
    591         if ( is_category() || is_tag() ) {
    592                 $title = single_term_title( '', false );
    593         }
    594 
    595590        // If there's a taxonomy
    596591        if ( is_tax() ) {
    597                 $term = get_queried_object();
    598                 if ( $term ) {
    599                         $tax = get_taxonomy( $term->taxonomy );
    600                         $title = single_term_title( $tax->labels->name . $t_sep, false );
    601                 }
     592                $title = single_term_title( '', false );
    602593        }
    603594
    604595        // If there's an author
    function single_term_title( $prefix = '', $display = true ) { 
    807798        if ( empty( $term_name ) )
    808799                return;
    809800
     801        $result = apply_filters( 'single_term_title_result', $prefix . $term_name, $term_name, $prefix );
     802
    810803        if ( $display )
    811                 echo $prefix . $term_name;
     804                echo $result;
    812805        else
    813                 return $prefix . $term_name;
     806                return $result;
    814807}
    815808
    816809/**