Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #40298, comment 1


Ignore:
Timestamp:
03/29/2017 01:21:38 PM (7 years ago)
Author:
Chouby
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40298, comment 1

    initial v1  
    11IMHO, you must not internationalize CPT slugs bases. WordPress has no slug base for CPT but it has for taxonomies (categories, tags and post formats), and you'll see that they are not internationalized. See https://github.com/WordPress/WordPress/blob/4.7.3/wp-includes/taxonomy.php#L38-L53
    22
    3 The reason is exactly the kind of issue you are running in. A CPT slug base must never change on your site. If you are writing a plugin, the translations may not be available first. So the slug base will be 'events'? Then at some point, the translations will become available and the slug base will become 'translated_events' changing all the corresponding urls.
     3The reason is exactly the kind of issue you are running in. A CPT slug base must never change on your site. If you are writing a plugin, the translations may not be available first. So the slug base will be 'events'. Then at some point, the translations will become available and the slug base will become 'translated_events' changing all the corresponding urls.
    44
    55If you want to allow the customization of your custom post type slug base, the best is to do as done by WordPress for categories and tags and provide an option. If this is for a unique project, you can just hardcode it in your language.