wp-bootstrap-navwalker
wp-bootstrap-navwalker copied to clipboard
please add option for custom dropdown menu classes
Thanks for contributing this, super helpful.
I just ran into a limitation that I thought might impact others. I had not run into an issue with this before, but I needed to control dropdown menu alignment and found I could not.
I added the following within start_lvl() replacing line 50:
if ( isset( $args->dropdown_menu_class ) ) { $classes = explode(" ", $args->dropdown_menu_class ); } else { // Default class to add to the file. $classes = array( 'dropdown-menu' ); }
Then usage looks like such:
'dropdown_menu_class' => 'dropdown-menu dropdown-menu-right'