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
764  * @since 2.8.0
765  *
766  * @see wp_print_scripts()
767  */
768 function print_head_scripts() {
769      global $wp_scripts, $concatenate_scripts;
770
771      if ( ! did_action('wp_print_scripts') ) {
772           /** This action is documented in wp-includes/functions.wp-scripts.php */
773           do_action( 'wp_print_scripts' );
774      }
775
776      if ( !is_a($wp_scripts, 'WP_Scripts') )
777           $wp_scripts = new WP_Scripts();
778
779      script_concat_settings();
780      $wp_scripts->do_concat = $concatenate_scripts;
781      $wp_scripts->do_head_items();
782
 
Line Code
861  *
862  * Postpones the scripts that were queued for the footer.
863  * wp_print_footer_scripts() is called in the footer to print these scripts.
864  *
865  * @since 2.8.0
866  */
867 function wp_print_head_scripts() {
868      if ( ! did_action('wp_print_scripts') ) {
869           /** This action is documented in wp-includes/functions.wp-scripts.php */
870           do_action( 'wp_print_scripts' );
871      }
872
873      global $wp_scripts;
874
875      if ( !is_a($wp_scripts, 'WP_Scripts') )
876           return array(); // no need to run if nothing is queued
877
878      return print_head_scripts();
879 }