Last active
February 7, 2023 11:43
-
-
Save leewillis77/65fc4babd0f7a3776966e2324965bf6a to your computer and use it in GitHub Desktop.
Exclude multiple categories from the Google Product Feed
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
<?php | |
function lw_gpf_exclude_product( $excluded, $product_id, $feed_format ) { | |
// return TRUE to exclude this product | |
// return FALSE to include this product | |
// return $excluded to keep the standard behaviour for this product. | |
return $excluded; | |
} | |
add_filter( 'woocommerce_gpf_exclude_product', 'lw_gpf_exclude_product', 11, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment