List shipping zones, shipping methods and their IDs for use in custom code.
A few articles on BusinessBloomer.com about shipping in WooCommerce require the shipping method ID e.g. Hide Shipping By Shipping Class, and provide instructions to find it. It’s messy, involving looking at html source code. I’ve decided to make is much easier.
Hover reveal not an option
My first idea was to reveal the shipping method ID when you hover over the method section, like how the ‘Edit | Delete’ links show.
Back to businessbloomer.com
I copied the businessbloomer.com code to find all shipping zones and methods. Next up was to find the hook to display the information on the Shipping zones page. It needed a little tweaking to only display on the main Shipping zones page and not the ‘Shipping options’ and ‘Shipping classes’ sub pages.
I went back and forth with a simple unordered list and then a table, finally settling on a combination of the two.