[wp-trac] [WordPress Trac] #43991: Flush rewrites depend on admin language, not site language

WordPress Trac noreply at wordpress.org
Mon May 7 14:42:04 UTC 2018


#43991: Flush rewrites depend on admin language, not site language
--------------------------+-----------------------------
 Reporter:  danielpataki  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi everyone,

 I've found an issue which seems to prevent proper translations of custom
 post type rewrite slugs. The issue is that when the rewrite rules are
 regenerated the user's admin language setting is taken into account.

 You can reproduce the issue in a vanilla WP install using twentyseventeen
 with the following modifications. I have also attached a zip version of
 the modified theme for brevity's sake.

 I registered a custom post type with the following rewrite parameter
 {{{#!php
 'rewrite' => array( 'slug' => __('careers', 'textdomain'), 'with_front' =>
 false ),
 }}}

 I changed the language of the site to Spanish and made sure the po file
 was in place. "careers" was translated to "carreras". I generated the mo
 file, visited the permalink settings page. I could then go to the
 /carreras/ page and it loaded as expected.

 Now, if you go and change your admin language only in your profile
 settings and then go to the permalink page it breaks. The archive is
 accessible through /careers/ as usual.

 I am not familiar enough with the rewrite subsystem to propose changes,
 but hopefully someone here has the experience to do so :)

 Thanks so much!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43991>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list