Wordpress multiple slugs for a Custom Post Type

南笙酒味 提交于 2019-12-06 03:18:15
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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!