How to manipulate “add media” pop-up

Is there any way to add your own button next to “insert into post” button on the “add media” pop-up? I would like the button to add my own shortcode tags around the inserted image.

The desired result:

[myshortcode]<a href="https://wordpress.stackexchange.com/questions/64801/link"><img scr="img.jpg" /></a>[/myshortcode]

instead of just:

<a href="https://wordpress.stackexchange.com/questions/64801/link"><img scr="img.jpg" /></a>

1 Answer
1

There’s no easy way to add a new button at present, however the “image_send_to_editor” filter will let you modify the HTML that is returned for the post insertion.

Leave a Comment