Skip to content

Instantly share code, notes, and snippets.

@lschatzkin
Created May 20, 2014 17:48
Show Gist options
  • Save lschatzkin/3405ede11c1c0f6b3c3f to your computer and use it in GitHub Desktop.
Save lschatzkin/3405ede11c1c0f6b3c3f to your computer and use it in GitHub Desktop.
WordPress: Hide content-box on specific pages in admin
function remove_editor() {
if (isset($_GET['post'])) {
$id = $_GET['post'];
$template = get_post_meta($id, '_wp_page_template', true);
if($template == 'template_name.php'){
remove_post_type_support( 'page', 'editor' );
}
}
}
add_action('init', 'remove_editor');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment