WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby( object $menu1, object $menu2 ): int

This method has been deprecated. Use WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus() instead.

Sort menu objects by the class-supplied orderby property.

Description

This is a workaround for a lack of closures.

See also

Parameters

$menu1objectrequired
$menu2objectrequired

Return

int

Source

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 );
}

Changelog

VersionDescription
4.7.0Use wp_list_sort()
4.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.