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
1029  * @global bool $concatenate_scripts
1030  *
1031  * @return array
1032  */
1033 function print_head_scripts() {
1034      global $concatenate_scripts;
1035
1036      if ( ! did_action('wp_print_scripts') ) {
1037           /** This action is documented in wp-includes/functions.wp-scripts.php */
1038           do_action( 'wp_print_scripts' );
1039      }
1040
1041      $wp_scripts = wp_scripts();
1042
1043      script_concat_settings();
1044      $wp_scripts->do_concat = $concatenate_scripts;
1045      $wp_scripts->do_head_items();
1046
1047      /**
 
Line Code
1139  * @since 2.8.0
1140  *
1141  * @global WP_Scripts $wp_scripts
1142  *
1143  * @return array
1144  */
1145 function wp_print_head_scripts() {
1146      if ( ! did_action('wp_print_scripts') ) {
1147           /** This action is documented in wp-includes/functions.wp-scripts.php */
1148           do_action( 'wp_print_scripts' );
1149      }
1150
1151      global $wp_scripts;
1152
1153      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
1154           return array(); // no need to run if nothing is queued
1155      }
1156      return print_head_scripts();
1157 }