[wp-trac] [WordPress Trac] #39423: Create add_editor_script, analogous to add_editor_style (add JavaScript to TinyMCE)

WordPress Trac noreply at wordpress.org
Sun Jan 1 21:37:55 UTC 2017


#39423: Create add_editor_script, analogous to add_editor_style (add JavaScript to
TinyMCE)
---------------------------+------------------------------
 Reporter:  paulschreiber  |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Editor         |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------
Changes (by azaozz):

 * keywords:   => close


Comment:

 Don't think this is a good idea. If you want to run js or manipulate the
 DOM in the editor iframe, you should use "proper" plugin. TinyMCE has
 extensive APIs for that, look at `editor.dom` and `editor.$` (which is
 pretty similar to jQuery but inside the contenteditable body).

 If you cannot use the editor APIs, you should look into using `wpview`
 that will insert an iframe and make it non-editable.

 Also `add_editor_style()` extends and exposes an existing TinyMCE setting,
 see: https://www.tinymce.com/docs/configure/content-
 appearance/#content_css. Adding arbitrary JS to the editor iframe is not
 supported.

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


More information about the wp-trac mailing list