Make WordPress Core

Changeset 4903


Ignore:
Timestamp:
02/21/2007 02:13:47 AM (17 years ago)
Author:
markjaquith
Message:

properly sort categories by name for the_category(). Props rob1n. fixes #1302

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r4886 r4903  
    7272
    7373    if ( !empty($categories) )
    74         sort($categories);
     74        usort($categories, '_get_the_category_usort');
    7575    else
    7676        $categories = array();
    7777
    7878    return $categories;
     79}
     80
     81function _get_the_category_usort($a, $b) {
     82    return strcmp($a->category_name, $b->category_name);
    7983}
    8084
Note: See TracChangeset for help on using the changeset viewer.