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.
Line | Code |
---|---|
329 | * |
330 | * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load, |
331 | * the function does not instantiate the WP_Scripts object unless script names are explicitly passed. |
332 | * Does make use of already instantiated $wp_scripts if present. |
333 | * Use provided wp_print_scripts hook to register/enqueue new scripts. |
334 | * |
335 | * @see WP_Scripts::print_scripts() |
336 | */ |
337 | function wp_print_scripts( $handles = false ) { |
338 | do_action( 'wp_print_scripts' ); |
339 | if ( '' === $handles ) // for wp_head |
340 | $handles = false; |
341 |
|
342 | global $wp_scripts; |
343 | if ( !is_a($wp_scripts, 'WP_Scripts') ) { |
344 | if ( !$handles ) |
345 | return array(); // No need to instantiate if nothing's there. |
346 | else |
347 | $wp_scripts = new WP_Scripts(); |