How do I filter title and alt attributes in the gallery shortcode?
The shortcode is parsed by gallery_shortcode(), which calls wp_get_attachment_link(), which in turns calls wp_get_attachment_image(). This latter function writes the <img> tag with the title attribute. You’re lucky, because the attributes are filtered through wp_get_attachment_image_attributes, so you can hook into that and remove the title. To do this, you attach the hook before you call the … Read more