From 61bfa785098b7c6a77bc7a3677c0b02085c0ccb8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 27 Dec 2012 16:07:12 +0000 Subject: [PATCH] Limit the execution of wp_enqueue_media() to once per page. Prevents multiple _wpMediaViewsL10n variables. see #22843. git-svn-id: http://core.svn.wordpress.org/trunk@23214 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/media.php b/wp-includes/media.php index 288e1b9b48..2f47358d2d 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1431,6 +1431,11 @@ function wp_prepare_attachment_for_js( $attachment ) { * @since 3.5.0 */ function wp_enqueue_media( $args = array() ) { + + // Enqueue me just once per page, please. + if ( did_action( 'wp_enqueue_media' ) ) + return; + $defaults = array( 'post' => null, );