Ok i found the file causing the error – but not why it doesn’t work on the new site, but does on the old.
The file contains the following, to setup a custom mega-menu:
add_filter('wp_nav_menu_objects', 'megamenu_wp_nav_menu_objects', 10, 2);
function megamenu_wp_nav_menu_objects( $items, $args ) {
// loop
foreach( $items as $item ) {
// vars
$icon = get_field('mega_icon', $item);
$description = get_field('mega_description', $item);
// append icon
if( $icon ) {
$item->title = '<div class="mega-menu-icon-container"><div class="inner-text"><span class="title">' . $item->title .'</span>';
$item->title .= '<span class="description">' . $description .'</span>';
$item->title .= '</div>';
$item->title .= '<div class="inner-image"><img src="' . $icon['url'] .'"></div>';
$item->title .= '</div>';
$item->classes = 'mega-menu-icon';
}
}
// return
return $items;
}