You need to use the filter image_send_to_editor.
add_filter('image_send_to_editor', 'wpse_62869_img_wrapper', 20, 8);
function wpse_62869_img_wrapper( $html, $id, $caption, $title, $align, $url, $size, $alt )
{
return $html;
}
These are the values of a test insert and you can use them to build your own $html response.
html | <a href="http://wp34.dev/wp-content/uploads/2012/11/escritorio.jpg"><img src="http://wp34.dev/wp-content/uploads/2012/11/escritorio-224x300.jpg" alt="Alt text for the image" title="escritorio" width="224" height="300" class="aligncenter size-medium wp-image-9" /></a>
id | 9
caption | The image caption
title | escritorio
align | center
url | http://wp34.dev/wp-content/uploads/2012/11/escritorio.jpg
size | medium
alt | Alt text for the image
Related Posts:
- How to register images uploaded via FTP in media library?
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Adding a custom image upload size and making it selected by default?
- Hide custom image sizes from media library
- Change the filename format of saved featured images
- Create Image Uploader for Widget
- Using file_exists to check file in Uploads
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Rename image uploads with width in filename
- Admin Media grid view images won’t load
- Debugging upload problem: What part of WP does actual image-resizing?
- How to resize image on client-side before upload?
- How to upload imagick resource to media in wordpress
- Image upload via FTP to wordpress media library
- WordPress media upload “HTTP error”
- Validate Uploaded Image using WordPress’ Built-in Functions?
- Get most recent media upload
- Convert all images to PNG on file upload
- How to get media objects
- Can’t upload image using media_sideload_image
- Upload multiple images to a Woocomerce product
- Enable custom logo upload if logo is not in header
- Redirect to another page using contact form 7? [closed]
- WordPress automatically adds links to uploaded images
- WordPress function when file is uploaded, deleted or edited
- zip unzip attachments in wordpress
- Get featured image with custom size outside WordPress
- Images Uploaded saving onto older/previous year folders
- Convert canvas to image and upload image to server
- WordPress İmages Upload & Delete Error
- How to Make Thumbnail of Post Stay Animated
- Convert all uploaded PNG files to PNG-8 format
- Some problems in custom widget
- Checking page before applying image restrictions while uploading
- Change image data durgin upload
- WordPress loading all local images from specific directory?
- Renaming “Expand Details” within “Add Media”
- Save the outputted image into the Media Library, with a different filename and extension
- How to resize an image server-side before upload?
- Name Input from widget displays Sidebar name instead of saved data
- Edit Image/Image Details – Replace button missing
- How to automatically convert images to WebP on WordPress?
- Generate and upload screenshot as featured image for user-submitted post
- Changing upload directory temporarily
- Restricting Image Upload Sizes using ‘wp_handle_upload_prefilter’ – Stuck media progress bar when Featured Image?
- How to change upload directory in wp_handle_upload
- Decrease file size upload in Media
- Conditional Statement – check if post has an attachment image
- Accessing a random image via ajax
- Uploading images to Media Library fails with Memory Exhausted
- Edit image preview is not displayed
- How to upload a media file via FTP and then create an attachment post with it?
- How do I get images (with a thumbnail preview) to show in search results?
- Media library not loading after switching the main site of multisite
- WordPress won’t generate image sizes for certain images
- Change logo based on incoming domain
- Different upload path per file type
- wp_handle_upload – The uploaded file could not be moved to wp-content/uploads/2012/09
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- Cannot display or echo alt text on featured image
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- Image Uploader API
- How to get next image with this code from same post?
- get_children displaying images removed from the page
- “imagejpeg” function is not working in wordpress
- Display image from an external rss feed on wordpress without plugins
- Unable to upload images to the Media Library. Getting this erron on the console wp-admin/async-upload.php 403 (Forbidden)
- Original image not saving?
- Change WordPress Upload Folder using wp handle upload
- Create a post from every image in my media gallery
- Issue with images which have no sizes available
- How to remap one of the TinyMCE Advanced Editor button to open the wordpress media library?
- Where are the src and srcset sizes coming from?
- HTML showing after PHP code in tag
- Get uploaded image and attach it to the new post
- Shortcode function doesnt work without caption
- Why is my max_upload_filesize being limited to 2M? [duplicate]
- Add valid XHTML closing img tags to WordPress galleries
- How to get the filename from file system and create a download link?
- How to change the value “uploaded to” in the media library (WordPress 4.0)
- How to decrease the max file upload size without using php.ini or htaccess?
- Prepend to all image URLs with PHP, only for mobile devices
- Configure WordPress to Use Responsive Image Rendering
- Replace background image with post thumbnail in shortcode
- unsharp thumbnails after uploading image
- Sudden Upload HTTP errors, PHP uploads and memory limits are already to high to my taste. Anything else?
- Get list of posts from attachment
- Get the image title and alt from custom query
- media_handle_upload fails with gravity form submitted image
- Retrieving specific images from Media Library
- Pass php to database in JQuery: With AJAX?
- WordPress will suddenly stop saving files uploaded by my code (ran in nopriv ajax)
- Broken Media Library
- images in wordpress themes
- File Upload with Server in safe_mode
- How do I return an image from a script
- Display Post Titles on top of the_post_thumbnail()
- add if statement to the featured image
- Using Featured Image as Hero Background in Word Press