X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/41578db67d72562346e4dbb2a14889b23d522813..48ab98cb1779cf2088c1351ac3dd3d0da6fb31d3:/wp-admin/edit-form-advanced.php diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 8dc48150..ebda7a3f 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -11,6 +11,22 @@ if ( !defined('ABSPATH') ) die('-1'); wp_enqueue_script('post'); +$_wp_editor_expand = false; + +/** + * Filter whether to enable the 'expand' functionality in the post editor. + * + * @since 4.0.0 + * + * @param bool $expand Whether to enable the 'expand' functionality. Default true. + */ +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 ) ) { + + wp_enqueue_script('editor-expand'); + $_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' ); +} if ( wp_is_mobile() ) wp_enqueue_script( 'jquery-touch-punch' ); @@ -176,7 +192,7 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) { if ( post_type_supports($post_type, 'page-attributes') ) add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); -if ( $thumbnail_support ) +if ( $thumbnail_support && current_user_can( 'upload_files' ) ) add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low'); if ( post_type_supports($post_type, 'excerpt') ) @@ -483,15 +499,16 @@ do_action( 'edit_form_after_title', $post ); if ( post_type_supports($post_type, 'editor') ) { ?> -
+
post_content, 'content', array( 'dfw' => true, 'drag_drop_upload' => true, 'tabfocus_elements' => 'insert-media-button,save-post', - 'editor_height' => 360, + 'editor_height' => 300, 'tinymce' => array( 'resize' => false, + 'wp_autoresize_on' => $_wp_editor_expand, 'add_unload_trigger' => false, ), ) ); ?>