Add argument for parent modifier
Closed this issue · 1 comments
roryashfordbentley commented
I recently encountered a situation where I needed to add a modifier to the BEM menu <ul>
but the modifier did not need to be added to children.
an example:
<ul class="main-menu main-menu--secondary">
<li class="main-menu__item"><a href="#">Page 1</a></li>
<li class="main-menu__item"><a href="#">Page 2</a></li>
<li class="main-menu__item"><a href="#">Page 3</a></li>
</ul>
I propose adding an implementation along these lines:
<?php bem_menu( 'my_menu', 'main-menu', array('main-men--secondary','main-menu--something-else') ) ?>
I think that having the last argument accept an array allows for a lot more flexibility but it keeps the code really lean.
roryashfordbentley commented
Should the last argument accept a string as well as an array?