Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#45117 closed defect (bug) (duplicate)

Fix defining of the TinyMCE settings in script-loader

Reported by: azaozz Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords:
Focuses: Cc:


Following up from [43723] and https://github.com/WordPress/gutenberg/issues/8670.

[43723] copied some of the ThinMCE init array settings from class-wp-editor.php to script-loader.php. However it didn't include the "translation" from PHP to JS which resulted in the above GH issue. Similar problems (with JSON encoded strings) may exist in other complex TinyMCE settings added by plugins, like style_formats_merge formats, etc. see https://www.tiny.cloud/docs/configure/content-formatting/#formats.

Change History (3)

#1 @azaozz
3 years ago

Ideally the TinyMCE init settings should be abstracted in class-wp-editor.php and then used in script-loader. If that's likely to cause problems and we must duplicate that code (needs more looking into), we should add the "by-hand" translation from PHP to JS for the settings array, see https://core.trac.wordpress.org/browser/branches/5.0/src/wp-includes/class-wp-editor.php#L723.

That will also support using a JS function for some settings, which is somewhat common.

Last edited 3 years ago by azaozz (previous) (diff)

This ticket was mentioned in Slack in #core by azaozz. View the logs.

3 years ago

#3 @azaozz
3 years ago

  • Milestone 5.0 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Lets close this in favor of #45221. It will be fixed by the patch there.

Note: See TracTickets for help on using tickets.