I've been unable to crack this nut, but can't help feel that I'm missing something simple.
I'm developing a WooCommerce plugin that should provide a list of shipping classes on its admin settings page. The following code as suggested in another question's answer indicated that the following should work:
$shipping = new \WC_Shipping();
$shipping_classes = $shipping->get_shipping_classes();
var_dump($shipping_classes);
die();
Unfortunately the output is an empty array.
I am using Wordpress 4.9.5 and WooCommerce 3.3.5. Thanks for any help!
UPDATE I have the exact same problem as outlined here: get_terms() returns Invalid Taxonomy and have provided a work-around. However, I do not feel that is a solution.