WordPress.org

Make WordPress Core

#27724 closed defect (bug) (fixed)

Missing resize handle in TinyMCE

Reported by: toscho Owned by: azaozz
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.9
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

If you create a new instance of TinyMCE in the current trunk, the resize handle is missing. This is a regression, it works in 3.8.

Test code:

add_action( 'add_meta_boxes_post', function() {
	add_meta_box( 'resize_test', 'Resize test', function() {
		wp_editor( '', 'resize_test_editor', [ 'resize' => 'vertical' ] );
	});
});

This is rather important for translation plugins where a separate editor is used for each language. The typical workflow is:

  1. Write the original text in the first editor.
  2. Make the first editor smaller and the first translation editor larger, write the first translation.
  3. Make the second editor smaller and the third translation box larger …

The only way to resize the editor is to switch to HTML editor (if that is available), use its resize handle and switch back. Not exactly a good user experience.

Attachments (1)

27724.patch (485 bytes) - added by ocean90 15 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 @SergeyBiryukov15 months ago

  • Milestone changed from Awaiting Review to 3.9

comment:2 @ocean9015 months ago

It seems like before 3.9 the resize handle was enabled by default. The correct code for now is

wp_editor( '', 'resize_test_editor', [ 'tinymce' => [ 'resize' => 'vertical' ] ] );

@ocean9015 months ago

comment:3 @ocean9015 months ago

  • Owner set to azaozz
  • Status changed from new to reviewing

27724.patch changes the default value in wp_editor() for the resize handle.

I think the old TinyMCE setting were theme_advanced_resizing (was true) and theme_advanced_resize_horizontal ( was false).

comment:4 @ocean9015 months ago

  • Keywords has-patch added

comment:5 @azaozz15 months ago

Yes, the setting has changed, but vertical resizing is still enabled by default: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-editor.php#L453

The problem is on the Edit Post screen the first editor sets resize to false, and the second one (the test) doesn't set it back to true. To do that we can move resize to the "per instance" part of the settings.

comment:6 @azaozz15 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 28059:

TinyMCE: make sure vertical resizing and menubar show/hide are set to default for each instance, fixes #27724

Note: See TracTickets for help on using tickets.