The third argument passed to the filter are the $args
used for wp_nav_menu
:
function wpse_147499_nav_menu_css_class( $classes, $item, $args ) {
print_r( $args );
exit;
}
add_filter( 'nav_menu_css_class', 'wpse_147499_nav_menu_css_class', 10, 3 );
…which gives you:
stdClass Object
(
[menu] =>
[container] =>
[container_class] =>
[container_id] =>
[menu_class] =>
[menu_id] =>
[echo] => 1
[fallback_cb] =>
[before] =>
[after] =>
[link_before] =>
[link_after] =>
[items_wrap] =>
[depth] => 0
[walker] =>
[theme_location] =>
)
Obviously the values of these vary, and never assume that one will always be non-empty – but hopefully you should be able to differentiate between menus.