[wp-hackers] Helping international users by fixing this code

Milan Dinić liste at srpski.biz
Fri Mar 20 19:45:06 GMT 2009

Thank you for your reply! If Google Translate did good job, then in your
post about plugin you described same situation as I did, only difference is
that you had problem with other characters.

Your fix is partly working. (just to note that I need to remove line with
add_filter I had in original plugins). Old posts with Cyrilic letters can be
accesed but it doesn't completely work for new posts (meaning that we came
in situation we have before plugin :)).

First, on preview of slug on write page, slug is not transliterated
(although it is when post/page is published). Then slug for category is not
transliterated. Next, when writting on dashboard via Quick Press, nothing is
transliterated. And at last when creating new tag or category witout manual
enter of slug on its own editing pages (edit-tags.php and category.php)
again transliteration is not working. All of this worked without your fix.

So your code is not complete solution, and you should check if your plugin
is working as it is intented with newest version of WordPress (maybe that is

Thanks again

2009/3/20 Alexander Concha <alex at buayacorp.com>

> Hello,
> On Fri, Mar 20, 2009 at 5:38 PM, Milan Dinić <liste at srpski.biz> wrote:
> > Hi everyone
> >
> > [...]
> >
> > If we install any of this plugins, all Cyrillic letters from titles of
> > posts/pages/tags/categories are transliterated to Latin one in URL slugs
> for
> > new posts/pages/tags/categories, but problem is that if there are already
> > posts/pages/tags/categories with Cyrillic letters, those pages return 404
> > errors. (just to note that if we turn off plugin everything works without
> > problem)
> If I didn't misunderstand your problem, you can do the same I did for
> a plugin I wrote [1]:
> With the following snippet you won't have the 404 problem because
> sanitize_title_with_translit will be called only for the posts that
> are saved.
> ...
> function __enable_fix($post_name) {
>         add_action('sanitize_title', 'sanitize_title_with_translit', 0);
>         return $post_name;
> }
> add_filter('pre_post_name', '__enable_fix');
> ...
> [1]
> http://www.buayacorp.com/archivos/nueva-version-del-plugin-permalink-fix/
> --
> Alexander Concha
> http://www.buayacorp.com
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list