@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Validate the number format. |
| 64 | 64 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
| 65 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ( $args['value'] === '' ) { |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | $maxnum = FrmField::get_option( $this->field, 'maxnum' ); |
| 75 | 75 | |
| 76 | 76 | if ( $minnum !== '' && $value < $minnum ) { |
| 77 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' ); |
|
| 77 | + $errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' ); |
|
| 78 | 78 | } elseif ( $maxnum !== '' && $value > $maxnum ) { |
| 79 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' ); |
|
| 79 | + $errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->validate_step( $errors, $args ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | 97 | protected function validate_step( &$errors, $args ) { |
| 98 | - if ( isset( $errors[ 'field' . $args['id'] ] ) ) { |
|
| 98 | + if ( isset( $errors['field' . $args['id']] ) ) { |
|
| 99 | 99 | // Don't need to check if value is invalid before. |
| 100 | 100 | return; |
| 101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $errors[ 'field' . $args['id'] ] = sprintf( |
|
| 113 | + $errors['field' . $args['id']] = sprintf( |
|
| 114 | 114 | // Translators: %1$s: the first nearest value; %2$s: the second nearest value. |
| 115 | 115 | __( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ), |
| 116 | 116 | is_numeric( $result[0] ) ? floatval( $result[0] ) : $result[0], |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * @return array |
| 54 | 54 | */ |
| 55 | 55 | public static function add_gdpr_field( $fields ) { |
| 56 | - $fields[ self::FIELD_TYPE ] = array( |
|
| 56 | + $fields[self::FIELD_TYPE] = array( |
|
| 57 | 57 | 'name' => __( 'GDPR', 'formidable' ), |
| 58 | 58 | 'icon' => 'frm_icon_font frm-gdpr-icon', |
| 59 | 59 | ); |
@@ -76,10 +76,10 @@ |
||
| 76 | 76 | foreach ( $pro_fields as $field_key => $field_type ) { |
| 77 | 77 | |
| 78 | 78 | if ( isset( $field_type['section'] ) ) { |
| 79 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
|
| 80 | - $field_sections[ $field_type['section'] ] = array(); |
|
| 79 | + if ( ! isset( $field_sections[$field_type['section']] ) ) { |
|
| 80 | + $field_sections[$field_type['section']] = array(); |
|
| 81 | 81 | } |
| 82 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
|
| 82 | + $field_sections[$field_type['section']][$field_key] = $field_type; |
|
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -172,7 +172,7 @@ |
||
| 172 | 172 | |
| 173 | 173 | if ( ! $required && empty( $args['value'] ) ) { |
| 174 | 174 | $frm_settings = FrmAppHelper::get_settings(); |
| 175 | - $errors[ 'field' . $args['id'] ] = str_replace( '[field_name]', is_object( $this->field ) ? $this->field->name : $this->field['name'], $frm_settings->blank_msg ); |
|
| 175 | + $errors['field' . $args['id']] = str_replace( '[field_name]', is_object( $this->field ) ? $this->field->name : $this->field['name'], $frm_settings->blank_msg ); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
@@ -160,7 +160,7 @@ |
||
| 160 | 160 | * @return object|string |
| 161 | 161 | */ |
| 162 | 162 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
| 163 | - $body = array( |
|
| 163 | + $body = array( |
|
| 164 | 164 | 'frm_square_api_action' => $action, |
| 165 | 165 | 'frm_square_api_mode' => FrmSquareLiteAppHelper::active_mode(), |
| 166 | 166 | ); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $form = $this->get_form(); |
| 52 | - return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ]; |
|
| 52 | + return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key]; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | 'default' => 'id', |
| 97 | 97 | ) |
| 98 | 98 | ); |
| 99 | - $order = self::get_param( |
|
| 99 | + $order = self::get_param( |
|
| 100 | 100 | array( |
| 101 | 101 | 'param' => 'order', |
| 102 | 102 | 'default' => 'DESC', |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $form_ids = $this->get_form_ids( $form_id ); |
| 149 | 149 | $s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0]; |
| 150 | 150 | } else { |
| 151 | - $s_query[] = array( |
|
| 151 | + $s_query[] = array( |
|
| 152 | 152 | 'or' => 1, |
| 153 | 153 | 'parent_form_id' => null, |
| 154 | 154 | 'parent_form_id <' => 1, |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | $r = "<tr id='item-action-{$item->id}'$style>"; |
| 317 | 317 | |
| 318 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
| 318 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
| 319 | 319 | $action_col = false; |
| 320 | 320 | $action_columns = $this->get_action_columns(); |
| 321 | 321 | |
@@ -29,10 +29,10 @@ |
||
| 29 | 29 | // This filter hides gateway fields from the entries list. |
| 30 | 30 | add_filter( |
| 31 | 31 | 'frm_fields_in_entries_list_table', |
| 32 | - function ( $form_cols ) { |
|
| 32 | + function( $form_cols ) { |
|
| 33 | 33 | return array_filter( |
| 34 | 34 | $form_cols, |
| 35 | - function ( $form_col ) { |
|
| 35 | + function( $form_col ) { |
|
| 36 | 36 | return 'gateway' !== $form_col->type; |
| 37 | 37 | } |
| 38 | 38 | ); |
@@ -82,12 +82,12 @@ |
||
| 82 | 82 | $settings = $this->default_options(); |
| 83 | 83 | |
| 84 | 84 | foreach ( $settings as $setting => $default ) { |
| 85 | - if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) { |
|
| 86 | - $this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ); |
|
| 85 | + if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) { |
|
| 86 | + $this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) ); |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $this->settings->test_mode = isset( $params[ 'frm_' . $this->param() . '_test_mode' ] ) ? absint( $params[ 'frm_' . $this->param() . '_test_mode' ] ) : 0; |
|
| 90 | + $this->settings->test_mode = isset( $params['frm_' . $this->param() . '_test_mode'] ) ? absint( $params['frm_' . $this->param() . '_test_mode'] ) : 0; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |