Last active
September 15, 2020 08:35
-
-
Save leewillis77/6031ae65f269d1fe6488ddb4fd15483b to your computer and use it in GitHub Desktop.
Change exclusion for specific products in 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) { | |
// Do not exclude any of the specified product IDs. | |
if ( in_array( $product_id, [ 28 ] ) ) { | |
return false; | |
} | |
// Standard behaviour for all other products. | |
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