The same for me, the images do not have attribute title=””, although i write it in caption field in Wp media manager. How can i add title to image???
thank you in advance!
You can use a WordPress core filter to do this:
add_filter('wp_get_attachment_image_attributes', function($attr, $attachment){
$attr['title'] = trim(strip_tags( $attachment->post_excerpt ));
return $attr;
}, 10, 2);