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

Inline If statement to echo CSS [closed]

It may helpful to you… $video = (in_category ( 42 )) ? ‘has-video’ : ”; echo ‘<section id=”cooked-recipe-list-‘ . $list_id_counter . ‘” class=”cooked-clearfix cooked-recipe-‘ . $list_style . ‘ cooked-recipe-loader’ . ( in_array( $list_style, $masonry_layouts ) ? ‘ cooked-masonry’ : ” ) . ( isset($atts[‘columns’]) && $atts[‘columns’] ? ‘ cooked-columns-‘ . $atts[‘columns’] : ” ) . … Read more