Created
March 1, 2019 10:50
-
-
Save webdados/cc64e6c52eb901c70a69557e8cf0cf66 to your computer and use it in GitHub Desktop.
KuantoKusta WooCommerce - filter to remove product from feed
This file contains 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 | |
/* 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