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
This commit is contained in:
Scott Taylor 2015-01-16 02:27:49 +00:00
parent 7ccdc6b470
commit e1da69195d

View File

@ -74,9 +74,13 @@ function wp_print_scripts( $handles = false ) {
wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
global $wp_scripts;
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
if ( ! $handles ) { if ( ! $handles ) {
return array(); // No need to instantiate if nothing is there. return array(); // No need to instantiate if nothing is there.
} }
}
return wp_scripts()->do_items( $handles ); return wp_scripts()->do_items( $handles );
} }