[wp-trac] [WordPress Trac] #45221: FIx the TInyMCE init array in script-loader

WordPress Trac noreply at wordpress.org
Mon Oct 29 17:33:55 UTC 2018

#45221: FIx the TInyMCE init array in script-loader
 Reporter:  azaozz        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  5.0
Component:  TinyMCE       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
 The "TinyMCE init array" in script-loader mostly duplicates the "default"
 init array in class-wp-editor. However there are few differences that can
 cause regressions in themes and plugins.

 1. The init array is outputted by `$scripts->localize()` which is intended
 only for strings and the output is JSON encoded. This breaks some of the
 TinyMCE settings (added by plugins) as they must be raw js. For example
 the setting for `init_instance_callback` must be a "callable" js function,
 or it throws exception on loading.
 2. Currently in script-loader there is some code that does JSON decoding
 of the `style_formats` setting. However that may not be JSON encoded
 resulting in an JSON decode error and an empty string.

Ticket URL: <https://core.trac.wordpress.org/ticket/45221>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list