Hot answers tagged

2

I stumbled on a good and more global solution for this on Isabel Castillo's blog, by using wp_get_attachment_image_attributes filter: function isa_add_img_title( $attr, $attachment = null ) { $attr['title'] = trim( strip_tags( $attachment->post_title ) ); return $attr; } add_filter( 'wp_get_attachment_image_attributes','isa_add_img_title', 10, 2 )...



Only top voted, non community-wiki answers of a minimum length are eligible