Ograniczona rola sprzedawcy w woocommerce
Zadanie na dzisiaj. Jak zrobić aby pracownik obsługujący sklep nie miał wglądu w zamówienia. Może jedynie dodawać i edytować produkty. Po prostu stworzymy nową rolę – sprzedawca.
$rola = add_role( 'Sprzedawca', __('Sprzedawca'), array(
'read' => true,
'read_product' => true,
'read_shop_coupon' => true,
'edit_posts' => true,
'edit_post' => true,
'manage_categories' => true,
'edit_themes' => false,
'install_plugins' => false,
'assign_product_terms' => true,
'edit_product' => true,
'edit_product_terms' => true,
'edit_products' => true,
'edit_others_products' => true,
'edit_published_products' => true,
'publish_products' => true,
'delete_product' => true,
'delete_product_terms' => true,
'delete_products' => true,
'delete_published_products' => true,
'delete_others_products' => true,
'manage_product_terms' => true,
'publish_shop_coupons' => true,
'assign_shop_coupon_terms' => true,
'edit_shop_coupon' => true,
'edit_shop_coupon_terms' => true,
'edit_shop_coupons' => true,
'edit_published_shop_coupons' => true,
'manage_shop_coupon_terms' => true,
'delete_published_shop_coupons' => true,
'delete_others_shop_coupons' => true,
'upload_files' => true
) );