Created
October 25, 2018 15:14
-
-
Save mmilosheski/7c4df4e44ffb8c0023a7fde30241ca64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 globally | |
*/ | |
add_filter( 'use_block_editor_for_post', '__return_false' ); | |
/* | |
* Disable Gutenberg for specific post types | |
*/ | |
function disable_block_editor_cpt( $use_block_editor, $post_type ){ | |
if( 'page' == $post_type || 'post' == $post_type){ | |
$use_block_editor = false; | |
} | |
return $use_block_editor; | |
} | |
add_filter( 'use_block_editor_for_post_type', 'disable_block_editor_cpt', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot, works like a charm