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

scribu scribu at gmail.com
Mon Mar 23 19:51:09 GMT 2009


Maybe this will fix your problem:

function sanitize_title_with_translit($title) {
       global $tr;
       $new_title = strtr($title,$tr);

       return ($new_title == $title) ? $title : $new_title;
}

I've simply added a check so that the slug isn't converted twice.

On Sat, Mar 21, 2009 at 7:32 PM, Alexander Concha <alex at buayacorp.com>wrote:

> Hello,
>
> 2009/3/20 Milan Dinić <liste at srpski.biz>:
> > [...]
> >
> > 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
> > problem).
>
> Actually I haven't checked WP codebase in a long time, so I don't know
> what changed. The idea is simple, you should only fix permalinks when
> (post, category, tag, ...) slugs change.
> --
> Alexander Concha
> http://www.buayacorp.com
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
http://scribu.net


More information about the wp-hackers mailing list