Created
September 13, 2020 23:08
-
-
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.
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 | |
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