我需要将内置post类型“post”的重写slug更改为“example”。com/杂志/新闻/任何好消息”。
当我重新注册post类型“post”并将重写slug设置为“magazine/news”时,效果很好。但现在我不确定是否有任何副作用。有人对此有任何积极或消极的经验吗?
代码如下:
register_post_type( \'post\', array(
\'labels\' => array(
\'name_admin_bar\' => _x( \'Post\', \'add new on admin bar\' ),
),
\'public\' => true,
/* internal use only. don\'t use this when registering your own post type. */
\'_edit_link\' => \'post.php?post=%d\', /* internal use only. don\'t use this when registering your own post type. */
\'capability_type\' => \'post\',
\'map_meta_cap\' => true,
\'hierarchical\' => false,
\'rewrite\' => array(\'slug\' => \'magazine/news\'),
\'query_var\' => false,
\'delete_with_user\' => true,
\'supports\' => array( \'title\', \'editor\', \'author\', \'thumbnail\', \'excerpt\', \'trackbacks\', \'custom-fields\', \'comments\', \'revisions\', \'post-formats\' ),
) );