From 4ca703e03bf483d481fb32caeee085d3ec1977a9 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 23 Feb 2015 23:03:19 +0000 Subject: [PATCH] Load json2.js only in IE7 and older. Fixes #31276. git-svn-id: https://develop.svn.wordpress.org/trunk@31526 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/script-loader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 88f1c41536..a9087b5bd9 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -288,7 +288,8 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", array(), false, 1 ); - $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23'); + $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23' ); + did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' ); $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.6.0', 1 ); $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore','jquery' ), '1.1.2', 1 );