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

WordPress Trac noreply at wordpress.org
Sat Feb 6 00:41:37 UTC 2016


#35760: Provide API for TinyMCE editor to be dynamically instantiated via JS
-------------------------+-----------------------------
 Reporter:  westonruter  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Editor       |    Version:
 Severity:  normal       |   Keywords:
  Focuses:  javascript   |
-------------------------+-----------------------------
 There is apparently no easy way currently to bootstrap the TinyMCE content
 editor dynamically via JS, that is to initialize one or more editors after
 page load. There is a PHP API to embed an editor into a page statically
 via `wp_editor( $content, $editor_id, $settings )` but this does not work
 with JS (see #26295).

 It would be great if there was a proper JS API for spinning up new TinyMCE
 editors with all of the WordPress extensions and plugins. For example:
 `var editor = new wp.Editor( container, settings );`

 Ideally the required assets for the editor could be lazy-loaded instead of
 being loaded all up-front with the initial request.

 With an API for initializing an editor with JS, it would then be greatly
 simplified to do things like:

 * Create a Customizer control for a rich text editor.
 * Add rich text editing to a Text widget (#35243)
 * General content in the Customizer (#34923)
 * General frontend editing.

 For more background, see conversation:
 https://wordpress.slack.com/archives/core/p1454615457001581

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


More information about the wp-trac mailing list