WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
2293 | * @global bool $concatenate_scripts |
2294 | * |
2295 | * @return array |
2296 | */ |
2297 | function print_head_scripts() { |
2298 | global $concatenate_scripts; |
2299 |
|
2300 | if ( ! did_action( 'wp_print_scripts' ) ) { |
2301 | /** This action is documented in wp-includes/functions.wp-scripts.php */ |
2302 | do_action( 'wp_print_scripts' ); |
2303 | } |
2304 |
|
2305 | $wp_scripts = wp_scripts(); |
2306 |
|
2307 | script_concat_settings(); |
2308 | $wp_scripts->do_concat = $concatenate_scripts; |
2309 | $wp_scripts->do_head_items(); |
2310 |
|
2311 | /** |
Line | Code |
2405 | * @since 2.8.0 |
2406 | * |
2407 | * @global WP_Scripts $wp_scripts |
2408 | * |
2409 | * @return array |
2410 | */ |
2411 | function wp_print_head_scripts() { |
2412 | if ( ! did_action( 'wp_print_scripts' ) ) { |
2413 | /** This action is documented in wp-includes/functions.wp-scripts.php */ |
2414 | do_action( 'wp_print_scripts' ); |
2415 | } |
2416 |
|
2417 | global $wp_scripts; |
2418 |
|
2419 | if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { |
2420 | return array(); // no need to run if nothing is queued |
2421 | } |
2422 | return print_head_scripts(); |
2423 | } |