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
- How to draw media details for Isotope gallery using Photoswipe
- Hide old attachments from wp media library
- Image Upload “exceeds the maximum upload size for this site”, but php.ini is correct
- Failed media upload: “The uploaded file was only partially uploaded.”
- Uploading images: ‘ø’ get replaced with ‘ø’
- How to get custom image size for image uploaded in Customizer
- Restrict WordPress File Type Uploads by User Type
- Assign a picture URL to a page via PHP
- Upload a json file in php [closed]
- Styling images coming from another blog
- Custom image upload
- How to scale image with equal width and height without distortion?
- IMG src weird behaviour inside a single post loop
- Display post image with fancybox
- Upload Image in a WordPress page using PHP
- PHP code to call image Caption, Alternative Text, and Decription?
- How to order images in a post in WordPress 3.3?
- Change the URL of an image from wp_get_attachment_image_src except in the frontpage
- Why is $_REQUEST an empty array in admin-ajax.php?
- Best practice for migration friendly images in posts/pages?
- Get the post ID and display the images
- Responsive Header for Phone
- Upload file could not be moved to wp-content/uploads
- How to make own crop image function for WordPress plugin
- WordPress Media Library showing wrong preview size?
- Upload multiple images and insert them into custom html code
- Uploaded images not displaying in network site
- How do I Import / Upload Files with jQuery AJAX?
- How to limit the number of images displayed in the media window?
- Clickable image link sends people to wrong URL
- Get images attached to a specific page
- Timthumb.php image gallery not working on Multisite WordPress
- Upload multiple files in randomly generated folder using wp_upload_bits
- Change default gallery images – Currently they are displaying full size imagese
- Creating black and white copy of an image [closed]
- How do I increase the upload size only when editing special pages?
- How to set a featured image (thumbnail) with PHP?
- Displaying images outside the content
- Hook on file upload
- Update Images after edit via php
- AJAX and custom pages
- How to get the url of the entry in which an image belongs
- overwrite wordpress gallery with custom gallery shortcode
- Change upload URL by mime type
- Crop an image after upload on custom account page
- Restrict File Type Uploads by User on Wordress via functions.php
- How do I routinely extract the thumbnail of the most recent post?
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Creating image gallery in wordpress
- Image limit from 1 to 5
- Gallery requires a featured image but does not show it in posts/pages
- How do I change a Themes Header Image?
- Media Library is not loading on grid view in admin panel
- Blurry Images WordPress 5.8.1
- My subdirectory sites images (except webP) are throwing to 404 page even they are exist
- Understanding responsive imagery
- WordPress directories not writable after PHP version upgrade