Filter hook 'theme_root_uri'

in WP Core File wp-includes/theme.php at line 682

View Source

theme_root_uri

Filter Hook
Description
Filters the URI for themes directory.

Hook Information

File Location wp-includes/theme.php View on GitHub
Hook Type Filter
Line Number 682

Hook Parameters

Type Name Description
string $theme_root_uri The URI for themes directory.
string $siteurl WordPress web address which is set in General Options.
string $stylesheet_or_template The stylesheet or template name of the theme.

Usage Examples

Basic Usage
<?php
// Hook into theme_root_uri
add_filter('theme_root_uri', 'my_custom_filter', 10, 3);

function my_custom_filter($theme_root_uri, $siteurl, $stylesheet_or_template) {
    // Your custom filtering logic here
    return $theme_root_uri;
}

Source Code Context

wp-includes/theme.php:682 - How this hook is used in WordPress core
<?php
 677  	 *
 678  	 * @param string $theme_root_uri         The URI for themes directory.
 679  	 * @param string $siteurl                WordPress web address which is set in General Options.
 680  	 * @param string $stylesheet_or_template The stylesheet or template name of the theme.
 681  	 */
 682  	return apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template );
 683  }
 684  
 685  /**
 686   * Gets the raw theme root relative to the content directory with no filters applied.
 687   *

PHP Documentation

<?php
/**
	 * Filters the URI for themes directory.
	 *
	 * @since 1.5.0
	 *
	 * @param string $theme_root_uri         The URI for themes directory.
	 * @param string $siteurl                WordPress web address which is set in General Options.
	 * @param string $stylesheet_or_template The stylesheet or template name of the theme.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.