-
-
Save corypina/d3cf5ecc9141f63bfb511a1a4df7b551 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