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