IN FUNCTIONS.PHP
================
function add_specific_menu_location_atts( $atts, $item, $args ) {
// check if the item is in the primary menu
if( $args->theme_location == 'menu-1' ) {
// add the desired attributes:
$atts['class'] = 'main-nav__item';
}
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_specific_menu_location_atts', 10, 3 );