wp_print_head_scripts
Prints the script queue in the HTML head on the front end.
Description
(array) wp_print_head_scripts();
Postpones the scripts that were queued for the footer. wp_print_footer_scripts(…)
is called in the footer to print these scripts.
Returns (array)
Usage
if ( !function_exists( 'wp_print_head_scripts' ) ) { require_once ABSPATH . WPINC . '/script-loader.php'; } // NOTICE! Understand what this does before running. $result = wp_print_head_scripts();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/script-loader.php
- function wp_print_head_scripts() {
- if ( ! did_action('wp_print_scripts') ) {
- /** This action is documented in wp-includes/functions.wp-scripts.php */
- }
- global $wp_scripts;
- if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
- return array(); // no need to run if nothing is queued
- }
- return print_head_scripts();
- }