[wp-trac] [WordPress Trac] #40298: Translated custom post type archive slug is in user language, not site language

WordPress Trac noreply at wordpress.org
Wed Mar 29 12:54:51 UTC 2017


#40298: Translated custom post type archive slug is in user language, not site
language
--------------------------+-----------------------------
 Reporter:  docflo        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  I18N          |    Version:  4.7.3
 Severity:  normal        |   Keywords:
  Focuses:  template      |
--------------------------+-----------------------------
 Tried to do a search, got "OperationalError: (1040, 'Too many
 connections')" so: sorry if this is a dupe.

 I have a custom post type "event". In my register_post_type call I have

 {{{
        'slug' => _x( 'events', 'events slug', 'domain' ),

 }}}

 In my Dutch translation file I translate 'events' as 'agenda'.
 My user has the '''interface language''' set to English.

 When I change the '''site language''' from English to Dutch and flush the
 permalinks my single events all have the correct slug ("/agenda/single-
 post-slug").
 However the custom post type archive remains available under the old slug
 "/events/". The new slug "/agenda/" results in a 404.

 The "solution" is to change the user account's interface language to Dutch
 and flush the permalinks. Now the custom post type archive is available
 under the slug "/agenda/".

 This seems wrong and could lead to inadvertent changes of the URL for a
 cpt-archive. I would expect the cpt-archive to follow the site language,
 just like the single posts do.

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


More information about the wp-trac mailing list