Skip to content

Commit f9bde33

Browse files
committed
Fix bug where object_type was not required for edit/delete requests (it should be)
1 parent 9f46758 commit f9bde33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/CMB2_REST_Controller_Fields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function delete_field_value( $request ) {
156156
*/
157157
public function modify_field_value( $activity, $field ) {
158158

159-
if ( ! $this->request['object_id'] && ! $this->request['object_type'] ) {
159+
if ( ! $this->request['object_id'] || ! $this->request['object_type'] ) {
160160
return new WP_Error( 'cmb2_rest_modify_field_value_error', __( 'CMB2 Field value cannot be modified without the object_id and object_type parameters specified.', 'cmb2' ), array( 'status' => 400 ) );
161161
}
162162

0 commit comments

Comments
 (0)