@@ -168,7 +168,7 @@ |
||
168 | 168 | return; |
169 | 169 | } |
170 | 170 | |
171 | - unset( $dependencies[ $index ] ); |
|
171 | + unset( $dependencies[$index] ); |
|
172 | 172 | $dependencies = array_values( $dependencies ); |
173 | 173 | |
174 | 174 | $styles->registered['wp-admin']->deps = $dependencies; |
@@ -349,12 +349,12 @@ |
||
349 | 349 | array_walk( |
350 | 350 | $styles, |
351 | 351 | /** |
352 | - * Echo a style card for a single style in the $styles array. |
|
353 | - * |
|
354 | - * @param WP_Post $style |
|
355 | - * @param int $count Used for pagination. |
|
356 | - * @return void |
|
357 | - */ |
|
352 | + * Echo a style card for a single style in the $styles array. |
|
353 | + * |
|
354 | + * @param WP_Post $style |
|
355 | + * @param int $count Used for pagination. |
|
356 | + * @return void |
|
357 | + */ |
|
358 | 358 | function( $style ) use ( &$count ) { |
359 | 359 | $hidden = $count > ( self::PAGE_SIZE - 1 ); |
360 | 360 | $this->echo_style_card( $style, $hidden ); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | private static function has_dark_background( $style ) { |
131 | 131 | $key = 'fieldset_bg_color'; |
132 | 132 | |
133 | - if ( empty( $style->post_content[ $key ] ) ) { |
|
133 | + if ( empty( $style->post_content[$key] ) ) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
137 | - $color = $style->post_content[ $key ]; |
|
137 | + $color = $style->post_content[$key]; |
|
138 | 138 | |
139 | 139 | if ( 0 === strpos( $color, 'rgba' ) ) { |
140 | 140 | preg_match_all( '/([\\d.]+)/', $color, $matches ); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | ), |
205 | 205 | '/style-templates/' . $style['slug'] |
206 | 206 | ); |
207 | - $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
207 | + $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
208 | 208 | return $params; |
209 | 209 | }; |
210 | 210 | } else { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | continue; |
266 | 266 | } |
267 | 267 | |
268 | - $value = $style->post_content[ $key ]; |
|
268 | + $value = $style->post_content[$key]; |
|
269 | 269 | |
270 | 270 | $is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent'; |
271 | 271 | if ( $is_hex ) { |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | function( $style ) use ( &$count ) { |
414 | 414 | $hidden = $count > ( self::PAGE_SIZE - 1 ); |
415 | 415 | $this->echo_style_card( $style, $hidden ); |
416 | - ++$count; |
|
416 | + ++ $count; |
|
417 | 417 | } |
418 | 418 | ); |
419 | 419 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | // Remove 'Styling Template' from titles. |
51 | 51 | foreach ( $api_info as $id => $template ) { |
52 | 52 | if ( isset( $template['name'] ) ) { |
53 | - $api_info[ $id ]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
53 | + $api_info[$id]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $field_val = ''; |
133 | 133 | if ( is_object( $this->field ) ) { |
134 | 134 | $field_val = $this->field->{$column}; |
135 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
136 | - $field_val = $this->field[ $column ]; |
|
135 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
136 | + $field_val = $this->field[$column]; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $field_val; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if ( is_object( $this->field ) ) { |
148 | 148 | $this->field->{$column} = $value; |
149 | 149 | } elseif ( is_array( $this->field ) ) { |
150 | - $this->field[ $column ] = $value; |
|
150 | + $this->field[$column] = $value; |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | printf( |
528 | 528 | /* translators: %s: Field type */ |
529 | 529 | esc_html__( '%s Options', 'formidable' ), |
530 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
530 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
531 | 531 | ); |
532 | 532 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); |
533 | 533 | ?> |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | $fields = FrmField::field_selection(); |
651 | 651 | $fields = array_merge( $fields, FrmField::pro_field_selection() ); |
652 | 652 | |
653 | - if ( isset( $fields[ $this->type ] ) ) { |
|
654 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
653 | + if ( isset( $fields[$this->type] ) ) { |
|
654 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | return $name; |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | } |
663 | 663 | |
664 | 664 | public function get_default_field_options() { |
665 | - $opts = array( |
|
665 | + $opts = array( |
|
666 | 666 | 'size' => '', |
667 | 667 | 'max' => '', |
668 | 668 | 'label' => '', |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | } |
1005 | 1005 | } else { |
1006 | 1006 | $args['save_array'] = $this->is_readonly_array(); |
1007 | - $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1007 | + $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1008 | 1008 | } |
1009 | 1009 | |
1010 | 1010 | return $hidden; |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | protected function show_single_hidden( $selected, $args ) { |
1014 | 1014 | if ( $args['save_array'] ) { |
1015 | 1015 | $args['field_name'] .= '[]'; |
1016 | - $id = ''; |
|
1016 | + $id = ''; |
|
1017 | 1017 | } else { |
1018 | 1018 | $id = ' id="' . esc_attr( $args['html_id'] ) . '"'; |
1019 | 1019 | } |
@@ -1029,8 +1029,8 @@ discard block |
||
1029 | 1029 | $selected = $values['field_value']; |
1030 | 1030 | |
1031 | 1031 | if ( isset( $values['combo_name'] ) ) { |
1032 | - $options = $options[ $values['combo_name'] ]; |
|
1033 | - $selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : ''; |
|
1032 | + $options = $options[$values['combo_name']]; |
|
1033 | + $selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : ''; |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | $input = $this->select_tag( $values ); |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | protected function fill_display_field_values( $args = array() ) { |
1084 | - $defaults = array( |
|
1084 | + $defaults = array( |
|
1085 | 1085 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1086 | 1086 | 'field_id' => $this->get_field_column( 'id' ), |
1087 | 1087 | 'field_plus_id' => '', |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | } |
1135 | 1135 | } |
1136 | 1136 | |
1137 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1137 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1138 | 1138 | if ( $error_comes_first ) { |
1139 | 1139 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1140 | 1140 | } else { |
@@ -1213,11 +1213,11 @@ discard block |
||
1213 | 1213 | |
1214 | 1214 | $field_id = $this->get_field_column( 'id' ); |
1215 | 1215 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1216 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1216 | + $frm_validated_unique_values[$field_id] = array(); |
|
1217 | 1217 | return false; |
1218 | 1218 | } |
1219 | 1219 | |
1220 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1220 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1221 | 1221 | return $already_validated_this_value; |
1222 | 1222 | } |
1223 | 1223 | |
@@ -1242,7 +1242,7 @@ discard block |
||
1242 | 1242 | private function value_validated_as_unique( $value ) { |
1243 | 1243 | global $frm_validated_unique_values; |
1244 | 1244 | $field_id = $this->get_field_column( 'id' ); |
1245 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1245 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1246 | 1246 | } |
1247 | 1247 | |
1248 | 1248 | public function get_value_to_save( $value, $atts ) { |
@@ -1274,8 +1274,8 @@ discard block |
||
1274 | 1274 | $value = $this->prepare_display_value( $value, $atts ); |
1275 | 1275 | |
1276 | 1276 | if ( is_array( $value ) ) { |
1277 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
1278 | - $value = $value[ $atts['show'] ]; |
|
1277 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
1278 | + $value = $value[$atts['show']]; |
|
1279 | 1279 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
1280 | 1280 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1281 | 1281 | $value = implode( $sep, $value ); |
@@ -1344,8 +1344,8 @@ discard block |
||
1344 | 1344 | $saved_entries = $atts['ids']; |
1345 | 1345 | $new_value = array(); |
1346 | 1346 | foreach ( (array) $value as $old_child_id ) { |
1347 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1348 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1347 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1348 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1349 | 1349 | } |
1350 | 1350 | } |
1351 | 1351 |
@@ -1682,7 +1682,8 @@ discard block |
||
1682 | 1682 | $vars = array(); |
1683 | 1683 | FrmAppHelper::include_svg(); |
1684 | 1684 | |
1685 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1685 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
1686 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1686 | 1687 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
1687 | 1688 | |
1688 | 1689 | // Javascript needs to be allowed in some field settings. |
@@ -1992,7 +1993,8 @@ discard block |
||
1992 | 1993 | private static function maybe_get_form_to_show( $id ) { |
1993 | 1994 | $form = false; |
1994 | 1995 | |
1995 | - if ( ! empty( $id ) ) { // form id or key is set |
|
1996 | + if ( ! empty( $id ) ) { |
|
1997 | +// form id or key is set |
|
1996 | 1998 | $form = FrmForm::getOne( $id ); |
1997 | 1999 | if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) { |
1998 | 2000 | $form = false; |
@@ -2075,7 +2077,8 @@ discard block |
||
2075 | 2077 | private static function get_saved_errors( $form, $params ) { |
2076 | 2078 | global $frm_vars; |
2077 | 2079 | |
2078 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2080 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
2081 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2079 | 2082 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
2080 | 2083 | } else { |
2081 | 2084 | $errors = array(); |
@@ -2116,7 +2119,8 @@ discard block |
||
2116 | 2119 | * @return string|array |
2117 | 2120 | */ |
2118 | 2121 | private static function get_confirmation_method( $atts ) { |
2119 | - if ( ! empty( $atts['entry_id'] ) ) { // Check against entry has already submitted error. |
|
2122 | + if ( ! empty( $atts['entry_id'] ) ) { |
|
2123 | +// Check against entry has already submitted error. |
|
2120 | 2124 | $met_actions = self::get_met_on_submit_actions( $atts ); |
2121 | 2125 | if ( $met_actions ) { |
2122 | 2126 | return $met_actions; |
@@ -2230,7 +2234,8 @@ discard block |
||
2230 | 2234 | } |
2231 | 2235 | |
2232 | 2236 | if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $action ) ) { |
2233 | - if ( $has_redirect ) { // Do not process because we run the first redirect action only. |
|
2237 | + if ( $has_redirect ) { |
|
2238 | +// Do not process because we run the first redirect action only. |
|
2234 | 2239 | continue; |
2235 | 2240 | } |
2236 | 2241 | |
@@ -2393,12 +2398,14 @@ discard block |
||
2393 | 2398 | |
2394 | 2399 | $doing_ajax = FrmAppHelper::doing_ajax(); |
2395 | 2400 | |
2396 | - if ( ! empty( $args['ajax'] ) && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { // Is AJAX submit and there is just one Redirect action runs. |
|
2401 | + if ( ! empty( $args['ajax'] ) && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { |
|
2402 | +// Is AJAX submit and there is just one Redirect action runs. |
|
2397 | 2403 | echo json_encode( array( 'redirect' => $success_url ) ); |
2398 | 2404 | wp_die(); |
2399 | 2405 | } |
2400 | 2406 | |
2401 | - if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
|
2407 | + if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { |
|
2408 | +// Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
|
2402 | 2409 | wp_redirect( esc_url_raw( $success_url ) ); |
2403 | 2410 | die(); // do not use wp_die or redirect fails |
2404 | 2411 | } |
@@ -2431,7 +2438,8 @@ discard block |
||
2431 | 2438 | |
2432 | 2439 | echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
2433 | 2440 | echo '<script>'; |
2434 | - if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load. |
|
2441 | + if ( empty( $args['doing_ajax'] ) ) { |
|
2442 | +// Not AJAX submit, delay JS until window.load. |
|
2435 | 2443 | echo 'window.onload=function(){'; |
2436 | 2444 | } |
2437 | 2445 | echo 'setTimeout(function(){window.location="' . esc_url_raw( $args['success_url'] ) . '";}, ' . intval( $delay_time ) . ');'; |
@@ -520,11 +520,11 @@ discard block |
||
520 | 520 | ), |
521 | 521 | ); |
522 | 522 | |
523 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
523 | + if ( ! isset( $available_status[$status] ) ) { |
|
524 | 524 | return; |
525 | 525 | } |
526 | 526 | |
527 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
527 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
528 | 528 | |
529 | 529 | $params = FrmForm::list_page_params(); |
530 | 530 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | check_admin_referer( $status . '_form_' . $params['id'] ); |
533 | 533 | |
534 | 534 | $count = 0; |
535 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
535 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
536 | 536 | $count ++; |
537 | 537 | } |
538 | 538 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
550 | 550 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
551 | 551 | |
552 | - $message = $available_status[ $status ]['message']; |
|
552 | + $message = $available_status[$status]['message']; |
|
553 | 553 | |
554 | 554 | self::display_forms_list( $params, $message ); |
555 | 555 | } |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | 'type' => 'request', |
571 | 571 | ) |
572 | 572 | ); |
573 | - $message = sprintf( |
|
573 | + $message = sprintf( |
|
574 | 574 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
575 | 575 | _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), |
576 | 576 | $count, |
@@ -994,11 +994,11 @@ discard block |
||
994 | 994 | } |
995 | 995 | |
996 | 996 | foreach ( $template['categories'] as $category ) { |
997 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
998 | - $templates_by_category[ $category ] = array(); |
|
997 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
998 | + $templates_by_category[$category] = array(); |
|
999 | 999 | } |
1000 | 1000 | |
1001 | - $templates_by_category[ $category ][] = $template; |
|
1001 | + $templates_by_category[$category][] = $template; |
|
1002 | 1002 | } |
1003 | 1003 | } |
1004 | 1004 | unset( $template ); |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | $forms = FrmForm::get_published_forms( $where ); |
1028 | 1028 | $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/'; |
1029 | 1029 | |
1030 | - $templates_by_category[ $my_templates_translation ] = $custom_templates; |
|
1030 | + $templates_by_category[$my_templates_translation] = $custom_templates; |
|
1031 | 1031 | |
1032 | 1032 | unset( $pricing, $license_type, $where ); |
1033 | 1033 | wp_enqueue_script( 'accordion' ); // register accordion for template groups |
@@ -1270,7 +1270,7 @@ discard block |
||
1270 | 1270 | |
1271 | 1271 | foreach ( array( 'landing', 'chat' ) as $feature ) { |
1272 | 1272 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
1273 | - unset( $sections[ $feature ] ); |
|
1273 | + unset( $sections[$feature] ); |
|
1274 | 1274 | } |
1275 | 1275 | } |
1276 | 1276 | |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | $section['id'] = $section['anchor']; |
1304 | 1304 | } |
1305 | 1305 | |
1306 | - $sections[ $key ] = $section; |
|
1306 | + $sections[$key] = $section; |
|
1307 | 1307 | } |
1308 | 1308 | |
1309 | 1309 | return $sections; |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | if ( ! empty( $user_fields ) ) { |
1422 | 1422 | $user_helpers = array(); |
1423 | 1423 | foreach ( $user_fields as $uk => $uf ) { |
1424 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1424 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1425 | 1425 | unset( $uk, $uf ); |
1426 | 1426 | } |
1427 | 1427 | |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1554 | 1554 | $frm_vars['js_validate_forms'] = array(); |
1555 | 1555 | } |
1556 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1556 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1557 | 1557 | } |
1558 | 1558 | |
1559 | 1559 | public static function get_email_html() { |
@@ -1708,7 +1708,7 @@ discard block |
||
1708 | 1708 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1709 | 1709 | } else { |
1710 | 1710 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1711 | - $action = $vars[ $action ]; |
|
1711 | + $action = $vars[$action]; |
|
1712 | 1712 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1713 | 1713 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1714 | 1714 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1842,7 +1842,7 @@ discard block |
||
1842 | 1842 | $actions = array(); |
1843 | 1843 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1844 | 1844 | if ( is_object( $form ) ) { |
1845 | - $actions[ $form->id ] = $form->name; |
|
1845 | + $actions[$form->id] = $form->name; |
|
1846 | 1846 | } |
1847 | 1847 | unset( $form ); |
1848 | 1848 | } |
@@ -2084,8 +2084,8 @@ discard block |
||
2084 | 2084 | private static function get_saved_errors( $form, $params ) { |
2085 | 2085 | global $frm_vars; |
2086 | 2086 | |
2087 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2088 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
2087 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2088 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
2089 | 2089 | } else { |
2090 | 2090 | $errors = array(); |
2091 | 2091 | } |
@@ -2107,7 +2107,7 @@ discard block |
||
2107 | 2107 | public static function just_created_entry( $form_id ) { |
2108 | 2108 | global $frm_vars; |
2109 | 2109 | |
2110 | - return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
2110 | + return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
2111 | 2111 | } |
2112 | 2112 | |
2113 | 2113 | /** |
@@ -2133,7 +2133,7 @@ discard block |
||
2133 | 2133 | } |
2134 | 2134 | |
2135 | 2135 | $opt = 'success_action'; |
2136 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
2136 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
2137 | 2137 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
2138 | 2138 | |
2139 | 2139 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -2146,7 +2146,7 @@ discard block |
||
2146 | 2146 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
2147 | 2147 | if ( ! isset( $params['id'] ) ) { |
2148 | 2148 | global $frm_vars; |
2149 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
2149 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
2150 | 2150 | } |
2151 | 2151 | |
2152 | 2152 | $conf_method = self::get_confirmation_method( |
@@ -2212,7 +2212,7 @@ discard block |
||
2212 | 2212 | $args['success_opt'] = $opt; |
2213 | 2213 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
2214 | 2214 | |
2215 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
2215 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
2216 | 2216 | self::load_page_after_submit( $args ); |
2217 | 2217 | } elseif ( $args['conf_method'] === 'redirect' ) { |
2218 | 2218 | self::redirect_after_submit( $args ); |
@@ -2354,7 +2354,7 @@ discard block |
||
2354 | 2354 | |
2355 | 2355 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
2356 | 2356 | |
2357 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
2357 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
2358 | 2358 | |
2359 | 2359 | /** |
2360 | 2360 | * Filters the run success action args. |
@@ -2374,8 +2374,8 @@ discard block |
||
2374 | 2374 | private static function load_page_after_submit( $args ) { |
2375 | 2375 | global $post; |
2376 | 2376 | $opt = $args['success_opt']; |
2377 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
2378 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
2377 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
2378 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
2379 | 2379 | $old_post = $post; |
2380 | 2380 | $post = $page; |
2381 | 2381 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2405,7 +2405,7 @@ discard block |
||
2405 | 2405 | add_filter( 'frm_use_wpautop', '__return_false' ); |
2406 | 2406 | |
2407 | 2407 | $opt = $args['success_opt']; |
2408 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
2408 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
2409 | 2409 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
2410 | 2410 | $success_url = do_shortcode( $success_url ); |
2411 | 2411 | |
@@ -2577,7 +2577,7 @@ discard block |
||
2577 | 2577 | 'description' => false, |
2578 | 2578 | 'reset' => false, |
2579 | 2579 | ); |
2580 | - $args = wp_parse_args( $args, $defaults ); |
|
2580 | + $args = wp_parse_args( $args, $defaults ); |
|
2581 | 2581 | } |
2582 | 2582 | |
2583 | 2583 | /** |
@@ -2832,7 +2832,7 @@ discard block |
||
2832 | 2832 | |
2833 | 2833 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
2834 | 2834 | |
2835 | - $html = FrmAppHelper::clip( |
|
2835 | + $html = FrmAppHelper::clip( |
|
2836 | 2836 | function() { |
2837 | 2837 | FrmAppHelper::maybe_autocomplete_pages_options( |
2838 | 2838 | array( |
@@ -2869,7 +2869,7 @@ discard block |
||
2869 | 2869 | FrmAppHelper::unserialize_or_decode( $form->options ); |
2870 | 2870 | |
2871 | 2871 | $flag_key = 'on_submit_migrated'; |
2872 | - if ( ! empty( $form->options[ $flag_key ] ) ) { |
|
2872 | + if ( ! empty( $form->options[$flag_key] ) ) { |
|
2873 | 2873 | return; |
2874 | 2874 | } |
2875 | 2875 | |
@@ -2913,7 +2913,7 @@ discard block |
||
2913 | 2913 | $action['post_content'] = FrmAppHelper::prepare_and_encode( $action['post_content'] ); |
2914 | 2914 | FrmDb::save_json_post( $action ); |
2915 | 2915 | |
2916 | - $form->options[ $flag_key ] = 1; |
|
2916 | + $form->options[$flag_key] = 1; |
|
2917 | 2917 | FrmForm::update( $form->id, array( 'options' => $form->options ) ); |
2918 | 2918 | } |
2919 | 2919 | |
@@ -2929,20 +2929,20 @@ discard block |
||
2929 | 2929 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
2930 | 2930 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
2931 | 2931 | $data = array( |
2932 | - 'success_action' => $form_options[ $opt . 'action' ], |
|
2932 | + 'success_action' => $form_options[$opt . 'action'], |
|
2933 | 2933 | ); |
2934 | 2934 | |
2935 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
2935 | + switch ( $form_options[$opt . 'action'] ) { |
|
2936 | 2936 | case 'redirect': |
2937 | - $data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : ''; |
|
2937 | + $data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : ''; |
|
2938 | 2938 | break; |
2939 | 2939 | |
2940 | 2940 | case 'page': |
2941 | - $data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : ''; |
|
2941 | + $data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : ''; |
|
2942 | 2942 | break; |
2943 | 2943 | |
2944 | 2944 | default: |
2945 | - $data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : FrmOnSubmitHelper::get_default_msg(); |
|
2945 | + $data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : FrmOnSubmitHelper::get_default_msg(); |
|
2946 | 2946 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
2947 | 2947 | } |
2948 | 2948 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'text-color' => $style->post_content['text_color'], |
41 | 41 | 'submit-bg-color' => $style->post_content['submit_bg_color'], |
42 | 42 | ); |
43 | - $index = 0; |
|
43 | + $index = 0; |
|
44 | 44 | foreach ( $colors as $css_var_name => $color ) { |
45 | 45 | if ( 0 !== strpos( $color, 'rgb' ) ) { |
46 | 46 | $color = '#' . $color; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'style' => 'background-color: var(--' . $css_var_name . ')', |
52 | 52 | ); |
53 | 53 | |
54 | - ++$index; |
|
54 | + ++ $index; |
|
55 | 55 | ?> |
56 | 56 | <div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div> |
57 | 57 | <?php |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | if ( isset( $addon['categories'] ) ) { |
106 | 106 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
107 | 107 | if ( ! empty( $cats ) ) { |
108 | - unset( $addons[ $k ] ); |
|
108 | + unset( $addons[$k] ); |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | 113 | if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) { |
114 | - $addons[ $k ]['is_new'] = $this->is_new( $addon ); |
|
114 | + $addons[$k]['is_new'] = $this->is_new( $addon ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | return $addon; |
154 | 154 | } |
155 | 155 | } |
156 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
157 | - $plugin = $addons[ $download_id ]; |
|
156 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
157 | + $plugin = $addons[$download_id]; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return $plugin; |
@@ -219,25 +219,25 @@ |
||
219 | 219 | public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) { |
220 | 220 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
221 | 221 | if ( ! $action || ! is_object( $action ) ) { |
222 | - $form_options[ $opt . 'action' ] = self::get_default_action_type(); |
|
223 | - $form_options[ $opt . 'msg' ] = self::get_default_msg(); |
|
222 | + $form_options[$opt . 'action'] = self::get_default_action_type(); |
|
223 | + $form_options[$opt . 'msg'] = self::get_default_msg(); |
|
224 | 224 | |
225 | 225 | return; |
226 | 226 | } |
227 | 227 | |
228 | - $form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
228 | + $form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
229 | 229 | |
230 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
230 | + switch ( $form_options[$opt . 'action'] ) { |
|
231 | 231 | case 'redirect': |
232 | - $form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
232 | + $form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
233 | 233 | break; |
234 | 234 | |
235 | 235 | case 'page': |
236 | - $form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
236 | + $form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
237 | 237 | break; |
238 | 238 | |
239 | 239 | default: |
240 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
240 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
241 | 241 | $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
242 | 242 | } |
243 | 243 | } |