WordPress.org

Make WordPress Core

Changeset 5010


Ignore:
Timestamp:
03/09/2007 08:58:05 PM (11 years ago)
Author:
ryan
Message:

Use get_query_var()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/template-functions-general.php

    r4656 r5010  
    138138
    139139function wp_title($sep = '»', $display = true) {
    140     global $wpdb;
    141     global $m, $year, $monthnum, $day, $category_name, $month, $posts;
     140    global $wpdb, $month;
    142141
    143142    $cat = get_query_var('cat');
     
    147146    $author = get_query_var('author');
    148147    $author_name = get_query_var('author_name');
     148    $m = get_query_var('m');
     149    $year = get_query_var('year');
     150    $monthnum = get_query_var('monthnum');
     151    $day = get_query_var('day');
     152    $title = '';
    149153
    150154    // If there's a category
     
    152156            // category exclusion
    153157            if ( !stristr($cat,'-') )
    154                 $title = get_the_category_by_ID($cat);
    155     }
    156     if ( !empty($category_name) ) {
     158                $title = apply_filters('single_cat_title', get_the_category_by_ID($cat));
     159    } elseif ( !empty($category_name) ) {
    157160        if ( stristr($category_name,'/') ) {
    158161                $category_name = explode('/',$category_name);
     
    163166        }
    164167        $title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
     168        $title = apply_filters('single_cat_title', $title);
    165169    }
    166170
     
    245249
    246250function single_month_title($prefix = '', $display = true ) {
    247     global $m, $monthnum, $month, $year;
     251    global $month;
     252
     253    $m = get_query_var('m');
     254    $year = get_query_var('year');
     255    $monthnum = get_query_var('monthnum');
     256
    248257    if ( !empty($monthnum) && !empty($year) ) {
    249258        $my_year = $year;
Note: See TracChangeset for help on using the changeset viewer.