From 504d4ad5eb8366153f5424ec82d0bae7c7b9ca73 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 29 Sep 2014 15:45:16 +0000 Subject: [PATCH] Change the default orderby value in wp_get_nav_menus() to 'name'. props voldemortensen, igmoweb. fixes #29460. Built from https://develop.svn.wordpress.org/trunk@29792 git-svn-id: http://core.svn.wordpress.org/trunk@29564 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/nav-menus.php | 2 +- wp-includes/default-widgets.php | 2 +- wp-includes/nav-menu-template.php | 2 +- wp-includes/nav-menu.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 0dd34cf9e6..66590be119 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -380,7 +380,7 @@ switch ( $action ) { } // Get all nav menus. -$nav_menus = wp_get_nav_menus( array('orderby' => 'name') ); +$nav_menus = wp_get_nav_menus(); $menu_count = count( $nav_menus ); // Are we on the add new screen? diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index d54dbc732c..f4a6790711 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -1344,7 +1344,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget { $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : ''; // Get menus - $menus = wp_get_nav_menus( array( 'orderby' => 'name' ) ); + $menus = wp_get_nav_menus(); // If no menus exists, direct the user to go and create some. if ( !$menus ) { diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 4d380a25ee..6db82b1e8f 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -277,7 +277,7 @@ function wp_nav_menu( $args = array() ) { // get the first menu that has items if we still can't find a menu if ( ! $menu && !$args->theme_location ) { - $menus = wp_get_nav_menus( array( 'orderby' => 'name' ) ); + $menus = wp_get_nav_menus(); foreach ( $menus as $menu_maybe ) { if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) { $menu = $menu_maybe; diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 8a0ee77a4d..6c6af4b8a7 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -465,7 +465,7 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item * @return array menu objects */ function wp_get_nav_menus( $args = array() ) { - $defaults = array( 'hide_empty' => false, 'orderby' => 'none' ); + $defaults = array( 'hide_empty' => false, 'orderby' => 'name' ); $args = wp_parse_args( $args, $defaults ); /**