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().
$a falls lower in the natural order than $b. Zero if they fall equally.$a falls higher in the natural order than $b. Used with usort().private static function _name_sort( $a, $b ) {
return strnatcasecmp( $a->headers['Name'], $b->headers['Name'] );
}
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme/_name_sort