Ticket #4335: cat_id_order__branches_2.2.diff
| File cat_id_order__branches_2.2.diff, 1.1 KB (added by markjaquith, 5 years ago) |
|---|
-
wp-includes/link-template.php
77 77 $category = ''; 78 78 if (strpos($permalink, '%category%') !== false) { 79 79 $cats = get_the_category($post->ID); 80 if ( $cats ) 81 usort($cats, '_get_the_category_usort_by_ID'); // order by ID 80 82 $category = $cats[0]->category_nicename; 81 83 if ( $parent=$cats[0]->category_parent ) 82 84 $category = get_category_parents($parent, FALSE, '/', TRUE) . $category; -
wp-includes/category-template.php
83 83 return strcmp($a->category_name, $b->category_name); 84 84 } 85 85 86 function _get_the_category_usort_by_ID($a, $b) { 87 if ( $a->cat_ID > $b->cat_ID ) 88 return 1; 89 elseif ( $a->cat_ID < $b->cat_ID ) 90 return -1; 91 else 92 return 0; 93 } 94 86 95 function get_the_category_by_ID($cat_ID) { 87 96 $cat_ID = (int) $cat_ID; 88 97 $category = &get_category($cat_ID);
