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
680  * print_footer_scripts() is called in the footer to print these scripts.
681  *
682  * @since 2.8
683  * @see wp_print_scripts()
684  */
685 function print_head_scripts() {
686      global $wp_scripts, $concatenate_scripts;
687
688      if ( ! did_action('wp_print_scripts') )
689           do_action('wp_print_scripts');
690
691      if ( !is_a($wp_scripts, 'WP_Scripts') )
692           $wp_scripts = new WP_Scripts();
693
694      script_concat_settings();
695      $wp_scripts->do_concat = $concatenate_scripts;
696      $wp_scripts->do_head_items();
697
698      if ( apply_filters('print_head_scripts', true) )
 
Line Code
759  * Prints the script queue in the HTML head on the front end.
760  *
761  * Postpones the scripts that were queued for the footer.
762  * wp_print_footer_scripts() is called in the footer to print these scripts.
763  *
764  * @since 2.8
765  */
766 function wp_print_head_scripts() {
767      if ( ! did_action('wp_print_scripts') )
768           do_action('wp_print_scripts');
769
770      global $wp_scripts;
771
772      if ( !is_a($wp_scripts, 'WP_Scripts') )
773           return array(); // no need to run if nothing is queued
774
775      return print_head_scripts();
776 }
777