Put search string into <title> of search results page. Fixes #9103 props DD32.

git-svn-id: http://svn.automattic.com/wordpress/trunk@10660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-02-27 17:46:13 +00:00
parent 8da10297ba
commit 420b597cfe
1 changed files with 6 additions and 0 deletions

View File

@ -385,6 +385,7 @@ function wp_title($sep = '&raquo;', $display = true, $seplocation = '') {
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
$day = get_query_var('day');
$search = get_query_var('s');
$title = '';
$t_sep = '%WP_TITILE_SEP%'; // Temporary separator, for accurate flipping, if necessary
@ -456,6 +457,11 @@ function wp_title($sep = '&raquo;', $display = true, $seplocation = '') {
$term = $term->name;
$title = "$tax$t_sep$term";
}
//If it's a search
if ( is_search() ) {
$title = sprintf(__('Search Results %s %s'), $t_sep, strip_tags($search));
}
if ( is_404() ) {
$title = __('Page not found');