Created
January 29, 2014 20:28
-
-
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
This file contains 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
// 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