woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
234 stars 206 forks source link

Create new filters to control PRB visibility #2321

Open reykjalin opened 2 years ago

reykjalin commented 2 years ago

I think based on the discussion in #2099 we'll want to introduce 3 new filters to replace the current PRB visibility filters:

Once these filters have been out for 1-2 release cycles we should deprecate the filters they will replace again:

Originally brought up by @reykjalin in https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2099#issuecomment-1039764193

reykjalin commented 1 year ago

Sidenote: it may be better to pass the actual product objects to the filters so plugins/merchants won't have to make database requests for the actual product information to make a decision on whether to hide the PRBs or not.

Let's go with passing Product Objects instead of Product IDs to save anyone hooking into the filters a trip to the DB.

I think WC core may be shifting to a similar idea for some of its own filters too.