check if beaverbuilder is active or set beaverbuilder editor to default

Hey guys,

is there a way to set the BeaverBuilder as default editor? Or is there an option to check via php if BeaverBuilder is active?

The problem:

If i setup a new page, on the frontend my content takes the full width until bb is active.
Thanks in advance!

Hey David,

Interesting idea! That might make for a nice setting addition :slight_smile: I whipped this up really quick, so it might need some tweaking, but it should work…

function make_beaver_builder_default( $post_ID, $post, $update ) {
	
	   if ( ! $update ) {
      		update_post_meta( $post_ID, '_fl_builder_enabled', true );
	   }
}

add_action( 'wp_insert_post', 'make_beaver_builder_default', 10, 3 );

Let me know how that goes.

Justin

Sounds really good.

Will your code work for any post types on which we allow BB?

Yep! :slight_smile:

Hi Justin, sorry for my delay but i missed to subscribe to that conversation and forgot about that issue till it came up again today :smiley:

that seems to be working for me, but i need to go a little deeper.

I would need to check if bb is active on in the template maybe like:

<?php if(!bb_is_active()) { ?>
    /* Do some styling if BB isn't active */
    <style>
    ...
    </style>
<?php } else { ?>
    /* nothing else */
<?php } ?>

beause if i add a new multisite in my network, the default page content takes the complete page-width until BB was activated for that page and saved for the first time.

If i could check if BB isn’t active, i could apply some styling on the default pages.

Thanks!

Hey David,

You can check if BB is active or not using…

FLBuilderModel::is_builder_enabled()

Let me know if you have any questions.

Justin

Thank you Justin! Works like a charm! :slight_smile: :slight_smile: