Skip to content

Instantly share code, notes, and snippets.

@marktenney
Created September 13, 2020 23:08
Show Gist options
  • Save marktenney/7aa8d318efa3c75a337fd9995c932ba3 to your computer and use it in GitHub Desktop.
Save marktenney/7aa8d318efa3c75a337fd9995c932ba3 to your computer and use it in GitHub Desktop.
Use this to disable the wordpress editor for pages and allow only the Beaver Builder page builder.
<?php
function disable_gutenberg_4_bb( $can_edit, $post_type ) {
if($post_type=="page"){
$can_edit = false;
remove_post_type_support( 'page', 'editor' );
?>
<style>.fl-enable-editor, .fl-builder-admin-tabs {display: none !important ;}.fl-builder-admin-ui {display:block !important;}</style>
<?php
}
return $can_edit;
}
add_filter( 'gutenberg_can_edit_post_type', 'disable_gutenberg_4_bb', 10, 2 );
add_filter( 'use_block_editor_for_post_type', 'disable_gutenberg_4_bb', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment