From fcc188193f8755a2b38947f2a421f16b1e013bdd Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 29 Aug 2014 02:27:06 +0000 Subject: [PATCH] Editor expand: add a filter to turn it off from PHP, fixes #29423 git-svn-id: https://develop.svn.wordpress.org/trunk@29653 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-advanced.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 9356b1a245..6a1bc06ff4 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -11,12 +11,14 @@ if ( !defined('ABSPATH') ) die('-1'); wp_enqueue_script('post'); +$_wp_editor_expand = false; if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() && - ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) ) { + ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) && + apply_filters( 'wp_editor_expand', true ) ) { wp_enqueue_script('editor-expand'); - $_wp_autoresize_on = true; + $_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' ); } if ( wp_is_mobile() ) @@ -490,7 +492,7 @@ do_action( 'edit_form_after_title', $post ); if ( post_type_supports($post_type, 'editor') ) { ?> -
+
post_content, 'content', array( 'dfw' => true, @@ -499,7 +501,7 @@ if ( post_type_supports($post_type, 'editor') ) { 'editor_height' => 300, 'tinymce' => array( 'resize' => false, - 'wp_autoresize_on' => ( ! empty( $_wp_autoresize_on ) && get_user_setting( 'editor_expand', 'on' ) === 'on' ), + 'wp_autoresize_on' => $_wp_editor_expand, 'add_unload_trigger' => false, ), ) ); ?>