@@ -59,12 +59,12 @@ discard block |
||
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 |
||
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' ) ) ); |