You will need to take a look at the image_send_to_editor filter.
This will not update existing records but it if you get it working it will apply to each newly inserted image.
very basic filter:
function give_linked_images_class($html, $id, $caption, $title, $align, $url, $size, $alt="" ){
$html; //contains the string you need to edit, you might want to consider to rebuild the complete string.
return $html;
}
add_filter('image_send_to_editor','give_linked_images_class',10,8);
Related Posts:
- How to get title of images in post content
- Removing image dimensions from `the_content`
- Filter to remove image dimension attributes?
- Change WordPress image URLs via filter
- Always use for post images
- Change html structure of all img tags in WordPress
- Default Image Link Removal
- Remove title attribute from images
- hook into completed image upload filter
- Need help building a filter to edit the output of “image_send_to_editor”
- Filter Media Library by author or post_parent
- Preview Image Path in Admin Section
- How to display a shortcode caption somewhere other than the_content
- Alter image output in content
- How can I remove the image attachment ALT field?
- Filter to modify post_title after image upload?
- Change html structure of all img tags in WordPress
- Disable wordpress image sizes generation
- Extend core block attributes in post content
- What’s the proper way to use the get_image_tag filter?
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- How to get image ID to use inside wp_read_image_metadata()?
- Modify Image Source With The_Content Filter?
- Extracting gallery images in WordPress 3.5 on index.php
- Is there any action/filter hook to use when an image gets edited in the editor?
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- How to add custom classes to figure element only if image has caption?
- Change align classes for images
- How to filter the image embed code based on link type
- Add custom text in the media library image meta area
- WP 5.3 Removing Default WordPress Image Sizes
- Omit image captions from get_the_content()
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Remove Image Sizes in Media Settings Page
- How can I use wp_save_image_editor_file filter?
- How to stop WordPress from completely overriding my tags in my templates?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- the_content not showing responsive image attributes srcset or sizes
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- How can I change the to for lazyload wp smilies
- How to display a warning when an uploaded image is too small?
- How to remove image size inline style in article and include caption
- How to change an image source when rendering on frontend?
- How to change Gallery image url in product page ? In function.php?
- How to generate alt attributes with php / filters?
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- js alert in add_filter function for image_send_to_editor
- Why do images inserted in the post content via the_content() go off the max-width?
- Dinamically modifying attributes of images on posts
- How to attach post ID to image links in WordPress tinymce editor
- How to best adjust images to a max content width of 490px?
- image_send_to_editor filter – Unwanted paragraphs and line breaks
- How might one programmatically set the link for all images in all posts?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- Surround uploaded image link with div
- Rename uploads filenames to POST-ID on upload
- Show uploaded images in full size
- How to access & display images from a post without textual content ( and vice versa) according to best wordpress practices
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to add a link to media file for every image inserted in content?
- Replace image with its alt text?
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Neither intermediate_image_sizes_advanced or intermediate_image_sizes filter is firing
- ‘Add Media’ to post – filter images
- ‘apply_filters’ is breaking some shortcodes/HTML but not all
- get_post_gallery with Gutenberg
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- Add aditional class to get_avatar when showing image
- Double thumbnails?
- No srcset for hard-cropped thumbnails
- Loop through child images of a parent for a Nivo Slider
- Adjusting caption below single post image
- embed the_content
- Resizing image into thumbnail, small, medium and large options greyed out
- Show media url immediately after upload in media uploader
- Publish/Update post is changing image links from file url to post url
- How to open default wp image editor screen dynamically?
- update_post_meta attachment_image_alt description for Gutenberg
- Auto delete attachments that are older than x days
- Image increasing kb on resize
- 409 error (Conflict) when trying to insert an image into a post
- Exclude image titles from search results
- Thumbnails generated by “add_image_size” are not removed when removing media
- WordPress 3.0 embedded images
- TImthumb not working for absolute path
- Correctly implementing the Facebook Like button
- Store in media library image uploaded from url
- Get images attached to a specific page
- add_image_size function not working
- image resizing on post content without css and html tags
- Stop WordPress compressing images? – Quality is terrible
- wordpress add image size crop function not working in version 3.8
- Doing a bulk replace of images through back-end
- How to change a theme’s footer image
- How to wrap pattern-matches from the_content in [wiki]-shortcode tags
- WordPress 4.4.2 upload give error, can’t write is upper directory allowed to be written
- How to attach 1000’s of unattached images
- Unable to delete images in Media Library
- Getting featured image of blog page rather than post image
- image doesn’t display when option on product page chosen