Hi Justin,
I’m with you on this one. But I feel there is a bit of misunderstanding on what I propose here ??
I do not want to add any additional classes to the module wrappers. Actually, the exact opposite.
Currently you can add you own classes to module wrappers via module settings form, “Advanced” tab: https://awesomescreenshot.com/00446sp0c1 This would produce this module wrapper code:
<div class="fl-module fl-module-$ fl-node-# bg-red" data-node="#" data-animation-delay="#">
<div class="fl-module-content fl-node-content">
THE ACTUAL MODULE OUTPUT HERE FROM FRONTEND.PHP
</div>
</div>
Now let’s say, I am adding a custom “Button” module with this code in the module’s frontend.php
file:
echo '<a href="' . $settings->url . '" class="button ' . $settings->class . '">' . $settings->content . '</a>';
So, the actual “Button” module output in website frontend would look like this (with a module wrappers applied by Beaver Builder):
<div class="fl-module fl-module-button fl-node-# bg-red" data-node="#" data-animation-delay="0.0">
<div class="fl-module-content fl-node-content">
<a href="#" class="button bg-red">Button text</a>
</div>
</div>
Please notice the doubled bg-red
class applied both on module wrapper DIV and the actual button A tag. If the class applies a red background color, this would colorize both the button and the module wrapper, which is not desirable.
So, with my original proposition when applying the filter on the custom module class only, I can do this in my theme’s functions.php
file to get rid of the custom class applied on the module wrapper:
add_filter( 'render_module_class', '__return_empty_string' );
(*) Please note that this is just for our example. There is a $module
variable passed into the filter, so you can actually do this for specific modules only.
And this would resolve my issue as it would remove the bg-red
class from the module wrapper and the module output code would look like:
<div class="fl-module fl-module-button fl-node-#" data-node="#" data-animation-delay="0.0">
<div class="fl-module-content fl-node-content">
<a href="#" class="button bg-red">Button text</a>
</div>
</div>
Please, let me know if you have any more additional questions on why do I propose this and thank you very much for consideration (and your prompt replies, of course ?? )!
Best regards,
Oliver