@@ -749,8 +749,8 @@ discard block |
||
749 | 749 | */ |
750 | 750 | public static function get_shortcode_tag( $shortcodes, $short_key, $args ) { |
751 | 751 | _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' ); |
752 | - return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
753 | - } |
|
752 | + return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
753 | + } |
|
754 | 754 | |
755 | 755 | /** |
756 | 756 | * @deprecated 3.01 |
@@ -763,52 +763,52 @@ discard block |
||
763 | 763 | /** |
764 | 764 | * @deprecated 3.02.03 |
765 | 765 | */ |
766 | - public static function jquery_themes() { |
|
766 | + public static function jquery_themes() { |
|
767 | 767 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' ); |
768 | 768 | |
769 | - $themes = array( |
|
770 | - 'ui-lightness' => 'UI Lightness', |
|
771 | - 'ui-darkness' => 'UI Darkness', |
|
772 | - 'smoothness' => 'Smoothness', |
|
773 | - 'start' => 'Start', |
|
774 | - 'redmond' => 'Redmond', |
|
775 | - 'sunny' => 'Sunny', |
|
776 | - 'overcast' => 'Overcast', |
|
777 | - 'le-frog' => 'Le Frog', |
|
778 | - 'flick' => 'Flick', |
|
769 | + $themes = array( |
|
770 | + 'ui-lightness' => 'UI Lightness', |
|
771 | + 'ui-darkness' => 'UI Darkness', |
|
772 | + 'smoothness' => 'Smoothness', |
|
773 | + 'start' => 'Start', |
|
774 | + 'redmond' => 'Redmond', |
|
775 | + 'sunny' => 'Sunny', |
|
776 | + 'overcast' => 'Overcast', |
|
777 | + 'le-frog' => 'Le Frog', |
|
778 | + 'flick' => 'Flick', |
|
779 | 779 | 'pepper-grinder' => 'Pepper Grinder', |
780 | - 'eggplant' => 'Eggplant', |
|
781 | - 'dark-hive' => 'Dark Hive', |
|
782 | - 'cupertino' => 'Cupertino', |
|
783 | - 'south-street' => 'South Street', |
|
784 | - 'blitzer' => 'Blitzer', |
|
785 | - 'humanity' => 'Humanity', |
|
786 | - 'hot-sneaks' => 'Hot Sneaks', |
|
787 | - 'excite-bike' => 'Excite Bike', |
|
788 | - 'vader' => 'Vader', |
|
789 | - 'dot-luv' => 'Dot Luv', |
|
790 | - 'mint-choc' => 'Mint Choc', |
|
791 | - 'black-tie' => 'Black Tie', |
|
792 | - 'trontastic' => 'Trontastic', |
|
793 | - 'swanky-purse' => 'Swanky Purse', |
|
794 | - ); |
|
780 | + 'eggplant' => 'Eggplant', |
|
781 | + 'dark-hive' => 'Dark Hive', |
|
782 | + 'cupertino' => 'Cupertino', |
|
783 | + 'south-street' => 'South Street', |
|
784 | + 'blitzer' => 'Blitzer', |
|
785 | + 'humanity' => 'Humanity', |
|
786 | + 'hot-sneaks' => 'Hot Sneaks', |
|
787 | + 'excite-bike' => 'Excite Bike', |
|
788 | + 'vader' => 'Vader', |
|
789 | + 'dot-luv' => 'Dot Luv', |
|
790 | + 'mint-choc' => 'Mint Choc', |
|
791 | + 'black-tie' => 'Black Tie', |
|
792 | + 'trontastic' => 'Trontastic', |
|
793 | + 'swanky-purse' => 'Swanky Purse', |
|
794 | + ); |
|
795 | 795 | |
796 | 796 | $themes = apply_filters( 'frm_jquery_themes', $themes ); |
797 | - return $themes; |
|
798 | - } |
|
797 | + return $themes; |
|
798 | + } |
|
799 | 799 | |
800 | 800 | /** |
801 | 801 | * @deprecated 3.02.03 |
802 | 802 | */ |
803 | - public static function enqueue_jquery_css() { |
|
803 | + public static function enqueue_jquery_css() { |
|
804 | 804 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' ); |
805 | 805 | |
806 | 806 | $form = self::get_form_for_page(); |
807 | 807 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
808 | - if ( $theme_css != -1 ) { |
|
808 | + if ( $theme_css != -1 ) { |
|
809 | 809 | wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
810 | - } |
|
811 | - } |
|
810 | + } |
|
811 | + } |
|
812 | 812 | |
813 | 813 | /** |
814 | 814 | * @deprecated 3.02.03 |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | } |
822 | 822 | |
823 | 823 | return FrmProStylesController::jquery_css_url( $theme_css ); |
824 | - } |
|
824 | + } |
|
825 | 825 | |
826 | 826 | /** |
827 | 827 | * @deprecated 3.02.03 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
28 | 28 | |
29 | 29 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
30 | - $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ]; |
|
30 | + $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action]; |
|
31 | 31 | |
32 | 32 | if ( $action === 'create' ) { |
33 | 33 | FrmFormsController::update( $values ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | $values = FrmFormsHelper::setup_new_vars( $values ); |
38 | - $id = FrmForm::create( $values ); |
|
38 | + $id = FrmForm::create( $values ); |
|
39 | 39 | $values['id'] = $id; |
40 | 40 | |
41 | 41 | FrmFormsController::edit( $values ); |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | if ( is_array( $sub_field ) ) { |
60 | 60 | $sub_field = wp_parse_args( $sub_field, $defaults ); |
61 | 61 | $sub_field['name'] = $name; |
62 | - $this->sub_fields[ $name ] = $sub_field; |
|
62 | + $this->sub_fields[$name] = $sub_field; |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | 66 | if ( is_string( $sub_field ) ) { |
67 | - $this->sub_fields[ $name ] = wp_parse_args( |
|
67 | + $this->sub_fields[$name] = wp_parse_args( |
|
68 | 68 | array( |
69 | 69 | 'name' => $name, |
70 | 70 | 'label' => $sub_field, |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | if ( is_string( $option ) ) { |
119 | - $extra_options[ $key . '_' . $option ] = ''; |
|
119 | + $extra_options[$key . '_' . $option] = ''; |
|
120 | 120 | } elseif ( ! empty( $option['name'] ) ) { |
121 | - $extra_options[ $key . '_' . $option['name'] ] = ''; |
|
121 | + $extra_options[$key . '_' . $option['name']] = ''; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | foreach ( $this->sub_fields as $name => $sub_field ) { |
142 | 142 | $sub_field['name'] = $name; |
143 | 143 | $wrapper_classes = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name']; |
144 | - if ( ! isset( $processed_sub_fields[ $name ] ) ) { |
|
144 | + if ( ! isset( $processed_sub_fields[$name] ) ) { |
|
145 | 145 | // Options for this subfield should be hidden. |
146 | 146 | $wrapper_classes .= ' frm_hidden'; |
147 | 147 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $default_value = array(); |
172 | 172 | |
173 | 173 | foreach ( $this->sub_fields as $name => $sub_field ) { |
174 | - $default_value[ $name ] = ''; |
|
174 | + $default_value[$name] = ''; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $default_value; |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | // Placeholder. |
344 | 344 | if ( in_array( 'placeholder', $sub_field['options'], true ) ) { |
345 | 345 | $placeholders = FrmField::get_option( $field, 'placeholder' ); |
346 | - if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) { |
|
347 | - $field['placeholder'] = $placeholders[ $sub_field['name'] ]; |
|
346 | + if ( ! empty( $placeholders[$sub_field['name']] ) ) { |
|
347 | + $field['placeholder'] = $placeholders[$sub_field['name']]; |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | |
402 | 402 | // Validate not empty. |
403 | 403 | foreach ( $sub_fields as $name => $sub_field ) { |
404 | - if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) { |
|
405 | - $errors[ 'field' . $args['id'] . '-' . $name ] = ''; |
|
406 | - $errors[ 'field' . $args['id'] ] = $blank_msg; |
|
404 | + if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) { |
|
405 | + $errors['field' . $args['id'] . '-' . $name] = ''; |
|
406 | + $errors['field' . $args['id']] = $blank_msg; |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $field_key = isset( $this->field->field_key ) ? $this->field->field_key : $this->field['field_key']; |
423 | 423 | $sub_fields = $this->get_processed_sub_fields(); |
424 | 424 | foreach ( $sub_fields as $name => $sub_field ) { |
425 | - $headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
425 | + $headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | return $headings; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'title' => esc_attr__( 'Toggle Options', 'formidable' ), |
17 | 17 | ) |
18 | 18 | ); |
19 | - $e_args = array( |
|
19 | + $e_args = array( |
|
20 | 20 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
21 | 21 | 'textarea_rows' => 8, |
22 | 22 | ); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | $data_keys = array_keys( $data ); |
7 | 7 | $params = array(); |
8 | 8 | foreach ( $data_keys as $key ) { |
9 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
9 | + $params['data-' . $key] = $data[$key]; |
|
10 | 10 | } |
11 | 11 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
12 | 12 | $params['href'] = '#'; |
@@ -87,7 +87,8 @@ |
||
87 | 87 | |
88 | 88 | if ( ! isset( $imported['form_status'] ) || empty( $imported['form_status'] ) ) { |
89 | 89 | // Check for an error message in the XML. |
90 | - if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions |
|
90 | + if ( isset( $xml->Code ) && isset( $xml->Message ) ) { |
|
91 | +// phpcs:ignore WordPress.NamingConventions |
|
91 | 92 | $imported['error'] = (string) $xml->Message; // phpcs:ignore WordPress.NamingConventions |
92 | 93 | } |
93 | 94 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | if ( $term && is_array( $term ) ) { |
179 | 179 | $imported['imported']['terms'] ++; |
180 | - $imported['terms'][ (int) $t->term_id ] = $term['term_id']; |
|
180 | + $imported['terms'][(int) $t->term_id] = $term['term_id']; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | unset( $term, $t ); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | // Keep track of whether this specific form was updated or not. |
236 | - $imported['form_status'][ $form_id ] = 'imported'; |
|
236 | + $imported['form_status'][$form_id] = 'imported'; |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | // Update field ids/keys to new ones. |
249 | 249 | do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) ); |
250 | 250 | |
251 | - $imported['forms'][ (int) $item->id ] = $form_id; |
|
251 | + $imported['forms'][(int) $item->id] = $form_id; |
|
252 | 252 | |
253 | 253 | // Send pre 2.0 form options through function that creates actions. |
254 | 254 | self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true ); |
@@ -322,15 +322,15 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | // Keep track of whether this specific form was updated or not |
325 | - $imported['form_status'][ $form_id ] = 'updated'; |
|
325 | + $imported['form_status'][$form_id] = 'updated'; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | private static function get_form_fields( $form_id ) { |
329 | 329 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' ); |
330 | 330 | $old_fields = array(); |
331 | 331 | foreach ( $form_fields as $f ) { |
332 | - $old_fields[ $f->id ] = $f; |
|
333 | - $old_fields[ $f->field_key ] = $f->id; |
|
332 | + $old_fields[$f->id] = $f; |
|
333 | + $old_fields[$f->field_key] = $f->id; |
|
334 | 334 | unset( $f ); |
335 | 335 | } |
336 | 336 | $form_fields = $old_fields; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | */ |
388 | 388 | private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) { |
389 | 389 | if ( $parent_form_id ) { |
390 | - $child_forms[ $form_id ] = $parent_form_id; |
|
390 | + $child_forms[$form_id] = $parent_form_id; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | |
@@ -402,9 +402,9 @@ discard block |
||
402 | 402 | */ |
403 | 403 | private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) { |
404 | 404 | foreach ( $child_forms as $child_form_id => $old_parent_form_id ) { |
405 | - if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) { |
|
405 | + if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) { |
|
406 | 406 | // Update all children with this old parent_form_id |
407 | - $new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ]; |
|
407 | + $new_parent_form_id = (int) $imported_forms[$old_parent_form_id]; |
|
408 | 408 | FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) ); |
409 | 409 | do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id ); |
410 | 410 | } |
@@ -434,30 +434,30 @@ discard block |
||
434 | 434 | |
435 | 435 | if ( ! empty( $this_form ) ) { |
436 | 436 | // check for field to edit by field id |
437 | - if ( isset( $form_fields[ $f['id'] ] ) ) { |
|
437 | + if ( isset( $form_fields[$f['id']] ) ) { |
|
438 | 438 | FrmField::update( $f['id'], $f ); |
439 | 439 | $imported['updated']['fields'] ++; |
440 | 440 | |
441 | - unset( $form_fields[ $f['id'] ] ); |
|
441 | + unset( $form_fields[$f['id']] ); |
|
442 | 442 | |
443 | 443 | // Unset old field key. |
444 | - if ( isset( $form_fields[ $f['field_key'] ] ) ) { |
|
445 | - unset( $form_fields[ $f['field_key'] ] ); |
|
444 | + if ( isset( $form_fields[$f['field_key']] ) ) { |
|
445 | + unset( $form_fields[$f['field_key']] ); |
|
446 | 446 | } |
447 | - } elseif ( isset( $form_fields[ $f['field_key'] ] ) ) { |
|
448 | - $keys_by_original_field_id[ $f['id'] ] = $f['field_key']; |
|
447 | + } elseif ( isset( $form_fields[$f['field_key']] ) ) { |
|
448 | + $keys_by_original_field_id[$f['id']] = $f['field_key']; |
|
449 | 449 | |
450 | 450 | // check for field to edit by field key |
451 | 451 | unset( $f['id'] ); |
452 | 452 | |
453 | - FrmField::update( $form_fields[ $f['field_key'] ], $f ); |
|
453 | + FrmField::update( $form_fields[$f['field_key']], $f ); |
|
454 | 454 | $imported['updated']['fields'] ++; |
455 | 455 | |
456 | 456 | // Unset old field id. |
457 | - unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); |
|
457 | + unset( $form_fields[$form_fields[$f['field_key']]] ); |
|
458 | 458 | |
459 | 459 | // Unset old field key. |
460 | - unset( $form_fields[ $f['field_key'] ] ); |
|
460 | + unset( $form_fields[$f['field_key']] ); |
|
461 | 461 | } else { |
462 | 462 | // If no matching field id or key in this form, create the field. |
463 | 463 | self::create_imported_field( $f, $imported ); |
@@ -566,8 +566,8 @@ discard block |
||
566 | 566 | if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) { |
567 | 567 | if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) { |
568 | 568 | $form_select = (int) $f['field_options']['form_select']; |
569 | - if ( isset( $imported['forms'][ $form_select ] ) ) { |
|
570 | - $f['field_options']['form_select'] = $imported['forms'][ $form_select ]; |
|
569 | + if ( isset( $imported['forms'][$form_select] ) ) { |
|
570 | + $f['field_options']['form_select'] = $imported['forms'][$form_select]; |
|
571 | 571 | } |
572 | 572 | } |
573 | 573 | } |
@@ -588,8 +588,8 @@ discard block |
||
588 | 588 | |
589 | 589 | if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) { |
590 | 590 | $old_form = $f['field_options']['get_values_form']; |
591 | - if ( isset( $imported['forms'][ $old_form ] ) ) { |
|
592 | - $f['field_options']['get_values_form'] = $imported['forms'][ $old_form ]; |
|
591 | + if ( isset( $imported['forms'][$old_form] ) ) { |
|
592 | + $f['field_options']['get_values_form'] = $imported['forms'][$old_form]; |
|
593 | 593 | } |
594 | 594 | } |
595 | 595 | } |
@@ -610,12 +610,12 @@ discard block |
||
610 | 610 | private static function migrate_placeholders( &$f ) { |
611 | 611 | $update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' ); |
612 | 612 | foreach ( $update_values as $k => $v ) { |
613 | - $f[ $k ] = $v; |
|
613 | + $f[$k] = $v; |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | $update_values = self::migrate_field_placeholder( $f, 'default_blank' ); |
617 | 617 | foreach ( $update_values as $k => $v ) { |
618 | - $f[ $k ] = $v; |
|
618 | + $f[$k] = $v; |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | public static function migrate_field_placeholder( $field, $type ) { |
630 | 630 | $field = (array) $field; |
631 | 631 | $field_options = $field['field_options']; |
632 | - if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) { |
|
632 | + if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) { |
|
633 | 633 | return array(); |
634 | 634 | } |
635 | 635 | |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | } |
656 | 656 | |
657 | 657 | if ( $opt == $default_value ) { |
658 | - unset( $options[ $opt_key ] ); |
|
658 | + unset( $options[$opt_key] ); |
|
659 | 659 | break; |
660 | 660 | } |
661 | 661 | } |
@@ -712,10 +712,10 @@ discard block |
||
712 | 712 | |
713 | 713 | $image_id = FrmProFileImport::import_attachment( $option['src'], $field_object ); |
714 | 714 | // Remove the src from options as it isn't required after import. |
715 | - unset( $field['options'][ $key ]['src'] ); |
|
715 | + unset( $field['options'][$key]['src'] ); |
|
716 | 716 | |
717 | 717 | if ( is_numeric( $image_id ) ) { |
718 | - $field['options'][ $key ]['image'] = $image_id; |
|
718 | + $field['options'][$key]['image'] = $image_id; |
|
719 | 719 | } |
720 | 720 | } |
721 | 721 | |
@@ -883,8 +883,8 @@ discard block |
||
883 | 883 | } else { |
884 | 884 | if ( $post['post_type'] === 'frm_display' ) { |
885 | 885 | $post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] ); |
886 | - } elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) { |
|
887 | - $post['post_parent'] = $imported['posts'][ $post['post_parent'] ]; |
|
886 | + } elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) { |
|
887 | + $post['post_parent'] = $imported['posts'][$post['post_parent']]; |
|
888 | 888 | } |
889 | 889 | // Create/update post now |
890 | 890 | $post_id = wp_insert_post( $post ); |
@@ -895,27 +895,27 @@ discard block |
||
895 | 895 | } |
896 | 896 | |
897 | 897 | if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) { |
898 | - $posts_with_shortcodes[ $post_id ] = $post; |
|
898 | + $posts_with_shortcodes[$post_id] = $post; |
|
899 | 899 | } |
900 | 900 | |
901 | 901 | self::update_postmeta( $post, $post_id ); |
902 | 902 | self::update_layout( $post, $post_id ); |
903 | 903 | |
904 | 904 | $this_type = 'posts'; |
905 | - if ( isset( $post_types[ $post['post_type'] ] ) ) { |
|
906 | - $this_type = $post_types[ $post['post_type'] ]; |
|
905 | + if ( isset( $post_types[$post['post_type']] ) ) { |
|
906 | + $this_type = $post_types[$post['post_type']]; |
|
907 | 907 | } |
908 | 908 | |
909 | 909 | if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) { |
910 | - $imported['updated'][ $this_type ] ++; |
|
910 | + $imported['updated'][$this_type] ++; |
|
911 | 911 | } else { |
912 | - $imported['imported'][ $this_type ] ++; |
|
912 | + $imported['imported'][$this_type] ++; |
|
913 | 913 | } |
914 | 914 | |
915 | - $imported['posts'][ (int) $old_id ] = $post_id; |
|
915 | + $imported['posts'][(int) $old_id] = $post_id; |
|
916 | 916 | |
917 | 917 | if ( $post['post_type'] === 'frm_display' ) { |
918 | - $view_ids[ (int) $old_id ] = $post_id; |
|
918 | + $view_ids[(int) $old_id] = $post_id; |
|
919 | 919 | } |
920 | 920 | |
921 | 921 | do_action( 'frm_after_import_view', $post_id, $post ); |
@@ -1076,9 +1076,9 @@ discard block |
||
1076 | 1076 | $post['attachment_url'] = (string) $item->attachment_url; |
1077 | 1077 | } |
1078 | 1078 | |
1079 | - if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) { |
|
1079 | + if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) { |
|
1080 | 1080 | // update to new form id |
1081 | - $post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ]; |
|
1081 | + $post['menu_order'] = $imported['forms'][(int) $post['menu_order']]; |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | // Don't allow default styles to take over a site's default style |
@@ -1115,8 +1115,8 @@ discard block |
||
1115 | 1115 | ); |
1116 | 1116 | |
1117 | 1117 | // Switch old form and field ids to new ones. |
1118 | - if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) { |
|
1119 | - $m['value'] = $imported['forms'][ (int) $m['value'] ]; |
|
1118 | + if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) { |
|
1119 | + $m['value'] = $imported['forms'][(int) $m['value']]; |
|
1120 | 1120 | } else { |
1121 | 1121 | $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] ); |
1122 | 1122 | |
@@ -1127,15 +1127,15 @@ discard block |
||
1127 | 1127 | } elseif ( 'frm_options' === $m['key'] ) { |
1128 | 1128 | |
1129 | 1129 | foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) { |
1130 | - if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) { |
|
1131 | - $m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ]; |
|
1130 | + if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) { |
|
1131 | + $m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]]; |
|
1132 | 1132 | } |
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | $check_dup_array = array(); |
1136 | 1136 | if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) { |
1137 | - if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) { |
|
1138 | - $m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ]; |
|
1137 | + if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) { |
|
1138 | + $m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']]; |
|
1139 | 1139 | } elseif ( is_array( $m['value']['order_by'] ) ) { |
1140 | 1140 | $check_dup_array[] = 'order_by'; |
1141 | 1141 | } |
@@ -1146,9 +1146,9 @@ discard block |
||
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | foreach ( $check_dup_array as $check_k ) { |
1149 | - foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) { |
|
1150 | - if ( isset( $frm_duplicate_ids[ $mv ] ) ) { |
|
1151 | - $m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ]; |
|
1149 | + foreach ( (array) $m['value'][$check_k] as $mk => $mv ) { |
|
1150 | + if ( isset( $frm_duplicate_ids[$mv] ) ) { |
|
1151 | + $m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv]; |
|
1152 | 1152 | } |
1153 | 1153 | unset( $mk, $mv ); |
1154 | 1154 | } |
@@ -1161,11 +1161,11 @@ discard block |
||
1161 | 1161 | $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] ); |
1162 | 1162 | } |
1163 | 1163 | |
1164 | - $post['postmeta'][ (string) $meta->meta_key ] = $m['value']; |
|
1164 | + $post['postmeta'][(string) $meta->meta_key] = $m['value']; |
|
1165 | 1165 | } |
1166 | 1166 | |
1167 | 1167 | private static function populate_layout( &$post, $layout ) { |
1168 | - $post['layout'][ (string) $layout->type ] = (string) $layout->data; |
|
1168 | + $post['layout'][(string) $layout->type] = (string) $layout->data; |
|
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | /** |
@@ -1193,11 +1193,11 @@ discard block |
||
1193 | 1193 | $name = (string) $c; |
1194 | 1194 | } |
1195 | 1195 | |
1196 | - if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) { |
|
1197 | - $post['tax_input'][ $taxonomy ] = array(); |
|
1196 | + if ( ! isset( $post['tax_input'][$taxonomy] ) ) { |
|
1197 | + $post['tax_input'][$taxonomy] = array(); |
|
1198 | 1198 | } |
1199 | 1199 | |
1200 | - $post['tax_input'][ $taxonomy ][] = $name; |
|
1200 | + $post['tax_input'][$taxonomy][] = $name; |
|
1201 | 1201 | unset( $name ); |
1202 | 1202 | }//end foreach |
1203 | 1203 | } |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | |
1337 | 1337 | $message = '<ul>'; |
1338 | 1338 | foreach ( $result as $type => $results ) { |
1339 | - if ( ! isset( $t_strings[ $type ] ) ) { |
|
1339 | + if ( ! isset( $t_strings[$type] ) ) { |
|
1340 | 1340 | // only print imported and updated |
1341 | 1341 | continue; |
1342 | 1342 | } |
@@ -1348,7 +1348,7 @@ discard block |
||
1348 | 1348 | } |
1349 | 1349 | |
1350 | 1350 | if ( ! empty( $s_message ) ) { |
1351 | - $message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> '; |
|
1351 | + $message .= '<li><strong>' . $t_strings[$type] . ':</strong> '; |
|
1352 | 1352 | $message .= implode( ', ', $s_message ); |
1353 | 1353 | $message .= '</li>'; |
1354 | 1354 | } |
@@ -1400,8 +1400,8 @@ discard block |
||
1400 | 1400 | 'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ), |
1401 | 1401 | ); |
1402 | 1402 | |
1403 | - if ( isset( $strings[ $type ] ) ) { |
|
1404 | - $s_message[] = $strings[ $type ]; |
|
1403 | + if ( isset( $strings[$type] ) ) { |
|
1404 | + $s_message[] = $strings[$type]; |
|
1405 | 1405 | } else { |
1406 | 1406 | $string = ' ' . $m . ' ' . ucfirst( $type ); |
1407 | 1407 | |
@@ -1549,7 +1549,7 @@ discard block |
||
1549 | 1549 | |
1550 | 1550 | foreach ( $options as $key => $option ) { |
1551 | 1551 | if ( is_array( $option ) && ! empty( $option['image'] ) ) { |
1552 | - $options[ $key ]['src'] = wp_get_attachment_url( $option['image'] ); |
|
1552 | + $options[$key]['src'] = wp_get_attachment_url( $option['image'] ); |
|
1553 | 1553 | $updated = true; |
1554 | 1554 | } |
1555 | 1555 | } |
@@ -1578,8 +1578,8 @@ discard block |
||
1578 | 1578 | */ |
1579 | 1579 | private static function remove_defaults( $defaults, &$saved ) { |
1580 | 1580 | foreach ( $saved as $key => $value ) { |
1581 | - if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) { |
|
1582 | - unset( $saved[ $key ] ); |
|
1581 | + if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) { |
|
1582 | + unset( $saved[$key] ); |
|
1583 | 1583 | } |
1584 | 1584 | } |
1585 | 1585 | } |
@@ -1590,14 +1590,14 @@ discard block |
||
1590 | 1590 | * @since 3.06 |
1591 | 1591 | */ |
1592 | 1592 | private static function remove_default_html( $html_name, $defaults, &$options ) { |
1593 | - if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) { |
|
1593 | + if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) { |
|
1594 | 1594 | return; |
1595 | 1595 | } |
1596 | 1596 | |
1597 | - $old_html = str_replace( "\r\n", "\n", $options[ $html_name ] ); |
|
1598 | - $default_html = $defaults[ $html_name ]; |
|
1597 | + $old_html = str_replace( "\r\n", "\n", $options[$html_name] ); |
|
1598 | + $default_html = $defaults[$html_name]; |
|
1599 | 1599 | if ( $old_html == $default_html ) { |
1600 | - unset( $options[ $html_name ] ); |
|
1600 | + unset( $options[$html_name] ); |
|
1601 | 1601 | |
1602 | 1602 | return; |
1603 | 1603 | } |
@@ -1605,7 +1605,7 @@ discard block |
||
1605 | 1605 | // Account for some of the older field default HTML. |
1606 | 1606 | $default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html ); |
1607 | 1607 | if ( $old_html == $default_html ) { |
1608 | - unset( $options[ $html_name ] ); |
|
1608 | + unset( $options[$html_name] ); |
|
1609 | 1609 | } |
1610 | 1610 | } |
1611 | 1611 | |
@@ -1696,8 +1696,8 @@ discard block |
||
1696 | 1696 | ); |
1697 | 1697 | |
1698 | 1698 | foreach ( $post_settings as $post_setting ) { |
1699 | - if ( isset( $form_options[ $post_setting ] ) ) { |
|
1700 | - $new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ]; |
|
1699 | + if ( isset( $form_options[$post_setting] ) ) { |
|
1700 | + $new_action['post_content'][$post_setting] = $form_options[$post_setting]; |
|
1701 | 1701 | } |
1702 | 1702 | unset( $post_setting ); |
1703 | 1703 | } |
@@ -1768,11 +1768,11 @@ discard block |
||
1768 | 1768 | foreach ( $post_content as $key => $setting ) { |
1769 | 1769 | if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) { |
1770 | 1770 | // Replace old IDs with new IDs |
1771 | - $post_content[ $key ] = str_replace( $old, $new, $setting ); |
|
1771 | + $post_content[$key] = str_replace( $old, $new, $setting ); |
|
1772 | 1772 | } elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) { |
1773 | 1773 | foreach ( $setting as $k => $val ) { |
1774 | 1774 | // Replace old IDs with new IDs |
1775 | - $post_content[ $key ][ $k ] = str_replace( $old, $new, $val ); |
|
1775 | + $post_content[$key][$k] = str_replace( $old, $new, $val ); |
|
1776 | 1776 | } |
1777 | 1777 | } |
1778 | 1778 | unset( $key, $setting ); |
@@ -1848,8 +1848,8 @@ discard block |
||
1848 | 1848 | private static function remove_deprecated_notification_settings( $form_id, $form_options ) { |
1849 | 1849 | $delete_settings = array( 'notification', 'autoresponder', 'email_to' ); |
1850 | 1850 | foreach ( $delete_settings as $index ) { |
1851 | - if ( isset( $form_options[ $index ] ) ) { |
|
1852 | - unset( $form_options[ $index ] ); |
|
1851 | + if ( isset( $form_options[$index] ) ) { |
|
1852 | + unset( $form_options[$index] ); |
|
1853 | 1853 | } |
1854 | 1854 | } |
1855 | 1855 | FrmForm::update( $form_id, array( 'options' => $form_options ) ); |
@@ -1902,12 +1902,12 @@ discard block |
||
1902 | 1902 | 'reply_to_name' => '', |
1903 | 1903 | ); |
1904 | 1904 | foreach ( $reply_fields as $f => $val ) { |
1905 | - if ( isset( $notification[ $f ] ) ) { |
|
1906 | - $atts[ $f ] = $notification[ $f ]; |
|
1907 | - if ( 'custom' == $notification[ $f ] ) { |
|
1908 | - $atts[ $f ] = $notification[ 'cust_' . $f ]; |
|
1909 | - } elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) { |
|
1910 | - $atts[ $f ] = '[' . $atts[ $f ] . ']'; |
|
1905 | + if ( isset( $notification[$f] ) ) { |
|
1906 | + $atts[$f] = $notification[$f]; |
|
1907 | + if ( 'custom' == $notification[$f] ) { |
|
1908 | + $atts[$f] = $notification['cust_' . $f]; |
|
1909 | + } elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) { |
|
1910 | + $atts[$f] = '[' . $atts[$f] . ']'; |
|
1911 | 1911 | } |
1912 | 1912 | } |
1913 | 1913 | unset( $f, $val ); |
@@ -1938,13 +1938,13 @@ discard block |
||
1938 | 1938 | foreach ( $atts['email_to'] as $key => $email_field ) { |
1939 | 1939 | |
1940 | 1940 | if ( is_numeric( $email_field ) ) { |
1941 | - $atts['email_to'][ $key ] = '[' . $email_field . ']'; |
|
1941 | + $atts['email_to'][$key] = '[' . $email_field . ']'; |
|
1942 | 1942 | } |
1943 | 1943 | |
1944 | 1944 | if ( strpos( $email_field, '|' ) ) { |
1945 | 1945 | $email_opt = explode( '|', $email_field ); |
1946 | 1946 | if ( isset( $email_opt[0] ) ) { |
1947 | - $atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']'; |
|
1947 | + $atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']'; |
|
1948 | 1948 | } |
1949 | 1949 | unset( $email_opt ); |
1950 | 1950 | } |
@@ -1965,12 +1965,12 @@ discard block |
||
1965 | 1965 | // Add more fields to the new notification |
1966 | 1966 | $add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' ); |
1967 | 1967 | foreach ( $add_fields as $add_field ) { |
1968 | - if ( isset( $notification[ $add_field ] ) ) { |
|
1969 | - $new_notification['post_content'][ $add_field ] = $notification[ $add_field ]; |
|
1968 | + if ( isset( $notification[$add_field] ) ) { |
|
1969 | + $new_notification['post_content'][$add_field] = $notification[$add_field]; |
|
1970 | 1970 | } elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) { |
1971 | - $new_notification['post_content'][ $add_field ] = 0; |
|
1971 | + $new_notification['post_content'][$add_field] = 0; |
|
1972 | 1972 | } else { |
1973 | - $new_notification['post_content'][ $add_field ] = ''; |
|
1973 | + $new_notification['post_content'][$add_field] = ''; |
|
1974 | 1974 | } |
1975 | 1975 | unset( $add_field ); |
1976 | 1976 | } |
@@ -1994,7 +1994,7 @@ discard block |
||
1994 | 1994 | if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) { |
1995 | 1995 | foreach ( $post_content['conditions'] as $email_key => $val ) { |
1996 | 1996 | if ( is_numeric( $email_key ) ) { |
1997 | - $post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) ); |
|
1997 | + $post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) ); |
|
1998 | 1998 | } |
1999 | 1999 | unset( $email_key, $val ); |
2000 | 2000 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $max_length = intval( FrmField::get_option( $this->field, 'max' ) ); |
35 | 35 | |
36 | 36 | if ( $max_length && strlen( $args['value'] ) > $max_length ) { |
37 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
37 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | return $errors; |
@@ -75,20 +75,20 @@ discard block |
||
75 | 75 | 'name' => sprintf( |
76 | 76 | /* translators: Formidable addon name */ |
77 | 77 | esc_html_x( 'Formidable %s', 'Formidable Addon Name', 'formidable' ), |
78 | - $addon_list[ $matching_addon ]['name'] |
|
78 | + $addon_list[$matching_addon]['name'] |
|
79 | 79 | ), |
80 | - 'addon' => $addon_list[ $matching_addon ]['slug'], |
|
81 | - 'short_description' => $addon_list[ $matching_addon ]['excerpt'], |
|
80 | + 'addon' => $addon_list[$matching_addon]['slug'], |
|
81 | + 'short_description' => $addon_list[$matching_addon]['excerpt'], |
|
82 | 82 | 'slug' => self::$slug, |
83 | - 'version' => $addon_list[ $matching_addon ]['version'], |
|
83 | + 'version' => $addon_list[$matching_addon]['version'], |
|
84 | 84 | ); |
85 | 85 | |
86 | - if ( ! empty( $addon_list[ $matching_addon ]['external'] ) ) { |
|
86 | + if ( ! empty( $addon_list[$matching_addon]['external'] ) ) { |
|
87 | 87 | unset( $overrides['name'] ); |
88 | 88 | } |
89 | 89 | |
90 | 90 | // Splice in the base addon data. |
91 | - $inject = array_merge( $inject, $addon_list[ $matching_addon ], $overrides ); |
|
91 | + $inject = array_merge( $inject, $addon_list[$matching_addon], $overrides ); |
|
92 | 92 | |
93 | 93 | // Add it to the top of the list. |
94 | 94 | array_unshift( $result->plugins, $inject ); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | protected function is_installed( $plugin ) { |
341 | 341 | $all_plugins = FrmAppHelper::get_plugins(); |
342 | - return isset( $all_plugins[ $plugin ] ); |
|
342 | + return isset( $all_plugins[$plugin] ); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | |
202 | 202 | if ( is_wp_error( $resp ) ) { |
203 | 203 | $error_string = $resp->get_error_message(); |
204 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your captcha', 'formidable' ); |
|
205 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
204 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your captcha', 'formidable' ); |
|
205 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
206 | 206 | return $errors; |
207 | 207 | } |
208 | 208 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if ( $invalid_message === __( 'The reCAPTCHA was not entered correctly', 'formidable' ) ) { |
230 | 230 | $invalid_message = ''; |
231 | 231 | } |
232 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message ); |
|
232 | + $errors['field' . $args['id']] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message ); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | return $errors; |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | $frm_vars['captcha_scores'] = array(); |
246 | 246 | } |
247 | 247 | $form_id = is_object( $this->field ) ? $this->field->form_id : $this->field['form_id']; |
248 | - if ( ! isset( $frm_vars['captcha_scores'][ $form_id ] ) ) { |
|
249 | - $frm_vars['captcha_scores'][ $form_id ] = $score; |
|
248 | + if ( ! isset( $frm_vars['captcha_scores'][$form_id] ) ) { |
|
249 | + $frm_vars['captcha_scores'][$form_id] = $score; |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 |
@@ -119,7 +119,8 @@ |
||
119 | 119 | * @return void |
120 | 120 | */ |
121 | 121 | private static function maybe_hook_into_global_settings_save() { |
122 | - if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
122 | + if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { |
|
123 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
123 | 124 | // Avoid changing any style data if the style array is not sent in the request. |
124 | 125 | return; |
125 | 126 | } |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | parse_str( $query, $parsed_query ); |
654 | - $form_id = ! empty( $parsed_query['form'] ) ? absint( $parsed_query['form'] ) : 0; |
|
654 | + $form_id = ! empty( $parsed_query['form'] ) ? absint( $parsed_query['form'] ) : 0; |
|
655 | 655 | |
656 | 656 | $style = new stdClass(); |
657 | 657 | $style->ID = end( $ids ); |
@@ -689,8 +689,8 @@ discard block |
||
689 | 689 | |
690 | 690 | $forms = FrmForm::get_published_forms(); |
691 | 691 | foreach ( $forms as $form ) { |
692 | - $new_style = ( isset( $_POST['style'] ) && isset( $_POST['style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
693 | - $previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
692 | + $new_style = ( isset( $_POST['style'] ) && isset( $_POST['style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
693 | + $previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][$form->id] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
694 | 694 | if ( $new_style == $previous_style ) { |
695 | 695 | continue; |
696 | 696 | } |
@@ -1064,8 +1064,8 @@ discard block |
||
1064 | 1064 | */ |
1065 | 1065 | public static function get_style_val( $val, $form = 'default' ) { |
1066 | 1066 | $style = self::get_form_style( $form ); |
1067 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
1068 | - return $style->post_content[ $val ]; |
|
1067 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
1068 | + return $style->post_content[$val]; |
|
1069 | 1069 | } |
1070 | 1070 | } |
1071 | 1071 | |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | } elseif ( 'alt_bg_color' == $name ) { |
1085 | 1085 | $setting = 'bg_color_active'; |
1086 | 1086 | } |
1087 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
1087 | + $default_styles[$name] = $style->post_content[$setting]; |
|
1088 | 1088 | unset( $name, $val ); |
1089 | 1089 | } |
1090 | 1090 |