| @@ 224-232 (lines=9) @@ | ||
| 221 | * @param array $data |
|
| 222 | * @return array |
|
| 223 | */ |
|
| 224 | public function edit_customer( $id, $data ) { |
|
| 225 | ||
| 226 | $id = $this->validate_request( $id, 'customer', 'edit' ); |
|
| 227 | ||
| 228 | if ( ! is_wp_error( $id ) ) |
|
| 229 | return $id; |
|
| 230 | ||
| 231 | return $this->get_customer( $id ); |
|
| 232 | } |
|
| 233 | ||
| 234 | /** |
|
| 235 | * Delete a customer |
|
| @@ 241-249 (lines=9) @@ | ||
| 238 | * @param int $id the customer ID |
|
| 239 | * @return array |
|
| 240 | */ |
|
| 241 | public function delete_customer( $id ) { |
|
| 242 | ||
| 243 | $id = $this->validate_request( $id, 'customer', 'delete' ); |
|
| 244 | ||
| 245 | if ( ! is_wp_error( $id ) ) |
|
| 246 | return $id; |
|
| 247 | ||
| 248 | return $this->delete( $id, 'customer' ); |
|
| 249 | } |
|
| 250 | ||
| 251 | /** |
|
| 252 | * Get the orders for a customer |
|