How to list only english custom menus in a metabox alike the Custom Menu widget?

103 Views Asked by At

I'm currently developing a custom theme for Wordpress which also uses WPML. One of the features is a page independent "Quick navigation menu" that resides in the sidebar of pages.

My approach is to use custom menus (Appearance->Menus) for this. On Edit Page screens I want to include a metabox with a dropdown for selecting the right menu. Creating the metabox is easy:

function page_menus_meta(){
    add_meta_box('page_menusid', 'Quick navigation menu', 'page_menus_metabox', 'page', 'normal', 'high');
}
add_action( 'add_meta_boxes', 'page_menus_meta' );

The problem is in displaying the available menus. It must be possible, since the widget "Custom Menu" exists and does exactly that. But when I list all menus I also get the menus translated by WPML which I do not want. I use..

$menus = get_terms('nav_menu');

..for displaying the menus.

My question: How do I list all english-only menus alike the Custom Menu widget?

Subquestion: If someone knows where the code for the Custom Menu resides in the WordPress core I might figure it out myself. Can't seem to find the file though..

0

There are 0 best solutions below