Created
August 26, 2021 08:38
-
-
Save Auke1810/31fe45d5b334ff92992bb2c8ca3ee655 to your computer and use it in GitHub Desktop.
exclude list of products from feed with the use of an array
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 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