WordPress.org

Make WordPress Core

Changeset 31193


Ignore:
Timestamp:
01/16/2015 02:27:49 AM (6 years ago)
Author:
wonderboymusic
Message:

In wp_print_scripts(), bail if $handles is false and the $wp_scripts global has not been instantiated.

See [31192], #20513.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.wp-scripts.php

    r31192 r31193  
    7575    wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    7676
    77     if ( ! $handles ) {
    78         return array(); // No need to instantiate if nothing is there.
    79     }
     77    global $wp_scripts;
     78    if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
     79        if ( ! $handles ) {
     80            return array(); // No need to instantiate if nothing is there.
     81        }
     82    }
     83
    8084    return wp_scripts()->do_items( $handles );
    8185}
Note: See TracChangeset for help on using the changeset viewer.