_wp_object_count_sort_cb

The timeline below displays how wordpress function _wp_object_count_sort_cb has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Serves as a callback for comparing objects based on count.
 *
 * Used with `uasort()`.
 *
 * @since 3.1.0
 * @access private
 *
 * @param object $a The first object to compare.
 * @param object $b 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`.
 */
function _wp_object_count_sort_cb($a, $b)
{
    return $a->count - $b->count;
}

WordPress Version: 4.5

/**
 * Serves as a callback for comparing objects based on count.
 *
 * Used with `uasort()`.
 *
 * @since 3.1.0
 * @access private
 *
 * @param object $a The first object to compare.
 * @param object $b The second object to compare.
 * @return bool Whether the count value for `$a` is greater than the count value for `$b`.
 */
function _wp_object_count_sort_cb($a, $b)
{
    return $a->count > $b->count;
}

WordPress Version: 4.3

/**
 * Callback for comparing objects based on count
 *
 * @since 3.1.0
 * @access private
 * @return bool
 */
function _wp_object_count_sort_cb($a, $b)
{
    return $a->count > $b->count;
}

WordPress Version: 3.7

/**
 * Callback for comparing objects based on count
 *
 * @since 3.1.0
 * @access private
 */
function _wp_object_count_sort_cb($a, $b)
{
    return $a->count > $b->count;
}