I try to apply the function to sanitize file downloaded from the plugin WP Filebase
In the functions.php
file of my theme I included this
function make_san_filename($filename) {
$info = pathinfo($filename);
$ext = empty($info['extension']) ? '' : '.' . $info['extension'];
$name = str_replace($ext, '', $filename);
return sanitize_title(strtolower($name)) . $ext;
}
add_filter('sanitize_file_name', 'make_san_filename', 10);
The function works perfectly with the files manager WordPress, URLs of my files are clear, but the function does not work for the downloaded files with WP Filebase, so I can not replace the special characters in my URLs as : e + ® to à …
Any idea or alternative ?