Skip to:
Content
Pages
Categories
Search
Top
Bottom

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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have same problem!

    @hoangstorm:

    For some reason, when I got the email notification for your reply on my original post, it included your post with a solution! Now your post only shows “I have the same problem”.

    The solution was:

    “I have same problem, but a have solved it.

    This problem is when you create or edit a post, bbpress not call sanitize_title function, it only call trim and stripslashes function.

    You can change it to sanitize_title function in bb-post.php and bb-edit.php and use your plugin.

    Hope this help!”

    Did you edit your post to remove this solution because it’s not working or something else happened?


    Alex Seidanis
    Participant

    @beerallica

    Did you ever manage to make this work?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar