sanitize_file_name filter-hookWP 2.8.0

Filters a sanitized filename string.

Usage

add_filter( 'sanitize_file_name', 'wp_kama_sanitize_file_name_filter', 10, 2 );

/**
 * Function for `sanitize_file_name` filter-hook.
 * 
 * @param string $filename     Sanitized filename.
 * @param string $filename_raw The filename prior to sanitization.
 *
 * @return string
 */
function wp_kama_sanitize_file_name_filter( $filename, $filename_raw ){

	// filter...
	return $filename;
}
$filename(string)
Sanitized filename.
$filename_raw(string)
The filename prior to sanitization.

Changelog

Since 2.8.0 Introduced.

Where the hook is called

sanitize_file_name()
sanitize_file_name
wp-includes/formatting.php 2107
return apply_filters( 'sanitize_file_name', $filename, $filename_raw );
wp-includes/formatting.php 2067
return apply_filters( 'sanitize_file_name', $filename, $filename_raw );

Where the hook is used in WordPress

Usage not found.