stylesheet_directory_uri

Filters the stylesheet directory URI.

Description

apply_filters( 'stylesheet_directory_uri', (string) $stylesheet_dir_uri, (string) $stylesheet, (string) $theme_root_uri ); 

Parameters (3)

0. $stylesheet_dir_uri (string)
Stylesheet directory URI.
1. $stylesheet (string)
Name of the activated theme's directory.
2. $theme_root_uri (string)
The theme root uri.

Usage

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

Defined (1)

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

/wp-includes/theme.php  
  1. return apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri );