Alert: 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.

_sort_uname_callback() WordPress Function

The sort_uname_callback() function is used to compare two usernames and sort them in alphabetical order. This function is used by the usort() function.

_sort_uname_callback( array $a, array $b ) #

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


Parameters

$a

(array)(Required)array with 'Name' key.

$b

(array)(Required)array with 'Name' key.


Top ↑

Return

(int) Return 0 or 1 based on two string comparison.


Top ↑

Source

File: wp-admin/includes/plugin.php

function _sort_uname_callback( $a, $b ) {
	return strnatcasecmp( $a['Name'], $b['Name'] );
}

Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.