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
2122  * @global bool $concatenate_scripts
2123  *
2124  * @return string[] Handles of the scripts that were printed.
2125  */
2126 function print_head_scripts() {
2127      global $concatenate_scripts;
2128
2129      if ( ! did_action( 'wp_print_scripts' ) ) {
2130           /** This action is documented in wp-includes/functions.wp-scripts.php */
2131           do_action( 'wp_print_scripts' );
2132      }
2133
2134      $wp_scripts = wp_scripts();
2135
2136      script_concat_settings();
2137      $wp_scripts->do_concat = $concatenate_scripts;
2138      $wp_scripts->do_head_items();
2139
2140      /**
 
Line Code
2245  * @global WP_Scripts $wp_scripts
2246  *
2247  * @return string[] Handles of the scripts that were printed.
2248  */
2249 function wp_print_head_scripts() {
2250      global $wp_scripts;
2251
2252      if ( ! did_action( 'wp_print_scripts' ) ) {
2253           /** This action is documented in wp-includes/functions.wp-scripts.php */
2254           do_action( 'wp_print_scripts' );
2255      }
2256
2257      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
2258           return array(); // No need to run if nothing is queued.
2259      }
2260
2261      return print_head_scripts();
2262 }
2263