Skip to content

Instantly share code, notes, and snippets.

View ErvinLlojku's full-sized avatar

Ervin Llojku ErvinLlojku

View GitHub Profile
@davidsneighbour
davidsneighbour / dnb-transliterate-slug.php
Last active April 26, 2020 17:04
Umlauts for German WordPress slug - add these lines to your functions.php and forget it.
<?php
add_filter('sanitize_title', 'dnb_transliterate_slug', 5, 3);
function dnb_transliterate_slug($title, $raw_title = NULL, $context = 'query') {
// Hacky hook due to hacky core, see
// http://core.trac.wordpress.org/ticket/16905
if ($raw_title != NULL) {
$title = $raw_title; // undo remove_accents
}