WP_Theme::_name_sort

Advertisement

Private Access Private Access

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.

Summery Summery

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

Syntax Syntax

WP_Theme::_name_sort( string $a, string $b )

Description 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 Parameters

$a

(string) (Required) First name.

$b

(string) (Required) Second name.

Return 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 Source

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

	 * @param WP_Theme $a First theme.
	 * @param WP_Theme $b Second theme.
	 * @return int Negative if `$a` falls lower in the natural order than `$b`. Zero if they fall equally.

Advertisement

Changelog Changelog

Changelog
Version Description
3.4.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.