Opened 9 years ago
Last modified 6 years ago
#43045 new enhancement
Trigger events equivalent to editor:image-edit and editor:image-update in media-image-widget.js
| Reported by: | danielbachhuber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Widgets | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: | javascript |
Description
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.
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Discovery should be done to see why these events aren't firing.