Why nav_menu_css_class doesn’t work with apply_filters?

Because that’s not what apply_filters() does. You’ll even see the usage guide and examples at your link all use add_filter(). Also see the official docs on Filters. Using apply_filters() makes a value filterable. add_filter() is used to filter a filterable value by passing a function that does the filtering. WordPress uses apply_filters(‘nav_menu_css_class’, …, which allows … Read more