I’m using the BB plugin in combination with a theme I’m building. My theme has flat-style buttons (without rounded corners), and I’m wondering if there’s a way to disable the deafult 4px rounded corners BB puts on buttons. That way the buttons created with BB would be automatically more in line with my theme’s buttons.
Is there a filter for doing this? If yes, I’d be very grateful for a code snippet (I’m new when it comes to filters, so a snippet of code to copy/paste would be super-helpful).
Thank you for your support.
PS: I realise I could do this with CSS, but then rounded corners would always be overridden, and it would be better to be able to have them if desired. Thank you.
Sorry to say but there’s no filters for CSS. You’re right though in that we can always override it with another CSS. You can just attach the rounded corners to a class so when you need it on a button, you simply need to add that specific class to it.
Thank you Ben,
I just came across this page http://forum.wpbeaverbuilder.com/knowledge-base/filter-reference/ and it mentions this filter: fl_builder_render_css. Would I be able to do what I want with that?
That filter simply gives us all of the rendered CSS in a variable. So it’s not really the filter you’re looking for to use.
I’d suggest just overriding it with CSS. Same thing would actually happen if you’re to use that filter, you’d have to change the border-radius value to 0, which would affect all BB buttons.
OK Ben, thank you. I’ll go the CSS override route then, which will work fine in most situations. My only concern is if someone did want to use rounded corners it would seem like that functionality is broken. But I could explain and they could always override the override again.
Certainly something I can live with. But perhaps in the future there could be an option for setting the default rounded corners value globally, just like module margins and paddings can be set globally now.
Thank you for your help with this.
Thanks for the suggestion! We actually have plans to implement a global Button setting type of thing, so it’s easier to style all of the buttons throughout the site. Unfortunately though, we don’t have an ETA as to when that will be released.