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?
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Filter to remove image dimension attributes?
- Programmatically adding images to media library
- Programmatically get images by URL and save in uploads folder
- how to get original image using wp_get_attachment_image_src
- Can I attach image to post without adding it to post?
- remove links from images using functions.php
- 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)?
- Disable image attachment links
- wp_get_attachment_image_src and server path
- How to find attachment by it’s name?
- Change WordPress image URLs via filter
- Always use for post images
- Change html structure of all img tags in WordPress
- Remove title attribute from images
- How do I delete all generated images from my server except those currently used in posts
- Insert an image into a post by API
- Function to call the attachment image from post
- hook into completed image upload filter
- Theme Customiser Image Control
- How can I hide media library images from general users?
- Get attachment ID of author_meta image – Attachment Metadata
- Associate an existing image with a post
- Need help building a filter to edit the output of “image_send_to_editor”
- Programatically creating image attachments from local URLs and setting featured image
- Filter Media Library by author or post_parent
- Preview Image Path in Admin Section
- How to add a link in a image’s caption?
- How do i upload an image and return the image id?
- Get Attachment ID from URL [duplicate]
- How to remove title attribute from gallery links and images
- Separate attachment images from post loop
- copy attachment title to description and alt text
- Get an image from url in front end submission form
- Alter image output in content
- How can I remove the image attachment ALT field?
- Open the attachment details modal
- How to upload image without post ID using the new media uploader?
- How do I delete thousands of unattached images?
- add data-attribute to all images inside the_content()
- Allowing post attachments without allowing to insert in text
- Applying class to links around self hosted images embedded to posts/pages
- Rename attachments during upload
- Filter to modify post_title after image upload?
- How can I get a different image size, if all I have is the link?
- How to remove link from an image in a post?
- Regex to turn embedded images in to attachments
- Re-process Images
- Show prev and next post links for parent post of current image in attachment page?
- Pulling Post Image Attachments in WordPress 3.9
- Change html structure of all img tags in WordPress
- Link Featured Thumb to Attachment Page, If Possible
- 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
- Image still linked as attachment to page even though it has been deleted
- Disable wordpress image sizes generation
- Remove ‘wp-content/themes/themename/’ from Image path
- Extend core block attributes in post content
- Display one random image, but only if landscape
- get_attachment_id() only get id of first attached image after post update
- Why can I not view image attachment pages?
- 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?
- Add a new data attribute in tag
- 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
- Link to full size image or attachment page in photo theme
- get the image of the post
- add the post as canonical for attachment page wordpress
- How to get image ID to use inside wp_read_image_metadata()?
- media_sideload_image with rewritten urls?
- All Images on wordpress site broken
- Add an attribute to attachments
- 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
- Pull images from the gallery
- Link Attachment Image to Category
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Customizing the attachement page to show rest of all images in a gallery from post
- Move Image Captions Inside Link ( tag) if Added
- Is it possible to change ‘Link to’ in all images in all articles?
- 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