Skip to content

Instantly share code, notes, and snippets.

@vivianspencer
Last active September 29, 2021 09:48
Show Gist options
  • Save vivianspencer/c6d9ce87b180902415b2c3bd2fbbf08d to your computer and use it in GitHub Desktop.
Save vivianspencer/c6d9ce87b180902415b2c3bd2fbbf08d to your computer and use it in GitHub Desktop.
Remove gutenberg editor from custom post types #wordpress
<?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