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() WordPress Method
The WP_Theme::_name_sort() method is used to sort themes by name. This is a private method and is not meant to be called directly.
WP_Theme::_name_sort( WP_Theme $a, WP_Theme $b ) #
Callback function for usort() to naturally sort themes by name.
Description
Accesses the Name header directly from the class for maximum speed. Would choke on HTML but we don’t care enough to slow it down with strip_tags().
Parameters
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().
Source
File: wp-includes/class-wp-theme.php
private static function _name_sort( $a, $b ) { return strnatcasecmp( $a->headers['Name'], $b->headers['Name'] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |