Navigation Menus

Get All WordPress Navigation Menus

Wordpress menu

If you are creating a custom themes options page or a WordPress plugin which needs to get all the WordPress menus in your site. This small function can be very useful, it will return all the WordPress menus on your site in an array so you can process them as you want.

This uses the WordPress function get_terms() to get all the nav_menu's on the site.

function get_all_wordpress_menus(){
    return get_terms( 'nav_menu', array( 'hide_empty' => true ) ); 
Back to top

Fastest WordPress Hosting With WPEngine

Stunning speed, powerful security, and best-in-class customer service. At WP Engine.

Risk free for 60 days