nochmals GermanPermalinks
Von der Umlautkodierung in Titeln der WordPress-Permalinks hatte ich es gestern ja schon gehabt. Nur wenn man ecto benutzt, dann bringt das leider alles nichts… :-(
Denn ecto kodiert die Umlaute selber schon. So steht im Titel dann nicht ein Ü sondern ein Ü, und somit greift Papa Scotts plugin nicht. Schade. Oder ich fasse es kurz selber an und füge die entsprechenden Werte hinzu.
Versuch mal mit diesen Funktion:
function german_permalinks($title) {$german_chars['in'] = array( chr(196), chr(228), chr(214), chr(246), chr(220), chr(252), chr(223));
$german_chars['ecto'] = array( 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß');
$german_chars['out'] = array('Ae', 'ae', 'Oe', 'oe', 'Ue', 'ue', "ss");
$title=html_entity_decode($title);
if (my_seems_utf8($title)) {
$invalid_latin_chars = array(chr(197).chr(146) => 'OE', chr(197).chr(147) => 'oe', chr(197).chr(160) => 'S', chr(197).chr(189) => 'Z', chr(197).chr(161) => 's', chr(197).chr(190) => 'z', chr(226).chr(130).chr(172) => 'E');
$title = utf8_decode(strtr($title, $invalid_latin_chars));
}
$title = str_replace($german_chars['ecto'], $german_chars['out'], $title);
$title = str_replace($german_chars['in'], $german_chars['out'], $title);
$title = sanitize_title_with_dashes($title);
return $title;
}
Er, das hat nicht geklappt. Der neue Funktion (mit Entities) ist jetzt auf die Wiki-Seite: http://wiki.wordpress.org/GermanPermalinks
—–BEGIN PGP SIGNED MESSAGE—–
Hash: SHA1
Wow, phantastisch! So funktioniert es! Vielen Dank, das hätte ich so schnell nicht erwartet.
—–BEGIN PGP SIGNATURE—–
Version: GnuPG v1.2.4 (Darwin)
Comment: http://bronski.net/bronski.asc
iEYEARECAAYFAkDGDcQACgkQ/ay4pK+rrYMzLgCeOuZDhT3/HgRmYicYujjMHf36
K6wAoPuL9GvMjVMY62aB1b52BTNIcn/G
=i+qG
—–END PGP SIGNATURE—–