From 57db88842012846eccc5ece29d57e37fa6aa67e0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 9 Nov 2012 04:51:25 +0000 Subject: [PATCH] Allow wp_plupload_default_settings() to be called multiple times without doubling up the output. see #22060. git-svn-id: http://core.svn.wordpress.org/trunk@22488 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 301285f233..89254daea3 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1176,6 +1176,10 @@ function wp_max_upload_size() { function wp_plupload_default_settings() { global $wp_scripts; + $data = $wp_scripts->get_data( 'wp-plupload', 'data' ); + if ( $data && false !== strpos( $data, '_wpPluploadSettings' ) ) + return; + $max_upload_size = wp_max_upload_size(); $defaults = array( @@ -1211,7 +1215,6 @@ function wp_plupload_default_settings() { $script = 'var _wpPluploadSettings = ' . json_encode( $settings ) . ';'; - $data = $wp_scripts->get_data( 'wp-plupload', 'data' ); if ( $data ) $script = "$data\n$script";