Created
March 26, 2022 16:25
-
-
Save elpuas/f592a9aed78a9ef4d6d11aed46d7e271 to your computer and use it in GitHub Desktop.
Disable Gutenberg by Custom Post Type
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 by CPT | |
* | |
* @param Object $current_status Current status. | |
* @param string $post_type Post type. | |
* @author ElPuasDigitalCrafts | |
*/ | |
function prefix_disable_gutenberg( $current_status, $post_type ) { | |
if ( 'speakers' === $post_type ) { | |
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