Make WordPress Core

Changeset 18815


Ignore:
Timestamp:
09/29/2011 05:20:34 PM (14 years ago)
Author:
nacin
Message:

Make the sort-by-object-property functions generic. see #14424.

File:
1 edited

Legend:

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

    r18814 r18815  
    643643            // SQL cannot save you; this is a second (potentially different) sort on a subset of data.
    644644            if ( 'name' == $orderby )
    645                 uasort( $tags, '_wp_tag_cloud_name_sort_cb' );
     645                uasort( $tags, '_wp_object_name_sort_cb' );
    646646            else
    647                 uasort( $tags, '_wp_tag_cloud_count_sort_cb' );
     647                uasort( $tags, '_wp_object_count_sort_cb' );
    648648
    649649            if ( 'DESC' == $order )
     
    705705
    706706/**
    707  * Callback for comparing tags based on name
     707 * Callback for comparing objects based on name
    708708 *
    709709 * @since 3.1.0
    710710 * @access private
    711711 */
    712 function _wp_tag_cloud_name_sort_cb( $a, $b ) {
     712function _wp_object_name_sort_cb( $a, $b ) {
    713713    return strnatcasecmp( $a->name, $b->name );
    714714}
    715715
    716716/**
    717  * Callback for comparing tags based on count
     717 * Callback for comparing objects based on count
    718718 *
    719719 * @since 3.1.0
    720720 * @access private
    721721 */
    722 function _wp_tag_cloud_count_sort_cb( $a, $b ) {
     722function _wp_object_count_sort_cb( $a, $b ) {
    723723    return ( $a->count > $b->count );
    724724}
Note: See TracChangeset for help on using the changeset viewer.