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

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

Sort menu objects by the class-supplied orderby property.


Description Description

This is a workaround for a lack of closures.

See also See also


Top ↑

Parameters Parameters

$menu1

(object) (Required)

$menu2

(object) (Required)


Top ↑

Return Return

(int)


Top ↑

Source Source

File: wp-includes/customize/class-wp-customize-nav-menu-setting.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Use wp_list_sort()
4.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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