_sort_uname_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.

Declares a callback to sort array by a ‘Name’ key.

Parameters

$aarrayrequired
array with 'Name' key.
$barrayrequired
array with 'Name' key.

Return

int Return 0 or 1 based on two string comparison.

Source

function _sort_uname_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.