WP_Theme::_name_sort()
Callback function for usort() to naturally sort themes by name.
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().
Method of the class: WP_Theme{}
No Hooks.
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().
Usage
$result = WP_Theme::_name_sort( $a, $b );
Changelog
Since 3.4.0 | Introduced. |
WP_Theme::_name_sort() WP Theme:: name sort code WP 6.8
private static function _name_sort( $a, $b ) { return strnatcasecmp( $a->headers['Name'], $b->headers['Name'] ); }