Ticket #2161: 2161.diff
File 2161.diff, 1.0 KB (added by , 19 years ago) |
---|
-
wp-includes/classes.php
483 483 $cat_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir); 484 484 485 485 $all_cat_ids = get_all_category_ids(); 486 $q['cat'] = 0; 486 $q['cat'] = 0; $partial_match = 0; 487 487 foreach ( $all_cat_ids as $cat_id ) { 488 488 $cat = get_category($cat_id); 489 489 if ( $cat->fullpath == $cat_path ) { 490 490 $q['cat'] = $cat_id; 491 491 break; 492 } elseif ( $cat->category_nicename == $q['category_name'] ) { 493 $partial_match = $cat_id; 492 494 } 493 495 } 496 497 //if we don't match the entire hierarchy fallback on just matching the nicename 498 if (!$q['cat'] && $partial_match) { 499 $q['cat'] = $partial_match; 500 } 494 501 495 502 $tables = ", $wpdb->post2cat, $wpdb->categories"; 496 503 $join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) LEFT JOIN $wpdb->categories ON ($wpdb->post2cat.category_id = $wpdb->categories.cat_ID) ";