WordPress.org

Ready to get started?Download WordPress

Forums

Why wp_get_attachment_link is using filename as title attribute? (1 post)

  1. Marco Panichi
    Member
    Posted 10 months ago #

    Actually wp_get_attachment_link (called inside the gallery shortcode) function is using the filename of the image to fill the title tag:

    <a rel="gallery-1" href="[...]/uploads/2013/06/dorepicture.png" title="dorepicture" class="cboxElement">
    	<img width="150" height="150" src="[...]/uploads/2013/06/dorepicture-150x150.png" class="attachment-thumbnail" alt="website screenshot">
    </a>

    I need to change this behaviour, in order to show the title in the gallery. So:

    <a rel="gallery-1" href="[...]/uploads/2013/06/dorepicture.png" title="My website screenshot!" class="cboxElement">
    	<img width="150" height="150" src="[...]/uploads/2013/06/dorepicture-150x150.png" class="attachment-thumbnail" alt="website screenshot">
    </a>

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 10 months ago by Marco Panichi
  • This topic is not resolved
  • WordPress version: 3.5.1