Skip to content

Instantly share code, notes, and snippets.

@danielbitzer
Last active September 14, 2022 11:23
Show Gist options
  • Save danielbitzer/3506ad4f32777c4228d9ef24ccb4627c to your computer and use it in GitHub Desktop.
Save danielbitzer/3506ad4f32777c4228d9ef24ccb4627c to your computer and use it in GitHub Desktop.
AutomateWoo - Using shop.products custom filter option
<?php
/**
* Use variable {{ shop.products | type: 'custom', filter: 'my_shop_products_custom_filter' }}
*/
add_filter( 'my_shop_products_custom_filter', 'my_shop_products_custom_filter', 10, 2 );
/**
* @param $product_ids array
* @param $workflow AutomateWoo\Workflow
* @return array
*/
function my_shop_products_custom_filter( $product_ids, $workflow ) {
// add product queries here
return [ 586, 4033, 582 ]; // return ids of products
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment