Getting all woocommerce products from REST API call in plugin

I was close to the answer here, but held back by being unfamiliar with how global WordPress can be, and how that can be used to extend plugins. All I needed to do was wrap the plugin logic in a check for the presence of Woocommerce: if ( in_array( ‘woocommerce/woocommerce.php’, apply_filters( ‘active_plugins’, get_option( ‘active_plugins’ ) … Read more

WooCommerce REST API AJAX Auth – 401 response

First off, the WooCommerce REST API documentation is available here and you should check it out. Secondly, the examples below are using the /wc/v3/products/categories (“List all product categories“) endpoint. And here’s a proper way to authenticate your request using OAuth — it always works when authenticating over HTTPS and it is the only accepted option … Read more

404 error custom post type rest api

You need to declare that your CPT supports REST via show_in_rest when registering it, then use the REST API endpoint for that post type. For example, I have a CPT on my own site for talks named tomjn_talks, and it has an endpoint at /wp/v2/tomjn_talks