Media: Prevent undefined errors when media scripts are enqueued outside of wp_enqueue_media(). fixes #22495, see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-20 01:48:37 +00:00
parent ef6ff8b4a8
commit d4744fda0a
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ window.wp = window.wp || {};
_.extend( media, { model: {}, view: {}, controller: {} });
// Link any localized strings.
l10n = media.model.l10n = _.isUndefined( _wpMediaModelsL10n ) ? {} : _wpMediaModelsL10n;
l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
/**
* ========================================================================

View File

@ -6,7 +6,7 @@
l10n;
// Link any localized strings.
l10n = media.view.l10n = _.isUndefined( _wpMediaViewsL10n ) ? {} : _wpMediaViewsL10n;
l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
// Link any settings.
media.view.settings = l10n.settings || {};