Skip to content

Instantly share code, notes, and snippets.

@offroadkev
Last active June 14, 2016 06:51
Show Gist options
  • Save offroadkev/360d88d3503c186ef1651c0d3ecc2c5b to your computer and use it in GitHub Desktop.
Save offroadkev/360d88d3503c186ef1651c0d3ecc2c5b to your computer and use it in GitHub Desktop.
Hide WP Editor For Specific Page Edit Screens
<?php
/*
* Hide WP Editor for Specific Page IDs
* Note: I really should update this to be by page template
*/
function hide_native_wysiwyg_editor() {
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID']; // Get post ID
if( !isset( $post_id ) ) return;
if( $post_id == '17' || $post_id == '33') { // add page ID's
remove_post_type_support('page', 'editor');
}
}
add_action( 'admin_init', 'hide_native_wysiwyg_editor' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment