nav_menu: how to force a subpage switching on the parent menu

As pointed out from @Howdy_McGee it should be possible to use the current-menu-anchestor css class.

However, using the standard menu walker in a CPT archive page taxonomically nested under a menu item I wasn’t able to get the class out as expected.

The solution I adopted was to add a create a filter to inject the required class

add_filter( 'wp_nav_menu_objects', 'am_filter_menu_class' );