Changeset 1185 for trunk/wp-includes/template-functions-general.php
- Timestamp:
- 04/26/2004 11:54:52 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-general.php
r1157 r1185 93 93 function wp_title($sep = '»', $display = true) { 94 94 global $wpdb, $tableposts, $tablecategories; 95 global $year, $monthnum, $day, $cat, $p, $name, $month ;95 global $year, $monthnum, $day, $cat, $p, $name, $month, $posts, $single; 96 96 97 97 // If there's a category … … 123 123 124 124 // If there's a post 125 if (intval($p) || '' != $name) { 126 if (!$p) { 127 if ($year != '') { 128 $year = '' . intval($year); 129 $where .= ' AND YEAR(post_date)=' . $year; 130 } 131 132 if ($monthnum != '') { 133 $monthnum = '' . intval($monthnum); 134 $where .= ' AND MONTH(post_date)=' . $monthnum; 135 } 136 137 if ($day != '') { 138 $day = '' . intval($day); 139 $where .= ' AND DAYOFMONTH(post_date)=' . $day; 140 } 141 $p = $wpdb->get_var("SELECT ID FROM $tableposts WHERE post_name = '$name' $where"); 142 } 143 $post_data = get_postdata($p); 144 $title = strip_tags(stripslashes($post_data['Title'])); 125 if ($single) { 126 $title = strip_tags(stripslashes($posts[0]->post_title)); 145 127 $title = apply_filters('single_post_title', $title); 146 128 }
Note: See TracChangeset
for help on using the changeset viewer.