Skip to content

Commit

Permalink
fix active ancestor class for current page ancestor (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willemijnr authored Oct 4, 2021
1 parent 9329469 commit 79953f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp_bem_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
if ( is_array( $item->classes ) ) {
$active_page_class = in_array( 'current-menu-item', $item->classes, true ) ? $prefix . $suffix['active_item'] : '';
$active_parent_class = in_array( 'current-menu-parent', $item->classes, true ) ? $prefix . $suffix['parent_of_active_item'] : '';
$active_ancestor_class = in_array( 'current-menu-ancestor', $item->classes, true ) ? $prefix . $suffix['ancestor_of_active_item'] : '';
$active_ancestor_class = in_array( 'current-menu-ancestor', $item->classes, true ) || in_array( 'current-page-ancestor', $item->classes, true ) ? $prefix . $suffix['ancestor_of_active_item'] : '';
if ( isset( $item->classes[0] ) ) {
$user_class = '' !== $item->classes[0] ? $prefix . '__item--' . $item->classes[0] : '';
}
Expand Down

0 comments on commit 79953f1

Please sign in to comment.