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() WordPress Method

The WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby() method is used to sort menus by their orderby property. This is a private method and should not be called directly.

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

Sort menu objects by the class-supplied orderby property.


Description

This is a workaround for a lack of closures.

Top ↑

See also


Top ↑

Parameters

$menu1

(object)(Required)

$menu2

(object)(Required)


Top ↑

Return

(int)


Top ↑

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
VersionDescription
4.7.0Use wp_list_sort()
4.3.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.