Skip to content

Instantly share code, notes, and snippets.

@islandjoe
Last active October 16, 2016 21:11
Show Gist options
  • Save islandjoe/f9895e205346ef916c057e519fe48c6d to your computer and use it in GitHub Desktop.
Save islandjoe/f9895e205346ef916c057e519fe48c6d to your computer and use it in GitHub Desktop.
WordPress hide editor on specific admin page
<?
add_action( 'admin_head', function() {
global $pagenow;
if ( !('post.php' == $pagenow) ) return;
global $post;
// Get the Post ID.
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
if( !isset( $post_id ) ) return;
// Here we use the page's slug (e.g., wedding-package)
if('wedding-package' == $post->post_name){
remove_post_type_support('page', 'editor');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment