Created
May 15, 2023 11:19
-
-
Save raftaar1191/f0366f8e637240b49fa251aebb655526 to your computer and use it in GitHub Desktop.
Remove gutenbur and wp-editor from Specific page
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
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