woocommerce get array of featured product ids

WooCommerce: Return An Array Of Featured Product IDs

If you need to show WooCommerce featured products on non-shop pages, here’s a quick way of grabbing an array of all featured product IDs.