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

  1. if ( !function_exists( 'wp_print_head_scripts' ) ) { 
  2. require_once ABSPATH . WPINC . '/script-loader.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_print_head_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/script-loader.php  
  1. function wp_print_head_scripts() { 
  2. if ( ! did_action('wp_print_scripts') ) { 
  3. /** This action is documented in wp-includes/functions.wp-scripts.php */ 
  4.  
  5. global $wp_scripts; 
  6.  
  7. if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 
  8. return array(); // no need to run if nothing is queued 
  9. return print_head_scripts();