Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Created August 26, 2021 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Auke1810/31fe45d5b334ff92992bb2c8ca3ee655 to your computer and use it in GitHub Desktop.
Save Auke1810/31fe45d5b334ff92992bb2c8ca3ee655 to your computer and use it in GitHub Desktop.
exclude list of products from feed with the use of an array
<?php
function exclude_list_from_feed( $attributes, $feed_id, $product_id ) {
//Array with the numbers from products we want te exclude
$exclude_array = array(13608, 13632, 16123, 16405);
if (in_array($attributes['id'], $exclude_array,) == false )
{
// Return the $attributes from products not in the exclude list
return $attributes;
}
}
add_filter( 'wppfm_feed_item_value', 'exclude_list_from_feed', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment