Make WordPress Core


Ignore:
Timestamp:
10/21/2016 05:00:29 PM (8 years ago)
Author:
ocean90
Message:

Revert [38859] due to an incomplete implementation.

See https://core.trac.wordpress.org/ticket/37128#comment:27.
See #37128.

File:
1 edited

Legend:

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

    r38859 r38863  
    9898     */
    9999    return apply_filters( 'get_the_categories', $categories, $id );
     100}
     101
     102/**
     103 * Sort categories by name.
     104 *
     105 * Used by usort() as a callback, should not be used directly. Can actually be
     106 * used to sort any term object.
     107 *
     108 * @since 2.3.0
     109 * @access private
     110 *
     111 * @param object $a
     112 * @param object $b
     113 * @return int
     114 */
     115function _usort_terms_by_name( $a, $b ) {
     116    return strcmp( $a->name, $b->name );
     117}
     118
     119/**
     120 * Sort categories by ID.
     121 *
     122 * Used by usort() as a callback, should not be used directly. Can actually be
     123 * used to sort any term object.
     124 *
     125 * @since 2.3.0
     126 * @access private
     127 *
     128 * @param object $a
     129 * @param object $b
     130 * @return int
     131 */
     132function _usort_terms_by_ID( $a, $b ) {
     133    if ( $a->term_id > $b->term_id )
     134        return 1;
     135    elseif ( $a->term_id < $b->term_id )
     136        return -1;
     137    else
     138        return 0;
    100139}
    101140
Note: See TracChangeset for help on using the changeset viewer.