@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $section['function'] = $original; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $sections[ $key ] = $section; |
|
| 118 | + $sections[$key] = $section; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $sections; |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $section = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' ); |
| 129 | 129 | $sections = self::get_settings_tabs(); |
| 130 | - if ( ! isset( $sections[ $section ] ) ) { |
|
| 130 | + if ( ! isset( $sections[$section] ) ) { |
|
| 131 | 131 | wp_die(); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - $section = $sections[ $section ]; |
|
| 134 | + $section = $sections[$section]; |
|
| 135 | 135 | |
| 136 | 136 | if ( isset( $section['class'] ) ) { |
| 137 | 137 | call_user_func( array( $section['class'], $section['function'] ) ); |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | foreach ( $action_controls as $action ) { |
| 101 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 101 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 102 | 102 | continue; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $this_group = $action->action_options['group']; |
| 106 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
| 106 | + if ( ! isset( $groups[$this_group] ) ) { |
|
| 107 | 107 | $this_group = 'misc'; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
| 111 | - $groups[ $this_group ]['actions'] = array(); |
|
| 110 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
| 111 | + $groups[$this_group]['actions'] = array(); |
|
| 112 | 112 | } |
| 113 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
| 113 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
| 114 | 114 | |
| 115 | 115 | unset( $action ); |
| 116 | 116 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | return $a; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $actions[ $a->id_base ] = $a; |
|
| 244 | + $actions[$a->id_base] = $a; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | return $actions; |
@@ -272,16 +272,16 @@ discard block |
||
| 272 | 272 | $action_map = array(); |
| 273 | 273 | |
| 274 | 274 | foreach ( $action_controls as $key => $control ) { |
| 275 | - $action_map[ $control->id_base ] = $key; |
|
| 275 | + $action_map[$control->id_base] = $key; |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | foreach ( $form_actions as $action ) { |
| 279 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 279 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 280 | 280 | // don't try and show settings if action no longer exists |
| 281 | 281 | continue; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 284 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
@@ -489,8 +489,8 @@ discard block |
||
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | // Store actions so they can be triggered with the correct priority. |
| 492 | - $stored_actions[ $action->ID ] = $action; |
|
| 493 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 492 | + $stored_actions[$action->ID] = $action; |
|
| 493 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 494 | 494 | |
| 495 | 495 | unset( $action ); |
| 496 | 496 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | new FrmNotification(); |
| 503 | 503 | |
| 504 | 504 | foreach ( $action_priority as $action_id => $priority ) { |
| 505 | - $action = $stored_actions[ $action_id ]; |
|
| 505 | + $action = $stored_actions[$action_id]; |
|
| 506 | 506 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 507 | 507 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 508 | 508 | |
@@ -549,12 +549,12 @@ discard block |
||
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | public function register( $action_class ) { |
| 552 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 552 | + $this->actions[$action_class] = new $action_class(); |
|
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | public function unregister( $action_class ) { |
| 556 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 557 | - unset( $this->actions[ $action_class ] ); |
|
| 556 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 557 | + unset( $this->actions[$action_class] ); |
|
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 | |
@@ -563,8 +563,8 @@ discard block |
||
| 563 | 563 | |
| 564 | 564 | foreach ( $keys as $key ) { |
| 565 | 565 | // don't register new action if old action with the same id is already registered |
| 566 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 567 | - $this->actions[ $key ]->_register(); |
|
| 566 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 567 | + $this->actions[$key]->_register(); |
|
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | } |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before{ |
| 88 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ); ?>"; |
|
| 88 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ); ?>"; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_plus_icon:before{ |
| 92 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ); ?>"; |
|
| 92 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ); ?>"; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before, |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | .<?php echo esc_html( $style_class ); ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{ |
| 102 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ); ?>"; |
|
| 102 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ); ?>"; |
|
| 103 | 103 | color:<?php echo esc_html( $section_color . $important ); ?>; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | .<?php echo esc_html( $style_class ); ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{ |
| 107 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ); ?>"; |
|
| 107 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ); ?>"; |
|
| 108 | 108 | color:<?php echo esc_html( $section_color . $important ); ?>; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | </li> |
| 31 | 31 | <?php |
| 32 | 32 | foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) { |
| 33 | - if ( ! isset( $templates[ $template ] ) ) { |
|
| 33 | + if ( ! isset( $templates[$template] ) ) { |
|
| 34 | 34 | continue; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $template = $templates[ $template ]; |
|
| 37 | + $template = $templates[$template]; |
|
| 38 | 38 | $plan_required = FrmFormsHelper::get_plan_required( $template ); |
| 39 | 39 | $link = FrmFormsHelper::get_template_install_link( $template, compact( 'pricing', 'license_type', 'plan_required' ) ); |
| 40 | 40 | ?> |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | </div> |
| 139 | 139 | </td> |
| 140 | 140 | </tr> |
| 141 | - <?php unset( $template, $templates[ $k ] ); ?> |
|
| 141 | + <?php unset( $template, $templates[$k] ); ?> |
|
| 142 | 142 | <?php } ?> |
| 143 | 143 | </tbody> |
| 144 | 144 | </table> |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | </div> |
| 239 | 239 | </td> |
| 240 | 240 | </tr> |
| 241 | - <?php unset( $template, $templates[ $k ] ); ?> |
|
| 241 | + <?php unset( $template, $templates[$k] ); ?> |
|
| 242 | 242 | <?php } ?> |
| 243 | 243 | </tbody> |
| 244 | 244 | </table> |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | foreach ( (array) $fields as $f ) { |
| 331 | 331 | FrmAppHelper::unserialize_or_decode( $f->field_options ); |
| 332 | - $size = $f->field_options['size']; |
|
| 332 | + $size = $f->field_options['size']; |
|
| 333 | 333 | $this->maybe_convert_migrated_size( $size ); |
| 334 | 334 | |
| 335 | 335 | if ( $size === $f->field_options['size'] ) { |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | continue; |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
| 395 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
| 396 | 396 | } |
| 397 | 397 | update_option( 'widget_frm_show_form', $widgets ); |
| 398 | 398 | } |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
| 492 | 492 | continue; |
| 493 | 493 | } |
| 494 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
| 494 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
| 495 | 495 | } |
| 496 | 496 | update_option( 'widget_frm_show_form', $widgets ); |
| 497 | 497 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | foreach ( $values as $value_key => $value ) { |
| 142 | 142 | if ( $value_key && in_array( $value_key, $form_fields ) ) { |
| 143 | - $new_values[ $value_key ] = $value; |
|
| 143 | + $new_values[$value_key] = $value; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -210,15 +210,15 @@ discard block |
||
| 210 | 210 | $existing_keys = array_keys( $values['item_meta'] ); |
| 211 | 211 | foreach ( $all_fields as $fid ) { |
| 212 | 212 | if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) { |
| 213 | - $values['item_meta'][ $fid->id ] = ''; |
|
| 213 | + $values['item_meta'][$fid->id] = ''; |
|
| 214 | 214 | } |
| 215 | - $field_array[ $fid->id ] = $fid; |
|
| 215 | + $field_array[$fid->id] = $fid; |
|
| 216 | 216 | } |
| 217 | 217 | unset( $all_fields ); |
| 218 | 218 | |
| 219 | 219 | foreach ( $values['item_meta'] as $field_id => $default_value ) { |
| 220 | - if ( isset( $field_array[ $field_id ] ) ) { |
|
| 221 | - $field = $field_array[ $field_id ]; |
|
| 220 | + if ( isset( $field_array[$field_id] ) ) { |
|
| 221 | + $field = $field_array[$field_id]; |
|
| 222 | 222 | } else { |
| 223 | 223 | $field = FrmField::getOne( $field_id ); |
| 224 | 224 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | continue; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ); |
|
| 230 | + $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) ); |
|
| 231 | 231 | if ( $is_settings_page ) { |
| 232 | 232 | self::get_settings_page_html( $values, $field ); |
| 233 | 233 | |
@@ -242,15 +242,15 @@ discard block |
||
| 242 | 242 | $update_options = apply_filters( 'frm_field_options_to_update', $update_options ); |
| 243 | 243 | |
| 244 | 244 | foreach ( $update_options as $opt => $default ) { |
| 245 | - $field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default; |
|
| 246 | - self::sanitize_field_opt( $opt, $field->field_options[ $opt ] ); |
|
| 245 | + $field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default; |
|
| 246 | + self::sanitize_field_opt( $opt, $field->field_options[$opt] ); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | $field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values ); |
| 250 | 250 | |
| 251 | 251 | $new_field = array( |
| 252 | 252 | 'field_options' => $field->field_options, |
| 253 | - 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', |
|
| 253 | + 'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '', |
|
| 254 | 254 | ); |
| 255 | 255 | |
| 256 | 256 | self::prepare_field_update_values( $field, $values, $new_field ); |
@@ -279,11 +279,11 @@ discard block |
||
| 279 | 279 | * Updating the settings page |
| 280 | 280 | */ |
| 281 | 281 | private static function get_settings_page_html( $values, &$field ) { |
| 282 | - if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) { |
|
| 282 | + if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) { |
|
| 283 | 283 | $prev_opts = array(); |
| 284 | 284 | $fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type ); |
| 285 | 285 | |
| 286 | - $field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html; |
|
| 286 | + $field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html; |
|
| 287 | 287 | } elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) { |
| 288 | 288 | $prev_opts = $field->field_options; |
| 289 | 289 | } |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | foreach ( $field_cols as $col => $default ) { |
| 310 | 310 | $default = ( $default === '' ) ? $field->{$col} : $default; |
| 311 | 311 | |
| 312 | - $new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default; |
|
| 312 | + $new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // Don't save the template option. |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | self::maybe_get_form( $form ); |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | - if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) { |
|
| 727 | - return $frm_vars['form_params'][ $form->id ]; |
|
| 726 | + if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) { |
|
| 727 | + return $frm_vars['form_params'][$form->id]; |
|
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | $action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // WPCS: CSRF ok. |
@@ -753,15 +753,15 @@ discard block |
||
| 753 | 753 | //if there are two forms on the same page, make sure not to submit both |
| 754 | 754 | foreach ( $default_values as $var => $default ) { |
| 755 | 755 | if ( $var == 'action' ) { |
| 756 | - $values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 756 | + $values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 757 | 757 | } else { |
| 758 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 758 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 759 | 759 | } |
| 760 | 760 | unset( $var, $default ); |
| 761 | 761 | } |
| 762 | 762 | } else { |
| 763 | 763 | foreach ( $default_values as $var => $default ) { |
| 764 | - $values[ $var ] = $default; |
|
| 764 | + $values[$var] = $default; |
|
| 765 | 765 | unset( $var, $default ); |
| 766 | 766 | } |
| 767 | 767 | } |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | 'sdir' => '', |
| 788 | 788 | ); |
| 789 | 789 | foreach ( $defaults as $var => $default ) { |
| 790 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 790 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 791 | 791 | } |
| 792 | 792 | |
| 793 | 793 | return $values; |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | 'keep_post' => '', |
| 816 | 816 | ); |
| 817 | 817 | foreach ( $defaults as $var => $default ) { |
| 818 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 818 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | return $values; |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | public static function get_option( $atts ) { |
| 901 | 901 | $form = $atts['form']; |
| 902 | 902 | |
| 903 | - return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $atts['default']; |
|
| 903 | + return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $atts['default']; |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | self::print_file_headers( $filename ); |
| 38 | 38 | unset( $filename ); |
| 39 | 39 | |
| 40 | - $comment_count = FrmDb::get_count( |
|
| 40 | + $comment_count = FrmDb::get_count( |
|
| 41 | 41 | 'frm_item_metas', |
| 42 | 42 | array( |
| 43 | 43 | 'item_id' => $atts['entry_ids'], |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | private static function prepare_csv_headings() { |
| 104 | 104 | $headings = array(); |
| 105 | 105 | self::csv_headings( $headings ); |
| 106 | - $headings = apply_filters( |
|
| 106 | + $headings = apply_filters( |
|
| 107 | 107 | 'frm_csv_columns', |
| 108 | 108 | $headings, |
| 109 | 109 | self::$form_id, |
@@ -121,10 +121,10 @@ discard block |
||
| 121 | 121 | $field_headings = array(); |
| 122 | 122 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
| 123 | 123 | if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] && ! in_array( $col->type, $separate_values, true ) ) { |
| 124 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 124 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
| 127 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
| 128 | 128 | $field_headings = apply_filters( |
| 129 | 129 | 'frm_csv_field_columns', |
| 130 | 130 | $field_headings, |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | if ( self::$comment_count ) { |
| 140 | 140 | for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
| 141 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
| 142 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
| 143 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
| 141 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
| 142 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
| 143 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
| 144 | 144 | } |
| 145 | 145 | unset( $i ); |
| 146 | 146 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | private static function prepare_next_csv_rows( $next_set ) { |
| 166 | 166 | // order by parent_item_id so children will be first |
| 167 | - $where = array( |
|
| 167 | + $where = array( |
|
| 168 | 168 | 'or' => 1, |
| 169 | 169 | 'id' => $next_set, |
| 170 | 170 | 'parent_item_id' => $next_set, |
@@ -209,30 +209,30 @@ discard block |
||
| 209 | 209 | continue; |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 213 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
| 214 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 212 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 213 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
| 214 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 215 | 215 | // if the data is here, it should be an array but if this field has collected data |
| 216 | 216 | // both while inside and outside of the repeating section, it's possible this is a string |
| 217 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
| 217 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | //add the repeated values |
| 221 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
| 221 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
| 222 | 222 | } |
| 223 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
| 223 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | // add the embedded form id |
| 227 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
| 228 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
| 227 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
| 228 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
| 229 | 229 | } |
| 230 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
| 230 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | private static function add_field_values_to_csv( &$row ) { |
| 234 | 234 | foreach ( self::$fields as $col ) { |
| 235 | - $field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false; |
|
| 235 | + $field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false; |
|
| 236 | 236 | |
| 237 | 237 | FrmAppHelper::unserialize_or_decode( $field_value ); |
| 238 | 238 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -257,15 +257,15 @@ discard block |
||
| 257 | 257 | 'show_icon' => false, |
| 258 | 258 | 'entry_id' => self::$entry->id, |
| 259 | 259 | 'sep' => self::$separator, |
| 260 | - '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, |
|
| 260 | + '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, |
|
| 261 | 261 | ) |
| 262 | 262 | ); |
| 263 | 263 | |
| 264 | - $row[ $col->id . '_label' ] = $sep_value; |
|
| 264 | + $row[$col->id . '_label'] = $sep_value; |
|
| 265 | 265 | unset( $sep_value ); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - $row[ $col->id ] = $field_value; |
|
| 268 | + $row[$col->id] = $field_value; |
|
| 269 | 269 | |
| 270 | 270 | unset( $col, $field_value ); |
| 271 | 271 | } |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | if ( is_array( $atts['field_value'] ) ) { |
| 279 | 279 | foreach ( $atts['field_value'] as $key => $sub_value ) { |
| 280 | 280 | $column_key = $atts['col']->id . '_' . $key; |
| 281 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 282 | - $row[ $column_key ] = $sub_value; |
|
| 281 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
| 282 | + $row[$column_key] = $sub_value; |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $sep = ''; |
| 304 | 304 | |
| 305 | 305 | foreach ( self::$headings as $k => $heading ) { |
| 306 | - $row = isset( $rows[ $k ] ) ? $rows[ $k ] : ''; |
|
| 306 | + $row = isset( $rows[$k] ) ? $rows[$k] : ''; |
|
| 307 | 307 | if ( is_array( $row ) ) { |
| 308 | 308 | // implode the repeated field values |
| 309 | 309 | $row = implode( self::$separator, FrmAppHelper::array_flatten( $row, 'reset' ) ); |
@@ -136,6 +136,9 @@ |
||
| 136 | 136 | return apply_filters( 'frm_setup_edit_entry_vars', $values, $record ); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | + /** |
|
| 140 | + * @param string $message |
|
| 141 | + */ |
|
| 139 | 142 | public static function replace_default_message( $message, $atts ) { |
| 140 | 143 | if ( strpos( $message, '[default-message' ) === false && |
| 141 | 144 | strpos( $message, '[default_message' ) === false && |
@@ -117,10 +117,10 @@ discard block |
||
| 117 | 117 | if ( $_POST ) { |
| 118 | 118 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 119 | 119 | if ( $repeating ) { |
| 120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
| 120 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { |
|
| 121 | 121 | $value_is_posted = true; |
| 122 | 122 | } |
| 123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
| 123 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { |
|
| 124 | 124 | $value_is_posted = true; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
| 151 | 151 | |
| 152 | 152 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 153 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 153 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 154 | 154 | if ( ! empty( $add_atts ) ) { |
| 155 | 155 | $this_atts = array_merge( $atts, $add_atts ); |
| 156 | 156 | } else { |
@@ -160,14 +160,14 @@ discard block |
||
| 160 | 160 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
| 161 | 161 | |
| 162 | 162 | // Add the default message. |
| 163 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 163 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return $message; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 170 | - $field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
| 170 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
| 171 | 171 | |
| 172 | 172 | if ( FrmAppHelper::pro_is_installed() ) { |
| 173 | 173 | FrmProEntriesHelper::get_dynamic_list_values( $field, $entry, $field_value ); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) ); |
| 186 | 186 | } else { |
| 187 | 187 | // Get all values for this field. |
| 188 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
| 188 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
| 189 | 189 | |
| 190 | 190 | if ( $child_values ) { |
| 191 | 191 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $value = $args['temp_value']; |
| 300 | 300 | } |
| 301 | 301 | if ( empty( $args['parent_field_id'] ) ) { |
| 302 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 302 | + $_POST['item_meta'][$field->id] = $value; |
|
| 303 | 303 | } else { |
| 304 | 304 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 305 | 305 | } |
@@ -311,20 +311,20 @@ discard block |
||
| 311 | 311 | * @since 4.01 |
| 312 | 312 | */ |
| 313 | 313 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 314 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && |
|
| 315 | - is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
| 314 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && |
|
| 315 | + is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { |
|
| 316 | 316 | |
| 317 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || |
|
| 318 | - ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
| 319 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); |
|
| 317 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || |
|
| 318 | + ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { |
|
| 319 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); |
|
| 320 | 320 | } |
| 321 | 321 | } else { |
| 322 | 322 | // All of the section was probably removed. |
| 323 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); |
|
| 324 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); |
|
| 323 | + $_POST['item_meta'][$args['parent_field_id']] = array(); |
|
| 324 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; |
|
| 327 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -355,10 +355,10 @@ discard block |
||
| 355 | 355 | if ( empty( $args['parent_field_id'] ) ) { |
| 356 | 356 | // Sanitizing is done next. |
| 357 | 357 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 358 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; |
|
| 358 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; |
|
| 359 | 359 | } else { |
| 360 | 360 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 361 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; |
|
| 361 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; |
|
| 362 | 362 | } |
| 363 | 363 | return $value; |
| 364 | 364 | } |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | self::set_other_repeating_vals( $field, $value, $args ); |
| 390 | 390 | |
| 391 | 391 | // Check if there are any posted "Other" values. |
| 392 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
| 392 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { |
|
| 393 | 393 | |
| 394 | 394 | // Save original value. |
| 395 | 395 | $args['temp_value'] = $value; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | // Sanitizing is done next. |
| 399 | 399 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 400 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); |
|
| 400 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); |
|
| 401 | 401 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 402 | 402 | |
| 403 | 403 | // Set the validation value now |
@@ -420,13 +420,13 @@ discard block |
||
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | // Check if there are any other posted "other" values for this field. |
| 423 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
| 423 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { |
|
| 424 | 424 | // Save original value |
| 425 | 425 | $args['temp_value'] = $value; |
| 426 | 426 | $args['other'] = true; |
| 427 | 427 | |
| 428 | 428 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 429 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); |
|
| 429 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); |
|
| 430 | 430 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 431 | 431 | |
| 432 | 432 | // Set the validation value now. |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 454 | 454 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 455 | 455 | foreach ( $other_vals as $k => $v ) { |
| 456 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 456 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 457 | 457 | // If the other box is checked, but doesn't have a value. |
| 458 | 458 | $value = ''; |
| 459 | 459 | break; |
@@ -470,25 +470,25 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | // Multi-select dropdown. |
| 472 | 472 | if ( is_array( $value ) ) { |
| 473 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 473 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 474 | 474 | |
| 475 | 475 | if ( $o_key !== false ) { |
| 476 | 476 | // Modify the original value so other key will be preserved. |
| 477 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 477 | + $value[$other_key] = $value[$o_key]; |
|
| 478 | 478 | |
| 479 | 479 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 480 | 480 | // If going backwards and forwards between pages, the array key will match the other key. |
| 481 | 481 | if ( $o_key !== $other_key ) { |
| 482 | - unset( $value[ $o_key ] ); |
|
| 482 | + unset( $value[$o_key] ); |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | $args['temp_value'] = $value; |
| 486 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 487 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 488 | - unset( $value[ $other_key ] ); |
|
| 486 | + $value[$other_key] = reset( $other_vals ); |
|
| 487 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 488 | + unset( $value[$other_key] ); |
|
| 489 | 489 | } |
| 490 | 490 | } |
| 491 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 491 | + } elseif ( $field->options[$other_key] == $value ) { |
|
| 492 | 492 | $value = $other_vals; |
| 493 | 493 | } |
| 494 | 494 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args ); |
| 86 | 86 | $to = $this->explode_emails( $to ); |
| 87 | 87 | |
| 88 | - $where = array( |
|
| 88 | + $where = array( |
|
| 89 | 89 | 'it.field_id !' => 0, |
| 90 | 90 | 'it.item_id' => $this->entry->id, |
| 91 | 91 | ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'entry' => $this->entry, |
| 96 | 96 | 'form' => $this->form, |
| 97 | 97 | ); |
| 98 | - $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 98 | + $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 99 | 99 | |
| 100 | 100 | $this->to = array_unique( (array) $to ); |
| 101 | 101 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | // Add the user info if it isn't already included |
| 300 | 300 | if ( $this->include_user_info && $prev_mail_body === $mail_body ) { |
| 301 | - $data = $this->entry->description; |
|
| 301 | + $data = $this->entry->description; |
|
| 302 | 302 | $mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n"; |
| 303 | 303 | $this->maybe_add_ip( $mail_body ); |
| 304 | 304 | $mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n"; |
@@ -563,12 +563,12 @@ discard block |
||
| 563 | 563 | $name = trim( str_replace( $email, '', $val ) ); |
| 564 | 564 | } else { |
| 565 | 565 | // If user enters a name without an email |
| 566 | - unset( $recipients[ $key ] ); |
|
| 566 | + unset( $recipients[$key] ); |
|
| 567 | 567 | continue; |
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | - $recipients[ $key ] = $this->format_from_email( $name, $email ); |
|
| 571 | + $recipients[$key] = $this->format_from_email( $name, $email ); |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | return $recipients; |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | ); |
| 710 | 710 | |
| 711 | 711 | // Remove phone number from to addresses |
| 712 | - unset( $this->to[ $key ] ); |
|
| 712 | + unset( $this->to[$key] ); |
|
| 713 | 713 | } |
| 714 | 714 | } |
| 715 | 715 | } |