Last active
July 12, 2019 17:39
-
-
Save LeoLopesWeb/eb4a59b0de5fbc12da6968418870c54c to your computer and use it in GitHub Desktop.
via plugin:
https://wordpress.org/plugins/disable-gutenberg/ tutorial:
https://digwp.com/2018/04/how-to-disable-gutenberg/
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
// Disable Gutenberg Completely | |
// disable for posts | |
add_filter('use_block_editor_for_post', '__return_false', 10); | |
// disable for post types | |
add_filter('use_block_editor_for_post_type', '__return_false', 10); | |
//Disable Gutenberg for Custom Post Types | |
function disable_gutenberg_page($is_enabled, $post_type) { | |
if ($post_type === 'page') return false; | |
return $is_enabled; | |
} | |
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_page', 10, 2); | |
function disable_gutenberg_block($is_enabled, $post_type) { | |
if ($post_type === 'blocks') return false; | |
return $is_enabled; | |
} | |
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_block', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works perfect, thanks a lot