style_loader_tag filter-hookWP 2.6.0

Filters the HTML link tag of an enqueued style.


add_filter( 'style_loader_tag', 'wp_kama_style_loader_tag_filter', 10, 4 );

 * Function for `style_loader_tag` filter-hook.
 * @param string $tag    The link tag for the enqueued style.
 * @param string $handle The style's registered handle.
 * @param string $href   The stylesheet's source URL.
 * @param string $media  The stylesheet's media attribute.
 * @return string
function wp_kama_style_loader_tag_filter( $tag, $handle, $href, $media ){

	// filter...
	return $tag;
The link tag for the enqueued style.
The style's registered handle.
The stylesheet's source URL.
The stylesheet's media attribute.


Since 2.6.0 Introduced.
Since 4.3.0 Introduced the $href parameter.
Since 4.5.0 Introduced the $media parameter.

Where the hook is called

wp-includes/class-wp-styles.php 251
$tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media );
wp-includes/class-wp-styles.php 272
$rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );

Where the hook is used in WordPress

Usage not found.