I am using this function
$args = array (
'order' => 'DESC',
);
$items = wp_get_nav_menu_items( $custom_menu, $args );
then, if I change args to
$args = array (
'order' => 'ASC',
);
and the result is still the same.
Anybody have suggestion?
When you look in WordPress source code, you will find reason for that. On line 538 of nav-menu.php you’ll find:
I didn’t check why, but it looks like this sorting doesn’t work right. The easiest thing you can do to fixthis is to change output type to disable this sorting.
So when you add
'output'=>OBJECT
or'output'=>ARRAY_N
to your args it should work just fine.PS. It’s even known bug: http://core.trac.wordpress.org/ticket/15533