script_loader_src

Filters the script loader source.

Description

apply_filters( 'script_loader_src', (string) $src, (string) $handle ); 

Parameters (2)

0. $src (string)
Script loader source path.
1. $handle (string)
Script handle.

Usage

To run the hook, copy the example below.
  1. $src = apply_filters( 'script_loader_src', $src, $handle ); 
  2.  
  3. if ( !empty( $src ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the script_loader_src callback 
  2. function filter_script_loader_src( $src, $handle ) { 
  3. // make filter magic happen here... 
  4. return $src
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'script_loader_src', 'filter_script_loader_src', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'script_loader_src', 'filter_script_loader_src', 10, 2 ); 

Defined (5)

The filter is defined in the following location(s).

/wp-includes/class.wp-scripts.php  
  1. $srce = apply_filters( 'script_loader_src', $src, $handle ); 
  1. $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) ); 
/wp-includes/formatting.php  
  1. 'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ), 
  1. 'twemoji' => apply_filters( 'script_loader_src', includes_url( "js/twemoji.js?$version" ), 'twemoji' ), 
  1. 'concatemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji-release.min.js?$version" ), 'concatemoji' ),