The below will add a class called class-here
to all menu items:
/**
* Filters the CSS class(es) applied to a menu item's list item element.
*
* @param array $classes The CSS classes that are applied to the menu item's `<li>` element.
* @param WP_Post $item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
*
* @return Array $classes
*/
function theme_prefix_nav_menu_css_class( $classes, $item, $args, $dpeth ) {
$classes[] = 'class-here';
return $classes;
}
add_filter( 'nav_menu_css_class', 'theme_prefix_nav_menu_css_class', 10, 4 );
You could add this to your themes functions.php
file. There’s a bunch of other hooks when the WordPress WP Nav Walker creates the menus – Check out The Code Reference