sanitize_file_name_chars хук-фильтрWP 2.8.0

Filters the list of characters to remove from a filename.

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

add_filter( 'sanitize_file_name_chars', 'wp_kama_sanitize_file_name_chars_filter', 10, 2 );

/**
 * Function for `sanitize_file_name_chars` filter-hook.
 * 
 * @param string[] $special_chars Array of characters to remove.
 * @param string   $filename_raw  The original filename to be sanitized.
 *
 * @return string[]
 */
function wp_kama_sanitize_file_name_chars_filter( $special_chars, $filename_raw ){

	// filter...
	return $special_chars;
}
$special_chars(string[])
Array of characters to remove.
$filename_raw(строка)
The original filename to be sanitized.

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

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

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

sanitize_file_name()
sanitize_file_name_chars
wp-includes/formatting.php 2046
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );

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

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