Indeed, I only know Wordpress plugins such as Wordpress Flickr Manager . By reading the source code, you could understand how it works and implement your own. I have used this plugin in the past and am doing exactly what you want, a flickr photo in the editor with the correct URL.
Start with FlickrManager.php , function manage_page() , the default value in switch , this is where the plugin shows the panel for adding an image to the message: it creates the short code value in your message, so be sure to check the function image_shortcode() in the same module.
source share