A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
Defines 3 new boolean variables for better readability: $is_dropdown, $is_dropdown_item, $is_active. They indicate whether a menu item is a dropdown, a dropdown item and whether the menu item is active.
Fixes #431 (misplaced
.active
class). Fixes dropdown markup on items without children (reported in https://github.com/wp-bootstrap/wp-bootstrap-navwalker/issues/517#issuecomment-909436992).Changes proposed in this Pull Request:
$is_dropdown
,$is_dropdown_item
,$is_active
. They indicate whether a menu item is a dropdown, a dropdown item and whether the menu item is active..active
class from the li-element and add it to the a-element if the item is a dropdown item. (https://getbootstrap.com/docs/4.6/components/dropdowns/#active)Proposed changelog entry for your changes:
Fix misplaced .active class Remove dropdown markup on items without visible children