WordPress.org

Make WordPress Core

Ticket #7167: 7167.diff

File 7167.diff, 821 bytes (added by ionfish, 6 years ago)
  • wp-includes/general-template.php

     
    366366function wp_title($sep = '»', $display = true, $seplocation = '') { 
    367367        global $wpdb, $wp_locale, $wp_query; 
    368368 
     369        $search = get_query_var('s'); 
    369370        $cat = get_query_var('cat'); 
    370371        $tag = get_query_var('tag_id'); 
    371372        $category_name = get_query_var('category_name'); 
     
    379380 
    380381        $t_sep = '%WP_TITILE_SEP%'; // Temporary separator, for accurate flipping, if necessary 
    381382 
     383        // If there's a search 
     384        if ( !empty($search) ) { 
     385                $title = sprintf( __('Search results for %s'), get_search_query() ); 
     386        } 
     387         
    382388        // If there's a category 
    383389        if ( !empty($cat) ) { 
    384390                        // category exclusion