Latin characters in slugs
-
I’m greek and I have a WordPress blog in greek running bbpress RC4.
The problem with using greek in your blog is the use of non-latin characters in the titles of the posts. This leads to the creation of slugs with non-latin characters and consequently pretty-permalinks with non-latin characters. That -of course- is a problem because URLs look nice in the address bar of your browser i.e.
http://deltahacker.gr/2011/08/19/πάρα-πολύ-καλά-νέα-αυτό/
but when you copy the URL to paste it somewhere else -in an email for example-, the same URL becomes:
http://deltahacker.gr/2011/08/19/%CF%80%CE%AC%CF%81%CE%B1-%CF%80%CE%BF%CE%BB%CF%8D-%CE%BA%CE%B1%CE%BB%CE%AC-%CE%BD%CE%AD%CE%B1-%CE%B1%CF%85%CF%84%CF%8C/
To resolve this problem, greek blog owners can use the plugin Greeklish-Permalings (from the words Greek & English). This plugin adds a filter on the sanitize_title function of WordPress with a new function that converts every non-latin character to a similar latin. For example, the greek alpha character “α” becomes the latin alpha character “a” and so on. So when someone creates a new post, and wordpress tries to create a slug automatically, sanitize-title is called, which is hooked to the plugin, and so a slug with only latin characters is created, even if there are non-latin characters in the title.
You can see the code of this very small plugin on my dropbox:
http://dl.dropbox.com/u/1816074/greeklish-permalinks.php
The problem is that the plugin does not work with bbpress titles. If a forum or topic title contains greek (non-latin) characters, they are not converted to latin even if the plugin is enabled. Does someone know why is this happening?
Doesn’t bbpress call the sanitize_title function? Do not plugin function filters work for custom post types?
- You must be logged in to reply to this topic.