Skip to content

Instantly share code, notes, and snippets.

@sunilw
Created January 29, 2014 20:28
Show Gist options
  • Save sunilw/8696321 to your computer and use it in GitHub Desktop.
Save sunilw/8696321 to your computer and use it in GitHub Desktop.
Wordpress: hides editor on a particular page. In this case, the options page
// hide editor on options page
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
if( !isset( $post_id ) ) return;
// Hide the editor on the page titled 'options'
$page_options = get_the_title($post_id);
if($page_options == 'options'){
remove_post_type_support('page', 'editor');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment