Skip to content

Commit

Permalink
Introduce .is-active to the active nav class as used from Foundation …
Browse files Browse the repository at this point in the history
…6.4.0 onwards

This addresses issues found in #397 where the $dropdown-menu-item-background-active didn't seem to apply. But the actual issue is Foundation now uses .is-active and not .active.

To preserve back-compat for other devs I've left .active present.
  • Loading branch information
Garrett Hyder authored Apr 14, 2019
1 parent b02273e commit ede8d73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ function joints_footer_links_fallback() {
function required_active_nav_class( $classes, $item ) {
if ( $item->current == 1 || $item->current_item_ancestor == true ) {
$classes[] = 'active';
$classes[] = 'is-active';
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'required_active_nav_class', 10, 2 );
add_filter( 'nav_menu_css_class', 'required_active_nav_class', 10, 2 );

0 comments on commit ede8d73

Please sign in to comment.