From e1da69195dc9c51cf5d6872131a6e4004f769e20 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 16 Jan 2015 02:27:49 +0000 Subject: [PATCH] In `wp_print_scripts()`, bail if `$handles` is `false` and the `$wp_scripts` global has not been instantiated. See [31192], #20513. git-svn-id: https://develop.svn.wordpress.org/trunk@31193 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.wp-scripts.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/functions.wp-scripts.php b/src/wp-includes/functions.wp-scripts.php index 465d07be4d..bf4ff40866 100644 --- a/src/wp-includes/functions.wp-scripts.php +++ b/src/wp-includes/functions.wp-scripts.php @@ -74,9 +74,13 @@ function wp_print_scripts( $handles = false ) { wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); - if ( ! $handles ) { - return array(); // No need to instantiate if nothing is there. + global $wp_scripts; + if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { + if ( ! $handles ) { + return array(); // No need to instantiate if nothing is there. + } } + return wp_scripts()->do_items( $handles ); }