WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't find a specific hook. If I already have added an image to an article via editor and then I edit it, I'd like to intercept the code just before it is sent again to the editor.

I already use 'image_send_to_editor' but it works on the first image insertion, not if the image gets edited.

Can you help me please?

share|improve this question
Did you find such filter? Looking for it too. – Sergey Apr 2 at 13:47
mmm to be true, I didn't remember :P 4 years are too much for me :) But I think the answers below can be interesting too. – Stratboy Apr 3 at 16:04

edit_attachment Runs when an attached file is edited/updated to the database. Action function arguments: attachment ID

This is found deocumented in the Codex under the Action Reference. Please take a closer look at the Codex before posting questions related directly to syntax. :)

share|improve this answer
Well, it doesn't work at all. – Stratboy Aug 31 '12 at 16:50
Great description. – Eric Holmes Aug 31 '12 at 17:07

You'll also be surprised to find that the straightforward answer of using the_content will work, too.

For instance, I wrote an answer to a question on this site that asked how to add a class to the anchor tag on linked images. In some cases, such as when the image is edited after being added, solutions that use image_send_to_editor won't work. You might want to check it out: http://wordpress.stackexchange.com/a/189881/67366

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.