Last active
September 29, 2021 09:48
-
-
Save vivianspencer/c6d9ce87b180902415b2c3bd2fbbf08d to your computer and use it in GitHub Desktop.
Remove gutenberg editor from custom post types #wordpress
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 | |
// Remove gutenberg editor from custom post types | |
function prefix_disable_gutenberg($current_status, $post_type) | |
{ | |
if (in_array($post_type, ['client'])) { | |
return false; | |
} | |
return $current_status; | |
} | |
add_filter('use_block_editor_for_post_type', __NAMESPACE__ . '\\prefix_disable_gutenberg', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment