_usort_terms_by_ID( object $a, object $b ): int

This function has been deprecated since 4.7.0. Use wp_list_sort() instead.

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

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

$aobjectrequired
$bobjectrequired

Return

int

Source

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

Changelog

VersionDescription
4.7.0Deprecated. Use wp_list_sort()
2.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.