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

In this article

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.

Serves as a callback for comparing objects based on count.

Description

Used with uasort().

Parameters

$aobjectrequired
The first object to compare.
$bobjectrequired
The second object to compare.

Return

int Negative number if $a->count is less than $b->count, zero if they are equal, or greater than zero if $a->count is greater than $b->count.

Source

function _wp_object_count_sort_cb( $a, $b ) {
	return ( $a->count - $b->count );
}

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

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