wpseek.com
A WordPress-centric search engine for devs and theme authors



_wp_object_name_sort_cb › WordPress Function

Since3.1.0
Deprecatedn/a
_wp_object_name_sort_cb ( $a, $b )
Access:
  • private
Parameters: (2)
  • (object) $a The first object to compare.
    Required: Yes
  • (object) $b The second object to compare.
    Required: Yes
Returns:
  • (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`.
Defined at:
Codex:

Serves as a callback for comparing objects based on name.

Used with uasort().


Source

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