Get menus created with menu editor?

I am new to wordpress and I am creating a theme for a local company as my final project towards my college degree. They wish to use this theme as a main theme for all their wp sites and that any change in design shall be taken care of by child themes.

they requested that some subpages should have a sidebar menu and some others to have another sidebar menu.

I have made a metabox with a dropdownlist in the page editor so that I can select a menu for each page. The dropdownlist displays all registered menus that are hardcoded inside the theme but not the ones created inside the admin menu editor.

$menus = get_registered_nav_menus();
echo '<select>';
foreach($menus as $menu => $value){
   echo '<option value="'.$menu.'">' . $value .'</option>';
echo '</select>';

How can I also get the menus that are created with the admin menu editor?

Read more here: Get menus created with menu editor?

Leave a Reply

Your email address will not be published. Required fields are marked *