mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
Use get_query_var()
git-svn-id: https://develop.svn.wordpress.org/branches/2.0@5010 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7c8f7724fa
commit
b58d19a416
@ -137,8 +137,7 @@ function get_bloginfo($show='') {
|
||||
|
||||
|
||||
function wp_title($sep = '»', $display = true) {
|
||||
global $wpdb;
|
||||
global $m, $year, $monthnum, $day, $category_name, $month, $posts;
|
||||
global $wpdb, $month;
|
||||
|
||||
$cat = get_query_var('cat');
|
||||
$p = get_query_var('p');
|
||||
@ -146,14 +145,18 @@ 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
|
||||
if ( !empty($cat) ) {
|
||||
// category exclusion
|
||||
if ( !stristr($cat,'-') )
|
||||
$title = get_the_category_by_ID($cat);
|
||||
}
|
||||
if ( !empty($category_name) ) {
|
||||
$title = apply_filters('single_cat_title', get_the_category_by_ID($cat));
|
||||
} elseif ( !empty($category_name) ) {
|
||||
if ( stristr($category_name,'/') ) {
|
||||
$category_name = explode('/',$category_name);
|
||||
if ( $category_name[count($category_name)-1] )
|
||||
@ -162,6 +165,7 @@ function wp_title($sep = '»', $display = true) {
|
||||
$category_name = $category_name[count($category_name)-2]; // there was a trailling slash
|
||||
}
|
||||
$title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
|
||||
$title = apply_filters('single_cat_title', $title);
|
||||
}
|
||||
|
||||
// If there's an author
|
||||
@ -244,7 +248,12 @@ function single_cat_title($prefix = '', $display = true ) {
|
||||
|
||||
|
||||
function single_month_title($prefix = '', $display = true ) {
|
||||
global $m, $monthnum, $month, $year;
|
||||
global $month;
|
||||
|
||||
$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 = $month[str_pad($monthnum, 2, '0', STR_PAD_LEFT)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user