Media: Ensure media-views is enqueued and registered before localizing.

fixes #24724.


git-svn-id: https://develop.svn.wordpress.org/trunk@29678 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-09-02 19:35:35 +00:00
parent 9c82e2854e
commit 896bbfacae

View File

@ -3045,9 +3045,11 @@ function wp_enqueue_media( $args = array() ) {
$strings['settings'] = $settings;
// Ensure we enqueue media-editor first, that way media-views is
// registered internally before we try to localize it. see #24724.
wp_enqueue_script( 'media-editor' );
wp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );
wp_enqueue_script( 'media-editor' );
wp_enqueue_script( 'media-audiovideo' );
wp_enqueue_style( 'media-views' );
if ( is_admin() ) {