Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9419 closed defect (bug) (duplicate)

WordPress and image alt tags

Reported by: carolinem Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7.1
Component: Media Keywords: 2nd-opinion
Focuses: Cc:


Hi WordPress gurus,

I work for a state university that is considering WordPress as a CMS for our Web site. One thing that is very important to us as a state university is adhering to section 508 guidelines for Web accessibility, and we're running into a problem with WP and image alt tags.

Currently, WordPress is set up such that the Title or Caption of an image is inserted as the alternative text. The Title is a required field, so technically, every image always has alternate text.

This would be fine, except the title of the image defaults to the file name upon upload. The image file name is most often not meaningful (ie. "DSCN1899" vs. "This is a photo of Bob and Sally on their camping trip") and therefore not accessible.

What we'd like to do is require users to re-enter the image title upon uploading it--in other words, we don't want the Title field to auto-fill with the image file name--so they are forced to consider using meaningful text to describe the image before saving it to the database.

At present this would probably have to be done with a hack, but so far myself and another programmer have not been able to find the file or source code to do this. We've managed to customize the rest of the system to suit our needs, but this accessibility issue keeps tripping us up.

It would be ideal if there were a required field called Alternative Text built in to the backend--something independent of the Title and Caption.

Thanks for your time!

Change History (5)

comment:1 hakre5 years ago

Yeah, not so easy to find, because this will be injected after upload with html-code returned from wp-admin/async-upload.php.

but the code is not generated in there, looks like a filter is providing this and you can therefore subclass is with your own callback function:

filter: attachment_fields_to_edit

the actual form is defined (and echoed) from file wp-admin/includes/media.php from the function get_media_item().

I hope this information may help to dig further into it.

comment:2 Denis-de-Bernardy5 years ago

  • Keywords 2nd-opinion added; section 508 accessibility alternative text alt tag image removed
  • Milestone changed from Unassigned to 2.9

Imo this is plugin material. There are a bunch of filters that let one filter a post/page/attachment's data before and after it gets saved. So if one particular workflow requires a title to be present, it really shouldn't hinder the workflow of others (mine certainly does NOT require any).

comment:3 janeforshort5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

+1 to carolinem's point about accessibility, which is already on record at http://core.trac.wordpress.org/ticket/8256 to separate alt text from caption field.

+1 Denis-de-Bernardy for suggesting that it is plugin territory to REQUIRE users to enter a title.

The accessibility issue is valid, and will be taken care of through other ticket. Forcing a user to enter a title, when many users don't want to, should be in a plugin, not core.

comment:4 mtekk5 years ago

  • Milestone 2.9 deleted

comment:5 hakre5 years ago

Duplicate, see #8256

Note: See TracTickets for help on using tickets.