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
550  * print_footer_scripts() is called in the footer to print these scripts.
551  *
552  * @since 2.8
553  * @see wp_print_scripts()
554  */
555 function print_head_scripts() {
556      global $wp_scripts, $concatenate_scripts;
557
558      if ( ! did_action('wp_print_scripts') )
559           do_action('wp_print_scripts');
560
561      if ( !is_a($wp_scripts, 'WP_Scripts') )
562           $wp_scripts = new WP_Scripts();
563
564      script_concat_settings();
565      $wp_scripts->do_concat = $concatenate_scripts;
566      $wp_scripts->do_head_items();
567
568      if ( apply_filters('print_head_scripts', true) )
 
Line Code
627  * Prints the script queue in the HTML head on the front end.
628  *
629  * Postpones the scripts that were queued for the footer.
630  * wp_print_footer_scripts() is called in the footer to print these scripts.
631  *
632  * @since 2.8
633  */
634 function wp_print_head_scripts() {
635      if ( ! did_action('wp_print_scripts') )
636           do_action('wp_print_scripts');
637
638      global $wp_scripts;
639
640      if ( !is_a($wp_scripts, 'WP_Scripts') )
641           return array(); // no need to run if nothing is queued
642
643      return print_head_scripts();
644 }
645