Last active
March 25, 2020 14:50
-
-
Save morgyface/50b03079eb957fd3b29a6b8a81ea0a16 to your computer and use it in GitHub Desktop.
WordPress | Remove the default editor from templates
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
| <?php | |
| // Removes the default editor | |
| add_action('admin_head', 'hide_editor'); | |
| function hide_editor() { | |
| $template_file = $template_file = basename(get_page_template()); | |
| $excluded = array( | |
| 'home-page.php', | |
| 'search-page.php' | |
| ); | |
| foreach ($excluded as $template){ | |
| if ($template_file == $template) { | |
| remove_post_type_support('page', 'editor'); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment