@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | if ( ! $terms ) { |
25 | 25 | $options .= sprintf( '<li><label>%s</label></li>', esc_html( $this->_text( 'no_terms_text', esc_html__( 'No terms', 'cmb2' ) ) ) ); |
26 | 26 | } else { |
27 | - $option_none = $field->args( 'show_option_none' ); |
|
27 | + $option_none = $field->args( 'show_option_none' ); |
|
28 | 28 | if ( ! empty( $option_none ) ) { |
29 | 29 | |
30 | 30 | $field_id = $this->_id(); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'label' => $option_none, |
55 | 55 | ); |
56 | 56 | if ( $saved_term == $option_none_value ) { |
57 | - $args['checked'] = 'checked'; |
|
57 | + $args[ 'checked' ] = 'checked'; |
|
58 | 58 | } |
59 | 59 | $options .= $this->list_input( $args, $i ); |
60 | 60 | $i++; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ); |
68 | 68 | |
69 | 69 | if ( $saved_term == $term->slug ) { |
70 | - $args['checked'] = 'checked'; |
|
70 | + $args[ 'checked' ] = 'checked'; |
|
71 | 71 | } |
72 | 72 | $options .= $this->list_input( $args, $i ); |
73 | 73 | $i++; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | // Check for methods to be proxied to the CMB2_Type_Base object. |
55 | 55 | if ( $exists = $this->maybe_proxy_method( $fieldtype, $arguments ) ) { |
56 | - return $exists['value']; |
|
56 | + return $exists[ 'value' ]; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Check for custom field type class. |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | 'class' => 'cmb2-hidden', |
482 | 482 | ); |
483 | 483 | if ( $this->field->group ) { |
484 | - $args['data-groupid'] = $this->field->group->id(); |
|
485 | - $args['data-iterator'] = $this->iterator; |
|
484 | + $args[ 'data-groupid' ] = $this->field->group->id(); |
|
485 | + $args[ 'data-iterator' ] = $this->iterator; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', $args, 'input' )->render(); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | public function render() { |
16 | 16 | |
17 | - $this->field->args['default'] = $this->field->get_default() |
|
17 | + $this->field->args[ 'default' ] = $this->field->get_default() |
|
18 | 18 | ? $this->field->get_default() |
19 | 19 | : CMB2_Utils::timezone_string(); |
20 | 20 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | ); |
37 | 37 | |
38 | 38 | if ( is_array( $saved_terms ) && in_array( $term->slug, $saved_terms ) ) { |
39 | - $args['checked'] = 'checked'; |
|
39 | + $args[ 'checked' ] = 'checked'; |
|
40 | 40 | } |
41 | 41 | $options .= $this->list_input( $args, $i ); |
42 | 42 | $i++; |
@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | $img_size_data = parent::get_image_size_data( $img_size, 'large' ); |
25 | 25 | |
26 | 26 | // if options array and 'url' => false, then hide the url field |
27 | - $input_type = array_key_exists( 'url', $options ) && false === $options['url'] ? 'hidden' : 'text'; |
|
27 | + $input_type = array_key_exists( 'url', $options ) && false === $options[ 'url' ] ? 'hidden' : 'text'; |
|
28 | 28 | |
29 | 29 | $output .= parent::render( array( |
30 | 30 | 'type' => $input_type, |
31 | 31 | 'class' => 'cmb2-upload-file regular-text', |
32 | 32 | 'size' => 45, |
33 | 33 | 'desc' => '', |
34 | - 'data-previewsize' => sprintf( '[%d,%d]', $img_size_data['width'], $img_size_data['height'] ), |
|
35 | - 'data-sizename' => $img_size_data['name'], |
|
34 | + 'data-previewsize' => sprintf( '[%d,%d]', $img_size_data[ 'width' ], $img_size_data[ 'height' ] ), |
|
35 | + 'data-sizename' => $img_size_data[ 'name' ], |
|
36 | 36 | 'data-queryargs' => ! empty( $query_args ) ? json_encode( $query_args ) : '', |
37 | 37 | 'js_dependencies' => 'media-editor', |
38 | 38 | ) ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | if ( $_id_value ) { |
81 | 81 | $image = wp_get_attachment_image( $_id_value, $img_size, null, array( 'class' => 'cmb-file-field-image' ) ); |
82 | 82 | } else { |
83 | - $image = '<img style="max-width: ' . absint( $img_size_data['width'] ) . 'px; width: 100%;" src="' . $meta_value . '" class="cmb-file-field-image" alt="" />'; |
|
83 | + $image = '<img style="max-width: ' . absint( $img_size_data[ 'width' ] ) . 'px; width: 100%;" src="' . $meta_value . '" class="cmb-file-field-image" alt="" />'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $output .= $this->img_status_output( array( |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function img_status_output( $args ) { |
57 | 57 | return sprintf( '<%1$s class="img-status cmb2-media-item">%2$s<p class="cmb2-remove-wrapper"><a href="#" class="cmb2-remove-file-button"%3$s>%4$s</a></p>%5$s</%1$s>', |
58 | - $args['tag'], |
|
59 | - $args['image'], |
|
60 | - isset( $args['cached_id'] ) ? ' rel="' . $args['cached_id'] . '"' : '', |
|
58 | + $args[ 'tag' ], |
|
59 | + $args[ 'image' ], |
|
60 | + isset( $args[ 'cached_id' ] ) ? ' rel="' . $args[ 'cached_id' ] . '"' : '', |
|
61 | 61 | esc_html( $this->_text( 'remove_image_text', esc_html__( 'Remove Image', 'cmb2' ) ) ), |
62 | - isset( $args['id_input'] ) ? $args['id_input'] : '' |
|
62 | + isset( $args[ 'id_input' ] ) ? $args[ 'id_input' ] : '' |
|
63 | 63 | ); |
64 | 64 | } |
65 | 65 | |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function file_status_output( $args ) { |
73 | 73 | return sprintf( '<%1$s class="file-status cmb2-media-item"><span>%2$s <strong>%3$s</strong></span> (<a href="%4$s" target="_blank" rel="external">%5$s</a> / <a href="#" class="cmb2-remove-file-button"%6$s>%7$s</a>)%8$s</%1$s>', |
74 | - $args['tag'], |
|
74 | + $args[ 'tag' ], |
|
75 | 75 | esc_html( $this->_text( 'file_text', esc_html__( 'File:', 'cmb2' ) ) ), |
76 | - CMB2_Utils::get_file_name_from_path( $args['value'] ), |
|
77 | - $args['value'], |
|
76 | + CMB2_Utils::get_file_name_from_path( $args[ 'value' ] ), |
|
77 | + $args[ 'value' ], |
|
78 | 78 | esc_html( $this->_text( 'file_download_text', esc_html__( 'Download', 'cmb2' ) ) ), |
79 | - isset( $args['cached_id'] ) ? ' rel="' . $args['cached_id'] . '"' : '', |
|
79 | + isset( $args[ 'cached_id' ] ) ? ' rel="' . $args[ 'cached_id' ] . '"' : '', |
|
80 | 80 | esc_html( $this->_text( 'remove_text', esc_html__( 'Remove', 'cmb2' ) ) ), |
81 | - isset( $args['id_input'] ) ? $args['id_input'] : '' |
|
81 | + isset( $args[ 'id_input' ] ) ? $args[ 'id_input' ] : '' |
|
82 | 82 | ); |
83 | 83 | } |
84 | 84 | |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | $data = array(); |
104 | 104 | |
105 | 105 | if ( is_array( $img_size ) ) { |
106 | - $data['width'] = intval( $img_size[0] ); |
|
107 | - $data['height'] = intval( $img_size[1] ); |
|
108 | - $data['name'] = ''; |
|
106 | + $data[ 'width' ] = intval( $img_size[ 0 ] ); |
|
107 | + $data[ 'height' ] = intval( $img_size[ 1 ] ); |
|
108 | + $data[ 'name' ] = ''; |
|
109 | 109 | |
110 | 110 | // Try and get the closest named size from our array of dimensions |
111 | 111 | if ( $named_size = CMB2_Utils::get_named_size( $img_size ) ) { |
112 | - $data['name'] = $named_size; |
|
112 | + $data[ 'name' ] = $named_size; |
|
113 | 113 | } |
114 | 114 | } else { |
115 | 115 | |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | // Get image dimensions from named sizes |
129 | - $data['width'] = intval( $image_sizes[ $img_size ]['width'] ); |
|
130 | - $data['height'] = intval( $image_sizes[ $img_size ]['height'] ); |
|
131 | - $data['name'] = $img_size; |
|
129 | + $data[ 'width' ] = intval( $image_sizes[ $img_size ][ 'width' ] ); |
|
130 | + $data[ 'height' ] = intval( $image_sizes[ $img_size ][ 'height' ] ); |
|
131 | + $data[ 'name' ] = $img_size; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | return $data; |
@@ -150,17 +150,17 @@ discard block |
||
150 | 150 | foreach ( CMB2_Utils::get_available_image_sizes() as $size => $info ) { |
151 | 151 | |
152 | 152 | // registered image size exists for this attachment |
153 | - if ( isset( $meta['sizes'][ $size ] ) ) { |
|
153 | + if ( isset( $meta[ 'sizes' ][ $size ] ) ) { |
|
154 | 154 | |
155 | 155 | $attachment_url = wp_get_attachment_url( $attachment->ID ); |
156 | 156 | $base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url ); |
157 | - $size_meta = $meta['sizes'][ $size ]; |
|
157 | + $size_meta = $meta[ 'sizes' ][ $size ]; |
|
158 | 158 | |
159 | - $response['sizes'][ $size ] = array( |
|
160 | - 'url' => $base_url . $size_meta['file'], |
|
161 | - 'height' => $size_meta['height'], |
|
162 | - 'width' => $size_meta['width'], |
|
163 | - 'orientation' => $size_meta['height'] > $size_meta['width'] ? 'portrait' : 'landscape', |
|
159 | + $response[ 'sizes' ][ $size ] = array( |
|
160 | + 'url' => $base_url . $size_meta[ 'file' ], |
|
161 | + 'height' => $size_meta[ 'height' ], |
|
162 | + 'width' => $size_meta[ 'width' ], |
|
163 | + 'orientation' => $size_meta[ 'height' ] > $size_meta[ 'width' ] ? 'portrait' : 'landscape', |
|
164 | 164 | ); |
165 | 165 | } |
166 | 166 | } |
@@ -56,24 +56,24 @@ |
||
56 | 56 | $min = $debug ? '' : '.min'; |
57 | 57 | |
58 | 58 | // if colorpicker |
59 | - if ( ! is_admin() && isset( $dependencies['wp-color-picker'] ) ) { |
|
59 | + if ( ! is_admin() && isset( $dependencies[ 'wp-color-picker' ] ) ) { |
|
60 | 60 | self::colorpicker_frontend(); |
61 | 61 | } |
62 | 62 | |
63 | 63 | // if file/file_list |
64 | - if ( isset( $dependencies['media-editor'] ) ) { |
|
64 | + if ( isset( $dependencies[ 'media-editor' ] ) ) { |
|
65 | 65 | wp_enqueue_media(); |
66 | 66 | CMB2_Type_File_Base::output_js_underscore_templates(); |
67 | 67 | } |
68 | 68 | |
69 | 69 | // if timepicker |
70 | - if ( isset( $dependencies['jquery-ui-datetimepicker'] ) ) { |
|
70 | + if ( isset( $dependencies[ 'jquery-ui-datetimepicker' ] ) ) { |
|
71 | 71 | wp_register_script( 'jquery-ui-datetimepicker', CMB2_Utils::url( 'js/jquery-ui-timepicker-addon.min.js' ), array( 'jquery-ui-slider' ), CMB2_VERSION ); |
72 | 72 | } |
73 | 73 | |
74 | 74 | // if cmb2-wysiwyg |
75 | - $enqueue_wysiwyg = isset( $dependencies['cmb2-wysiwyg'] ) && $debug; |
|
76 | - unset( $dependencies['cmb2-wysiwyg'] ); |
|
75 | + $enqueue_wysiwyg = isset( $dependencies[ 'cmb2-wysiwyg' ] ) && $debug; |
|
76 | + unset( $dependencies[ 'cmb2-wysiwyg' ] ); |
|
77 | 77 | |
78 | 78 | // Enqueue cmb JS |
79 | 79 | wp_enqueue_script( self::$handle, CMB2_Utils::url( "js/cmb2{$min}.js" ), $dependencies, CMB2_VERSION, true ); |
@@ -154,30 +154,30 @@ discard block |
||
154 | 154 | foreach ( self::$boxes as $cmb_id => $rest_box ) { |
155 | 155 | $types = array_flip( $rest_box->cmb->box_types() ); |
156 | 156 | |
157 | - if ( isset( $types['user'] ) ) { |
|
158 | - unset( $types['user'] ); |
|
159 | - self::$type_boxes['user'][ $cmb_id ] = $cmb_id; |
|
157 | + if ( isset( $types[ 'user' ] ) ) { |
|
158 | + unset( $types[ 'user' ] ); |
|
159 | + self::$type_boxes[ 'user' ][ $cmb_id ] = $cmb_id; |
|
160 | 160 | } |
161 | 161 | |
162 | - if ( isset( $types['comment'] ) ) { |
|
163 | - unset( $types['comment'] ); |
|
164 | - self::$type_boxes['comment'][ $cmb_id ] = $cmb_id; |
|
162 | + if ( isset( $types[ 'comment' ] ) ) { |
|
163 | + unset( $types[ 'comment' ] ); |
|
164 | + self::$type_boxes[ 'comment' ][ $cmb_id ] = $cmb_id; |
|
165 | 165 | } |
166 | 166 | |
167 | - if ( isset( $types['term'] ) ) { |
|
168 | - unset( $types['term'] ); |
|
167 | + if ( isset( $types[ 'term' ] ) ) { |
|
168 | + unset( $types[ 'term' ] ); |
|
169 | 169 | |
170 | 170 | $taxonomies = array_merge( |
171 | 171 | $taxonomies, |
172 | 172 | CMB2_Utils::ensure_array( $rest_box->cmb->prop( 'taxonomies' ) ) |
173 | 173 | ); |
174 | 174 | |
175 | - self::$type_boxes['term'][ $cmb_id ] = $cmb_id; |
|
175 | + self::$type_boxes[ 'term' ][ $cmb_id ] = $cmb_id; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | if ( ! empty( $types ) ) { |
179 | 179 | $alltypes = array_merge( $alltypes, array_flip( $types ) ); |
180 | - self::$type_boxes['post'][ $cmb_id ] = $cmb_id; |
|
180 | + self::$type_boxes[ 'post' ][ $cmb_id ] = $cmb_id; |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -187,15 +187,15 @@ discard block |
||
187 | 187 | self::register_rest_field( $alltypes, 'post' ); |
188 | 188 | } |
189 | 189 | |
190 | - if ( ! empty( self::$type_boxes['user'] ) ) { |
|
190 | + if ( ! empty( self::$type_boxes[ 'user' ] ) ) { |
|
191 | 191 | self::register_rest_field( 'user', 'user' ); |
192 | 192 | } |
193 | 193 | |
194 | - if ( ! empty( self::$type_boxes['comment'] ) ) { |
|
194 | + if ( ! empty( self::$type_boxes[ 'comment' ] ) ) { |
|
195 | 195 | self::register_rest_field( 'comment', 'comment' ); |
196 | 196 | } |
197 | 197 | |
198 | - if ( ! empty( self::$type_boxes['term'] ) ) { |
|
198 | + if ( ! empty( self::$type_boxes[ 'term' ] ) ) { |
|
199 | 199 | self::register_rest_field( $taxonomies, 'term' ); |
200 | 200 | } |
201 | 201 | } |
@@ -228,18 +228,18 @@ discard block |
||
228 | 228 | */ |
229 | 229 | protected function declare_read_edit_fields() { |
230 | 230 | foreach ( $this->cmb->prop( 'fields' ) as $field ) { |
231 | - $show_in_rest = isset( $field['show_in_rest'] ) ? $field['show_in_rest'] : null; |
|
231 | + $show_in_rest = isset( $field[ 'show_in_rest' ] ) ? $field[ 'show_in_rest' ] : null; |
|
232 | 232 | |
233 | 233 | if ( false === $show_in_rest ) { |
234 | 234 | continue; |
235 | 235 | } |
236 | 236 | |
237 | 237 | if ( $this->can_read( $show_in_rest ) ) { |
238 | - $this->read_fields[] = $field['id']; |
|
238 | + $this->read_fields[ ] = $field[ 'id' ]; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | if ( $this->can_edit( $show_in_rest ) ) { |
242 | - $this->edit_fields[] = $field['id']; |
|
242 | + $this->edit_fields[ ] = $field[ 'id' ]; |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | * @return mixed |
370 | 370 | */ |
371 | 371 | protected static function get_rest_values( $object, $request, $object_type, $main_object_type = 'post' ) { |
372 | - if ( ! isset( $object['id'] ) ) { |
|
372 | + if ( ! isset( $object[ 'id' ] ) ) { |
|
373 | 373 | return; |
374 | 374 | } |
375 | 375 | |
@@ -380,12 +380,12 @@ discard block |
||
380 | 380 | $rest_box = self::$boxes[ $cmb_id ]; |
381 | 381 | |
382 | 382 | foreach ( $rest_box->read_fields as $field_id ) { |
383 | - $rest_box->cmb->object_id( $object['id'] ); |
|
383 | + $rest_box->cmb->object_id( $object[ 'id' ] ); |
|
384 | 384 | $rest_box->cmb->object_type( $main_object_type ); |
385 | 385 | |
386 | 386 | $field = $rest_box->cmb->get_field( $field_id ); |
387 | 387 | |
388 | - $field->object_id( $object['id'] ); |
|
388 | + $field->object_id( $object[ 'id' ] ); |
|
389 | 389 | $field->object_type( $main_object_type ); |
390 | 390 | |
391 | 391 | $values[ $cmb_id ][ $field->id( true ) ] = $field->get_data(); |
@@ -619,8 +619,8 @@ discard block |
||
619 | 619 | return intval( $object->comment_ID ); |
620 | 620 | } |
621 | 621 | case 'term': |
622 | - if ( is_array( $object ) && isset( $object['term_id'] ) ) { |
|
623 | - return intval( $object['term_id'] ); |
|
622 | + if ( is_array( $object ) && isset( $object[ 'term_id' ] ) ) { |
|
623 | + return intval( $object[ 'term_id' ] ); |
|
624 | 624 | } elseif ( isset( $object->term_id ) ) { |
625 | 625 | return intval( $object->term_id ); |
626 | 626 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | ) ); |
50 | 50 | |
51 | 51 | $delete_args = $args; |
52 | - $delete_args['object_id']['required'] = true; |
|
53 | - $delete_args['object_type']['required'] = true; |
|
52 | + $delete_args[ 'object_id' ][ 'required' ] = true; |
|
53 | + $delete_args[ 'object_type' ][ 'required' ] = true; |
|
54 | 54 | |
55 | 55 | // Returns specific field data. |
56 | 56 | register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<cmb_id>[\w-]+)/fields/(?P<field_id>[\w-]+)', array( |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | foreach ( $this->rest_box->cmb->prop( 'fields', array() ) as $field ) { |
123 | 123 | |
124 | 124 | // Make sure this field can be read. |
125 | - $this->field = $this->rest_box->field_can_read( $field['id'], true ); |
|
125 | + $this->field = $this->rest_box->field_can_read( $field[ 'id' ], true ); |
|
126 | 126 | |
127 | 127 | // And make sure current user can view this box. |
128 | 128 | if ( $this->field && $this->get_item_permissions_check_filter() ) { |
129 | - $fields[ $field['id'] ] = $this->server->response_to_data( |
|
129 | + $fields[ $field[ 'id' ] ] = $this->server->response_to_data( |
|
130 | 130 | $this->prepare_field_response(), |
131 | - isset( $this->request['_embed'] ) |
|
131 | + isset( $this->request[ '_embed' ] ) |
|
132 | 132 | ); |
133 | 133 | } |
134 | 134 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | public function update_item( $request ) { |
233 | 233 | $this->initiate_rest_read_box( $request, 'field_value_update' ); |
234 | 234 | |
235 | - if ( ! $this->request['value'] ) { |
|
235 | + if ( ! $this->request[ 'value' ] ) { |
|
236 | 236 | return new WP_Error( 'cmb2_rest_update_field_error', __( 'CMB2 Field value cannot be updated without the value parameter specified.', 'cmb2' ), array( 'status' => 400 ) ); |
237 | 237 | } |
238 | 238 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function modify_field_value( $activity ) { |
293 | 293 | |
294 | - if ( ! $this->request['object_id'] || ! $this->request['object_type'] ) { |
|
294 | + if ( ! $this->request[ 'object_id' ] || ! $this->request[ 'object_type' ] ) { |
|
295 | 295 | 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 ) ); |
296 | 296 | } |
297 | 297 | |
@@ -310,11 +310,11 @@ discard block |
||
310 | 310 | |
311 | 311 | $this->field->args[ "value_{$activity}" ] = (bool) 'deleted' === $activity |
312 | 312 | ? $this->field->remove_data() |
313 | - : $this->field->save_field( $this->request['value'] ); |
|
313 | + : $this->field->save_field( $this->request[ 'value' ] ); |
|
314 | 314 | |
315 | 315 | // If options page, save the $activity options |
316 | - if ( 'options-page' == $this->request['object_type'] ) { |
|
317 | - $this->field->args[ "value_{$activity}" ] = cmb2_options( $this->request['object_id'] )->set(); |
|
316 | + if ( 'options-page' == $this->request[ 'object_type' ] ) { |
|
317 | + $this->field->args[ "value_{$activity}" ] = cmb2_options( $this->request[ 'object_id' ] )->set(); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | return $this->prepare_read_field( $this->field ); |
@@ -389,13 +389,13 @@ discard block |
||
389 | 389 | $value = $field->options(); |
390 | 390 | } elseif ( in_array( $key, CMB2_Field::$callable_fields, true ) ) { |
391 | 391 | |
392 | - if ( isset( $this->request['_rendered'] ) ) { |
|
392 | + if ( isset( $this->request[ '_rendered' ] ) ) { |
|
393 | 393 | $value = $key === 'render_row_cb' ? $rendered : $field->get_param_callback_result( $key ); |
394 | 394 | } elseif ( is_array( $value ) ) { |
395 | 395 | // We need to rewrite callbacks as string as they will cause |
396 | 396 | // JSON recursion errors. |
397 | - $class = is_string( $value[0] ) ? $value[0] : get_class( $value[0] ); |
|
398 | - $value = $class . '::' . $value[1]; |
|
397 | + $class = is_string( $value[ 0 ] ) ? $value[ 0 ] : get_class( $value[ 0 ] ); |
|
398 | + $value = $class . '::' . $value[ 1 ]; |
|
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
@@ -408,8 +408,8 @@ discard block |
||
408 | 408 | } |
409 | 409 | } |
410 | 410 | |
411 | - if ( $this->request['object_id'] && $this->request['object_type'] ) { |
|
412 | - $field_data['value'] = $field->get_data(); |
|
411 | + if ( $this->request[ 'object_id' ] && $this->request[ 'object_type' ] ) { |
|
412 | + $field_data[ 'value' ] = $field->get_data(); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | return $field_data; |