Make WordPress Core

Changeset 814


Ignore:
Timestamp:
01/31/2004 12:03:51 AM (22 years ago)
Author:
mikelittle
Message:

Fixed category name bug. "When excluding a category by using '$cat = "-4";' in index.php, the name of the excluded cat is added to the page title."

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r808 r814  
    152152    $cat = addslashes_gpc($cat);
    153153    if (stristr($cat,'-')) {
     154        // Note: if we have a negative, we ignore all the positives. It must
     155        // always mean 'everything /except/ this one'. We should be able to do
     156        // multiple negatives but we don't :-(
    154157        $eq = '!=';
    155158        $andor = 'AND';
     
    169172    }
    170173    $whichcat .= ')';
     174    if ($eq == '!=') {
     175        $cat = '-'.$cat; //put back the knowledge that we are excluding a category.
     176    }
    171177}
    172178
     
    375381            header('Location: ' . get_permalink($posts[0]->ID));
    376382        }
    377 }
    378 }
     383    }
     384} // end if posts.
    379385?>
  • trunk/wp-includes/template-functions-general.php

    r801 r814  
    6666    // If there's a category
    6767    if(!empty($cat)) {
    68         $title = stripslashes(get_the_category_by_ID($cat));
     68        if (!stristr($cat,'-')) { // category excluded
     69            $title = stripslashes(get_the_category_by_ID($cat));
     70        }
    6971    }
    7072    if (!empty($category_name)) {
Note: See TracChangeset for help on using the changeset viewer.