/** * Prints script tags in document head * * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load, * the function does not instantiate the WP_Scripts object unless script names are explicitly passed. * Does make use of already instantiated $wp_scripts if present. * Use provided wp_print_scripts hook to register/enqueue new scripts. * * @see WP_Scripts::print_scripts() */ function wp_print_scripts($handles = false) { do_action('wp_print_scripts'); if ('' === $handles) { // for wp_head $handles = false; } global $wp_scripts; if (!is_a($wp_scripts, 'WP_Scripts')) { if (!$handles) { return array(); } else { $wp_scripts = new WP_Scripts(); } } return $wp_scripts->print_scripts($handles); }
/** * Prints script tags in document head * * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load, * the function does not instantiate the WP_Scripts object unless script names are explicitly passed. * Does make use of already instantiated $wp_scripts if present. * Use provided wp_print_scripts hook to register/enqueue new scripts. * * @see WP_Scripts::print_scripts() */ function wp_print_scripts( $handles = false ) { do_action( 'wp_print_scripts' ); if ( '' === $handles ) // for wp_head $handles = false; global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) { if ( !$handles ) return array(); // No need to instantiate if nothing's there. else $wp_scripts = new WP_Scripts(); } return $wp_scripts->print_scripts( $handles ); }