style_loader_tag хук-фильтрWP 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.

Список изменений

С версии 2.6.0 Введена.
С версии 4.3.0 Introduced the $href parameter.
С версии 4.5.0 Introduced the $media parameter.

Где вызывается хук

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 );

Где используется хук в WordPress

Использование не найдено.