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

fixes #24724.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-09-02 19:36:16 +00:00
parent 6af7341655
commit e496cc6e4b

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() ) {