[#3176] REST API webhooks endpoint tweaks from unit test

This commit is contained in:
Max Rice 2014-09-01 03:27:19 -04:00
parent 4cffe3182f
commit 38dd928f23
1 changed files with 2 additions and 2 deletions

View File

@ -319,7 +319,7 @@ class WC_API_Webhooks extends WC_API_Resource {
return true;
}
list( $resource, $event ) = explode( '.', $topic );
@list( $resource, $event ) = explode( '.', $topic );
if ( ! isset( $resource ) || ! isset( $event ) ) {
return false;
@ -476,7 +476,7 @@ class WC_API_Webhooks extends WC_API_Resource {
$id = absint( $id );
if ( empty( $id ) ) {
return new WP_Error( 'woocommerce_api_invalid_webhook_delivery_id', __( 'Invalid webhook delivery ID', 'woocommerce' ), array( 'status' => 400 ) );
return new WP_Error( 'woocommerce_api_invalid_webhook_delivery_id', __( 'Invalid webhook delivery ID', 'woocommerce' ), array( 'status' => 404 ) );
}
$webhook = new WC_Webhook( $webhook_id );