Skip to content

Instantly share code, notes, and snippets.

View PP test
{
"ok":true,
"items":[
{ "id": 1,
"name": "Task 1",
"url": "https://github.com/woocommerce/woocommerce/issues/27026"
},
{ "id": 2,
"name": "Task 2",
"url": "https://github.com/woocommerce/woocommerce/issues/26983"
@peterfabian
peterfabian / rest_api_errors.txt
Created Jul 2, 2020
WP errors from the WooCommerce REST API directory
View rest_api_errors.txt
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array( 'status' => 404 ) );
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array( 'status' => rest_authorization_required_code() ) );
return new WP_Error( "woocommerce_rest_{$this->post_type}_exists", sprintf( __( 'Cannot create existing %s.', 'woocommerce' ), $this->post_type ), array( 'status' => 400 ) );
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_delivery_url", __( 'Webhook delivery URL must be a valid URL starting with http
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'ID is invalid.', 'woocom