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 save WordPress post and attachment images from front end using media library?
- Retrieve alt text by referencing the img src
- Show next image in array if page is revisited by same logged user
- WordPress append -1 to the image name
- async upload not working when not logged
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- Change the URL of an image from wp_get_attachment_image_src for Product Posts based on Category
- Update Images after edit via php
- not outputting medium size image URL
- Configure WordPress to Use Responsive Image Rendering
- How to use data URL in WordPress?
- Replace background image with post thumbnail in shortcode
- Resize post thumbnail
- Where Do Image Dimensions Get Added To A Filename?
- I have a background-image in css file but don’t show in site.how to fix this prblm. i sent screenshot. thx
- How do I stop an Image Address from loading in the Browser?
- Trying to generate a CSS file in wordpress uploads folder
- Could creation of various image sizes cause slow form submission response?
- unsharp thumbnails after uploading image
- AJAX and custom pages
- How to get the url of the entry in which an image belongs
- How to add a PHP scripts into WordPress
- overwrite wordpress gallery with custom gallery shortcode
- Maximum file Upload
- Using custom php to connect to database blocks wp from accessing galery pictures
- Sudden Upload HTTP errors, PHP uploads and memory limits are already to high to my taste. Anything else?
- Featured images duplicating and replacing next image
- Change upload URL by mime type
- Get list of posts from attachment
- I can’t load my images from a js file using wp_localize_script
- Images uploaded via Gutenberg image block are cropped
- How to create an unordered list of images separate from the content
- Right path for renaming a file in uploads folder
- Get the image title and alt from custom query
- How to include different html tags in the header for different pages?
- How to handle a lot of media files in the uploads folder? (+10.000)
- How to always display full size image
- I want url from a file in media using title file
- what’s the syntax for if the image exists get the image?
- WordPress file upload
- Broken images in media library
- Upload images from one server to an other in wordpress
- Crop an image after upload on custom account page
- media_handle_upload fails with gravity form submitted image
- Restrict File Type Uploads by User on Wordress via functions.php
- Images are not getting uploaded
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- wp_delete_attachment not working with multiple values
- Retrieving specific images from Media Library
- Redimension thumbnail crop without creating new images
- How do I routinely extract the thumbnail of the most recent post?
- How to change this internal image link parameter using PHP?
- add class to background image
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set