_sort_name_callback( array $a, array $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.

Callback to sort array by a ‘name’ key.

Parameters

$aarrayrequired
First array.
$barrayrequired
Second array.

Return

int

Source

function _sort_name_callback( $a, $b ) {
	return strnatcasecmp( $a['name'], $b['name'] );
}

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

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