I can get array keys of product data tabs in woo product editor page by this code var_dump( array_keys( $tabs ) );
, so I can hide them. But I could not solve the array keys of couple tabs that created by plugin and build in tab by the theme (flatsome). Any help really appreciate it. Thank you.
add_filter('woocommerce_product_data_tabs' , 'block_wc_product_tabs' );
function block_wc_product_tabs($tabs) {
if (!current_user_can('yith_vendor')) { // replace role ID with your own
return $tabs;
}
var_dump( array_keys( $tabs ) );
//unset($tabs['general']);
//unset($tabs['inventory']);
unset($tabs['linked_product']);
unset( $tabs['tm_extra_product_options'] );
//unset( $tabs['product_origin'] );
return $tabs;
}
2
Answers
below the code used by the plugin to add the tab in product data tabs
Try increasing the order of execution of your action.