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 |
|---|---|
| 365 | if ( $this->do_concat ) { |
| 366 | /** |
| 367 | * Filters the script loader source. |
| 368 | * |
| 369 | * @since 2.2.0 |
| 370 | * |
| 371 | * @param string $src Script loader source path. |
| 372 | * @param string $handle Script handle. |
| 373 | */ |
| 374 | $filtered_src = apply_filters( 'script_loader_src', $src, $handle ); |
| 375 | |
| 376 | if ( |
| 377 | $this->in_default_dir( $filtered_src ) |
| 378 | && ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) ) |
| 379 | ) { |
| 380 | $this->do_concat = false; |
| 381 | |
| 382 | // Have to print the so-far concatenated scripts right away to maintain the right order. |
| 383 | _print_scripts(); |
| Line | Code |
| 411 | if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && str_starts_with( $src, $this->content_url ) ) ) { |
| 412 | $src = $this->base_url . $src; |
| 413 | } |
| 414 | |
| 415 | if ( ! empty( $ver ) ) { |
| 416 | $src = add_query_arg( 'ver', $ver, $src ); |
| 417 | } |
| 418 | |
| 419 | /** This filter is documented in wp-includes/class-wp-scripts.php */ |
| 420 | $src = esc_url_raw( apply_filters( 'script_loader_src', $src, $handle ) ); |
| 421 | |
| 422 | if ( ! $src ) { |
| 423 | return true; |
| 424 | } |
| 425 | |
| 426 | $attr = array( |
| 427 | 'src' => $src, |
| 428 | 'id' => "{$handle}-js", |
| 429 | ); |