mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Use full hierarchy when resolving category URIs. fixes #1787 Props: ringmaster Owen
git-svn-id: https://develop.svn.wordpress.org/trunk@2968 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1319,8 +1319,17 @@ function update_post_caches(&$posts) {
|
||||
function update_category_cache() {
|
||||
global $cache_categories, $wpdb;
|
||||
if ( $dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories") ):
|
||||
foreach ($dogs as $catt)
|
||||
$cache_categories[$catt->cat_ID] = $catt;
|
||||
foreach ($dogs as $catt)
|
||||
$cache_categories[$catt->cat_ID] = $catt;
|
||||
|
||||
foreach ($cache_categories as $catt) {
|
||||
$curcat = $catt->cat_ID;
|
||||
$cache_categories[$catt->cat_ID]->fullpath = '/' . $cache_categories[$catt->cat_ID]->category_nicename;
|
||||
while ($cache_categories[$curcat]->category_parent != 0) {
|
||||
$curcat = $cache_categories[$curcat]->category_parent;
|
||||
$cache_categories[$catt->cat_ID]->fullpath = '/' . $cache_categories[$curcat]->category_nicename . $cache_categories[$catt->cat_ID]->fullpath;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
else :
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user