#31578 closed defect (bug) (fixed)
Any wp_editor instances would break on RTL languages
Reported by: | maimairel | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.1.1 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
Hi there, there's an issue with RTL languages and additional wp_editor
instances. I'll describe the two things that happened on this ticket.
- When adding any additional
wp_editor
instances on RTL languages, the function_mce_set_direction
would produce a PHP warning.
This is caused by wp-includes/functions.php
, line 2904 on WP 4.1.1:
$input['plugins'] .= ',directionality';
This is because the settings array in _WP_Editors::editor_settings
does not have the plugins
property anymore after the first init.
- The fatal issue would be this one, where the code in step 1 caused another issue on the following initialization JS code.
init = tinyMCEPreInit.mceInit[edId] = tinymce.extend( {}, firstInit, tinyMCEPreInit.mceInit[edId] );
tinymce.extend
would normally extend the editor settings object with a plugins
property, but because of the code in _mce_set_direction
the settings object already has the plugins
property with a value of ,directionality
This caused the additional tinymce instance to display the default buttons.
I hope this gets resolved soon!
Thank you!
Seems we need
isset( $input['plugins'] )
there.