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

Can a Cauchy sequence converge for one metric while not converging for another?

How can bays and straits be determined in a procedurally generated map?

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

how to check a propriety using r studio

What typically incentivizes a professor to change jobs to a lower ranking university?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

"You are your self first supporter", a more proper way to say it

A case of the sniffles

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

dbcc cleantable batch size explanation

Why can't we play rap on piano?

Do I have a twin with permutated remainders?

What defenses are there against being summoned by the Gate spell?

Cross compiling for RPi - error while loading shared libraries

Modeling an IP Address

Why doesn't H₄O²⁺ exist?

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

Why are electrically insulating heatsinks so rare? Is it just cost?

Uncaught TypeError: 'set' on proxy: trap returned falsish for property Name

Do infinite dimensional systems make sense?

Why does Kotter return in Welcome Back Kotter?

Can I ask the recruiters in my resume to put the reason why I am rejected?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Is it possible to run Internet Explorer on OS X El Capitan?



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



.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

971721




971721












  • 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

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
    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

Magento 1.9 observer on only new product added ( no updated product )Admin Create New Order ObserverObserver checkout_cart_product_add_after get product quantity in cartHow can I differentiate between product creation and saving existing products?How to get the original price Product SaveBeforeMagento Observer for Admin Sales order Address updateHow do i get quantity in a product_save_after event observer magento2?Using observer event to get updated customer infoSave product observer - detect availabilityEvent not triggered when new product added in admin : Magento 2magento 1.9 observer on quantity product change

Does an object always see its latest internal state irrespective of thread? The 2019 Stack Overflow Developer Survey Results Are InDoes a finally block always get executed in Java?Java: serial thread confinement questionJava difference between fixed threadpool and scheduled threadpoolJackrabbit and concurrent modificationHow to stop a Runnable scheduled for repeated execution after a certain number of executionsMultiple threads accessing inner classHow can a loop be completed by two thread? say loop from count=1 to count=4 by ist thread and count =5 to 8 by 2nd thread?If I keep a reference to a Runnable, when does the Thread it ran on get released?How to stop a schedule ScheduledExecutorServiceHow to implement a singleThreadedScheduledExcecutor in wildfly

Adding contour labels to SpatialLinesDataFrame or sf object? The Next CEO of Stack OverflowTearing of SpatialLinesDataFrame and problem with gClip functionAutomatically adjusting map labelsExtracting data.frame from simple features object in RR convert sf object back to SpatialPolygonsDataFrameSimplify polygons of sf objectlines of a SpatialLinesDataFrame corresponding to pointsCropping sf object in R?Pattern matching with grepl on SpatialPolygonsDataFrame object in RHow to create and empty SpatialLinesDataFrame in RWarning message in raster::rotate(): “this does not look like an appropriate object for this function”