Uses
Uses | Description |
---|---|
wp-includes/functions.php: _deprecated_function() | Mark a function as deprecated and inform when it has been used. |
This function has been deprecated. Use wp_list_sort() instead.
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Sort menu items by the desired key.
(object) (Required) The first object to compare
(object) (Required) The second object to compare
(int) -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b.
File: wp-includes/deprecated.php
function _sort_nav_menu_items( $a, $b ) { global $_menu_item_sort_prop; _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' ); if ( empty( $_menu_item_sort_prop ) ) return 0; if ( ! isset( $a->$_menu_item_sort_prop ) || ! isset( $b->$_menu_item_sort_prop ) ) return 0; $_a = (int) $a->$_menu_item_sort_prop; $_b = (int) $b->$_menu_item_sort_prop; if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop ) return 0; elseif ( $_a == $a->$_menu_item_sort_prop && $_b == $b->$_menu_item_sort_prop ) return $_a < $_b ? -1 : 1; else return strcmp( $a->$_menu_item_sort_prop, $b->$_menu_item_sort_prop ); }
Version | Description |
---|---|
4.7.0 | Use wp_list_sort() |
3.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_sort_nav_menu_items