Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#9419 closed defect (bug) (duplicate)

WordPress and image alt tags

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

Description

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 (6)

#1 @hakre
15 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.

#2 @Denis-de-Bernardy
15 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).

#3 @janeforshort
15 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.

#4 @mtekk
15 years ago

  • Milestone 2.9 deleted

#5 @hakre
15 years ago

Duplicate, see #8256

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.