Last active
January 26, 2018 13:00
-
-
Save albionselimaj/4bba6ffbbd2c7cc19e76f06820797d39 to your computer and use it in GitHub Desktop.
Hide Listing Packages products from Shop page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_product_query', function( $q ) { | |
$tax_query = (array) $q->get( 'product_type' ); | |
$tax_query[] = [ | |
'taxonomy' => 'product_type', | |
'field' => 'slug', | |
'terms' => [ 'job_package', 'job_package_subscription' ], | |
'operator' => 'NOT IN', | |
]; | |
$q->set( 'tax_query', $tax_query ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment