Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: script_loader_src

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
269           if ( $this->do_concat ) {
270                /**
271                 * Filters the script loader source.
272                 *
273                 * @since 2.2.0
274                 *
275                 * @param string $src    Script loader source path.
276                 * @param string $handle Script handle.
277                 */
278                $srce = apply_filters( 'script_loader_src', $src, $handle );
279
280                if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle ) ) {
281                     $this->do_concat = false;
282
283                     // Have to print the so-far concatenated scripts right away to maintain the right order.
284                     _print_scripts();
285                     $this->reset();
286                } elseif ( $this->in_default_dir( $srce ) && ! $conditional ) {
287                     $this->print_code .= $this->print_extra_script( $handle, false );
 
Line Code
313
314           if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
315                $src = $this->base_url . $src;
316           }
317
318           if ( ! empty( $ver ) )
319                $src = add_query_arg( 'ver', $ver, $src );
320
321           /** This filter is documented in wp-includes/class.wp-scripts.php */
322           $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
323
324           if ( ! $src )
325                return true;
326
327           $tag = "{$cond_before}{$before_handle}<script type='text/javascript' src='$src'></script>\n{$after_handle}{$cond_after}";
328
329           /**
330            * Filters the HTML script tag of an enqueued script.
331            *