[wp-trac] [WordPress Trac] #36735: Add media, insert from URL and alt attribute

WordPress Trac noreply at wordpress.org
Wed Jul 20 14:37:26 UTC 2016

#36735: Add media, insert from URL and alt attribute
 Reporter:  afercia           |       Owner:  joemcgill
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.6
Component:  Media             |     Version:
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  accessibility
Changes (by joemcgill):

 * status:  reopened => closed
 * resolution:   => fixed


 In [changeset:"38116"]:
 #!CommitTicketReference repository="" revision="38116"
 Media: Ensure empty `alt` attributes are set to blank strings.

 This is a follow up to [38065] to ensure that `wp.html.string()` always
 converts empty `alt` attributes to `alt=""` rather than returning HTML
 empty attribute notation, like `alt`. This allows screen readers to ignore
 images with empty `alt` attributes, rather than reading out the URL

 Additionally this completely removes the logic in `wp.html.string()` for
 converting blank attributes to empty attribute notation since empty
 notation is generally meant to denote a boolean value, e.g.,
 `checked` == `checked="checked"`, which doesn't apply in this context
 boolean attributes must be omitted in order to represent a `false` value.
 See: https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes

 Props adamsilverstein, afineman, joemcgill.
 Fixes #36735.

Ticket URL: <https://core.trac.wordpress.org/ticket/36735#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list