Filter hook 'stylesheet_uri'

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

View Source

stylesheet_uri

Filter Hook
Description
Filters the URI of the active theme stylesheet.

Hook Information

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

Hook Parameters

Type Name Description
string $stylesheet_uri Stylesheet URI for the active theme/child theme.
string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.

Usage Examples

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

function my_custom_filter($stylesheet_uri, $stylesheet_dir_uri) {
    // Your custom filtering logic here
    return $stylesheet_uri;
}

Source Code Context

wp-includes/theme.php:263 - How this hook is used in WordPress core
<?php
 258  	 * @since 1.5.0
 259  	 *
 260  	 * @param string $stylesheet_uri     Stylesheet URI for the active theme/child theme.
 261  	 * @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.
 262  	 */
 263  	return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
 264  }
 265  
 266  /**
 267   * Retrieves the localized stylesheet URI.
 268   *

PHP Documentation

<?php
/**
	 * Filters the URI of the active theme stylesheet.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet_uri     Stylesheet URI for the active theme/child theme.
	 * @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.