stylesheet_directory

Filters the stylesheet directory path for current theme.

Description

apply_filters( 'stylesheet_directory', (string) $stylesheet_dir, (string) $stylesheet, (string) $theme_root ); 

Parameters (3)

0. $stylesheet_dir (string)
Absolute path to the current theme.
1. $stylesheet (string)
Directory name of the current theme.
2. $theme_root (string)
Absolute path to themes directory.

Usage

To run the hook, copy the example below.
  1. $stylesheet_dir = apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root ); 
  2.  
  3. if ( !empty( $stylesheet_dir ) ) { 
  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 callback 
  2. function filter_stylesheet_directory( $stylesheet_dir, $stylesheet, $theme_root ) { 
  3. // make filter magic happen here... 
  4. return $stylesheet_dir
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'stylesheet_directory', 'filter_stylesheet_directory', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'stylesheet_directory', 'filter_stylesheet_directory', 10, 3 ); 

Defined (1)

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

/wp-includes/theme.php  
  1. return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );