[wp-trac] [WordPress Trac] #43045: Trigger events equivalent to editor:image-edit and editor:image-update in media-image-widget.js

WordPress Trac noreply at wordpress.org
Mon Jan 8 20:51:25 UTC 2018


#43045: Trigger events equivalent to editor:image-edit and editor:image-update in
media-image-widget.js
-----------------------------+----------------------------
 Reporter:  danielbachhuber  |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Future Release
Component:  Widgets          |    Version:
 Severity:  normal           |   Keywords:
  Focuses:  javascript       |
-----------------------------+----------------------------
 The `wpeditimage` TinyMCE plugin has helpful `editor:image-edit` and
 `editor:image-update` events for hooking additional metadata onto the
 Image object. Here's an example:

 {{{
 wp.media.events.on('editor:image-edit',function(event){
         event.metadata.pinterest_text = event.editor.$(event.image).attr
 ('data-pin-description');
 });
 wp.media.events.on('editor:image-update',function(event){
         event.editor.$(event.image).attr('data-pin-description',
 event.metadata.pinterest_text);
 });
 }}}

 Although the new Image Widget reuses the `image-details` frame, it doesn't
 fire these equivalent events, making integration difficult. It would be
 helpful if the `ImageWidgetControl` implemented equivalent events.

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


More information about the wp-trac mailing list