WP_Theme::get_theme_root_uri() WordPress Method

The WP_Theme::get_theme_root_uri() method retrieves the URI for the themes directory. This is useful for retrieving the URL for enqueuing scripts and stylesheets, or for retrieving template files.

WP_Theme::get_theme_root_uri() #

Returns the URL to the directory of the theme root.


Description

This is typically the absolute URL to wp-content/themes. This forms the basis for all other URLs returned by WP_Theme, so we pass it to the public function get_theme_root_uri() and allow it to run the ‘theme_root_uri’ filter.


Top ↑

Return

(string) Theme root URI.


Top ↑

Source

File: wp-includes/class-wp-theme.php

	public function get_theme_root_uri() {
		if ( ! isset( $this->theme_root_uri ) ) {
			$this->theme_root_uri = get_theme_root_uri( $this->stylesheet, $this->theme_root );
		}
		return $this->theme_root_uri;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.