Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_print_scripts

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
592  * print_footer_scripts() is called in the footer to print these scripts.
593  *
594  * @since 2.8
595  * @see wp_print_scripts()
596  */
597 function print_head_scripts() {
598      global $wp_scripts, $concatenate_scripts;
599
600      if ( ! did_action('wp_print_scripts') )
601           do_action('wp_print_scripts');
602
603      if ( !is_a($wp_scripts, 'WP_Scripts') )
604           $wp_scripts = new WP_Scripts();
605
606      script_concat_settings();
607      $wp_scripts->do_concat = $concatenate_scripts;
608      $wp_scripts->do_head_items();
609
610      if ( apply_filters('print_head_scripts', true) )
 
Line Code
668  * Prints the script queue in the HTML head on the front end.
669  *
670  * Postpones the scripts that were queued for the footer.
671  * wp_print_footer_scripts() is called in the footer to print these scripts.
672  *
673  * @since 2.8
674  */
675 function wp_print_head_scripts() {
676      if ( ! did_action('wp_print_scripts') )
677           do_action('wp_print_scripts');
678
679      global $wp_scripts;
680
681      if ( !is_a($wp_scripts, 'WP_Scripts') )
682           return array(); // no need to run if nothing is queued
683
684      return print_head_scripts();
685 }
686