Skip to content

Instantly share code, notes, and snippets.

@webdados
Created March 1, 2019 10:50
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 webdados/cc64e6c52eb901c70a69557e8cf0cf66 to your computer and use it in GitHub Desktop.
Save webdados/cc64e6c52eb901c70a69557e8cf0cf66 to your computer and use it in GitHub Desktop.
KuantoKusta WooCommerce - filter to remove product from feed
<?php
/* https://wordpress.org/plugins/feed-kuantokusta-for-woocommerce/ */
//To remove a product from the KuantoKusta feed
add_filter( 'kuantokusta_product_node_show', 'my_kuantokusta_product_node_show', 10, 3 );
function my_kuantokusta_product_node_show( $show, $product, $product_type ) {
//Check your $product details, categories, whatever... and return true or false accordingly
if ( 1 == 1 ) {
return false;
}
return $show;
}
//To remove a product variation from the KuantoKusta feed
add_filter( 'kuantokusta_variation_node_show', 'my_kuantokusta_variation_node_show', 10, 3 );
function my_kuantokusta_variation_node_show( $show, $product, $variation ) {
//Check your $product or $variation details, categories, whatever... and return true or false accordingly
if ( 1 == 1 ) {
return false;
}
return $show;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment