woocommerce_product_feed_args
Allows the base arguments for querying products for product feeds to be changed.
Variable products are not included by default, as their variations will be included. orderby and order are always overridden with ID and ASC, as products are walked by ID.
Usage
add_filter( 'woocommerce_product_feed_args', 'wp_kama_woocommerce_product_feed_args_filter', 10, 2 );
/**
* Function for `woocommerce_product_feed_args` filter-hook.
*
* @param array $query_args The arguments to pass to wc_get_products().
* @param IntegrationInterface $integration The integration that the query belongs to.
*
* @return array
*/
function wp_kama_woocommerce_product_feed_args_filter( $query_args, $integration ){
// filter...
return $query_args;
}
- $query_args(array)
- The arguments to pass to wc_get_products().
- $integration(IntegrationInterface)
- The integration that the query belongs to.
Changelog
| Since 10.5.0 | Introduced. |
Where the hook is called
woocommerce_product_feed_args
woocommerce/src/Internal/ProductFeed/Feed/ProductWalker.php 151-155
$query_args = apply_filters( 'woocommerce_product_feed_args', $query_args, $integration );