wp_get_nav_menus() – Returns all navigation menu objects.

You appear to be a bot. Output may be restricted

Description

Returns all navigation menu objects.

Usage

$WP_Term[] = wp_get_nav_menus( $args );

Parameters

$args
( array ) optional – Optional. Array of arguments passed on to get_terms(). Default empty array.

Returns

WP_Term[] An array of menu objects.

Source

File name: wordpress/wp-includes/nav-menu.php
Lines:

1 to 20 of 20
function wp_get_nav_menus( $args = array() ) {
  $defaults = array(
    'taxonomy'   => 'nav_menu',
    'hide_empty' => false,
    'orderby'    => 'name',
  );
  $args     = wp_parse_args( $args, $defaults );

  
/**
 * Filters the navigation menu objects being returned.
 *
 * @since 3.0.0
 *
 * @see get_terms()
 *
 * @param WP_Term[] $menus An array of menu objects.
 * @param array     $args  An array of arguments used to retrieve menu objects.
 */
  return apply_filters( 'wp_get_nav_menus', get_terms( $args ), $args );
}
 

 View on GitHub View on Trac