Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Forked from pdewouters/gist:3875212
Created October 11, 2012 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/3875217 to your computer and use it in GitHub Desktop.
Save wpsmith/3875217 to your computer and use it in GitHub Desktop.
disable wysiwyg on specific page ID
add_action( 'admin_init', 'wps_hide_editor' );
/**
* Remove the editor for a specific post.
*
* @return null Returns early for non-admin and other admin pages.
*/
function wps_hide_editor() {
$post_id = isset( $_GET['post'] ) ? $_GET['post'] : $_POST['post_ID'] ;
if( ! isset( $post_id ) || ! is_admin() ) return;
if ( 25 == $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