script_loader_src хук-фильтрWP 2.2.0

Filters the script loader source.

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

add_filter( 'script_loader_src', 'wp_kama_script_loader_src_filter', 10, 2 );

/**
 * Function for `script_loader_src` filter-hook.
 * 
 * @param string $src    Script loader source path.
 * @param string $handle Script handle.
 *
 * @return string
 */
function wp_kama_script_loader_src_filter( $src, $handle ){

	// filter...
	return $src;
}
$src(строка)
Script loader source path.
$handle(строка)
Script handle.

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

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

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

WP_Scripts::do_item()
script_loader_src
_print_emoji_detection_script()
script_loader_src
wp_get_script_polyfill()
script_loader_src
wp-includes/class.wp-scripts.php 334
$srce = apply_filters( 'script_loader_src', $src, $handle );
wp-includes/formatting.php 5791
'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ),
wp-includes/formatting.php 5793
'twemoji' => apply_filters( 'script_loader_src', includes_url( "js/twemoji.js?$version" ), 'twemoji' ),
wp-includes/formatting.php 5798
'concatemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji-release.min.js?$version" ), 'concatemoji' ),
wp-includes/script-loader.php 194
$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
wp-includes/class.wp-scripts.php 387
$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );

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

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