Created
January 20, 2016 05:04
-
-
Save pablocattaneo/3e719869e5a68acc621f to your computer and use it in GitHub Desktop.
Remove de main content editor for a specific page in Wordpress
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
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