Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
Last active December 21, 2015 23:59
Show Gist options
  • Save annalinneajohansson/6386596 to your computer and use it in GitHub Desktop.
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
<?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