diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index bc452a0776..993856d927 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -53,9 +53,13 @@ $_content_editor_dfw = false; * @param bool $expand Whether to enable the 'expand' functionality. Default true. * @param string $post_type Post type. */ -if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() && - ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) && - apply_filters( 'wp_editor_expand', true, $post_type ) ) { +$_wp_editor_expand_enabled = apply_filters( 'wp_editor_expand', true, $post_type ); + +if ( post_type_supports( $post_type, 'editor' ) + && ! wp_is_mobile() + && ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) + && $_wp_editor_expand_enabled +) { wp_enqueue_script( 'editor-expand' ); $_content_editor_dfw = true;