style_loader_src

Filters an enqueued style's fully-qualified URL.

Description

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

Parameters (2)

0. $src (string)
The source URL of the enqueued style.
1. $handle (string)
The style's registered handle.

Usage

To run the hook, copy the example below.
  1. $src = apply_filters( 'style_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 style_loader_src callback 
  2. function filter_style_loader_src( $src, $handle ) { 
  3. // make filter magic happen here... 
  4. return $src
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'style_loader_src', 'filter_style_loader_src', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'style_loader_src', 'filter_style_loader_src', 10, 2 ); 

Defined (2)

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

/wp-includes/class.wp-styles.php  
  1. $src = apply_filters( 'style_loader_src', $src, $handle ); 
/wp-includes/default-filters.php  
  1. add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );