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
git-svn-id: https://develop.svn.wordpress.org/trunk@14751 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8203d22175
commit
b6d8dbf426
|
@ -345,7 +345,7 @@ switch ( $action ) {
|
|||
}
|
||||
|
||||
// Get all nav menus
|
||||
$nav_menus = wp_get_nav_menus();
|
||||
$nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
|
||||
|
||||
// Get recently edited nav menu
|
||||
$recently_edited = (int) get_user_option( 'nav_menu_recently_edited' );
|
||||
|
|
|
@ -394,10 +394,13 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param $args array Array of arguments passed on to get_terms().
|
||||
* @return array menu objects
|
||||
*/
|
||||
function wp_get_nav_menus() {
|
||||
return get_terms( 'nav_menu', array( 'hide_empty' => false, 'orderby' => 'id' ) );
|
||||
function wp_get_nav_menus( $args = array() ) {
|
||||
$defaults = array( 'hide_empty' => false, 'orderby' => 'none' );
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
return get_terms( 'nav_menu', $args);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue