How can you check if there are any products with a specific product attribute in the shop?
I could query (eg. with
wc_get_products()) all products and check if they (or their variations) are in stock and then collect all the attribute values in an array and test the specific attribute against that array.
However, I think that sounds like a huge amount of database requests so I wondered if there is an easier path that I am missing.