Filter hook 'stylesheet_directory'

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

View Source

stylesheet_directory

Filter Hook
Description
Filters the stylesheet directory path for the active theme.

Hook Information

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

Hook Parameters

Type Name Description
string $stylesheet_dir Absolute path to the active theme.
string $stylesheet Directory name of the active theme.
string $theme_root Absolute path to themes directory.

Usage Examples

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

function my_custom_filter($stylesheet_dir, $stylesheet, $theme_root) {
    // Your custom filtering logic here
    return $stylesheet_dir;
}

Source Code Context

wp-includes/theme.php:215 - How this hook is used in WordPress core
<?php
 210  	 *
 211  	 * @param string $stylesheet_dir Absolute path to the active theme.
 212  	 * @param string $stylesheet     Directory name of the active theme.
 213  	 * @param string $theme_root     Absolute path to themes directory.
 214  	 */
 215  	return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
 216  }
 217  
 218  /**
 219   * Retrieves stylesheet directory URI for the active theme.
 220   *

PHP Documentation

<?php
/**
	 * Filters the stylesheet directory path for the active theme.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet_dir Absolute path to the active theme.
	 * @param string $stylesheet     Directory name of the active theme.
	 * @param string $theme_root     Absolute path to themes directory.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.