Changeset 5003 for trunk/wp-includes/general-template.php
- Timestamp:
- 03/09/2007 04:06:23 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r4990 r5003 157 157 158 158 function wp_title($sep = '»', $display = true) { 159 global $wpdb; 160 global $m, $year, $monthnum, $day, $category_name, $wp_locale, $posts; 159 global $wpdb, $wp_locale, $wp_query; 161 160 162 161 $cat = get_query_var('cat'); … … 166 165 $author = get_query_var('author'); 167 166 $author_name = get_query_var('author_name'); 167 $m = get_query_var('m'); 168 $year = get_query_var('year'); 169 $monthnum = get_query_var('monthnum'); 170 $day = get_query_var('day'); 168 171 $title = ''; 169 172 … … 205 208 $title = $year; 206 209 if ( !empty($monthnum) ) 207 $title .= " $sep " .$wp_locale->get_month($monthnum);210 $title .= " $sep " . $wp_locale->get_month($monthnum); 208 211 if ( !empty($day) ) 209 $title .= " $sep " .zeroise($day, 2);212 $title .= " $sep " . zeroise($day, 2); 210 213 } 211 214 212 215 // If there is a post 213 216 if ( is_single() || is_page() ) { 214 $title = strip_tags($ posts[0]->post_title);217 $title = strip_tags($wp_query->get_queried_object()->post_title); 215 218 $title = apply_filters('single_post_title', $title); 216 219 } … … 265 268 266 269 function single_month_title($prefix = '', $display = true ) { 267 global $m, $monthnum, $wp_locale, $year; 270 global $wp_locale; 271 272 $m = get_query_var('m'); 273 $year = get_query_var('year'); 274 $monthnum = get_query_var('monthnum'); 275 268 276 if ( !empty($monthnum) && !empty($year) ) { 269 277 $my_year = $year;
Note: See TracChangeset
for help on using the changeset viewer.