WordPress.org

Make WordPress Core

Changeset 14751


Ignore:
Timestamp:
05/19/2010 06:52:37 PM (8 years ago)
Author:
ryan
Message:

Order menu tabs by name. Allow passing args to wp_get_nav_menus() which are passed on to get_terms(). Default orderby for wo_get_nav_menus() to none since most requests won't care about order. fixes #13334

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/nav-menus.php

    r14738 r14751  
    346346
    347347// Get all nav menus
    348 $nav_menus = wp_get_nav_menus();
     348$nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
    349349
    350350// Get recently edited nav menu
  • trunk/wp-includes/nav-menu.php

    r14721 r14751  
    395395 * @since 3.0.0
    396396 *
     397 * @param $args array Array of arguments passed on to get_terms().
    397398 * @return array menu objects
    398399 */
    399 function wp_get_nav_menus() {
    400     return get_terms( 'nav_menu', array( 'hide_empty' => false, 'orderby' => 'id' ) );
     400function wp_get_nav_menus( $args = array() ) {
     401    $defaults = array( 'hide_empty' => false, 'orderby' => 'none' );
     402    $args = wp_parse_args( $args, $defaults );
     403    return get_terms( 'nav_menu',  $args);
    401404}
    402405
Note: See TracChangeset for help on using the changeset viewer.