The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Back End › How to check if a menu item is assigned to a menu location
I wish to show an admin notice to users if my theme made menu name is not selected. So for me, the menu name is My Theme Menu (slug my-theme-menu) and the location is primary-menu.
//check if the menu My Theme Menu is selected to primary menu or not
I think you can use wp_get_nav_menu_items(). As far as I can tell it returns false when the menu does not exist and empty array if the menu doesn’t have any items in it.