WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby()protectedWP 4.3.0

Deprecated from version 4.7.0. It is no longer supported and can be removed in future releases. Use wp_list_sort() instead.

Sort menu objects by the class-supplied orderby property.

This is a workaround for a lack of closures.

Method of the class: WP_Customize_Nav_Menu_Setting{}

No Hooks.

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->_sort_menus_by_orderby( $menu1, $menu2 );
$menu1(object) (required)
-
$menu2(object) (required)
-

Notes

Changelog

Since 4.3.0 Introduced.
Deprecated since 4.7.0 Use wp_list_sort()

WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby() code WP 6.6.2

protected function _sort_menus_by_orderby( $menu1, $menu2 ) {
	_deprecated_function( __METHOD__, '4.7.0', 'wp_list_sort' );

	$key = $this->_current_menus_sort_orderby;
	return strcmp( $menu1->$key, $menu2->$key );
}