Last active
December 21, 2015 23:59
-
-
Save annalinneajohansson/6386596 to your computer and use it in GitHub Desktop.
Replace and/or remove accents and other special characters in filenames on upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Extended sanitize filename | |
Plugin URI: | |
Description: Replace and/or remove accents and other special characters in filenames on upload | |
Version: 1 | |
Author: Hippies | |
Author URI: http://hippies.se | |
*/ | |
add_filter( 'sanitize_file_name', 'extended_sanitize_file_name', 10, 2 ); | |
function extended_sanitize_file_name( $filename ) { | |
$sanitized_filename = remove_accents( $filename ); | |
return $sanitized_filename; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment