print_scripts_array хук-фильтрWP 2.3.0

Filters the list of script dependencies left to print.

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

add_filter( 'print_scripts_array', 'wp_kama_print_scripts_array_filter' );

/**
 * Function for `print_scripts_array` filter-hook.
 * 
 * @param string[] $to_do An array of script dependency handles.
 *
 * @return string[]
 */
function wp_kama_print_scripts_array_filter( $to_do ){

	// filter...
	return $to_do;
}
$to_do(string[])
An array of script dependency handles.

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

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

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

WP_Scripts::all_deps()
print_scripts_array
wp-includes/class-wp-scripts.php 735
$this->to_do = apply_filters( 'print_scripts_array', $this->to_do );

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

wp-includes/default-filters.php 593
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );