WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby

Advertisement

Deprecated Deprecated

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

Summery Summery

Sort menu objects by the class-supplied orderby property.

Syntax Syntax

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

Description Description

This is a workaround for a lack of closures.

Parameters Parameters

$menu1

(object) (Required)

$menu2

(object) (Required)

Return Return

(int)

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

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Use wp_list_sort()
4.3.0 Introduced.

See also See also

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.