mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Revert [38859] due to an incomplete implementation.
See https://core.trac.wordpress.org/ticket/37128#comment:27. See #37128. git-svn-id: https://develop.svn.wordpress.org/trunk@38863 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -99,6 +99,45 @@ function get_the_category( $id = false ) {
|
||||
return apply_filters( 'get_the_categories', $categories, $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort categories by name.
|
||||
*
|
||||
* Used by usort() as a callback, should not be used directly. Can actually be
|
||||
* used to sort any term object.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @access private
|
||||
*
|
||||
* @param object $a
|
||||
* @param object $b
|
||||
* @return int
|
||||
*/
|
||||
function _usort_terms_by_name( $a, $b ) {
|
||||
return strcmp( $a->name, $b->name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort categories by ID.
|
||||
*
|
||||
* Used by usort() as a callback, should not be used directly. Can actually be
|
||||
* used to sort any term object.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @access private
|
||||
*
|
||||
* @param object $a
|
||||
* @param object $b
|
||||
* @return int
|
||||
*/
|
||||
function _usort_terms_by_ID( $a, $b ) {
|
||||
if ( $a->term_id > $b->term_id )
|
||||
return 1;
|
||||
elseif ( $a->term_id < $b->term_id )
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve category name based on category ID.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user