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
This commit is contained in:
parent
b96ba570ea
commit
504d4ad5eb
|
@ -380,7 +380,7 @@ switch ( $action ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all nav menus.
|
// Get all nav menus.
|
||||||
$nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
|
$nav_menus = wp_get_nav_menus();
|
||||||
$menu_count = count( $nav_menus );
|
$menu_count = count( $nav_menus );
|
||||||
|
|
||||||
// Are we on the add new screen?
|
// Are we on the add new screen?
|
||||||
|
|
|
@ -1344,7 +1344,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||||
$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
|
$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
|
||||||
|
|
||||||
// Get menus
|
// 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 no menus exists, direct the user to go and create some.
|
||||||
if ( !$menus ) {
|
if ( !$menus ) {
|
||||||
|
|
|
@ -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
|
// get the first menu that has items if we still can't find a menu
|
||||||
if ( ! $menu && !$args->theme_location ) {
|
if ( ! $menu && !$args->theme_location ) {
|
||||||
$menus = wp_get_nav_menus( array( 'orderby' => 'name' ) );
|
$menus = wp_get_nav_menus();
|
||||||
foreach ( $menus as $menu_maybe ) {
|
foreach ( $menus as $menu_maybe ) {
|
||||||
if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) {
|
if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) {
|
||||||
$menu = $menu_maybe;
|
$menu = $menu_maybe;
|
||||||
|
|
|
@ -465,7 +465,7 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
|
||||||
* @return array menu objects
|
* @return array menu objects
|
||||||
*/
|
*/
|
||||||
function wp_get_nav_menus( $args = array() ) {
|
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 );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue