Opened 6 years ago
Closed 6 years ago
#45289 closed defect (bug) (worksforme)
wp.editor.initialize not working
Reported by: | otgschristian | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.0 |
Component: | TinyMCE | Keywords: | needs-patch reporter-feedback |
Focuses: | Cc: |
Description
WP 4.8 introduced some js methods to dynamically initialise / remove TinyMCE instances.
wp.editor.initialize() wp.editor.remove() wp.editor.getContent()
Working perfectly with last stable WP, but not with WP 5.0 (tested up to beta 3). The functions are no longer defined:
wp.editor.initialize is not a function
References:
https://make.wordpress.org/core/2017/05/20/editor-api-changes-in-4-8/
Change History (7)
#3
@
6 years ago
Found out that ' wp-api-request' is no longer loaded by default. Adding 'wp-editor' as script dependency for the script using the above mentioned functions and it's working as again.
If this is expected feel free to close the ticket.
#4
@
6 years ago
- Keywords reporter-feedback added
Thank you for the bug report, @otgschristian!
Do you have a sample of how you enqueued the JavaScript that caused this error?
#5
@
6 years ago
@pento thanks for looking at it.
Here a simple plugin that shows the issue: https://github.com/CGlingener/wp-45289
Addition: when using WP5.0 b3 with the last Gutenberg version from Github as standalone plugin I do not have the issue (while writing this it's version 4.2.0-rc.1).