You have a number of options.
You could use the add_filter( 'the_content', 'add_data_attributes' );
And after that find the images attached to the post.
Or you can use the image_send_to_editor
filter more here.
Related Posts:
- Navigate with keyboard in Gallery shortcode
- wp_get_attachment_image_src problem
- What are people using for displaying Image / Media copyright information?
- Insert Images at Master Uniform Height
- Circumventing the normal image upload process
- How to get current image’s slug in WP_image_editor?
- Add CSS class to every image
- Link to File URL by default
- How to Display an Image Uploaded through a Meta Box in a Template?
- Regex to turn embedded images in to attachments
- Removing Title Tag from Thumbnails
- When Uploading JPEGs, Does WordPress Compress the Original Image?
- Regenerate missing _wp_attachment_metadata
- How to make programmatic image upload generate thumbnail and sizes?
- Editing built in Gallery shortcode to filter by categories
- Image with description side by side
- How can i use wp_get_image_editor for image resizing
- Gallery images stored elsewhere (preferably Google Drive)
- WordPress gallery previous/next buttons showing all media library images
- Random popup image per user with no repeat
- Speed of the slider images should be increased in wordpress
- Modifying protexted image sizes: use “add_image_size()” or “update_option()”?
- attach unattached featured images to respective posts
- Confusion about arguments sent to add_image_size
- Is it possible to pull and display a single landscape oriented image
- Remove image classes from post thumbnail output
- Special purpose photos with each post
- WordPress – different icon image depends of comment number
- Change image url size in post editor (when cliking on image)
- Multiple images with Media Uploader on front-end
- Pull Random Attachments With Pagination
- image uploaded cant be shown
- Turn off image captions in gallery view?
- How to get default image sizes attribute
- Unyson Framework doesn’t show gallery images
- add_shortcode to capture URL screenshot not loading correctly
- Broken Images until Page Refresh
- Show image crop window on image upload
- Gallery with thumbnail carousel
- Uploaded images not displaying in network site
- Omit image captions from get_the_content()
- Specific image size is being generated without being registered
- How to limit the number of images displayed in the media window?
- Should I not compress my jpeg files before uploading to avoid double compression?
- Is it possible to preserve original images in order to change image size later?
- Generating a certain sized thumbnail on the fly?
- Need custom picture field for pages
- Only make custom image size if uploaded via Thickbox and attached to certain page
- Link listings with image
- Allow users to contribute images to a post
- How to add onclick event to widget image
- After Migration, images show up on a preview of the page but not the actual page [closed]
- Use default image as var
- How to apply image alt descriptions from media library?
- Specify automatically the height and weight of the images
- Image upload error?
- How to crop images in a certain size only for a certain page?
- How to pass on a value as parameter via url to another page
- Image not showing using a custom function and get_post_meta
- Random home page background images with caption text
- Cache issues with images not showing up
- Specific Days, Specific image on Front Page
- How to change image’s author via a function when using GravityForms uploader? [closed]
- Using different size thumbnails on different parts of my site… with functions.php?
- Serving Images from subdomain in wordpress
- Hover a css icon width other color inside wp_get_attachment_image
- Pictures randomly replaced by blue question mark
- WordPress PHP custom function is causing 500 Internal Server Error Connection Timeout
- Can’t upload Images to WordPress – Error 500 Response
- Post-processing of the image failed
- Get post thumbnail in specific size
- How to skip the creation of landscape thumbnails for an original portrait image
- Why are my button images blurry on mobile screens?
- Text not wrapping properly around image in WordPress Visual Editor [closed]
- How to show only one image in homepage
- Broken imges after moving wordpress website from localhost to server [closed]
- How to regularly backup and update WordPress website with lot of images?
- Resize images to match CSS
- Featured image appears in header
- Preventing the image-post problem from ahead (edit: without redirects)
- click on Gallery picture but pictures doesn’t appear
- How to Generate Custom Image Size in Uploads Folder?
- How to put images into theme from server folder (not from media library)
- How can I stop WP Image Editor upscaling from looking so pixellated?
- set specific dimension or minimum upload size [duplicate]
- Select image and display from textfield?
- How to show images uncropped after uploading?
- add_image_size() width not actually working
- Black and White Thumbnail in WordPress Gallery
- Upload button in metabox not working
- Saving a post, content filtering and user levels
- (Dynamically) Decrease the actual image size for downloads
- Are image addresses security relevant?
- wordpress images not display [closed]
- Parallax image problem
- While doing a bulk upload the Media Images are showing blank?
- Get content from one WordPress website to another
- How to import external media items into wordpress media library (without using storage)
- How to return responsive images from a sanitize_callback?
- WordPress Site Broken and it gives Headers Already sent error