This article is aimed at those who have some knowledge of programming WordPress themes and is specifically about adding structured data to WordPress navigation menus.
Navigation menus in WordPress are generated by a function. You may need to manipulate the function to structure how navigation menus are rendered.
For instance, your site’s navigation menu may be generated with PHP code in your theme like this:
wp_nav_menu(['theme_location' => 'primary_navigation', 'walker' => MyNavWalker(), 'menu_class' => 'nav']);