WP_Customize_Widgets::_sort_name_callback() WordPress Method

WP_Customize_Widgets::_sort_name_callback() is used internally by the WordPress Customizer to sort widget control objects by name.

WP_Customize_Widgets::_sort_name_callback( array $widget_a, array $widget_b ) #

Naturally orders available widgets by name.


Parameters

$widget_a

(array)(Required)The first widget to compare.

$widget_b

(array)(Required)The second widget to compare.


Top ↑

Return

(int) Reorder position for the current widget comparison.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

	protected function _sort_name_callback( $widget_a, $widget_b ) {
		return strnatcasecmp( $widget_a['name'], $widget_b['name'] );
	}

Top ↑

Changelog

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

Show More