[wp-trac] [WordPress Trac] #35760: Provide API for TinyMCE editor to be dynamically instantiated via JS

WordPress Trac noreply at wordpress.org
Thu Jan 26 06:21:15 UTC 2017


#35760: Provide API for TinyMCE editor to be dynamically instantiated via JS
-------------------------+-------------------------
 Reporter:  westonruter  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.8
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  javascript
-------------------------+-------------------------

Comment (by azaozz):

 Been thinking what would work best. As this is going to be "pure JS" way
 to load the needed parts for the editor, skipping most (all?) PHP filters
 that are currently in class-wp-editor.php seems better. This will avoid
 interference from current plugins.

 Instead of the PHP filters, we can fire custom jQuery events before
 initializing each editor instance, passing the settings. This will allow
 plugins to modify them similarly to using the PHP filters. To make it
 easier for the plugins, we would need to add another PHP filter or action
 to trigger loading of these scripts.

 The plan is to make another function similar to `wp_editor()` which will
 either output the script tags or return the src and scripts as strings so
 they can be lazy-loaded (we still have to output the translations and the
 settings from PHP). Then on the JS side will have a small function to load
 the scripts and CSS (if not already loaded) then initialize the editor
 firing the above events.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35760#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list