admin管理员组文章数量:1305642
I wrote a code to allow in-store product managers, without post editing permissions, and without other product editing permissions. I have a number of issues with the code, I would love to resolve.
- There are three menus in the control panel, which are not used and they appear anyway (the main page of the dashboard, Marketing, Woocommerce ).
- I need to allow the product author to receive emails.
I want to fix the code and not install plugins.
add_role('vendor_shop', __(
'vendor_shop'),
array(
'read' => true, // Allows a user to read
)
);
$result = add_role(
'vendor_shop',
__( 'vendor_shop' ),
array(
$role = get_role( 'vendor_shop' ),
$role->add_cap( 'manage_woocommerce' ),
$role->add_cap( 'delete_private_products' ),
$role->remove_cap( 'edit_others_products' ),
$role->remove_cap( 'edit_dashboard' ),
$role->remove_cap( 'fluentform_dashboard_access' ),
$role->add_cap( 'delete_product' ),
$role->add_cap( 'delete_product_terms' ),
$role->add_cap( 'delete_products' ),
$role->add_cap( 'delete_published_products' ),
$role->add_cap( 'edit_private_products' ),
$role->add_cap( 'edit_product' ),
$role->add_cap( 'edit_product_terms' ),
$role->add_cap( 'edit_products' ),
$role->add_cap( 'publish_products' ),
$role->add_cap( 'read_private_products' ),
$role->remove_cap( 'wysija_stats_dashboard' ),
$role->add_cap( 'manage_product_terms' ),
$role->add_cap( 'edit_published_products' ),
$role->add_cap( 'manage_product_terms' ),
$role->add_cap( 'manage_product_terms' ),
$role->add_cap( 'read_product' ),
$role->add_cap( 'views_products' ),
$role->remove_cap( 'edit_posts' ),
$role->remove_cap( 'view_woocommerce_reports' ),
$role->add_cap( 'manage_woocommerce_products' ),
$role->remove_cap( 'manage_woocommerce_orders' ),
$role->remove_cap( 'edit_shop_order' ),
$role->remove_cap( 'view_shop_order' ),
$role->add_cap( 'assign_product_terms' ),
$role->remove_cap( 'edit_pages' ),
$role->remove_cap( 'import' ),
$role->add_cap( 'views_upload' ),
$role->add_cap( 'unfiltered_upload' ),
$role->remove_cap( 'edit_others_shop_order' ),
$role->remove_cap( 'edit_others_posts' ),
$role->remove_cap( 'publish_posts' ),
$role->remove_cap( 'publish_shop_order' ),
$role->remove_cap( 'edit_published_posts' ),
$role->remove_cap( 'edit_others_posts' ),
$role->remove_cap( 'edit_others_posts' ),
$role->remove_cap( 'delete_others_products' ),
$role->remove_cap( 'edit_published_pages' ),
$role->remove_cap( 'delete_published_pages' ),
$role->remove_cap( 'delete_published_posts' ),
$role->remove_cap( 'edit_woocommerce_coupons' ),
$role->remove_cap( 'manage_shop_order' ),
$role->remove_cap( 'edit_shop_coupons' ),
$role->remove_cap( 'export' ),
)
);
本文标签: woocommerce offtopicProblems adding instore product managers
版权声明:本文标题:woocommerce offtopic - Problems adding in-store product managers 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741776754a2397069.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论