[wp-trac] [WordPress Trac] #36735: Add media, insert from URL and alt attribute
WordPress Trac
noreply at wordpress.org
Fri Jul 15 21:04:34 UTC 2016
#36735: Add media, insert from URL and alt attribute
--------------------------------------+----------------------------
Reporter: afercia | Owner: joemcgill
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.6
Component: Media | Version:
Severity: normal | Resolution:
Keywords: good-first-bug has-patch | Focuses: accessibility
--------------------------------------+----------------------------
Changes (by afineman):
* status: closed => reopened
* resolution: fixed =>
Comment:
Currently
{{{
alt
}}}
is unspecified.
Users should be able to specify
{{{
alt=""
}}}
See existing source code from media-editor.js line 54-70 below:
{{{
// Final fallbacks run after all processing has been completed.
fallbacks = function( props ) {
// Generate alt fallbacks and strip tags.
if ( 'image' === props.type && ! props.alt
) {
if ( props.caption ) {
props.alt = props.caption;
} else if ( props.title !==
props.url ) {
props.alt = props.title;
} else {
props.alt = '';
}
props.alt = props.alt.replace(
/<\/?[^>]+>/g, '' );
props.alt = props.alt.replace(
/[\r\n]+/g, ' ' );
}
return props;
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36735#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list