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.
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.