style_loader_src хук-фильтрWP 2.6.0

Filters an enqueued style's fully-qualified URL.

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

add_filter( 'style_loader_src', 'wp_kama_style_loader_src_filter', 10, 2 );

/**
 * Function for `style_loader_src` filter-hook.
 * 
 * @param string $src    The source URL of the enqueued style.
 * @param string $handle The style's registered handle.
 *
 * @return string
 */
function wp_kama_style_loader_src_filter( $src, $handle ){

	// filter...
	return $src;
}
$src(строка)
The source URL of the enqueued style.
$handle(строка)
The style's registered handle.

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

С версии 2.6.0 Введена.

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

WP_Styles::_css_href()
style_loader_src
wp-includes/class-wp-styles.php 412
$src = apply_filters( 'style_loader_src', $src, $handle );

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

wp-includes/default-filters.php 610
add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );