print_head_scripts

Prints the script queue in the HTML head on admin pages.

Description

(array) print_head_scripts(); 

Postpones the scripts that were queued for the footer. print_footer_scripts() is called in the footer to print these scripts.

Returns (array)


Usage

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

Defined (1)

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

/wp-includes/script-loader.php  
  1. function print_head_scripts() { 
  2. global $concatenate_scripts; 
  3.  
  4. if ( ! did_action('wp_print_scripts') ) { 
  5. /** This action is documented in wp-includes/functions.wp-scripts.php */ 
  6.  
  7. $wp_scripts =wp_scripts); 
  8.  
  9. $wp_scripts->do_concat = $concatenate_scripts; 
  10. $wp_scripts->do_head_items(); 
  11.  
  12. /** 
  13. * Filters whether to print the head scripts. 
  14. * @since 2.8.0 
  15. * @param bool $print Whether to print the head scripts. Default true. 
  16. */ 
  17. if ( apply_filters( 'print_head_scripts', true ) ) { 
  18.  
  19. $wp_scripts->reset(); 
  20. return $wp_scripts->done;