Title: _sort_uname_callback
Published: April 25, 2014
Last modified: May 20, 2026

---

# _sort_uname_callback( array $a, array $b ): int

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#parameters)󠁿

 `$a`arrayrequired

array with `'Name'` key.

`$b`arrayrequired

array with `'Name'` key.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#return)󠁿

 int Return 0 or 1 based on two string comparison.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/plugin.php#L427)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/plugin.php#L427-L429)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_sort_uname_callback/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_sort_uname_callback%2F)
before being able to contribute a note or feedback.