Hide tabs on woocommerce product editor for user role Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election Resultswoocommerce 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

Does the Black Tentacles spell do damage twice at the start of turn to an already restrained creature?

Can you force honesty by using the Speak with Dead and Zone of Truth spells together?

Monty Hall Problem-Probability Paradox

After Sam didn't return home in the end, were he and Al still friends?

what is the log of the PDF for a Normal Distribution?

Most effective melee weapons for arboreal combat? (pre-gunpowder technology)

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

Did pre-Columbian Americans know the spherical shape of the Earth?

I got rid of Mac OSX and replaced it with linux but now I can't change it back to OSX or windows

Putting class ranking in CV, but against dept guidelines

What does 丫 mean? 丫是什么意思?

What initially awakened the Balrog?

What is the role of と after a noun when it doesn't appear to count or list anything?

Can an iPhone 7 be made to function as a NFC Tag?

Trying to understand entropy as a novice in thermodynamics

Delete free apps from library

How many time has Arya actually used Needle?

Special flights

My mentor says to set image to Fine instead of RAW — how is this different from JPG?

Is there public access to the Meteor Crater in Arizona?

White walkers, cemeteries and wights

Caught masturbating at work

How to change the tick of the color bar legend to black

Simple Line in LaTeX Help!



Hide tabs on woocommerce product editor for user role



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election Resultswoocommerce 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



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








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
    Apr 2 at 9:17











  • 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
    Apr 2 at 9:27











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

    – Tanmay Patel
    Apr 2 at 9:35











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

    – jasaweb
    Apr 2 at 11:00

















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
    Apr 2 at 9:17











  • 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
    Apr 2 at 9:27











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

    – Tanmay Patel
    Apr 2 at 9:35











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

    – jasaweb
    Apr 2 at 11:00













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 Apr 2 at 8:56









jasawebjasaweb

85




85












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

    – Tanmay Patel
    Apr 2 at 9:17











  • 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
    Apr 2 at 9:27











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

    – Tanmay Patel
    Apr 2 at 9:35











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

    – jasaweb
    Apr 2 at 11:00

















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

    – Tanmay Patel
    Apr 2 at 9:17











  • 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
    Apr 2 at 9:27











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

    – Tanmay Patel
    Apr 2 at 9:35











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

    – jasaweb
    Apr 2 at 11:00
















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

– Tanmay Patel
Apr 2 at 9:17





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

– Tanmay Patel
Apr 2 at 9:17













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
Apr 2 at 9:27





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
Apr 2 at 9:27













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

– Tanmay Patel
Apr 2 at 9:35





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

– Tanmay Patel
Apr 2 at 9:35













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

– jasaweb
Apr 2 at 11:00





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

– jasaweb
Apr 2 at 11:00










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
    Apr 2 at 9:23












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

    – Karun
    Apr 2 at 9:26











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

    – jasaweb
    Apr 2 at 10:04


















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
    Apr 2 at 9:07












  • @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
    Apr 2 at 9:10











  • @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
    Apr 2 at 9:10












  • ok going to try

    – jasaweb
    Apr 2 at 9:12











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
    Apr 2 at 9:23












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

    – Karun
    Apr 2 at 9:26











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

    – jasaweb
    Apr 2 at 10:04















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
    Apr 2 at 9:23












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

    – Karun
    Apr 2 at 9:26











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

    – jasaweb
    Apr 2 at 10:04













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 Apr 2 at 9:02









KarunKarun

1,068721




1,068721












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

    – jasaweb
    Apr 2 at 9:23












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

    – Karun
    Apr 2 at 9:26











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

    – jasaweb
    Apr 2 at 10:04

















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

    – jasaweb
    Apr 2 at 9:23












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

    – Karun
    Apr 2 at 9:26











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

    – jasaweb
    Apr 2 at 10:04
















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

– jasaweb
Apr 2 at 9:23






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

– jasaweb
Apr 2 at 9:23














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

– Karun
Apr 2 at 9:26





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

– Karun
Apr 2 at 9:26













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

– jasaweb
Apr 2 at 10:04





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

– jasaweb
Apr 2 at 10:04













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
    Apr 2 at 9:07












  • @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
    Apr 2 at 9:10











  • @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
    Apr 2 at 9:10












  • ok going to try

    – jasaweb
    Apr 2 at 9:12















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
    Apr 2 at 9:07












  • @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
    Apr 2 at 9:10











  • @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
    Apr 2 at 9:10












  • ok going to try

    – jasaweb
    Apr 2 at 9:12













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 Apr 2 at 9:04









Tiago HillebrandtTiago Hillebrandt

1043




1043












  • 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
    Apr 2 at 9:07












  • @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
    Apr 2 at 9:10











  • @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
    Apr 2 at 9:10












  • ok going to try

    – jasaweb
    Apr 2 at 9:12

















  • 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
    Apr 2 at 9:07












  • @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
    Apr 2 at 9:10











  • @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
    Apr 2 at 9:10












  • ok going to try

    – jasaweb
    Apr 2 at 9:12
















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
Apr 2 at 9:07






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
Apr 2 at 9:07














@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
Apr 2 at 9:10





@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
Apr 2 at 9:10













@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
Apr 2 at 9:10






@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
Apr 2 at 9:10














ok going to try

– jasaweb
Apr 2 at 9:12





ok going to try

– jasaweb
Apr 2 at 9:12

















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

Triangular numbers and gcdProving sum of a set is $0 pmod n$ if $n$ is odd, or $fracn2 pmod n$ if $n$ is even?Is greatest common divisor of two numbers really their smallest linear combination?GCD, LCM RelationshipProve a set of nonnegative integers with greatest common divisor 1 and closed under addition has all but finite many nonnegative integers.all pairs of a and b in an equation containing gcdTriangular Numbers Modulo $k$ - Hit All Values?Understanding the Existence and Uniqueness of the GCDGCD and LCM with logical symbolsThe greatest common divisor of two positive integers less than 100 is equal to 3. Their least common multiple is twelve times one of the integers.Suppose that for all integers $x$, $x|a$ and $x|b$ if and only if $x|c$. Then $c = gcd(a,b)$Which is the gcd of 2 numbers which are multiplied and the result is 600000?

Ingelân Ynhâld Etymology | Geografy | Skiednis | Polityk en bestjoer | Ekonomy | Demografy | Kultuer | Klimaat | Sjoch ek | Keppelings om utens | Boarnen, noaten en referinsjes Navigaasjemenuwww.gov.ukOffisjele webside fan it regear fan it Feriene KeninkrykOffisjele webside fan it Britske FerkearsburoNederlânsktalige ynformaasje fan it Britske FerkearsburoOffisjele webside fan English Heritage, de organisaasje dy't him ynset foar it behâld fan it Ingelske kultuergoedYnwennertallen fan alle Britske stêden út 'e folkstelling fan 2011Notes en References, op dizze sideEngland

Հադիս Բովանդակություն Անվանում և նշանակություն | Դասակարգում | Աղբյուրներ | Նավարկման ցանկ