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
2048  * @global bool $concatenate_scripts
2049  *
2050  * @return array
2051  */
2052 function print_head_scripts() {
2053      global $concatenate_scripts;
2054
2055      if ( ! did_action( 'wp_print_scripts' ) ) {
2056           /** This action is documented in wp-includes/functions.wp-scripts.php */
2057           do_action( 'wp_print_scripts' );
2058      }
2059
2060      $wp_scripts = wp_scripts();
2061
2062      script_concat_settings();
2063      $wp_scripts->do_concat = $concatenate_scripts;
2064      $wp_scripts->do_head_items();
2065
2066      /**
 
Line Code
2168  * @global WP_Scripts $wp_scripts
2169  *
2170  * @return array
2171  */
2172 function wp_print_head_scripts() {
2173      global $wp_scripts;
2174
2175      if ( ! did_action( 'wp_print_scripts' ) ) {
2176           /** This action is documented in wp-includes/functions.wp-scripts.php */
2177           do_action( 'wp_print_scripts' );
2178      }
2179
2180      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
2181           return array(); // No need to run if nothing is queued.
2182      }
2183
2184      return print_head_scripts();
2185 }
2186