_usort_terms_by_ID()WP 2.3.0

Deprecated from version 4.7.0. It is no longer supported and can be removed in future releases. Use wp_list_sort() instead.

Sort categories by ID.

Used by usort() as a callback, should not be used directly. Can actually be used to sort any term object.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

Int.

Usage

_usort_terms_by_ID( $a, $b );
$a(object) (required)
-
$b(object) (required)
-

Changelog

Since 2.3.0 Introduced.
Deprecated since 4.7.0 Use wp_list_sort()

_usort_terms_by_ID() code WP 6.5.2

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;
}