[wp-trac] [WordPress Trac] #9591: remove_accents() improvements for i18n permalinks

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 19 11:58:06 UTC 2011


#9591: remove_accents() improvements for i18n permalinks
----------------------------------------+-----------------------
 Reporter:  Denis-de-Bernardy           |       Owner:  ryan
     Type:  defect (bug)                |      Status:  reopened
 Priority:  high                        |   Milestone:  3.3
Component:  Permalinks                  |     Version:  2.8
 Severity:  minor                       |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
----------------------------------------+-----------------------

Comment (by SergeyBiryukov):

 Replying to [comment:72 unsalkorkmaz]:
 > It basically uses raw_title and completely disabling all filtering
 right? is this safe?

 It only cancels `remove_accents()`, while the other filtering, such as
 `sanitize_title_with_dashes()`, is still performed. So I guess if you want
 to use accented characters in slugs, that's the proper solution.

 If you only want to remove accents from one characters and keep them on
 others, you can create your own version of `remove_accents()` and hook it
 to `sanitize_title`. A filter in `remove_accents()` itself would probably
 be a bit cleaner solution, but it's not necessary.

 I've attached [attachment:ticket:15248:allow-turkish-accents-in-
 slugs.php]. It should do exactly what you want: allow "şŞ İı Ğğ Üü Öö çÇ"
 characters and remove accents from all others. It also allows these
 characters in usernames, as per [comment:ticket:15248:1 your comment
 there].

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9591#comment:73>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list