WP_Theme::get_stylesheet_directory()publicWP 3.4.0

Returns the absolute path to the directory of a theme's "stylesheet" files.

In the case of a child theme, this is the absolute path to the directory of the child theme's files.

Method of the class: WP_Theme{}

No Hooks.

Return

String. Absolute path of the stylesheet directory.

Usage

$WP_Theme = new WP_Theme();
$WP_Theme->get_stylesheet_directory();

Changelog

Since 3.4.0 Introduced.

WP_Theme::get_stylesheet_directory() code WP 6.6.2

public function get_stylesheet_directory() {
	if ( $this->errors() && in_array( 'theme_root_missing', $this->errors()->get_error_codes(), true ) ) {
		return '';
	}

	return $this->theme_root . '/' . $this->stylesheet;
}