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