WordPress Attachment “Alt” Text Priority

Today  I was muddling around with gallery images’ captions/alt text/descriptions. I came to realize that I had no clue in what order WordPress retrieved the alt text for attachments; I knew from experience that it checked several places. The order is:

  1. Use Alt field first
  2. If not, Use the Caption
  3. Finally, use the title

This comes straight from the comments of `wp_get_attachment_image` as of WP 3.7 RC2.

Leave a Reply

Your email address will not be published. Required fields are marked *