[wp-trac] [WordPress Trac] #26872: TinyMCE 4.0 and missing/changed ID attributes

WordPress Trac noreply at wordpress.org
Sun Jan 19 21:25:59 UTC 2014


#26872: TinyMCE 4.0 and missing/changed ID attributes
--------------------------+--------------------
 Reporter:  GregRoss      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  TinyMCE       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  close         |
--------------------------+--------------------

Comment (by azaozz):

 Replying to [comment:6 GregRoss]:
 > Tinymce.on won't work for me as my javascript could execute before the
 tinymce object is created

 It would. TinyMCE is loaded on `'admin_print_footer_scripts'` with
 priority of 50: https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/class-wp-editor.php#L158. You can output a small script on the
 same action with priority of 51 that will "bootstrap" the rest of your JS.

 > ...the trigger looks like it could work, but would require different
 code for 3.8 and  3.9.

 Think that custom event will be quite useful for many plugins. Can
 probably be used in core too. That would make it much easier to hook into
 the editor instance and run some JS pretty much in the same way as from a
 TinyMCE plugin.

 > Lots of ways to get around the issue.

 Yep, or can simply use `$('#wp-content-editor-container .button-class')`.
 jQuery is optimized to handle these selectors nicely.

 > The mce_#s kind of seem useless now as you can't use them to identify
 any given button, only a random button.

 As far as I see they are intended for internal use. TinyMCE has API
 methods for selecting and manipulating all UI elements.

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


More information about the wp-trac mailing list