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
2100  * @global bool $concatenate_scripts
2101  *
2102  * @return string[] Handles of the scripts that were printed.
2103  */
2104 function print_head_scripts() {
2105      global $concatenate_scripts;
2106
2107      if ( ! did_action( 'wp_print_scripts' ) ) {
2108           /** This action is documented in wp-includes/functions.wp-scripts.php */
2109           do_action( 'wp_print_scripts' );
2110      }
2111
2112      $wp_scripts = wp_scripts();
2113
2114      script_concat_settings();
2115      $wp_scripts->do_concat = $concatenate_scripts;
2116      $wp_scripts->do_head_items();
2117
2118      /**
 
Line Code
2220  * @global WP_Scripts $wp_scripts
2221  *
2222  * @return string[] Handles of the scripts that were printed.
2223  */
2224 function wp_print_head_scripts() {
2225      global $wp_scripts;
2226
2227      if ( ! did_action( 'wp_print_scripts' ) ) {
2228           /** This action is documented in wp-includes/functions.wp-scripts.php */
2229           do_action( 'wp_print_scripts' );
2230      }
2231
2232      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
2233           return array(); // No need to run if nothing is queued.
2234      }
2235
2236      return print_head_scripts();
2237 }
2238