Last active
October 16, 2016 21:11
-
-
Save islandjoe/f9895e205346ef916c057e519fe48c6d to your computer and use it in GitHub Desktop.
WordPress hide editor on specific admin page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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