【发布时间】:2020-10-07 16:34:42
【问题描述】:
我正在尝试向 WordPress 和 WooCommerce 添加另一个客户角色。当用户登录时,我将使用这个新的客户角色来分配替代价格。我的代码有效,但我无法找到客户在 WordPress/WooCommerce 中默认拥有的权限。我希望这个新角色具有与默认客户帐户相同的权限。下面的代码位于我的子functions.php文件中。
/* Custom user roles */
add_role('distributor', __(
'Distributor'),
array(
'read' => true, // Allows a user to read
'create_posts' => true, // Allows user to create new posts
'edit_posts' => true, // Allows user to edit their own posts
'edit_others_posts' => true, // Allows user to edit others posts too
'publish_posts' => true, // Allows the user to publish posts
'manage_categories' => true, // Allows user to manage post categories
)
);
【问题讨论】:
标签: wordpress woocommerce