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
1823  * @global bool $concatenate_scripts
1824  *
1825  * @return array
1826  */
1827 function print_head_scripts() {
1828      global $concatenate_scripts;
1829
1830      if ( ! did_action( 'wp_print_scripts' ) ) {
1831           /** This action is documented in wp-includes/functions.wp-scripts.php */
1832           do_action( 'wp_print_scripts' );
1833      }
1834
1835      $wp_scripts = wp_scripts();
1836
1837      script_concat_settings();
1838      $wp_scripts->do_concat = $concatenate_scripts;
1839      $wp_scripts->do_head_items();
1840
1841      /**
 
Line Code
1941  * @since 2.8.0
1942  *
1943  * @global WP_Scripts $wp_scripts
1944  *
1945  * @return array
1946  */
1947 function wp_print_head_scripts() {
1948      if ( ! did_action( 'wp_print_scripts' ) ) {
1949           /** This action is documented in wp-includes/functions.wp-scripts.php */
1950           do_action( 'wp_print_scripts' );
1951      }
1952
1953      global $wp_scripts;
1954
1955      if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
1956           return array(); // No need to run if nothing is queued.
1957      }
1958      return print_head_scripts();
1959 }