get_theme_root_uri( string $stylesheet_or_template = '', string $theme_root = '' ): string  Retrieves URI for themes directory.   Description Does not have trailing slash.   Parameters   $stylesheet_or_template string Optional     The stylesheet or template name of the theme. Default is to leverage the main theme root.  Default: ''   $theme_root string Optional     The theme root for which calculations will be based, preventing the need for a get_raw_theme_root() call.   Default: ''     Return string Themes directory URI.   Source  File: wp-includes/theme.php. View all references  function get_theme_root_uri( $stylesheet_or_template = '', $theme_root = '' ) {
	global $wp_theme_directories;

	if ( $stylesheet_or_template && ! $theme_root ) {
		$theme_root = get_raw_theme_root( $stylesheet_or_template );
	}

	if ( $stylesheet_or_template && $theme_root ) {
		if ( in_array( $theme_root, (array) $wp_theme_directories, true ) ) {
			// Absolute path. Make an educated guess. YMMV -- but note the filter below.
			if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) {
				$theme_root_uri = content_url( str_replace( WP_CONTENT_DIR, '', $theme_root ) );
			} elseif ( 0 === strpos( $theme_root, ABSPATH ) ) {
				$theme_root_uri = site_url( str_replace( ABSPATH, '', $theme_root ) );
			} elseif ( 0 === strpos( $theme_root, WP_PLUGIN_DIR ) || 0 === strpos( $theme_root, WPMU_PLUGIN_DIR ) ) {
				$theme_root_uri = plugins_url( basename( $theme_root ), $theme_root );
			} else {
				$theme_root_uri = $theme_root;
			}
		} else {
			$theme_root_uri = content_url( $theme_root );
		}
	} else {
		$theme_root_uri = content_url( 'themes' );
	}

	/**
	 * 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.
	 */
	return apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template );
}
   Hooks     apply_filters( 'theme_root_uri', string $theme_root_uri, string $siteurl, string $stylesheet_or_template )   
Filters the URI for themes directory.      Related  Uses    Uses Description      get_raw_theme_root() wp-includes/theme.php   Gets the raw theme root relative to the content directory with no filters applied.     content_url() wp-includes/link-template.php   Retrieves the URL to the content directory.     plugins_url() wp-includes/link-template.php   Retrieves a URL within the plugins or mu-plugins directory.     site_url() wp-includes/link-template.php   Retrieves the URL for the current site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.     apply_filters() wp-includes/plugin.php   Calls the callback functions that have been added to a filter hook.     get_option() wp-includes/option.php   Retrieves an option value based on an option name.   
   Used By    Used By Description      get_stylesheet_directory_uri() wp-includes/theme.php   Retrieves stylesheet directory URI for the active theme.     get_template_directory_uri() wp-includes/theme.php   Retrieves template directory URI for the active theme.     WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069get_theme_root_uri() wp-includes/class-wp-theme.php   Returns the URL to the directory of the theme root.   
    Changelog    Version Description     1.5.0 Introduced.    

    
{'path': 'public/docs/wordpress/functions/get_theme_root_uri.html', 'source': 'DevDocs.IO'}