Warning: This function has been deprecated. Use wp_list_sort() instead.
Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
_usort_terms_by_ID() WordPress Function
The usort_terms_by_ID() function sorts an array of terms by term ID. This is useful for custom taxonomies that need to be sorted by term ID.
_usort_terms_by_ID( object $a, object $b ) #
Sort categories by ID.
Description
Used by usort() as a callback, should not be used directly. Can actually be used to sort any term object.
Parameters
- $a
(object)(Required)
- $b
(object)(Required)
Return
(int)
Source
File: wp-includes/deprecated.php
function _usort_terms_by_ID( $a, $b ) { _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' ); if ( $a->term_id > $b->term_id ) return 1; elseif ( $a->term_id < $b->term_id ) return -1; else return 0; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Use wp_list_sort() |
2.3.0 | Introduced. |