menu-1 поменять на свое значение.
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'] = $args->add_a_class;
}
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_specific_menu_location_atts', 10, 3 );
add_filter( 'nav_menu_link_attributes', 'add_class_to_items_link', 10, 3 );