@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | class FrmFormTemplateApi extends FrmFormApi { |
7 | 7 | |
8 | - protected static $code_option_name = 'frm_free_license_code'; |
|
8 | + protected static $code_option_name = 'frm_free_license_code'; |
|
9 | 9 | |
10 | 10 | private static $base_api_url = 'https://formidableforms.com/wp-json/form-templates/v1/'; |
11 | 11 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $templates = $this->get_api_info(); |
78 | 78 | $contact_form = 20872734; |
79 | - return isset( $templates[ $contact_form ] ) && ! empty( $templates[ $contact_form ]['url'] ); |
|
79 | + return isset( $templates[$contact_form] ) && ! empty( $templates[$contact_form]['url'] ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -137,15 +137,15 @@ discard block |
||
137 | 137 | continue; |
138 | 138 | } |
139 | 139 | |
140 | - $data['urlByKey'][ $template['key'] ] = $template['url']; |
|
140 | + $data['urlByKey'][$template['key']] = $template['url']; |
|
141 | 141 | } |
142 | 142 | |
143 | - if ( ! isset( $data['urlByKey'][ $key ] ) ) { |
|
143 | + if ( ! isset( $data['urlByKey'][$key] ) ) { |
|
144 | 144 | $error = new WP_Error( 400, 'We were unable to retrieve the template' ); |
145 | 145 | wp_send_json_error( $error ); |
146 | 146 | } |
147 | 147 | |
148 | - $data['url'] = $data['urlByKey'][ $key ]; |
|
148 | + $data['url'] = $data['urlByKey'][$key]; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | wp_send_json_success( $data ); |
@@ -102,7 +102,7 @@ |
||
102 | 102 | 'name' => 'FrmFieldName', |
103 | 103 | ); |
104 | 104 | |
105 | - $class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : ''; |
|
105 | + $class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : ''; |
|
106 | 106 | |
107 | 107 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
108 | 108 | } |
@@ -39,7 +39,8 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | foreach ( $sub_field['options'] as $option ) { |
42 | - if ( 'default_value' === $option ) { // We parse default value from field column. |
|
42 | + if ( 'default_value' === $option ) { |
|
43 | +// We parse default value from field column. |
|
43 | 44 | continue; |
44 | 45 | } |
45 | 46 |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | if ( is_array( $sub_field ) ) { |
60 | 60 | $sub_field = wp_parse_args( $sub_field, $defaults ); |
61 | 61 | $sub_field['name'] = $name; |
62 | - $this->sub_fields[ $name ] = $sub_field; |
|
62 | + $this->sub_fields[$name] = $sub_field; |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | 66 | if ( is_string( $sub_field ) ) { |
67 | - $this->sub_fields[ $name ] = wp_parse_args( |
|
67 | + $this->sub_fields[$name] = wp_parse_args( |
|
68 | 68 | array( |
69 | 69 | 'name' => $name, |
70 | 70 | 'label' => $sub_field, |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | if ( is_string( $option ) ) { |
119 | - $extra_options[ $key . '_' . $option ] = ''; |
|
119 | + $extra_options[$key . '_' . $option] = ''; |
|
120 | 120 | } elseif ( ! empty( $option['name'] ) ) { |
121 | - $extra_options[ $key . '_' . $option['name'] ] = ''; |
|
121 | + $extra_options[$key . '_' . $option['name']] = ''; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | foreach ( $this->sub_fields as $name => $sub_field ) { |
142 | 142 | $sub_field['name'] = $name; |
143 | 143 | $wrapper_classes = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name']; |
144 | - if ( ! isset( $processed_sub_fields[ $name ] ) ) { |
|
144 | + if ( ! isset( $processed_sub_fields[$name] ) ) { |
|
145 | 145 | // Options for this subfield should be hidden. |
146 | 146 | $wrapper_classes .= ' frm_hidden'; |
147 | 147 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $default_value = array(); |
172 | 172 | |
173 | 173 | foreach ( $this->sub_fields as $name => $sub_field ) { |
174 | - $default_value[ $name ] = ''; |
|
174 | + $default_value[$name] = ''; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $default_value; |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | // Placeholder. |
344 | 344 | if ( in_array( 'placeholder', $sub_field['options'], true ) ) { |
345 | 345 | $placeholders = FrmField::get_option( $field, 'placeholder' ); |
346 | - if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) { |
|
347 | - $field['placeholder'] = $placeholders[ $sub_field['name'] ]; |
|
346 | + if ( ! empty( $placeholders[$sub_field['name']] ) ) { |
|
347 | + $field['placeholder'] = $placeholders[$sub_field['name']]; |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | |
402 | 402 | // Validate not empty. |
403 | 403 | foreach ( $sub_fields as $name => $sub_field ) { |
404 | - if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) { |
|
405 | - $errors[ 'field' . $args['id'] . '-' . $name ] = ''; |
|
406 | - $errors[ 'field' . $args['id'] ] = $blank_msg; |
|
404 | + if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) { |
|
405 | + $errors['field' . $args['id'] . '-' . $name] = ''; |
|
406 | + $errors['field' . $args['id']] = $blank_msg; |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $field_key = isset( $this->field->field_key ) ? $this->field->field_key : $this->field['field_key']; |
423 | 423 | $sub_fields = $this->get_processed_sub_fields(); |
424 | 424 | foreach ( $sub_fields as $name => $sub_field ) { |
425 | - $headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
425 | + $headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | return $headings; |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | type="text" |
52 | 52 | name="<?php echo esc_attr( $input_name ); ?>" |
53 | 53 | id="<?php echo esc_attr( $input_id ); ?>" |
54 | - value="<?php echo esc_attr( isset( $default_value[ $sub_field['name'] ] ) ? $default_value[ $sub_field['name'] ] : '' ); ?>" |
|
54 | + value="<?php echo esc_attr( isset( $default_value[$sub_field['name']] ) ? $default_value[$sub_field['name']] : '' ); ?>" |
|
55 | 55 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
56 | 56 | data-changeatt="value" |
57 | 57 | /> |
58 | 58 | </span> |
59 | 59 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
60 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
60 | + <?php echo esc_html( $labels[$option] ); ?> |
|
61 | 61 | </label> |
62 | 62 | </p> |
63 | 63 | <?php |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | type="text" |
75 | 75 | name="<?php echo esc_attr( $input_name ); ?>" |
76 | 76 | id="<?php echo esc_attr( $input_id ); ?>" |
77 | - value="<?php echo esc_attr( isset( $input_value[ $sub_field['name'] ] ) ? $input_value[ $sub_field['name'] ] : '' ); ?>" |
|
77 | + value="<?php echo esc_attr( isset( $input_value[$sub_field['name']] ) ? $input_value[$sub_field['name']] : '' ); ?>" |
|
78 | 78 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
79 | 79 | data-changeatt="<?php echo esc_attr( $option ); ?>" |
80 | 80 | /> |
81 | 81 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
82 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
82 | + <?php echo esc_html( $labels[$option] ); ?> |
|
83 | 83 | </label> |
84 | 84 | </p> |
85 | 85 | <?php |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | data-changeme="frm_field_<?php echo esc_attr( $field_id . '_' . $sub_field['name'] ); ?>_desc" |
101 | 101 | /> |
102 | 102 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
103 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
103 | + <?php echo esc_html( $labels[$option] ); ?> |
|
104 | 104 | </label> |
105 | 105 | </p> |
106 | 106 | <?php |
@@ -122,7 +122,8 @@ |
||
122 | 122 | |
123 | 123 | private static function field_headings( $col ) { |
124 | 124 | $field_type_obj = FrmFieldFactory::get_field_factory( $col ); |
125 | - if ( ! empty( $field_type_obj->is_combo_field ) ) { // This is combo field. |
|
125 | + if ( ! empty( $field_type_obj->is_combo_field ) ) { |
|
126 | +// This is combo field. |
|
126 | 127 | return $field_type_obj->get_export_headings(); |
127 | 128 | } |
128 | 129 |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | unset( $filename ); |
125 | 125 | |
126 | - $comment_count = FrmDb::get_count( |
|
126 | + $comment_count = FrmDb::get_count( |
|
127 | 127 | 'frm_item_metas', |
128 | 128 | array( |
129 | 129 | 'item_id' => $atts['entry_ids'], |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | private static function prepare_csv_headings() { |
207 | 207 | $headings = array(); |
208 | 208 | self::csv_headings( $headings ); |
209 | - $headings = apply_filters( |
|
209 | + $headings = apply_filters( |
|
210 | 210 | 'frm_csv_columns', |
211 | 211 | $headings, |
212 | 212 | self::$form_id, |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | $field_headings = array(); |
230 | 230 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
231 | 231 | if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) { |
232 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
232 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
233 | 233 | } |
234 | 234 | |
235 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
235 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
236 | 236 | $field_headings = apply_filters( |
237 | 237 | 'frm_csv_field_columns', |
238 | 238 | $field_headings, |
@@ -252,14 +252,14 @@ discard block |
||
252 | 252 | foreach ( self::$fields as $col ) { |
253 | 253 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
254 | 254 | $repeater_id = $col->field_options['in_section']; |
255 | - $headings[ 'repeater' . $repeater_id ] = array(); // set a placeholder to maintain order for repeater fields |
|
255 | + $headings['repeater' . $repeater_id] = array(); // set a placeholder to maintain order for repeater fields |
|
256 | 256 | |
257 | - if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) { |
|
258 | - $fields_by_repeater_id[ $repeater_id ] = array(); |
|
257 | + if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) { |
|
258 | + $fields_by_repeater_id[$repeater_id] = array(); |
|
259 | 259 | $repeater_ids[] = $repeater_id; |
260 | 260 | } |
261 | 261 | |
262 | - $fields_by_repeater_id[ $repeater_id ][] = $col; |
|
262 | + $fields_by_repeater_id[$repeater_id][] = $col; |
|
263 | 263 | |
264 | 264 | continue; |
265 | 265 | } |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | $end = strpos( $row->meta_value, ':{' ); |
279 | 279 | $length = substr( $row->meta_value, $start, $end - $start ); |
280 | 280 | |
281 | - if ( $length > $max[ $row->field_id ] ) { |
|
282 | - $max[ $row->field_id ] = $length; |
|
281 | + if ( $length > $max[$row->field_id] ) { |
|
282 | + $max[$row->field_id] = $length; |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | unset( $start, $end, $length, $row, $repeater_meta, $where ); |
@@ -290,17 +290,17 @@ discard block |
||
290 | 290 | $repeater_id = str_replace( 'repeater', '', $key ); |
291 | 291 | |
292 | 292 | $repeater_headings = array(); |
293 | - foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) { |
|
293 | + foreach ( $fields_by_repeater_id[$repeater_id] as $col ) { |
|
294 | 294 | $repeater_headings += self::field_headings( $col ); |
295 | 295 | } |
296 | 296 | |
297 | - for ( $i = 0; $i < $max[ $repeater_id ]; $i ++ ) { |
|
297 | + for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) { |
|
298 | 298 | foreach ( $repeater_headings as $repeater_key => $repeater_name ) { |
299 | - $flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name; |
|
299 | + $flat[$repeater_key . '[' . $i . ']'] = $repeater_name; |
|
300 | 300 | } |
301 | 301 | } |
302 | 302 | } else { |
303 | - $flat[ $key ] = $heading; |
|
303 | + $flat[$key] = $heading; |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | |
315 | 315 | if ( self::$comment_count ) { |
316 | 316 | for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
317 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
318 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
319 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
317 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
318 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
319 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
320 | 320 | } |
321 | 321 | unset( $i ); |
322 | 322 | } |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | private static function prepare_next_csv_rows( $next_set ) { |
363 | 363 | // order by parent_item_id so children will be first |
364 | - $where = array( |
|
364 | + $where = array( |
|
365 | 365 | 'or' => 1, |
366 | 366 | 'id' => $next_set, |
367 | 367 | 'parent_item_id' => $next_set, |
@@ -407,32 +407,32 @@ discard block |
||
407 | 407 | continue; |
408 | 408 | } |
409 | 409 | |
410 | - if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) { |
|
411 | - $entries[ self::$entry->parent_item_id ] = new stdClass(); |
|
412 | - $entries[ self::$entry->parent_item_id ]->metas = array(); |
|
410 | + if ( ! isset( $entries[self::$entry->parent_item_id] ) ) { |
|
411 | + $entries[self::$entry->parent_item_id] = new stdClass(); |
|
412 | + $entries[self::$entry->parent_item_id]->metas = array(); |
|
413 | 413 | } |
414 | 414 | |
415 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
416 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
417 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
415 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
416 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
417 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
418 | 418 | // if the data is here, it should be an array but if this field has collected data |
419 | 419 | // both while inside and outside of the repeating section, it's possible this is a string |
420 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
420 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | //add the repeated values |
424 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
424 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | self::$entry->metas = self::fill_missing_repeater_metas( self::$entry->metas, $entries ); |
428 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
428 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | // add the embedded form id |
432 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
433 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
432 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
433 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
434 | 434 | } |
435 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
435 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | /** |
@@ -453,14 +453,14 @@ discard block |
||
453 | 453 | } |
454 | 454 | |
455 | 455 | $repeater_id = $field->field_options['in_section']; |
456 | - if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) { |
|
456 | + if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) { |
|
457 | 457 | return $metas; |
458 | 458 | } |
459 | 459 | |
460 | - foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) { |
|
461 | - if ( ! isset( $metas[ $repeater_child->id ] ) ) { |
|
462 | - $metas[ $repeater_child->id ] = ''; |
|
463 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = ''; |
|
460 | + foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) { |
|
461 | + if ( ! isset( $metas[$repeater_child->id] ) ) { |
|
462 | + $metas[$repeater_child->id] = ''; |
|
463 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = ''; |
|
464 | 464 | } |
465 | 465 | } |
466 | 466 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | |
480 | 480 | private static function add_field_values_to_csv( &$row ) { |
481 | 481 | foreach ( self::$fields as $col ) { |
482 | - $field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false; |
|
482 | + $field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false; |
|
483 | 483 | |
484 | 484 | FrmAppHelper::unserialize_or_decode( $field_value ); |
485 | 485 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -498,17 +498,17 @@ discard block |
||
498 | 498 | if ( ! empty( $col->field_options['separate_value'] ) ) { |
499 | 499 | $label_key = $col->id . '_label'; |
500 | 500 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
501 | - $row[ $label_key ] = array(); |
|
501 | + $row[$label_key] = array(); |
|
502 | 502 | foreach ( $field_value as $value ) { |
503 | - $row[ $label_key ][] = self::get_separate_value_label( $value, $col ); |
|
503 | + $row[$label_key][] = self::get_separate_value_label( $value, $col ); |
|
504 | 504 | } |
505 | 505 | } else { |
506 | - $row[ $label_key ] = self::get_separate_value_label( $field_value, $col ); |
|
506 | + $row[$label_key] = self::get_separate_value_label( $field_value, $col ); |
|
507 | 507 | } |
508 | 508 | unset( $label_key ); |
509 | 509 | } |
510 | 510 | |
511 | - $row[ $col->id ] = $field_value; |
|
511 | + $row[$col->id] = $field_value; |
|
512 | 512 | |
513 | 513 | unset( $col, $field_value ); |
514 | 514 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | 'show_icon' => false, |
532 | 532 | 'entry_id' => self::$entry->id, |
533 | 533 | 'sep' => self::$separator, |
534 | - 'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0, |
|
534 | + 'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0, |
|
535 | 535 | ) |
536 | 536 | ); |
537 | 537 | } |
@@ -546,8 +546,8 @@ discard block |
||
546 | 546 | // This is combo field inside repeater. The heading key has this format: [86_first[0]]. |
547 | 547 | foreach ( $sub_value as $sub_key => $sub_sub_value ) { |
548 | 548 | $column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']'; |
549 | - if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) { |
|
550 | - $row[ $column_key ] = $sub_sub_value; |
|
549 | + if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) { |
|
550 | + $row[$column_key] = $sub_sub_value; |
|
551 | 551 | } |
552 | 552 | } |
553 | 553 | |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | $column_key = $atts['col']->id . '_' . $key; |
558 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
559 | - $row[ $column_key ] = $sub_value; |
|
558 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
559 | + $row[$column_key] = $sub_value; |
|
560 | 560 | } |
561 | 561 | } |
562 | 562 | } |
@@ -581,18 +581,18 @@ discard block |
||
581 | 581 | $echo = 'echo' === self::$mode; |
582 | 582 | |
583 | 583 | foreach ( self::$headings as $k => $heading ) { |
584 | - if ( isset( $rows[ $k ] ) ) { |
|
585 | - $row = $rows[ $k ]; |
|
584 | + if ( isset( $rows[$k] ) ) { |
|
585 | + $row = $rows[$k]; |
|
586 | 586 | } else { |
587 | 587 | $row = ''; |
588 | 588 | // array indexed data is not at $rows[ $k ] |
589 | - if ( $k[ strlen( $k ) - 1 ] === ']' ) { |
|
589 | + if ( $k[strlen( $k ) - 1] === ']' ) { |
|
590 | 590 | $start = strrpos( $k, '[' ); |
591 | 591 | $key = substr( $k, 0, $start ++ ); |
592 | 592 | $index = substr( $k, $start, strlen( $k ) - 1 - $start ); |
593 | 593 | |
594 | - if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) { |
|
595 | - $row = $rows[ $key ][ $index ]; |
|
594 | + if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) { |
|
595 | + $row = $rows[$key][$index]; |
|
596 | 596 | } |
597 | 597 | |
598 | 598 | unset( $start, $key, $index ); |
@@ -213,10 +213,10 @@ |
||
213 | 213 | return false; |
214 | 214 | } |
215 | 215 | $form_params = $frm_vars['form_params']; |
216 | - if ( ! isset( $form_params[ $this->form_id ] ) ) { |
|
216 | + if ( ! isset( $form_params[$this->form_id] ) ) { |
|
217 | 217 | return false; |
218 | 218 | } |
219 | - $this_form_params = $form_params[ $this->form_id ]; |
|
219 | + $this_form_params = $form_params[$this->form_id]; |
|
220 | 220 | return ! empty( $this_form_params['action'] ) && 'update' === $this_form_params['action']; |
221 | 221 | } |
222 | 222 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | private function check_honeypot_setting() { |
49 | 49 | $form = $this->get_form(); |
50 | 50 | $key = $this->get_option_key(); |
51 | - return $form->options[ $key ]; |
|
51 | + return $form->options[$key]; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -38,7 +38,7 @@ |
||
38 | 38 | protected function is_option_on() { |
39 | 39 | $form = $this->get_form(); |
40 | 40 | $key = $this->get_option_key(); |
41 | - return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ]; |
|
41 | + return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key]; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | $result = array(); |
47 | 47 | |
48 | 48 | foreach ( $names as $name ) { |
49 | - if ( empty( $this->sub_fields[ $name ] ) ) { |
|
49 | + if ( empty( $this->sub_fields[$name] ) ) { |
|
50 | 50 | continue; |
51 | 51 | } |
52 | 52 | |
53 | - if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
54 | - $this->sub_fields[ $name ]['wrapper_classes'] = $col_class; |
|
55 | - } elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
56 | - $this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class; |
|
53 | + if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
54 | + $this->sub_fields[$name]['wrapper_classes'] = $col_class; |
|
55 | + } elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
56 | + $this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class; |
|
57 | 57 | } else { |
58 | - $this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class; |
|
58 | + $this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class; |
|
59 | 59 | } |
60 | 60 | |
61 | - $result[ $name ] = $this->sub_fields[ $name ]; |
|
61 | + $result[$name] = $this->sub_fields[$name]; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return $result; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | // Default desc. |
91 | 91 | foreach ( $this->sub_fields as $name => $sub_field ) { |
92 | - $extra_options[ $name . '_desc' ] = $sub_field['label']; |
|
92 | + $extra_options[$name . '_desc'] = $sub_field['label']; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | return $extra_options; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $name_layout = $this->get_name_layout(); |
126 | 126 | |
127 | 127 | if ( ! empty( $atts['show'] ) ) { |
128 | - return isset( $value[ $atts['show'] ] ) ? $value[ $atts['show'] ] : ''; |
|
128 | + return isset( $value[$atts['show']] ) ? $value[$atts['show']] : ''; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | $value = wp_parse_args( |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $args['sub_fields'] = $this->sub_fields; |
199 | 199 | |
200 | 200 | foreach ( $hidden_fields as $name => $hidden_field ) { |
201 | - $args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden'; |
|
201 | + $args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden'; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |