#5884
usevinc
Participant

Yes it all works great in the end. Thank you so much for all your support, Vladimir. =)

Finally, some of the wordpress plug-ins I’ve used as a WordPress User Role Editor before. Adminimize, User Roles and Capabilities, Members, Capability Manager Enhanced, WPFront. But none of them had as detailed and quality product support as the User Role Editor Pro plugin. If you like the User Role Editor plugin and you want to buy it, you can click on one of the links to User Role Editor Pro or WordPress User Roles And Capabilities Manager. Thank you again for everything, Vladimir. 🙂

add_filter('woocommerce_product_data_tabs', 'block_wc_product_tabs');

function block_wc_product_tabs($tabs) {
 
  if (!current_user_can('wc_product_vendors_admin_vendor', 'wc_product_vendors_manager_vendor', 'wc_product_vendors_pending_vendor', 'shop_manager', 'customer', 'subscriber', 'employer', 'editor', 'contributor', 'author')) {  // replace role/roles ID with your own
      return $tabs;
  }
  remove_action( 'woocommerce_product_write_panel_tabs', array( $GLOBALS['Product_Addon_Admin'], 'tab' ) ); //If you do not use WooCommerce product add-ons, delete this line starting with the "remove_action" section.
  
// If you want to restrict in the following woocommerce tabs, add "//" at the beginning of the line. Example: // unset ($ tabs ['general']);
  unset($tabs['general']);
  unset($tabs['inventory']);
  unset($tabs['shipping']);
  unset($tabs['linked_product']);
  unset($tabs['attribute']);
  unset($tabs['variations']);
  unset($tabs['advanced']);
  unset($tabs['wc_pao_params']);
  return $tabs;
}