Forked from jwondrusch/wordpress-disable-distraction-free.php
Created
October 27, 2016 15:38
-
-
Save hiphopsmurf/f9f8d1770f3ec9d9c6edb932d39bf0f3 to your computer and use it in GitHub Desktop.
Disable Distraction Free Writing Mode and Full Height Editor editor based on a list of post types.
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 | |
| /** | |
| * Disable Distraction Free Writing Mode and the "Auto Expanding" | |
| * height of the editor based on a list of post types. | |
| * | |
| * @return void | |
| */ | |
| function my_deregister_editor_expand($val, $post_type) | |
| { | |
| $disabled_post_types = array('custom_post_type'); | |
| return !in_array($post_type, $disabled_post_types); | |
| } | |
| add_filter('wp_editor_expand', 'my_deregister_editor_expand', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment