Make WordPress Core


Ignore:
Timestamp:
08/29/2014 02:27:06 AM (12 years ago)
Author:
azaozz
Message:

Editor expand: add a filter to turn it off from PHP, fixes #29423

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r29628 r29653  
    1212
    1313wp_enqueue_script('post');
     14$_wp_editor_expand = false;
    1415
    1516if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
    16      ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) ) {
     17     ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
     18     apply_filters( 'wp_editor_expand', true ) ) {
    1719
    1820    wp_enqueue_script('editor-expand');
    19     $_wp_autoresize_on = true;
     21    $_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' );
    2022}
    2123
     
    491493if ( post_type_supports($post_type, 'editor') ) {
    492494?>
    493 <div id="postdivrich" class="postarea<?php if ( get_user_setting( 'editor_expand', 'on' ) === 'on' ) { echo ' wp-editor-expand'; } ?>">
     495<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
    494496
    495497<?php wp_editor( $post->post_content, 'content', array(
     
    500502    'tinymce' => array(
    501503        'resize' => false,
    502         'wp_autoresize_on' => ( ! empty( $_wp_autoresize_on ) && get_user_setting( 'editor_expand', 'on' ) === 'on' ),
     504        'wp_autoresize_on' => $_wp_editor_expand,
    503505        'add_unload_trigger' => false,
    504506    ),
Note: See TracChangeset for help on using the changeset viewer.