Make WordPress Core

Changeset 1492


Ignore:
Timestamp:
07/28/2004 03:30:15 AM (20 years ago)
Author:
rboren
Message:

Fix wp_title() display of category_name.

File:
1 edited

Legend:

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

    r1491 r1492  
    9999function wp_title($sep = '»', $display = true) {
    100100    global $wpdb;
    101     global $m, $year, $monthnum, $day, $cat, $p, $name, $month, $posts;
     101    global $m, $year, $monthnum, $day, $cat, $category_name, $p, $name, $month, $posts;
    102102
    103103    // If there's a category
     
    108108    }
    109109    if (!empty($category_name)) {
     110        if (stristr($category_name,'/')) {
     111            $category_name = explode('/',$category_name);
     112            if ($category_name[count($category_name)-1]) {
     113                $category_name = $category_name[count($category_name)-1]; // no trailing slash
     114            } else {
     115                $category_name = $category_name[count($category_name)-2]; // there was a trailling slash
     116            }
     117        }
    110118        $title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
    111119    }
Note: See TracChangeset for help on using the changeset viewer.