$locations = get_theme_mod( 'nav_menu_locations' );
if(!empty($locations))
{
foreach($locations as $locationId => $menuValue)
{
switch($locationId)
{
case 'admin-menu-location':
$menu = get_term_by('name', 'Admin Menu', 'nav_menu');
break;
case 'author-menu-location':
$menu = get_term_by('name', 'Author Menu', 'nav_menu');
break;
case 'subscriber-menu-location':
$menu = get_term_by('name', 'Default Menu', 'nav_menu');
break;
}
if(isset($menu))
{
$locations[$locationId] = $menu->term_id;
}
}
set_theme_mod('nav_menu_locations', $locations);
}