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.

_usort_by_first_member() WordPress Function

The usort_by_first_member() WordPress function sorts an array of objects by the value of their first member. This is useful for sorting a list of objects by their ID, name, or any other value.

_usort_by_first_member( array $a, array $b ) #

Sorts a multidimensional array by first member of each top level member


Description

Used by uasort() as a callback, should not be used directly.


Top ↑

Parameters

$a

(array)(Required)

$b

(array)(Required)


Top ↑

Return

(int)


Top ↑

Source

File: wp-admin/includes/import.php

function _usort_by_first_member( $a, $b ) {
	return strnatcasecmp( $a[0], $b[0] );
}

Top ↑

Changelog

Changelog
VersionDescription
2.9.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.