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?
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. 🙂
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: https://wordpress.stackexchange.com/a/189881/67366