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
2063  * @global bool $concatenate_scripts
2064  *
2065  * @return array
2066  */
2067 function print_head_scripts() {
2068      global $concatenate_scripts;
2069
2070      if ( ! did_action('wp_print_scripts') ) {
2071           /** This action is documented in wp-includes/functions.wp-scripts.php */
2072           do_action( 'wp_print_scripts' );
2073      }
2074
2075      $wp_scripts = wp_scripts();
2076
2077      script_concat_settings();
2078      $wp_scripts->do_concat = $concatenate_scripts;
2079      $wp_scripts->do_head_items();
2080
2081      /**
 
Line Code
2173  * @since 2.8.0
2174  *
2175  * @global WP_Scripts $wp_scripts
2176  *
2177  * @return array
2178  */
2179 function wp_print_head_scripts() {
2180      if ( ! did_action('wp_print_scripts') ) {
2181           /** This action is documented in wp-includes/functions.wp-scripts.php */
2182           do_action( 'wp_print_scripts' );
2183      }
2184
2185      global $wp_scripts;
2186
2187      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
2188           return array(); // no need to run if nothing is queued
2189      }
2190      return print_head_scripts();
2191 }