@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | $new_val = FrmFieldsHelper::switch_field_ids( $value ); |
| 194 | 194 | if ( $new_val !== $value ) { |
| 195 | - $new_values[ $key ] = $new_val; |
|
| 195 | + $new_values[$key] = $new_val; |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | foreach ( $values as $value_key => $value ) { |
| 225 | 225 | if ( $value_key && in_array( $value_key, $form_fields ) ) { |
| 226 | - $new_values[ $value_key ] = $value; |
|
| 226 | + $new_values[$value_key] = $value; |
|
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
@@ -302,15 +302,15 @@ discard block |
||
| 302 | 302 | $existing_keys = array_keys( $values['item_meta'] ); |
| 303 | 303 | foreach ( $all_fields as $fid ) { |
| 304 | 304 | if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) { |
| 305 | - $values['item_meta'][ $fid->id ] = ''; |
|
| 305 | + $values['item_meta'][$fid->id] = ''; |
|
| 306 | 306 | } |
| 307 | - $field_array[ $fid->id ] = $fid; |
|
| 307 | + $field_array[$fid->id] = $fid; |
|
| 308 | 308 | } |
| 309 | 309 | unset( $all_fields ); |
| 310 | 310 | |
| 311 | 311 | foreach ( $values['item_meta'] as $field_id => $default_value ) { |
| 312 | - if ( isset( $field_array[ $field_id ] ) ) { |
|
| 313 | - $field = $field_array[ $field_id ]; |
|
| 312 | + if ( isset( $field_array[$field_id] ) ) { |
|
| 313 | + $field = $field_array[$field_id]; |
|
| 314 | 314 | } else { |
| 315 | 315 | $field = FrmField::getOne( $field_id ); |
| 316 | 316 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | continue; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ); |
|
| 322 | + $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) ); |
|
| 323 | 323 | if ( $is_settings_page ) { |
| 324 | 324 | self::get_settings_page_html( $values, $field ); |
| 325 | 325 | |
@@ -334,15 +334,15 @@ discard block |
||
| 334 | 334 | $update_options = apply_filters( 'frm_field_options_to_update', $update_options ); |
| 335 | 335 | |
| 336 | 336 | foreach ( $update_options as $opt => $default ) { |
| 337 | - $field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default; |
|
| 338 | - self::sanitize_field_opt( $opt, $field->field_options[ $opt ] ); |
|
| 337 | + $field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default; |
|
| 338 | + self::sanitize_field_opt( $opt, $field->field_options[$opt] ); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | $field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values ); |
| 342 | 342 | |
| 343 | 343 | $new_field = array( |
| 344 | 344 | 'field_options' => $field->field_options, |
| 345 | - 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', |
|
| 345 | + 'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '', |
|
| 346 | 346 | ); |
| 347 | 347 | |
| 348 | 348 | self::prepare_field_update_values( $field, $values, $new_field ); |
@@ -404,11 +404,11 @@ discard block |
||
| 404 | 404 | * Updating the settings page |
| 405 | 405 | */ |
| 406 | 406 | private static function get_settings_page_html( $values, &$field ) { |
| 407 | - if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) { |
|
| 407 | + if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) { |
|
| 408 | 408 | $prev_opts = array(); |
| 409 | 409 | $fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type ); |
| 410 | 410 | |
| 411 | - $field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html; |
|
| 411 | + $field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html; |
|
| 412 | 412 | } elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) { |
| 413 | 413 | $prev_opts = $field->field_options; |
| 414 | 414 | } |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | foreach ( $field_cols as $col => $default ) { |
| 435 | 435 | $default = ( $default === '' ) ? $field->{$col} : $default; |
| 436 | 436 | |
| 437 | - $new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default; |
|
| 437 | + $new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default; |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | // Don't save the template option. |
@@ -848,8 +848,8 @@ discard block |
||
| 848 | 848 | self::maybe_get_form( $form ); |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | - if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) { |
|
| 852 | - return $frm_vars['form_params'][ $form->id ]; |
|
| 851 | + if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) { |
|
| 852 | + return $frm_vars['form_params'][$form->id]; |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | $action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -878,15 +878,15 @@ discard block |
||
| 878 | 878 | //if there are two forms on the same page, make sure not to submit both |
| 879 | 879 | foreach ( $default_values as $var => $default ) { |
| 880 | 880 | if ( $var == 'action' ) { |
| 881 | - $values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 881 | + $values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 882 | 882 | } else { |
| 883 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 883 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 884 | 884 | } |
| 885 | 885 | unset( $var, $default ); |
| 886 | 886 | } |
| 887 | 887 | } else { |
| 888 | 888 | foreach ( $default_values as $var => $default ) { |
| 889 | - $values[ $var ] = $default; |
|
| 889 | + $values[$var] = $default; |
|
| 890 | 890 | unset( $var, $default ); |
| 891 | 891 | } |
| 892 | 892 | } |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | 'sdir' => '', |
| 913 | 913 | ); |
| 914 | 914 | foreach ( $defaults as $var => $default ) { |
| 915 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 915 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 916 | 916 | } |
| 917 | 917 | |
| 918 | 918 | return $values; |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | 'keep_post' => '', |
| 941 | 941 | ); |
| 942 | 942 | foreach ( $defaults as $var => $default ) { |
| 943 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 943 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | return $values; |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | $form = $atts['form']; |
| 1044 | 1044 | $default = isset( $atts['default'] ) ? $atts['default'] : ''; |
| 1045 | 1045 | |
| 1046 | - return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default; |
|
| 1046 | + return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $default; |
|
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | /** |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | foreach ( $type as $tb_type ) { |
| 20 | 20 | |
| 21 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 21 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
| 22 | 22 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
| 23 | 23 | continue; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 26 | + if ( ! isset( $records[$tb_type] ) ) { |
|
| 27 | 27 | // No records. |
| 28 | 28 | continue; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $item_ids = $records[ $tb_type ]; |
|
| 31 | + $item_ids = $records[$tb_type]; |
|
| 32 | 32 | |
| 33 | 33 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
| 34 | 34 | include dirname( __FILE__ ) . '/posts_xml.php'; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php'; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
| 41 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |