Completed
Pull Request — trunk (#541)
by Justin
07:44
created
includes/CMB2_REST_Controller_Fields.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 		if ( $cmb_id && ( $cmb = cmb2_get_metabox( $cmb_id, $this->object_id, $this->object_type ) ) ) {
60 60
 			$fields = array();
61 61
 			foreach ( $cmb->prop( 'fields', array() ) as $field ) {
62
-				$field = $this->get_rest_field( $cmb, $field['id'] );
62
+				$field = $this->get_rest_field( $cmb, $field[ 'id' ] );
63 63
 
64 64
 				if ( ! is_wp_error( $field ) ) {
65
-					$fields[ $field['id'] ] = $field;
65
+					$fields[ $field[ 'id' ] ] = $field;
66 66
 				} else {
67
-					$fields[ $field['id'] ] = array( 'error' => $field->get_error_message() );
67
+					$fields[ $field[ 'id' ] ] = array( 'error' => $field->get_error_message() );
68 68
 				}
69 69
 			}
70 70
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	public function get_field( $request ) {
86 86
 		$this->initiate_request( $request );
87 87
 
88
-		$cmb = cmb2_get_metabox( $this->request->get_param( 'cmb_id' ), $this->object_id, $this->object_type  );
88
+		$cmb = cmb2_get_metabox( $this->request->get_param( 'cmb_id' ), $this->object_id, $this->object_type );
89 89
 
90 90
 		if ( ! $cmb ) {
91 91
 			return $this->prepare_item( array( 'error' => __( 'No box found by that id.', 'cmb2' ) ) );
Please login to merge, or discard this patch.