Make WordPress Core

Changeset 62892


Ignore:
Timestamp:
07/29/2026 01:36:12 AM (7 weeks ago)
Author:
joedolson
Message:

Media: Use correct fallback aria-label for untitled images.

In the media library, the aria-label for an untitled image fell back to "uploading...", the string used during the upload processing. Change the values so that images only use "uploading..." during the uploading process, but otherwise use "(no title)", like other untitled items.

Developed in https://github.com/WordPress/wordpress-develop/pull/12136

Props jamieburchell, presskopp, khokansardar, joedolson, tusharaddweb, ankitkumarshah, chillifish, masteradhoc, cbravobernal.
Fixes #65438, see #64883.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/views/attachment.js

    r62105 r62892  
    1919
    2020        attributes: function() {
     21                var ariaLabel = this.model.get( 'title' );
     22
     23                if ( ! ariaLabel ) {
     24                        if ( this.model.get( 'uploading' ) ) {
     25                                ariaLabel = wp.i18n.__( 'uploading…' );
     26                        } else {
     27                                ariaLabel = wp.i18n.__( '(no title)' );
     28                        }
     29                }
     30
    2131                return {
    2232                        'tabIndex':     0,
    2333                        'role':         'checkbox',
    24                         'aria-label':   this.model.get( 'title' ) || wp.i18n.__( 'uploading…' ),
     34                        'aria-label':   ariaLabel,
    2535                        'aria-checked': false,
    2636                        'data-id':      this.model.get( 'id' )
Note: See TracChangeset for help on using the changeset viewer.