You can use a image_send_to_editor filter hook to achieve what you want.
<?php
add_filter( 'image_send_to_editor', 'imagehtmlchange', 10, 8);
function imagehtmlchange($html, $id, $caption, $title, $align, $url, $size, $alt) {
// your banny wrote - put your code here
return $html;
}
?>
Related Posts:
- Default Image Link Removal
- How to display a shortcode caption somewhere other than the_content
- How to filter the image embed code based on link type
- How to change an image source when rendering on frontend?
- How might one programmatically set the link for all images in all posts?
- Programmatically adding images to media library
- Programmatically get images by URL and save in uploads folder
- Can I attach image to post without adding it to post?
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- Is there a simple way to just insert a link to an image (without inserting an image)?
- Remove title attribute from images
- Insert an image into a post by API
- Function to call the attachment image from post
- Get attachment ID of author_meta image – Attachment Metadata
- Filter Media Library by author or post_parent
- How to add a link in a image’s caption?
- Separate attachment images from post loop
- copy attachment title to description and alt text
- Alter image output in content
- How can I remove the image attachment ALT field?
- Open the attachment details modal
- add data-attribute to all images inside the_content()
- Allowing post attachments without allowing to insert in text
- Rename attachments during upload
- Regex to turn embedded images in to attachments
- Change html structure of all img tags in WordPress
- Regenerate missing _wp_attachment_metadata
- Make alt text required when setting a featured image
- Best way to programatically add “rel” attributes to page and post images
- Display one random image, but only if landscape
- get_attachment_id() only get id of first attached image after post update
- Is there a way to get attachment data?
- What’s the proper way to use the get_image_tag filter?
- How to change image url?
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- Custom page template to display all image attachments
- get the image of the post
- media_sideload_image with rewritten urls?
- All Images on wordpress site broken
- Out of memory error reporting
- How can I attach hotlinked images in posts/pages within the same server?
- Multiple images in one attachment page
- WordPress Image Attachment using remote image
- Is there any action/filter hook to use when an image gets edited in the editor?
- Exclude images from “inserted into post” when trying to get attachments
- How to remove attachments size attribute [duplicate]
- WordPress adds extra width to post images container boxes
- Handling image uploads without thickbox
- Link Attachment Image to Category
- Move Image Captions Inside Link ( tag) if Added
- How to add custom classes to figure element only if image has caption?
- Help With Custom Image and Text Widget
- Change align classes for images
- Auto delete attachments that are older than x days
- Images attached to posts from library link to 404 error page
- Help to upload post attachments from Ajax
- Replacing the content of an image attachment using API
- Can’t filter wp_get_attachment_link
- Call to undefined function wp_generate_attachment_metadata()
- Add clickable link on an image
- How do you import images from a URL in your post?
- Get images attached to a specific page
- WordPress Creates Unused (Unregistered) Image Sizes
- How to stop WordPress from completely overriding my tags in my templates?
- How do I link a featured photo to it’s post?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- How to test if there are no more previous or next image on attachment page?
- Show last 12 uploaded images on home page, but only from posts
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Link to full-size image for subscriber only
- How to replace post image url before posting using api?
- How to get post id of first child of the same post type?
- How to change Gallery image url in product page ? In function.php?
- Link to products with the same image title (woocommerce)
- How to get title of images in post content
- How to echo images Urls from a wordpress post, that are relally in the post
- SQL: How to find all attachments that are not used in any posts/pages/custom_post_types
- Allow users to upload attachments to certain posts
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- Image linking and lightbox
- Server peek by Own-IP-Calls?
- Get “Image CSS Class” value from the Advanced Options section
- Dinamically modifying attributes of images on posts
- Uploaded images not showing properly using wordpress
- How can I add an “Attach image to this post/page” link on the Add Media lightbox?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- attachment.php & flexslider—linking thumbnail to specific image
- Create a custom attachment thumbnail for quick page load
- How can I hide previous_image_link() on first attachment page?
- Removing image dimensions from `the_content`
- Upload unnattached image from frontend
- Image attachement management – a philosophical question
- wp_get_attachment_link() add rel attribute if the link points to direct image
- Stop Attachment image names from taking top level permalink
- get_image_tag filter not working
- How can we see which posts don’t have a featured image or it doesn’t exist anymore?
- How to add a link to media file for every image inserted in content?
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- How to get WordPress to resize images for srcset?
- Attachment tag archive