theme_root_uri

Filters the URI for themes directory.

Description

apply_filters( 'theme_root_uri', (string) $theme_root_uri, (string) $get_option, (string) $stylesheet_or_template ); 

Parameters (3)

0. $theme_root_uri (string)
The URI for themes directory.
1. $get_option (string) => get_option( 'siteurl' )
WordPress web address which is set in General Options.
2. $stylesheet_or_template (string)
Stylesheet or template name of the theme.

Usage

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

Defined (1)

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

/wp-includes/theme.php  
  1. return apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template );