Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Created October 11, 2012 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pdewouters/3875212 to your computer and use it in GitHub Desktop.
Save pdewouters/3875212 to your computer and use it in GitHub Desktop.
disable wysiwyg on specific page ID
add_action( 'load-post.php', 'kjs_hide_editor' );
function kjs_hide_editor() {
global $current_screen;
if(in_array($current_screen->id, array('post', 'page','edit-post','edit-page'))){
$post_id = isset( $_GET['post'] ) ? $_GET['post'] : $_POST['post_ID'];
if ( ! isset( $post_id ) || ! is_admin() ) return;
if ( 743 == $post_id )
remove_post_type_support( 'page', 'editor' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment