Last active
October 2, 2019 11:22
-
-
Save JeremyEnglert/cd0227c776d2dab0029436f75e8bd422 to your computer and use it in GitHub Desktop.
Set BeaverBuilder as Default Editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sets Beaver Builder as the default editor. | |
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 ); | |
// Hides the editor button from editor screen | |
function remove_text_editor() { | |
echo '<style> | |
.fl-builder-admin-tabs { | |
display: none; | |
} | |
</style>'; | |
} | |
add_action('admin_head', 'remove_text_editor'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment