[wp-trac] [WordPress Trac] #32939: Add filter for get_locale() in remove_accents()

WordPress Trac noreply at wordpress.org
Mon Feb 6 12:32:30 UTC 2017


#32939: Add filter for get_locale() in remove_accents()
-------------------------------------------------+-------------------------
 Reporter:  akirk                                |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  I18N                                 |  Release
 Severity:  normal                               |     Version:  4.3
 Keywords:  needs-docs good-first-bug needs-     |  Resolution:
  patch                                          |     Focuses:
-------------------------------------------------+-------------------------
Changes (by swissspidy):

 * keywords:  needs-docs => needs-docs good-first-bug needs-patch


Comment:

 In the meantime, one could probably do something like this:

 {{{#!php
 <?php
 function wp32939_change_locale( $title, $raw_title, $context ) {
   remove_filter( 'sanitize_title', 'wp32939_change_locale ' );
   add_filter( 'locale', function() { return 'de_DE';  } );
   return sanitize_title( $raw_title, '', $context );
 }

 add_filter( 'sanitize_title', 'wp32939_change_locale', 10, 3 );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32939#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list