I am displaying a post gallery inside a custom post type, using the following in my single-custom.php template:
<?php echo do_shortcode('[gallery id="'.$post->ID.'" link="file" columns="5" orderby="menu_order"]'); ?>
One of the things included in the output is title="filename"
in the <img>
tag, like so:
<img width="150" height="150" src="http://mydomain.com/wp-content/uploads/DSC_0036-150x150.jpg" class="attachment-thumbnail" alt="DSC_0036" title="DSC_0036" />
I do not want to output the title attribute. Mostly, I don't want crappy filenames in the hover-over text, but there are hundreds of images and I'm not prepared to go into the Media Gallery and edit the title for each one. I'd prefer to also change the alt
attribute to the post name, perhaps.
Is there a way to filter the gallery to output the post name in the alt and title attributes, instead of the filename?