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;
}
$tag(строка)
The link tag for the enqueued style.
$handle(строка)
The style's registered handle.
$href(строка)
The stylesheet's source URL.
$media(строка)
The stylesheet's media attribute.

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

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

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

WP_Styles::do_item()
style_loader_tag
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

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