|
@@ 123-125 (lines=3) @@
|
| 120 |
|
public function update_field_value( $request ) { |
| 121 |
|
$this->initiate_rest_read_box( $request, 'field_value_update' ); |
| 122 |
|
|
| 123 |
|
if ( ! $this->request['object_id'] && ! $this->request['object_type'] ) { |
| 124 |
|
return $this->prepare_item( array( 'error' => __( 'CMB2 Field value cannot be updated without the object_id and object_type parameters specified.', 'cmb2' ) ) ); |
| 125 |
|
} |
| 126 |
|
|
| 127 |
|
if ( ! $this->request['value'] ) { |
| 128 |
|
return $this->prepare_item( array( 'error' => __( 'CMB2 Field value cannot be updated without the value parameter specified.', 'cmb2' ) ) ); |
|
@@ 163-165 (lines=3) @@
|
| 160 |
|
public function delete_field_value( $request ) { |
| 161 |
|
$this->initiate_rest_read_box( $request, 'field_value_delete' ); |
| 162 |
|
|
| 163 |
|
if ( ! $this->request['object_id'] && ! $this->request['object_type'] ) { |
| 164 |
|
return $this->prepare_item( array( 'error' => __( 'CMB2 Field value cannot be deleted without the object_id and object_type parameters specified.', 'cmb2' ) ) ); |
| 165 |
|
} |
| 166 |
|
|
| 167 |
|
if ( is_wp_error( $this->rest_box ) ) { |
| 168 |
|
return $this->prepare_item( array( 'error' => $this->rest_box->get_error_message() ) ); |