add_filter( 'nav_menu_css_class', 'add_custom_class', 10, 2 );
function add_custom_class( $classes, $item ) {
if ( 'Яблоки' == $item->title && is_product_category( 'cat1' ) ) {
$classes[] = 'current-menu-item';
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'add_custom_class', 10, 2 );
function add_custom_class( $classes, $item ) {
if ( 118 == $item->ID && is_product_category( 86 ) ) {
$classes[] = 'current-menu-item';
}
return $classes;
}