Fixedd status
This commit is contained in:
parent
58d90a2ee8
commit
a46aea1b77
|
@ -222,7 +222,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
||||||
$object = $this->get_object( (int) $request['id'] );
|
$object = $this->get_object( (int) $request['id'] );
|
||||||
|
|
||||||
if ( ! $object || 0 === $object->get_id() ) {
|
if ( ! $object || 0 === $object->get_id() ) {
|
||||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
|
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 400 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = $this->save_object( $request, false );
|
$object = $this->save_object( $request, false );
|
||||||
|
|
Loading…
Reference in New Issue