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. git-svn-id: https://develop.svn.wordpress.org/trunk@45925 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e2b68a4253
commit
425d6fd925
@ -1,4 +1,5 @@
|
|||||||
var Frame = wp.media.view.Frame,
|
var Frame = wp.media.view.Frame,
|
||||||
|
l10n = wp.media.view.l10n,
|
||||||
$ = jQuery,
|
$ = jQuery,
|
||||||
MediaFrame;
|
MediaFrame;
|
||||||
|
|
||||||
@ -32,7 +33,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
|
||||||
});
|
});
|
||||||
|
@ -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' ),
|
||||||
|
Loading…
Reference in New Issue
Block a user