AI Verified

Name

Remove categories from shop and other pages in Woocommerce

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

cloudmeister

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

10/12/2022

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Remove categories from shop and other pages in Woocommerce

 
                    
1/* Remove categories from shop and other pages in Woocommerce */
2function wc_hide_selected_terms( $terms, $taxonomies, $args ) {
3 $new_terms = array();
4 if ( in_array( 'product_cat', $taxonomies ) && !is_admin() && is_shop() || is_product_category() ) {
5 foreach ( $terms as $key => $term ) {
6 if ( ! in_array( $term->slug, array( 'unkategorisiert' ) ) ) {
7 $new_terms[] = $term;
8 }
9 }
10 $terms = $new_terms;
11 }
12 return $terms;
13}
14add_filter( 'get_terms', 'wc_hide_selected_terms', 10, 3 );

0

Related Snippets

Please see some snippets below related to this snippet..

WooCommerce

AI Verified

1

Add WooCommerce Attributes as Admin Column

Added: 2 months ago

Last Updated: 6 days ago

When. you're using Attributes, make it easier to see if any are active from your Products Dashboard.

WooCommerce

AI Verified

2

Add Product Picture to Orderlist

Added: 1 year ago

Last Updated: 1 year ago

WooCommerce

AI Verified

1

WooCommerce Add Custom Text Field To Product

Added: 1 year ago

Last Updated: 1 year ago

In this example, we show you how customer can add custom text to products which will show on the product page, cart, checkout, thank you page, and order editor.

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

1

Custom Login 4 Agencies

Added: 1 year ago

Last Updated: 1 year ago

Give your Clients a constant LogIn-Feeling with your CI You can: - add an Image from your Agency Site to the login.form - add a Link to/behind the Image - customize some border-color's - hide t...

WooCommerce

Unverified

0

CLOUD Meister: Checkout shipping inline

Added: 1 year ago

Last Updated: 1 year ago

WordPress Admin

AI Verified

0

enable autoupdater on specific time

Added: 1 year ago

Last Updated: 1 year ago

This enables the Autoupdater only between a specific time range.