WP_Customize_Widgets::_sort_name_callback()
Naturally orders available widgets by name.
{} It's a method of the class: WP_Customize_Widgets{}
No Hooks.
Return
Int
. Reorder position for the current widget comparison.
Usage
// protected - for code of main (parent) or child class $result = $this->_sort_name_callback( $widget_a, $widget_b );
- $widget_a(array) (required)
- The first widget to compare.
- $widget_b(array) (required)
- The second widget to compare.
Changelog
Since 3.9.0 | Introduced. |
Code of WP_Customize_Widgets::_sort_name_callback() WP Customize Widgets:: sort name callback WP 5.9.3
protected function _sort_name_callback( $widget_a, $widget_b ) { return strnatcasecmp( $widget_a['name'], $widget_b['name'] ); }