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
2085  * @global bool $concatenate_scripts
2086  *
2087  * @return array
2088  */
2089 function print_head_scripts() {
2090      global $concatenate_scripts;
2091
2092      if ( ! did_action( 'wp_print_scripts' ) ) {
2093           /** This action is documented in wp-includes/functions.wp-scripts.php */
2094           do_action( 'wp_print_scripts' );
2095      }
2096
2097      $wp_scripts = wp_scripts();
2098
2099      script_concat_settings();
2100      $wp_scripts->do_concat = $concatenate_scripts;
2101      $wp_scripts->do_head_items();
2102
2103      /**
 
Line Code
2205  * @global WP_Scripts $wp_scripts
2206  *
2207  * @return array
2208  */
2209 function wp_print_head_scripts() {
2210      global $wp_scripts;
2211
2212      if ( ! did_action( 'wp_print_scripts' ) ) {
2213           /** This action is documented in wp-includes/functions.wp-scripts.php */
2214           do_action( 'wp_print_scripts' );
2215      }
2216
2217      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
2218           return array(); // No need to run if nothing is queued.
2219      }
2220
2221      return print_head_scripts();
2222 }
2223