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 |
---|---|
325 | if ( $this->do_concat ) { |
326 | /** |
327 | * Filters the script loader source. |
328 | * |
329 | * @since 2.2.0 |
330 | * |
331 | * @param string $src Script loader source path. |
332 | * @param string $handle Script handle. |
333 | */ |
334 | $srce = apply_filters( 'script_loader_src', $src, $handle ); |
335 |
|
336 | if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations_stop_concat ) ) { |
337 | $this->do_concat = false; |
338 |
|
339 | // Have to print the so-far concatenated scripts right away to maintain the right order. |
340 | _print_scripts(); |
341 | $this->reset(); |
342 | } elseif ( $this->in_default_dir( $srce ) && ! $conditional ) { |
343 | $this->print_code .= $this->print_extra_script( $handle, false ); |
Line | Code |
378 | if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { |
379 | $src = $this->base_url . $src; |
380 | } |
381 |
|
382 | if ( ! empty( $ver ) ) { |
383 | $src = add_query_arg( 'ver', $ver, $src ); |
384 | } |
385 |
|
386 | /** This filter is documented in wp-includes/class.wp-scripts.php */ |
387 | $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) ); |
388 |
|
389 | if ( ! $src ) { |
390 | return true; |
391 | } |
392 |
|
393 | $tag = $translations . $cond_before . $before_handle; |
394 | $tag .= sprintf( "<script%s src='%s' id='%s-js'></script>\n", $this->type_attr, $src, esc_attr( $handle ) ); |
395 | $tag .= $after_handle . $cond_after; |
396 |
|