|
@@ 271-273 (lines=3) @@
|
| 268 |
|
*/ |
| 269 |
|
public function create_item_permissions_check( $request ) { |
| 270 |
|
|
| 271 |
|
if ( ! empty( $request['id'] ) ) { |
| 272 |
|
return new WP_Error( 'rest_invoice_exists', __( 'Cannot create existing invoice.', 'invoicing' ), array( 'status' => 400 ) ); |
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
$post_type = get_post_type_object( $this->post_type ); |
| 276 |
|
|
|
@@ 300-302 (lines=3) @@
|
| 297 |
|
*/ |
| 298 |
|
public function create_item( $request ) { |
| 299 |
|
|
| 300 |
|
if ( ! empty( $request['id'] ) ) { |
| 301 |
|
return new WP_Error( 'rest_invoice_exists', __( 'Cannot create existing invoice.', 'invoicing' ), array( 'status' => 400 ) ); |
| 302 |
|
} |
| 303 |
|
|
| 304 |
|
$request->set_param( 'context', 'edit' ); |
| 305 |
|
|