@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | unset( $filename ); |
| 156 | 156 | |
| 157 | - $comment_count = FrmDb::get_count( |
|
| 157 | + $comment_count = FrmDb::get_count( |
|
| 158 | 158 | 'frm_item_metas', |
| 159 | 159 | array( |
| 160 | 160 | 'item_id' => $atts['entry_ids'], |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | private static function prepare_csv_headings() { |
| 317 | 317 | $headings = array(); |
| 318 | 318 | self::csv_headings( $headings ); |
| 319 | - $headings = apply_filters( |
|
| 319 | + $headings = apply_filters( |
|
| 320 | 320 | 'frm_csv_columns', |
| 321 | 321 | $headings, |
| 322 | 322 | self::$form_id, |
@@ -345,15 +345,15 @@ discard block |
||
| 345 | 345 | $field_headings = array(); |
| 346 | 346 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
| 347 | 347 | if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) { |
| 348 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 348 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - if ( ! empty( $field_headings[ $col->id . '_label' ] ) ) { |
|
| 352 | - $field_headings[ $col->id ] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 351 | + if ( ! empty( $field_headings[$col->id . '_label'] ) ) { |
|
| 352 | + $field_headings[$col->id] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 353 | 353 | } else { |
| 354 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
| 354 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
| 355 | 355 | } |
| 356 | - $field_headings = apply_filters( |
|
| 356 | + $field_headings = apply_filters( |
|
| 357 | 357 | 'frm_csv_field_columns', |
| 358 | 358 | $field_headings, |
| 359 | 359 | array_merge( |
@@ -378,14 +378,14 @@ discard block |
||
| 378 | 378 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 379 | 379 | $repeater_id = $col->field_options['in_section']; |
| 380 | 380 | // Set a placeholder to maintain order for repeater fields. |
| 381 | - $headings[ 'repeater' . $repeater_id ] = array(); |
|
| 381 | + $headings['repeater' . $repeater_id] = array(); |
|
| 382 | 382 | |
| 383 | - if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 384 | - $fields_by_repeater_id[ $repeater_id ] = array(); |
|
| 383 | + if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) { |
|
| 384 | + $fields_by_repeater_id[$repeater_id] = array(); |
|
| 385 | 385 | $repeater_ids[] = $repeater_id; |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | - $fields_by_repeater_id[ $repeater_id ][] = $col; |
|
| 388 | + $fields_by_repeater_id[$repeater_id][] = $col; |
|
| 389 | 389 | |
| 390 | 390 | continue; |
| 391 | 391 | } |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | $end = strpos( $row->meta_value, ':{' ); |
| 405 | 405 | $length = substr( $row->meta_value, $start, $end - $start ); |
| 406 | 406 | |
| 407 | - if ( $length > $max[ $row->field_id ] ) { |
|
| 408 | - $max[ $row->field_id ] = $length; |
|
| 407 | + if ( $length > $max[$row->field_id] ) { |
|
| 408 | + $max[$row->field_id] = $length; |
|
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | unset( $start, $end, $length, $row, $repeater_meta, $where ); |
@@ -416,17 +416,17 @@ discard block |
||
| 416 | 416 | $repeater_id = str_replace( 'repeater', '', $key ); |
| 417 | 417 | |
| 418 | 418 | $repeater_headings = array(); |
| 419 | - foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) { |
|
| 419 | + foreach ( $fields_by_repeater_id[$repeater_id] as $col ) { |
|
| 420 | 420 | $repeater_headings += self::field_headings( $col ); |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | - for ( $i = 0; $i < $max[ $repeater_id ]; $i++ ) { |
|
| 423 | + for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) { |
|
| 424 | 424 | foreach ( $repeater_headings as $repeater_key => $repeater_name ) { |
| 425 | - $flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name; |
|
| 425 | + $flat[$repeater_key . '[' . $i . ']'] = $repeater_name; |
|
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | } else { |
| 429 | - $flat[ $key ] = $heading; |
|
| 429 | + $flat[$key] = $heading; |
|
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | 432 | |
@@ -439,10 +439,10 @@ discard block |
||
| 439 | 439 | }//end if |
| 440 | 440 | |
| 441 | 441 | if ( self::$comment_count ) { |
| 442 | - for ( $i = 0; $i < self::$comment_count; $i++ ) { |
|
| 443 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
| 444 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
| 445 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
| 442 | + for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
|
| 443 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
| 444 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
| 445 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
| 446 | 446 | } |
| 447 | 447 | unset( $i ); |
| 448 | 448 | } |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | */ |
| 496 | 496 | private static function prepare_next_csv_rows( $next_set ) { |
| 497 | 497 | if ( FrmAppHelper::pro_is_installed() ) { |
| 498 | - $where = array( |
|
| 498 | + $where = array( |
|
| 499 | 499 | 'or' => 1, |
| 500 | 500 | 'id' => $next_set, |
| 501 | 501 | 'parent_item_id' => $next_set, |
@@ -560,32 +560,32 @@ discard block |
||
| 560 | 560 | continue; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | - if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) { |
|
| 564 | - $entries[ self::$entry->parent_item_id ] = new stdClass(); |
|
| 565 | - $entries[ self::$entry->parent_item_id ]->metas = array(); |
|
| 563 | + if ( ! isset( $entries[self::$entry->parent_item_id] ) ) { |
|
| 564 | + $entries[self::$entry->parent_item_id] = new stdClass(); |
|
| 565 | + $entries[self::$entry->parent_item_id]->metas = array(); |
|
| 566 | 566 | } |
| 567 | 567 | |
| 568 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 569 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
| 570 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 568 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 569 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
| 570 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 571 | 571 | // if the data is here, it should be an array but if this field has collected data |
| 572 | 572 | // both while inside and outside of the repeating section, it's possible this is a string. |
| 573 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
| 573 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | // Add the repeated values. |
| 577 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
| 577 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
| 578 | 578 | }//end foreach |
| 579 | 579 | |
| 580 | 580 | self::$entry->metas = self::fill_missing_repeater_metas( self::$entry->metas, $entries ); |
| 581 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
| 581 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
| 582 | 582 | }//end if |
| 583 | 583 | |
| 584 | 584 | // add the embedded form id |
| 585 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
| 586 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
| 585 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
| 586 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
| 587 | 587 | } |
| 588 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
| 588 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | /** |
@@ -606,19 +606,19 @@ discard block |
||
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | $repeater_id = $field->field_options['in_section']; |
| 609 | - if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 609 | + if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) { |
|
| 610 | 610 | return $metas; |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | - foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) { |
|
| 614 | - if ( ! isset( $metas[ $repeater_child->id ] ) ) { |
|
| 615 | - $metas[ $repeater_child->id ] = ''; |
|
| 613 | + foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) { |
|
| 614 | + if ( ! isset( $metas[$repeater_child->id] ) ) { |
|
| 615 | + $metas[$repeater_child->id] = ''; |
|
| 616 | 616 | |
| 617 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) { |
|
| 618 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array(); |
|
| 617 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) || ! is_array( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) ) { |
|
| 618 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] = array(); |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = ''; |
|
| 621 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = ''; |
|
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | */ |
| 648 | 648 | private static function add_field_values_to_csv( &$row ) { |
| 649 | 649 | foreach ( self::$fields as $col ) { |
| 650 | - $field_value = self::$entry->metas[ $col->id ] ?? false; |
|
| 650 | + $field_value = self::$entry->metas[$col->id] ?? false; |
|
| 651 | 651 | |
| 652 | 652 | FrmFieldsHelper::prepare_field_value( $field_value, $col->type ); |
| 653 | 653 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -666,20 +666,20 @@ discard block |
||
| 666 | 666 | if ( ! empty( $col->field_options['separate_value'] ) ) { |
| 667 | 667 | $label_key = $col->id . '_label'; |
| 668 | 668 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 669 | - $row[ $label_key ] = array(); |
|
| 669 | + $row[$label_key] = array(); |
|
| 670 | 670 | |
| 671 | 671 | if ( is_array( $field_value ) ) { |
| 672 | 672 | foreach ( $field_value as $value ) { |
| 673 | - $row[ $label_key ][] = self::get_separate_value_label( $value, $col ); |
|
| 673 | + $row[$label_key][] = self::get_separate_value_label( $value, $col ); |
|
| 674 | 674 | } |
| 675 | 675 | } |
| 676 | 676 | } else { |
| 677 | - $row[ $label_key ] = self::get_separate_value_label( $field_value, $col ); |
|
| 677 | + $row[$label_key] = self::get_separate_value_label( $field_value, $col ); |
|
| 678 | 678 | } |
| 679 | 679 | unset( $label_key ); |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | - $row[ $col->id ] = $field_value; |
|
| 682 | + $row[$col->id] = $field_value; |
|
| 683 | 683 | |
| 684 | 684 | unset( $col, $field_value ); |
| 685 | 685 | }//end foreach |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | 'show_icon' => false, |
| 703 | 703 | 'entry_id' => self::$entry->id, |
| 704 | 704 | 'sep' => self::$separator, |
| 705 | - '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, |
|
| 705 | + '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, |
|
| 706 | 706 | ) |
| 707 | 707 | ); |
| 708 | 708 | } |
@@ -721,8 +721,8 @@ discard block |
||
| 721 | 721 | // This is combo field inside repeater. The heading key has this format: [86_first[0]]. |
| 722 | 722 | foreach ( $sub_value as $sub_key => $sub_sub_value ) { |
| 723 | 723 | $column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']'; |
| 724 | - if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 725 | - $row[ $column_key ] = $sub_sub_value; |
|
| 724 | + if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) { |
|
| 725 | + $row[$column_key] = $sub_sub_value; |
|
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | 728 | |
@@ -730,8 +730,8 @@ discard block |
||
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | $column_key = $atts['col']->id . '_' . $key; |
| 733 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 734 | - $row[ $column_key ] = $sub_value; |
|
| 733 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
| 734 | + $row[$column_key] = $sub_value; |
|
| 735 | 735 | } |
| 736 | 736 | } |
| 737 | 737 | } |
@@ -766,18 +766,18 @@ discard block |
||
| 766 | 766 | $echo = 'echo' === self::$mode; |
| 767 | 767 | |
| 768 | 768 | foreach ( self::$headings as $k => $heading ) { |
| 769 | - if ( isset( $rows[ $k ] ) ) { |
|
| 770 | - $row = $rows[ $k ]; |
|
| 769 | + if ( isset( $rows[$k] ) ) { |
|
| 770 | + $row = $rows[$k]; |
|
| 771 | 771 | } else { |
| 772 | 772 | $row = ''; |
| 773 | 773 | // array indexed data is not at $rows[ $k ] |
| 774 | - if ( $k[ strlen( $k ) - 1 ] === ']' ) { |
|
| 774 | + if ( $k[strlen( $k ) - 1] === ']' ) { |
|
| 775 | 775 | $start = strrpos( $k, '[' ); |
| 776 | - $key = substr( $k, 0, $start++ ); |
|
| 776 | + $key = substr( $k, 0, $start ++ ); |
|
| 777 | 777 | $index = substr( $k, $start, strlen( $k ) - 1 - $start ); |
| 778 | 778 | |
| 779 | - if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) { |
|
| 780 | - $row = $rows[ $key ][ $index ]; |
|
| 779 | + if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) { |
|
| 780 | + $row = $rows[$key][$index]; |
|
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | unset( $start, $key, $index ); |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | * @return void |
| 57 | 57 | */ |
| 58 | 58 | private static function flag_new_unique_key( $unique_id ) { |
| 59 | - if ( ! isset( self::$unique_id_match_checks[ $unique_id ] ) ) { |
|
| 60 | - self::$unique_id_match_checks[ $unique_id ] = false; |
|
| 59 | + if ( ! isset( self::$unique_id_match_checks[$unique_id] ) ) { |
|
| 60 | + self::$unique_id_match_checks[$unique_id] = false; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | if ( 0 === (int) $meta->field_id ) { |
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
| 115 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | return false; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if ( isset( self::$unique_id_match_checks[ $unique_id ] ) ) { |
|
| 181 | - return self::$unique_id_match_checks[ $unique_id ]; |
|
| 180 | + if ( isset( self::$unique_id_match_checks[$unique_id] ) ) { |
|
| 181 | + return self::$unique_id_match_checks[$unique_id]; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $timestamp = strtotime( $created_at ); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $timestamp = time(); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - self::$unique_id_match_checks[ $unique_id ] = (bool) FrmDb::get_var( |
|
| 189 | + self::$unique_id_match_checks[$unique_id] = (bool) FrmDb::get_var( |
|
| 190 | 190 | 'frm_item_metas', |
| 191 | 191 | array( |
| 192 | 192 | 'field_id' => 0, |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | 'id' |
| 197 | 197 | ); |
| 198 | 198 | |
| 199 | - return self::$unique_id_match_checks[ $unique_id ]; |
|
| 199 | + return self::$unique_id_match_checks[$unique_id]; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | $reduced = array(); |
| 227 | 227 | foreach ( $filter_vals as $field_id => $value ) { |
| 228 | 228 | $field = FrmFieldFactory::get_field_object( $field_id ); |
| 229 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
| 230 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
| 231 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
| 232 | - unset( $reduced[ $field_id ] ); |
|
| 229 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
| 230 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
| 231 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
| 232 | + unset( $reduced[$field_id] ); |
|
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | return $reduced; |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | private static function prepare_entries( &$entries ) { |
| 516 | 516 | foreach ( $entries as $k => $entry ) { |
| 517 | 517 | self::prepare_entry( $entry ); |
| 518 | - $entries[ $k ] = $entry; |
|
| 518 | + $entries[$k] = $entry; |
|
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | |
@@ -546,19 +546,19 @@ discard block |
||
| 546 | 546 | FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type ); |
| 547 | 547 | |
| 548 | 548 | if ( $meta_val->item_id == $entry->id ) { |
| 549 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
| 549 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
| 550 | 550 | if ( $include_key ) { |
| 551 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
| 551 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
| 552 | 552 | } |
| 553 | 553 | continue; |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | // include sub entries in an array |
| 557 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
| 558 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
| 557 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
| 558 | + $entry->metas[$meta_val->field_id] = array(); |
|
| 559 | 559 | } |
| 560 | 560 | |
| 561 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
| 561 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
| 562 | 562 | |
| 563 | 563 | unset( $meta_val ); |
| 564 | 564 | } |
@@ -662,16 +662,16 @@ discard block |
||
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | foreach ( $metas as $m_key => $meta_val ) { |
| 665 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
| 665 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
| 666 | 666 | continue; |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
| 670 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
| 669 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
| 670 | + $entries[$meta_val->item_id]->metas = array(); |
|
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type ); |
| 674 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
| 674 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
| 675 | 675 | unset( $m_key, $meta_val ); |
| 676 | 676 | } |
| 677 | 677 | |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | * @return mixed |
| 864 | 864 | */ |
| 865 | 865 | private static function get_entry_value( $values, $name, $default ) { |
| 866 | - return $values[ $name ] ?? $default; |
|
| 866 | + return $values[$name] ?? $default; |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | /** |
@@ -1070,7 +1070,7 @@ discard block |
||
| 1070 | 1070 | private static function maybe_add_captcha_meta( $form_id, $entry_id ) { |
| 1071 | 1071 | global $frm_vars; |
| 1072 | 1072 | if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) { |
| 1073 | - $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] ); |
|
| 1073 | + $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] ); |
|
| 1074 | 1074 | FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) ); |
| 1075 | 1075 | } |
| 1076 | 1076 | } |
@@ -133,19 +133,19 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | foreach ( $action_controls as $action ) { |
| 136 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 136 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 137 | 137 | continue; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $this_group = $action->action_options['group']; |
| 141 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
| 141 | + if ( ! isset( $groups[$this_group] ) ) { |
|
| 142 | 142 | $this_group = 'misc'; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
| 146 | - $groups[ $this_group ]['actions'] = array(); |
|
| 145 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
| 146 | + $groups[$this_group]['actions'] = array(); |
|
| 147 | 147 | } |
| 148 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
| 148 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
| 149 | 149 | |
| 150 | 150 | unset( $action ); |
| 151 | 151 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | return $a; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $actions[ $a->id_base ] = $a; |
|
| 322 | + $actions[$a->id_base] = $a; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | return $actions; |
@@ -358,18 +358,18 @@ discard block |
||
| 358 | 358 | $action_map = array(); |
| 359 | 359 | |
| 360 | 360 | foreach ( $action_controls as $key => $control ) { |
| 361 | - $action_map[ $control->id_base ] = $key; |
|
| 361 | + $action_map[$control->id_base] = $key; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | self::maybe_show_limit_warning( $form->id, $form_actions ); |
| 365 | 365 | |
| 366 | 366 | foreach ( $form_actions as $action ) { |
| 367 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 367 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 368 | 368 | // don't try and show settings if action no longer exists |
| 369 | 369 | continue; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 372 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | |
@@ -681,8 +681,8 @@ discard block |
||
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | // Store actions so they can be triggered with the correct priority. |
| 684 | - $stored_actions[ $action->ID ] = $action; |
|
| 685 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 684 | + $stored_actions[$action->ID] = $action; |
|
| 685 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 686 | 686 | |
| 687 | 687 | unset( $action ); |
| 688 | 688 | }//end foreach |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | new FrmNotification(); |
| 695 | 695 | |
| 696 | 696 | foreach ( $action_priority as $action_id => $priority ) { |
| 697 | - $action = $stored_actions[ $action_id ]; |
|
| 697 | + $action = $stored_actions[$action_id]; |
|
| 698 | 698 | |
| 699 | 699 | /** |
| 700 | 700 | * Allows custom form action trigger. |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | * @return void |
| 792 | 792 | */ |
| 793 | 793 | public function register( $action_class ) { |
| 794 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 794 | + $this->actions[$action_class] = new $action_class(); |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /** |
@@ -800,8 +800,8 @@ discard block |
||
| 800 | 800 | * @return void |
| 801 | 801 | */ |
| 802 | 802 | public function unregister( $action_class ) { |
| 803 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 804 | - unset( $this->actions[ $action_class ] ); |
|
| 803 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 804 | + unset( $this->actions[$action_class] ); |
|
| 805 | 805 | } |
| 806 | 806 | } |
| 807 | 807 | |
@@ -810,8 +810,8 @@ discard block |
||
| 810 | 810 | |
| 811 | 811 | foreach ( $keys as $key ) { |
| 812 | 812 | // don't register new action if old action with the same id is already registered |
| 813 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 814 | - $this->actions[ $key ]->_register(); |
|
| 813 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 814 | + $this->actions[$key]->_register(); |
|
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | } |
@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | return $this->get_pagenum(); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if ( isset( $this->_pagination_args[ $key ] ) ) { |
|
| 234 | - return $this->_pagination_args[ $key ]; |
|
| 233 | + if ( isset( $this->_pagination_args[$key] ) ) { |
|
| 234 | + return $this->_pagination_args[$key]; |
|
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | |
@@ -281,8 +281,8 @@ discard block |
||
| 281 | 281 | * @return void |
| 282 | 282 | */ |
| 283 | 283 | private function hidden_search_inputs( $param_name ) { |
| 284 | - if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
|
| 285 | - $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
|
| 284 | + if ( ! empty( $_REQUEST[$param_name] ) ) { |
|
| 285 | + $value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) ); |
|
| 286 | 286 | echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />'; |
| 287 | 287 | } |
| 288 | 288 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | echo "<ul class='subsubsub'>\n"; |
| 326 | 326 | foreach ( $views as $class => $view ) { |
| 327 | - $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 327 | + $views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 328 | 328 | } |
| 329 | 329 | echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 330 | 330 | echo '</ul>'; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | |
| 491 | 491 | $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; |
| 492 | 492 | foreach ( $actions as $action => $link ) { |
| 493 | - ++$i; |
|
| 493 | + ++ $i; |
|
| 494 | 494 | $sep = $i === $action_count ? '' : ' | '; |
| 495 | 495 | $out .= "<span class='$action'>$link$sep</span>"; |
| 496 | 496 | } |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | 'next' => __( 'Next page', 'formidable' ), |
| 724 | 724 | ); |
| 725 | 725 | |
| 726 | - return $labels[ $link ]; |
|
| 726 | + return $labels[$link]; |
|
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | private function current_url() { |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | |
| 829 | 829 | // If the primary column doesn't exist fall back to the |
| 830 | 830 | // first non-checkbox column. |
| 831 | - if ( ! isset( $columns[ $default ] ) ) { |
|
| 831 | + if ( ! isset( $columns[$default] ) ) { |
|
| 832 | 832 | $default = self::get_default_primary_column_name(); |
| 833 | 833 | } |
| 834 | 834 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | */ |
| 843 | 843 | $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); |
| 844 | 844 | |
| 845 | - if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { |
|
| 845 | + if ( empty( $column ) || ! isset( $columns[$column] ) ) { |
|
| 846 | 846 | $column = $default; |
| 847 | 847 | } |
| 848 | 848 | |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | // In 4.3, we added a fourth argument for primary column. |
| 864 | 864 | $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); |
| 865 | 865 | foreach ( $this->_column_headers as $key => $value ) { |
| 866 | - $column_headers[ $key ] = $value; |
|
| 866 | + $column_headers[$key] = $value; |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | return $column_headers; |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | $data[1] = false; |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | - $sortable[ $id ] = $data; |
|
| 899 | + $sortable[$id] = $data; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | $primary = $this->get_primary_column_name(); |
@@ -954,7 +954,7 @@ discard block |
||
| 954 | 954 | static $cb_counter = 1; |
| 955 | 955 | $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>'; |
| 956 | 956 | $columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />'; |
| 957 | - ++$cb_counter; |
|
| 957 | + ++ $cb_counter; |
|
| 958 | 958 | } |
| 959 | 959 | |
| 960 | 960 | foreach ( $columns as $column_key => $column_display_name ) { |
@@ -976,8 +976,8 @@ discard block |
||
| 976 | 976 | $class[] = 'column-primary'; |
| 977 | 977 | } |
| 978 | 978 | |
| 979 | - if ( isset( $sortable[ $column_key ] ) ) { |
|
| 980 | - list( $orderby, $desc_first ) = $sortable[ $column_key ]; |
|
| 979 | + if ( isset( $sortable[$column_key] ) ) { |
|
| 980 | + list( $orderby, $desc_first ) = $sortable[$column_key]; |
|
| 981 | 981 | |
| 982 | 982 | if ( $current_orderby == $orderby ) { |
| 983 | 983 | // The sorted column. The `aria-sort` attribute must be set only on the sorted column. |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false. |
| 1095 | 1095 | */ |
| 1096 | 1096 | protected function should_display( $args, $settings ) { |
| 1097 | - return ! isset( $args[ $settings ] ) || false !== $args[ $settings ]; |
|
| 1097 | + return ! isset( $args[$settings] ) || false !== $args[$settings]; |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | /** |