WordPress at a glance

get_stylesheet_directory() WP 1.0

Retrieve stylesheet directory path for current theme.

Is the basis for: get_theme_file_uri()
✈ 1 time = 0.000027s = very fast | 50000 times = 0.28s = very fast | PHP 7.0.2, WP 4.4.1
Hooks from function:
Return

String. Path to current theme directory.

Usage

get_stylesheet_directory();

Code of get_stylesheet_directory: wp-includes/theme.php VER 5.0.1

<?php
function get_stylesheet_directory() {
	$stylesheet = get_stylesheet();
	$theme_root = get_theme_root( $stylesheet );
	$stylesheet_dir = "$theme_root/$stylesheet";

	/**
	 * Filters the stylesheet directory path for current theme.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet_dir Absolute path to the current theme.
	 * @param string $stylesheet     Directory name of the current theme.
	 * @param string $theme_root     Absolute path to themes directory.
	 */
	return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}

Related Functions

From tag: theme path (theme folder url)

More from category: Theme files connection

No comments
    Hello, !     Log In . Register