Sort menu objects by the class-supplied orderby property.
Description
This is a workaround for a lack of closures.
See also
Parameters
$menu1objectrequired$menu2objectrequired
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
| Version | Description |
|---|---|
| 4.7.0 | Use wp_list_sort() |
| 4.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.