Skip to content

Instantly share code, notes, and snippets.

@raftaar1191
Created May 15, 2023 11:19
Show Gist options
  • Save raftaar1191/f0366f8e637240b49fa251aebb655526 to your computer and use it in GitHub Desktop.
Save raftaar1191/f0366f8e637240b49fa251aebb655526 to your computer and use it in GitHub Desktop.
Remove gutenbur and wp-editor from Specific page
function use_block_editor_for_post_disable_gutenberg( $can_edit, $post ) {
if( $post->ID == '247' ) {
return false;
}
return true;
}
add_filter( 'use_block_editor_for_post', 'use_block_editor_for_post_disable_gutenberg', 10, 2 );
// removes rich text editor for certain pages
function add_meta_boxes_remove_pages_editor(){
if( get_the_ID() === 247 ) {
remove_post_type_support( 'page', 'editor' );
} // end if
} // end remove_pages_editor
add_action( 'add_meta_boxes', 'add_meta_boxes_remove_pages_editor' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment