[wp-trac] [WordPress Trac] #15926: Give header and background images alt tags

WordPress Trac noreply at wordpress.org
Fri Jan 11 06:23:16 UTC 2013


#15926: Give header and background images alt tags
---------------------------------------+------------------------------
 Reporter:  jane                       |       Owner:
     Type:  defect (bug)               |      Status:  assigned
 Priority:  normal                     |   Milestone:  Awaiting Review
Component:  Accessibility              |     Version:  3.0
 Severity:  minor                      |  Resolution:
 Keywords:  gci has-patch ux-feedback  |
---------------------------------------+------------------------------
Changes (by kovshenin):

 * cc: kovshenin (added)
 * keywords:  3.2-early gci has-patch ux-feedback needs-refresh => gci has-
     patch ux-feedback


Comment:

 Refreshed in [attachment:15926.2.diff], moved field to the Header Text
 area, updated all default themes, added sanitization, added the value to
 `get_custom_header()`. Both `get_custom_header()->alt` and `get_theme_mod(
 'header_alt_text' );` would be correct to use.

 As opposed to 1.diff, 2.diff stores the escaped value. I don't really like
 the idea of storing the escaped value (as opposed to sanitized) but
 otherwise it would be vulnerable to XSS if theme developers forget to
 `esc_attr` when printing the value from `get_theme_mod`. Besides,
 `blogname` and other core options also store escaped values.

 Thinking about a better approach to tackle themes. Perhaps use
 `get_theme_mod` instead, which will not trigger an undefined notice in
 earlier versions of WordPress but `get_custom_header` looks so much nicer.

 Also, what if a theme does not implement the alt tags yet? Having that
 extra field do nothing in Appearance - Header seems like a waste, but
 doing `current_theme_supports( 'header_alt_text' );` seems like too much.
 Thoughts?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15926#comment:20>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list