Make WordPress Core


Ignore:
Timestamp:
10/28/2005 01:14:57 AM (21 years ago)
Author:
ryan
Message:

Use full hierarchy when resolving category URIs. fixes #1787 Props: ringmaster Owen

File:
1 edited

Legend:

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

    r2958 r2968  
    13201320    global $cache_categories, $wpdb;
    13211321    if ( $dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories") ):
    1322     foreach ($dogs as $catt)
    1323         $cache_categories[$catt->cat_ID] = $catt;
     1322        foreach ($dogs as $catt)
     1323            $cache_categories[$catt->cat_ID] = $catt;
     1324
     1325        foreach ($cache_categories as $catt) {
     1326            $curcat = $catt->cat_ID;
     1327            $cache_categories[$catt->cat_ID]->fullpath = '/' . $cache_categories[$catt->cat_ID]->category_nicename;
     1328            while ($cache_categories[$curcat]->category_parent != 0) {
     1329                $curcat = $cache_categories[$curcat]->category_parent;
     1330                $cache_categories[$catt->cat_ID]->fullpath = '/' . $cache_categories[$curcat]->category_nicename . $cache_categories[$catt->cat_ID]->fullpath;
     1331            }
     1332        }
    13241333        return true;
    13251334    else :
Note: See TracChangeset for help on using the changeset viewer.