Use get_query_var() in wp_title() and single_month_title().

git-svn-id: http://svn.automattic.com/wordpress/trunk@5003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-09 04:06:23 +00:00
parent c295c0bffe
commit f774780aff

View File

@ -156,8 +156,7 @@ function get_bloginfo($show='') {
function wp_title($sep = '»', $display = true) {
global $wpdb;
global $m, $year, $monthnum, $day, $category_name, $wp_locale, $posts;
global $wpdb, $wp_locale, $wp_query;
$cat = get_query_var('cat');
$p = get_query_var('p');
@ -165,6 +164,10 @@ function wp_title($sep = '»', $display = true) {
$category_name = get_query_var('category_name');
$author = get_query_var('author');
$author_name = get_query_var('author_name');
$m = get_query_var('m');
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
$day = get_query_var('day');
$title = '';
// If there's a category
@ -204,14 +207,14 @@ function wp_title($sep = '»', $display = true) {
if ( !empty($year) ) {
$title = $year;
if ( !empty($monthnum) )
$title .= " $sep ".$wp_locale->get_month($monthnum);
$title .= " $sep " . $wp_locale->get_month($monthnum);
if ( !empty($day) )
$title .= " $sep ".zeroise($day, 2);
$title .= " $sep " . zeroise($day, 2);
}
// If there is a post
if ( is_single() || is_page() ) {
$title = strip_tags($posts[0]->post_title);
$title = strip_tags($wp_query->get_queried_object()->post_title);
$title = apply_filters('single_post_title', $title);
}
@ -264,7 +267,12 @@ function single_cat_title($prefix = '', $display = true ) {
function single_month_title($prefix = '', $display = true ) {
global $m, $monthnum, $wp_locale, $year;
global $wp_locale;
$m = get_query_var('m');
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
if ( !empty($monthnum) && !empty($year) ) {
$my_year = $year;
$my_month = $wp_locale->get_month($monthnum);