Viewing 4 replies - 1 through 4 (of 4 total)
  • Try this code:

    add_filter('woocommerce_product_tabs','example_woocommerce_product_tabs', 30);
    function example_woocommerce_product_tabs($tabs){
    	// has_term( $term, $taxonomy, $post )
    	if( has_term( 'movie', 'product_cat'  ) ){
    		unset($tabs['inquiry']);
    	}
    	return $tabs;
    }

    In the above example, inquiry tab will be removed if the product is in the movie category.
    In the plugin, tabs are modified by the function attached to the hook with prority 20. Now new function is attached with higher value. has_term function can be used to check if product is contained in certain category or not. It yes then remove tab by unsetting tabs array.

    Messai

    (@messai)

    Nilambar Great plugin first of all.

    Is there any way I can chose on which product to use which tab … since not all product are gonna use all custom tabs.

    Thanks in advance.

    I tried the code mentioned – but it still shows. I placed this in my child theme functions.php file.

    Closing ticket.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide tabs in certain products’ is closed to new replies.