Skip to content

Instantly share code, notes, and snippets.

@jwondrusch
Last active September 13, 2022 18:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jwondrusch/41130a421a2a70b0e697 to your computer and use it in GitHub Desktop.
Save jwondrusch/41130a421a2a70b0e697 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.
<?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