I want to remove some characters from the slug, like “¿” that we use in spanish for opening a question.
If I go to wp-includes/formatting.php and in
function sanitize_title_with_dashes($title) line 820 wp32
I add this
$title = str_replace('¿', '', $title);
$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
And it is working correctly. So when I write in the title “¿Qué tal?” the slug is “que-tal”
Now, how to do it with a function so I can use it via functions.php or via a plugin??
I am doing this but it is not working
$slug = str_replace('¿', '', $slug);
Thanks in advance