Hide tabs on woocommerce product editor for user role2019 Community Moderator Electionwoocommerce product category tabsGood Solution for Adding jQuery Tabs Anywhere Within WordPress?WordPress Woocommerce - Product Typewoocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19%Add Custom CSS to Woocommerce Product Page in a specified categoryReplacing products on Woocommerce Product Category with Search Results from SearchWPDisplaying custom taxonomy on WooCommerce product pageHide Shipping Class Options in Woocommerce Product Data Shipping TabMove WooCommerce product tabs out of the tabsWoocommerce - Default product image by user role

Is this answer explanation correct?

How to install cross-compiler on Ubuntu 18.04?

What is the most common color to indicate the input-field is disabled?

Theorists sure want true answers to this!

Bullying boss launched a smear campaign and made me unemployable

ssTTsSTtRrriinInnnnNNNIiinngg

How to travel to Japan while expressing milk?

Do creatures with a listed speed of "0 ft., fly 30 ft. (hover)" ever touch the ground?

Using "tail" to follow a file without displaying the most recent lines

Is it possible to create a QR code using text?

Getting extremely large arrows with tikzcd

Was the Stack Exchange "Happy April Fools" page fitting with the '90's code?

How can saying a song's name be a copyright violation?

Notepad++ delete until colon for every line with replace all

Mathematica command that allows it to read my intentions

How could indestructible materials be used in power generation?

How do conventional missiles fly?

What Exploit Are These User Agents Trying to Use?

What is a Samsaran Word™?

Why didn't Boeing produce its own regional jet?

Is it inappropriate for a student to attend their mentor's dissertation defense?

In the UK, is it possible to get a referendum by a court decision?

What do you call someone who asks many questions?

How do I exit BASH while loop using modulus operator?



Hide tabs on woocommerce product editor for user role



2019 Community Moderator Electionwoocommerce product category tabsGood Solution for Adding jQuery Tabs Anywhere Within WordPress?WordPress Woocommerce - Product Typewoocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19%Add Custom CSS to Woocommerce Product Page in a specified categoryReplacing products on Woocommerce Product Category with Search Results from SearchWPDisplaying custom taxonomy on WooCommerce product pageHide Shipping Class Options in Woocommerce Product Data Shipping TabMove WooCommerce product tabs out of the tabsWoocommerce - Default product image by user role










1















I need help how to hide custom product data tabs (created by plugins) for custom user role on product page editor (see image).



enter image description here



I think it suppose to be done by modifying its CSS and apply it on functions.php



Already try and play with the below code and add the element in it, but not working.



