I released an update to WP Accessibility today, that adds some limited enforcement on
alt attributes for images. It’s not as sophisticated as I’d like it to be, but it’s a start.
This includes five separate pieces:
- In the media manager, images include an indication that shows whether they have an
alttext set or have been marked as decorative. If neither is true, it shows a link that points directly to the alt attribute field for editing.
- In the media editor and the insert media model, it inserts a checkbox to mark the image as decorative.
- If an image is inserted and the decorative checkbox is selected, then it automatically strips any alt attribute text out of the inserted image text.
- If an image is inserted and the decorative checkbox is not selected, then if the image has text in the alt field, everything happens normally. If not, the image is wrapped in an extra div, and text is appended to the image that indicates that the image needs alt text.
- Custom editor styles highlight the wrapper so that it’s more obvious as an error. The author then needs to take action to fix the content of their post.
Here’s looking for you…