Remove Specified Product Editor Tabs

This snippet will simply remove the tabs you wish to remove from the Vendor Dashboard’s Product Editor. For me, I did not need Linked Products or the Advanced tab because they were just not necessary. I also personally use the Yith Product Shipping plugin to handle shipping instead of the default Woocommerce Shipping Zones, which there was no way my vendors would be able to figure out. So I had no need for the default shipping tab either for a time.

Note: I commissioned a plugin that integrates the Yith Product Shipping plugin into a new tab in the product editor and gives vendors the ability to enter shipping charges themselves in a much easier format. Find it in the Plugins section of the site.

Huge lesson learned: On the WCMp website they provide code to add your own custom product editor tab. For some reason, that code is set up to override the Advanced tab instead of creating an actual new one–which is accomplished just by naming it something else. If you use this code to remove the Advanced tab and then later try adding your own, it won’t display and that’s why. I’m not ready to talk about how many hours that took to figure out.

As always, this is either added to your Child Theme’s functions.php file, or consider using the My Custom Functions Pro plugin to manage and organize all your snippets.

// NOTE:  THE CODE PROVIDED BY WCMP TO ADD YOUR OWN NEW TAB HERE CURRENTLY IS SET TO OVERWRITE THE ADVANCED TAB.  HAVING THIS CODE HERE MAKES IT SO YOUR NEW TAB WILL NEVER SHOW UP.  ASK ME HOW MANY HOURS WERE SPENT FIGURING THAT OUT.

add_filter('wcmp_product_data_tabs', 'callback_wcmp_product_data_tabs', 99);

// Choose which tabs to unset.
function callback_wcmp_product_data_tabs($tabs){
   unset($tabs['advanced']);
   unset($tabs['shipping']);  // Don't forget this has weights and dimensions in it.  Might be better to edit the template than remove the tab completely if you don't want to lose all the features, especially for csv downloads.
   unset($tabs['linked_product']);
   return $tabs;
}

Is this no longer relevant or not working? Please let us know in the comments!

Comments on this post

Your email address will not be published. Required fields are marked *