From e496cc6e4b074f8531b2ac3c1eafd84e56754b26 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 2 Sep 2014 19:36:16 +0000 Subject: [PATCH] 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 --- wp-includes/media.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 31a2892f4a..b49e324f67 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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() ) {