// Remove Product Data Tabs Options on product page editor
add_filter('woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );

function hide_wc_product_tabs($tabs)

if (!current_user_can('yith_vendor')) // replace role ID with your own
return $tabs;


//what code should I implement here

return $tabs;



Any help appreciate. thank you










share|improve this question






















  • Which plugin is used for custom product data tabs? So I can clearly understand and will help you.

    – Tanmay Patel
    21 hours ago











  • what @Karun said below solved the problem but not all, the tab created by plugin should be hide is Epeken and the additional extra tab created by the theme.

    – jasaweb
    20 hours ago











  • Can you please let me know theme name or give me website URL. So I can check it.

    – Tanmay Patel
    20 hours ago











  • Here is the theme link themeforest.net/item/…

    – jasaweb
    19 hours ago















1















I need help how to hide custom product data tabs (created by plugins) for custom user role on product page editor (see image).



enter image description here



I think it suppose to be done by modifying its CSS and apply it on functions.php



Already try and play with the below code and add the element in it, but not working.



// Remove Product Data Tabs Options on product page editor
add_filter('woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );

function hide_wc_product_tabs($tabs)

if (!current_user_can('yith_vendor')) // replace role ID with your own
return $tabs;


//what code should I implement here

return $tabs;



Any help appreciate. thank you










share|improve this question






















  • Which plugin is used for custom product data tabs? So I can clearly understand and will help you.

    – Tanmay Patel
    21 hours ago











  • what @Karun said below solved the problem but not all, the tab created by plugin should be hide is Epeken and the additional extra tab created by the theme.

    – jasaweb
    20 hours ago











  • Can you please let me know theme name or give me website URL. So I can check it.

    – Tanmay Patel
    20 hours ago











  • Here is the theme link themeforest.net/item/…

    – jasaweb
    19 hours ago













1












1








1








I need help how to hide custom product data tabs (created by plugins) for custom user role on product page editor (see image).



enter image description here



I think it suppose to be done by modifying its CSS and apply it on functions.php



Already try and play with the below code and add the element in it, but not working.



// Remove Product Data Tabs Options on product page editor
add_filter('woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );

function hide_wc_product_tabs($tabs)

if (!current_user_can('yith_vendor')) // replace role ID with your own
return $tabs;


//what code should I implement here

return $tabs;



Any help appreciate. thank you










share|improve this question














I need help how to hide custom product data tabs (created by plugins) for custom user role on product page editor (see image).



enter image description here



I think it suppose to be done by modifying its CSS and apply it on functions.php



Already try and play with the below code and add the element in it, but not working.



// Remove Product Data Tabs Options on product page editor
add_filter('woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );

function hide_wc_product_tabs($tabs)

if (!current_user_can('yith_vendor')) // replace role ID with your own
return $tabs;


//what code should I implement here

return $tabs;



Any help appreciate. thank you







woocommerce tabs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 21 hours ago









jasawebjasaweb

85




85












  • Which plugin is used for custom product data tabs? So I can clearly understand and will help you.

    – Tanmay Patel
    21 hours ago











  • what @Karun said below solved the problem but not all, the tab created by plugin should be hide is Epeken and the additional extra tab created by the theme.

    – jasaweb
    20 hours ago











  • Can you please let me know theme name or give me website URL. So I can check it.

    – Tanmay Patel
    20 hours ago











  • Here is the theme link themeforest.net/item/…

    – jasaweb
    19 hours ago

















  • Which plugin is used for custom product data tabs? So I can clearly understand and will help you.

    – Tanmay Patel
    21 hours ago











  • what @Karun said below solved the problem but not all, the tab created by plugin should be hide is Epeken and the additional extra tab created by the theme.

    – jasaweb
    20 hours ago











  • Can you please let me know theme name or give me website URL. So I can check it.

    – Tanmay Patel
    20 hours ago











  • Here is the theme link themeforest.net/item/…

    – jasaweb
    19 hours ago
















Which plugin is used for custom product data tabs? So I can clearly understand and will help you.

– Tanmay Patel
21 hours ago





Which plugin is used for custom product data tabs? So I can clearly understand and will help you.

– Tanmay Patel
21 hours ago













what @Karun said below solved the problem but not all, the tab created by plugin should be hide is Epeken and the additional extra tab created by the theme.

– jasaweb
20 hours ago





what @Karun said below solved the problem but not all, the tab created by plugin should be hide is Epeken and the additional extra tab created by the theme.

– jasaweb
20 hours ago













Can you please let me know theme name or give me website URL. So I can check it.

– Tanmay Patel
20 hours ago





Can you please let me know theme name or give me website URL. So I can check it.

– Tanmay Patel
20 hours ago













Here is the theme link themeforest.net/item/…

– jasaweb
19 hours ago





Here is the theme link themeforest.net/item/…

– jasaweb
19 hours ago










2 Answers
2






active

oldest

votes


















1














The $tabs will return an array. Before the line return $tabs; you should check the key in the array and unset it. You can use var_dump to check what the array contains if you're unsure of the key name.






share|improve this answer























  • thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

    – jasaweb
    21 hours ago












  • $tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

    – Karun
    20 hours ago











  • still no luck after increasing the priority value. any other method?

    – jasaweb
    20 hours ago


















1














So using your code as reference, you could do something like:



function hide_wc_product_tabs( $tabs ) 
if ( ! current_user_can( 'yith_vendor' ) )
return $tabs;


unset( $tabs['inventory'] ); // Removes the inventory tab.

return $tabs;


add_filter( 'woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );


These are the default WooCommerce product tabs:



Array ( [0] => general [1] => inventory [2] => shipping [3] => linked_product [4] => attribute [5] => variations [6] => advanced )


Hope it helps!






share|improve this answer























  • I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

    – jasaweb
    21 hours ago












  • @jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

    – dboris
    21 hours ago











  • @jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

    – Tiago Hillebrandt
    21 hours ago












  • ok going to try

    – jasaweb
    21 hours ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "110"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f333204%2fhide-tabs-on-woocommerce-product-editor-for-user-role%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














The $tabs will return an array. Before the line return $tabs; you should check the key in the array and unset it. You can use var_dump to check what the array contains if you're unsure of the key name.






share|improve this answer























  • thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

    – jasaweb
    21 hours ago












  • $tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

    – Karun
    20 hours ago











  • still no luck after increasing the priority value. any other method?

    – jasaweb
    20 hours ago















1














The $tabs will return an array. Before the line return $tabs; you should check the key in the array and unset it. You can use var_dump to check what the array contains if you're unsure of the key name.






share|improve this answer























  • thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

    – jasaweb
    21 hours ago












  • $tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

    – Karun
    20 hours ago











  • still no luck after increasing the priority value. any other method?

    – jasaweb
    20 hours ago













1












1








1







The $tabs will return an array. Before the line return $tabs; you should check the key in the array and unset it. You can use var_dump to check what the array contains if you're unsure of the key name.






share|improve this answer













The $tabs will return an array. Before the line return $tabs; you should check the key in the array and unset it. You can use var_dump to check what the array contains if you're unsure of the key name.







share|improve this answer












share|improve this answer



share|improve this answer










answered 21 hours ago









KarunKarun

867721




867721












  • thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

    – jasaweb
    21 hours ago












  • $tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

    – Karun
    20 hours ago











  • still no luck after increasing the priority value. any other method?

    – jasaweb
    20 hours ago

















  • thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

    – jasaweb
    21 hours ago












  • $tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

    – Karun
    20 hours ago











  • still no luck after increasing the priority value. any other method?

    – jasaweb
    20 hours ago
















thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

– jasaweb
21 hours ago






thanks, it works but I only got one key name from the tabs, how to get the other tabs key name?

– jasaweb
21 hours ago














$tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

– Karun
20 hours ago





$tabs should return all the available keys. Try increasing the priority value on add_filter and keep on debugging using var_dump

– Karun
20 hours ago













still no luck after increasing the priority value. any other method?

– jasaweb
20 hours ago





still no luck after increasing the priority value. any other method?

– jasaweb
20 hours ago













1














So using your code as reference, you could do something like:



function hide_wc_product_tabs( $tabs ) 
if ( ! current_user_can( 'yith_vendor' ) )
return $tabs;


unset( $tabs['inventory'] ); // Removes the inventory tab.

return $tabs;


add_filter( 'woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );


These are the default WooCommerce product tabs:



Array ( [0] => general [1] => inventory [2] => shipping [3] => linked_product [4] => attribute [5] => variations [6] => advanced )


Hope it helps!






share|improve this answer























  • I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

    – jasaweb
    21 hours ago












  • @jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

    – dboris
    21 hours ago











  • @jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

    – Tiago Hillebrandt
    21 hours ago












  • ok going to try

    – jasaweb
    21 hours ago















1














So using your code as reference, you could do something like:



function hide_wc_product_tabs( $tabs ) 
if ( ! current_user_can( 'yith_vendor' ) )
return $tabs;


unset( $tabs['inventory'] ); // Removes the inventory tab.

return $tabs;


add_filter( 'woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );


These are the default WooCommerce product tabs:



Array ( [0] => general [1] => inventory [2] => shipping [3] => linked_product [4] => attribute [5] => variations [6] => advanced )


Hope it helps!






share|improve this answer























  • I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

    – jasaweb
    21 hours ago












  • @jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

    – dboris
    21 hours ago











  • @jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

    – Tiago Hillebrandt
    21 hours ago












  • ok going to try

    – jasaweb
    21 hours ago













1












1








1







So using your code as reference, you could do something like:



function hide_wc_product_tabs( $tabs ) 
if ( ! current_user_can( 'yith_vendor' ) )
return $tabs;


unset( $tabs['inventory'] ); // Removes the inventory tab.

return $tabs;


add_filter( 'woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );


These are the default WooCommerce product tabs:



Array ( [0] => general [1] => inventory [2] => shipping [3] => linked_product [4] => attribute [5] => variations [6] => advanced )


Hope it helps!






share|improve this answer













So using your code as reference, you could do something like:



function hide_wc_product_tabs( $tabs ) 
if ( ! current_user_can( 'yith_vendor' ) )
return $tabs;


unset( $tabs['inventory'] ); // Removes the inventory tab.

return $tabs;


add_filter( 'woocommerce_product_data_tabs' , 'hide_wc_product_tabs' );


These are the default WooCommerce product tabs:



Array ( [0] => general [1] => inventory [2] => shipping [3] => linked_product [4] => attribute [5] => variations [6] => advanced )


Hope it helps!







share|improve this answer












share|improve this answer



share|improve this answer










answered 21 hours ago









Tiago HillebrandtTiago Hillebrandt

943




943












  • I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

    – jasaweb
    21 hours ago












  • @jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

    – dboris
    21 hours ago











  • @jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

    – Tiago Hillebrandt
    21 hours ago












  • ok going to try

    – jasaweb
    21 hours ago

















  • I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

    – jasaweb
    21 hours ago












  • @jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

    – dboris
    21 hours ago











  • @jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

    – Tiago Hillebrandt
    21 hours ago












  • ok going to try

    – jasaweb
    21 hours ago
















I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

– jasaweb
21 hours ago






I get it, but what I need to hide additional custom tabs created by specific plugins. I think it suppose to be done by modifying its CSS and apply it in the code.

– jasaweb
21 hours ago














@jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

– dboris
21 hours ago





@jasaweb You can do what @Karun suggested in his answer, do a var_dump($tabs) so you can see what is the key for each tab, and then unset what you don't need.

– dboris
21 hours ago













@jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

– Tiago Hillebrandt
21 hours ago






@jasaweb So you can add this line before that unset: var_dump( array_keys( $tabs ) ); It will print the "name" for all the tabs that are available, then you can unset the ones you want to.

– Tiago Hillebrandt
21 hours ago














ok going to try

– jasaweb
21 hours ago





ok going to try

– jasaweb
21 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to WordPress Development Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f333204%2fhide-tabs-on-woocommerce-product-editor-for-user-role%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?