_wp_object_name_sort_cb( object $a, object $b )

Serves as a callback for comparing objects based on name.


Description

Used with uasort().


Top ↑

Parameters

$a

(object) (Required) The first object to compare.

$b

(object) (Required) The second object to compare.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/category-template.php

function _wp_object_name_sort_cb( $a, $b ) {
	return strnatcasecmp( $a->name, $b->name );
}

Top ↑

Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes

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