WordPress.org

Make WordPress Core

Changeset 22694


Ignore:
Timestamp:
11/20/12 01:48:37 (17 months ago)
Author:
koopersmith
Message:

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

Location:
trunk/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-models.js

    r22666 r22694  
    4040 
    4141    // Link any localized strings. 
    42     l10n = media.model.l10n = _.isUndefined( _wpMediaModelsL10n ) ? {} : _wpMediaModelsL10n; 
     42    l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n; 
    4343 
    4444    /** 
  • trunk/wp-includes/js/media-views.js

    r22692 r22694  
    77 
    88    // Link any localized strings. 
    9     l10n = media.view.l10n = _.isUndefined( _wpMediaViewsL10n ) ? {} : _wpMediaViewsL10n; 
     9    l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n; 
    1010 
    1111    // Link any settings. 
Note: See TracChangeset for help on using the changeset viewer.