Skip to content

Instantly share code, notes, and snippets.

View Bradley-D's full-sized avatar

Bradley Davis Bradley-D

View GitHub Profile
* Hook in on activation
* Define image sizes
function yourtheme_woocommerce_image_dimensions() {
global $pagenow;
thenbrent /
Last active December 22, 2015 18:39
WooCommerce Developer Test

WooCommerce API Test

Create a WordPress plugin to add an API endpoint for recent orders placed with a WooCommerce store.

The API endpoint should accept one parameter - an integer for the number of recent orders. For example, passing "5" to the endpoint will return the 5 most recent orders (ordered from newest to oldest).

If no integer is passed to the endpoint, WordPress's default posts per page setting should be used to determine the number of orders.

The endpoint's response should be a JSON object containing the relevant number of WC_Order objects.