[wp-trac] [WordPress Trac] #34823: image_send_to_editor filter is not fired when an Image is edited or replaced in TinyMce

WordPress Trac noreply at wordpress.org
Wed Oct 5 18:45:16 UTC 2016


#34823: image_send_to_editor filter is not fired when an Image is edited or
replaced in TinyMce
-------------------------------------+-------------------------------------
 Reporter:  nicola.peluchetti        |       Owner:  adamsilverstein
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:
Component:  Media                    |     Version:  4.3.1
 Severity:  normal                   |  Resolution:  wontfix
 Keywords:  needs-docs reporter-     |     Focuses:  ui, javascript, docs,
  feedback                           |  administration
-------------------------------------+-------------------------------------
Changes (by adamsilverstein):

 * status:  assigned => closed
 * resolution:   => wontfix
 * milestone:  4.7 =>


Comment:

 Replying to [comment:9 nicola.peluchetti]:
 > Replying to [comment:6 adamsilverstein]:
 > Hi @adamsilverstein, thanks for looking into this.
 > I think that the Javascript solution you proposed is appropriate, could
 that solution work even on the first insert and not only on edity? I'm
 asking because it would make more sense to have the code and the logic
 only in one place instead of sharing it between PHP and JS.

 I looked into this and I think php may be the simplest bet for the insert
 which is handled quite separately from an edit of existing content.
 looking at wp.media.editor.insert i do see that you can override the
 default behavior by creating a (global) window.send_to_editor function,
 but the code would need to be completely different and we don't fire any
 type of event here you can hook into other than possibly
 `mceInsertContent`.

 Good luck! Closing this as wontfix.

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


More information about the wp-trac mailing list