A custom post type can be registered with one slug (e.g. products)
register_post_type('products', $args);
How can I add multiple slugs to the same Custom Post Type?
website_address.com/en/products/
website_address.com/fr/produits/
website_address.com/it/prodotti/
henrywright
The rewrite argument for register_post_type() accepts an array. One of the array keys is slug. So you could i18n it like this:
register_post_type(
'products',
array (
'rewrite' => array (
'slug' => _x( 'products', 'URL slug', 'your_text_domain' )
)
)
);
Idea taken from here.
Ref: https://codex.wordpress.org/Function_Reference/register_post_type
来源:https://stackoverflow.com/questions/30533210/wordpress-multiple-slugs-for-a-custom-post-type