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.
I've enabled hovering dropdowns and when using add_filter( 'nav_menu_link_attributes', 'my_hover_dropdown_parent_link', 10, 4); to allow href links on nav items and that works fine but then the "disabled" class stops working if I do want to disable some links.
I tried adding disabled class on some parent menu items to remove the link but my filter overrides.
What I ended up doing to get it to work is switching the order here:
Line 202
// Allow filtering of the $atts array before using it. $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth ); // update atts of this item based on any custom linkmod classes. $atts = self::update_atts_for_linkmod_type( $atts, $linkmod_classes );
Would there have been a better way so I don't have to edit the navwalker.
I've enabled hovering dropdowns and when using
add_filter( 'nav_menu_link_attributes', 'my_hover_dropdown_parent_link', 10, 4);
to allow href links on nav items and that works fine but then the "disabled" class stops working if I do want to disable some links.I tried adding disabled class on some parent menu items to remove the link but my filter overrides.
What I ended up doing to get it to work is switching the order here:
Line 202
// Allow filtering of the $atts array before using it. $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );
// update atts of this item based on any custom linkmod classes. $atts = self::update_atts_for_linkmod_type( $atts, $linkmod_classes );
Would there have been a better way so I don't have to edit the navwalker.