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
2367  * @global bool $concatenate_scripts
2368  *
2369  * @return array
2370  */
2371 function print_head_scripts() {
2372      global $concatenate_scripts;
2373
2374      if ( ! did_action( 'wp_print_scripts' ) ) {
2375           /** This action is documented in wp-includes/functions.wp-scripts.php */
2376           do_action( 'wp_print_scripts' );
2377      }
2378
2379      $wp_scripts = wp_scripts();
2380
2381      script_concat_settings();
2382      $wp_scripts->do_concat = $concatenate_scripts;
2383      $wp_scripts->do_head_items();
2384
2385      /**
 
Line Code
2479  * @since 2.8.0
2480  *
2481  * @global WP_Scripts $wp_scripts
2482  *
2483  * @return array
2484  */
2485 function wp_print_head_scripts() {
2486      if ( ! did_action( 'wp_print_scripts' ) ) {
2487           /** This action is documented in wp-includes/functions.wp-scripts.php */
2488           do_action( 'wp_print_scripts' );
2489      }
2490
2491      global $wp_scripts;
2492
2493      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
2494           return array(); // no need to run if nothing is queued
2495      }
2496      return print_head_scripts();
2497 }