Accessibility: Add a default title for the media modal dialog.

Makes sure the media modal dialog `h1` heading isn't empty when custom media frames don't set a title. This is particularly important now that the media modal is an ARIA dialog, as the title is referenced by an `aria-labelledby` attribute to properly label the dialog.

Props donmhico, audrasjb.
Fixes #47612.

Built from https://develop.svn.wordpress.org/trunk@45925


git-svn-id: http://core.svn.wordpress.org/trunk@45736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2019-09-01 15:18:56 +00:00
parent 7fd6077864
commit 3ab18dba93
4 changed files with 8 additions and 6 deletions

View File

@ -2903,6 +2903,7 @@ module.exports = Frame;
/***/ (function(module, exports) { /***/ (function(module, exports) {
var Frame = wp.media.view.Frame, var Frame = wp.media.view.Frame,
l10n = wp.media.view.l10n,
$ = jQuery, $ = jQuery,
MediaFrame; MediaFrame;
@ -2936,7 +2937,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
Frame.prototype.initialize.apply( this, arguments ); Frame.prototype.initialize.apply( this, arguments );
_.defaults( this.options, { _.defaults( this.options, {
title: '', title: l10n.mediaFrameDefaultTitle,
modal: true, modal: true,
uploader: true uploader: true
}); });

File diff suppressed because one or more lines are too long

View File

@ -3764,6 +3764,7 @@ function wp_enqueue_media( $args = array() ) {
$strings = array( $strings = array(
// Generic // Generic
'mediaFrameDefaultTitle' => __( 'Media' ),
'url' => __( 'URL' ), 'url' => __( 'URL' ),
'addMedia' => __( 'Add Media' ), 'addMedia' => __( 'Add Media' ),
'search' => __( 'Search' ), 'search' => __( 'Search' ),

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-45924'; $wp_version = '5.3-alpha-45925';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.