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.

WP_Theme::_name_sort_i18n() WordPress Method

The WP_Theme::_name_sort_i18n() method is used to sort an array of themes by name, translated into the current locale.

WP_Theme::_name_sort_i18n( WP_Theme $a, WP_Theme $b ) #

Callback function for usort() to naturally sort themes by translated name.


Parameters

$a

(WP_Theme)(Required)First theme.

$b

(WP_Theme)(Required)Second theme.


Top ↑

Return

(int) Negative if $a falls lower in the natural order than $b. Zero if they fall equally. Greater than 0 if $a falls higher in the natural order than $b. Used with usort().


Top ↑

Source

File: wp-includes/class-wp-theme.php

	private static function _name_sort_i18n( $a, $b ) {
		return strnatcasecmp( $a->name_translated, $b->name_translated );
	}

Top ↑

Changelog

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