@@ 309-311 (lines=3) @@ | ||
306 | true |
|
307 | ); |
|
308 | ||
309 | if ( ! $this->field ) { |
|
310 | return new WP_Error( 'cmb2_rest_no_field_by_id_error', __( 'No field found by that id.', 'cmb2' ), array( 'status' => 403 ) ); |
|
311 | } |
|
312 | ||
313 | $this->field->args["value_{$activity}"] = (bool) 'deleted' === $activity |
|
314 | ? $this->field->remove_data() |
|
@@ 336-338 (lines=3) @@ | ||
333 | public function prepare_read_field( $field ) { |
|
334 | $this->field = $this->rest_box->field_can_read( $field, true ); |
|
335 | ||
336 | if ( ! $this->field ) { |
|
337 | return new WP_Error( 'cmb2_rest_no_field_by_id_error', __( 'No field found by that id.', 'cmb2' ), array( 'status' => 403 ) ); |
|
338 | } |
|
339 | ||
340 | return $this->prepare_item( $this->prepare_field_response() ); |
|
341 | } |