@@ -1889,7 +1889,8 @@ discard block |
||
1889 | 1889 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
1890 | 1890 | $vars = array(); |
1891 | 1891 | FrmAppHelper::include_svg(); |
1892 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1892 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
1893 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1893 | 1894 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
1894 | 1895 | |
1895 | 1896 | // Javascript needs to be allowed in some field settings. |
@@ -2314,7 +2315,8 @@ discard block |
||
2314 | 2315 | private static function get_saved_errors( $form, $params ) { |
2315 | 2316 | global $frm_vars; |
2316 | 2317 | |
2317 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2318 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
2319 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2318 | 2320 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
2319 | 2321 | } else { |
2320 | 2322 | $errors = array(); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | if ( FrmTestModeController::should_add_test_mode_container() ) { |
439 | 439 | add_action( |
440 | 440 | 'wp_enqueue_scripts', |
441 | - function () { |
|
441 | + function() { |
|
442 | 442 | // Enqueue multiselect dropdown requirements. |
443 | 443 | $plugin_url = FrmAppHelper::plugin_url(); |
444 | 444 | $version = FrmAppHelper::plugin_version(); |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | * @param string|null $src |
742 | 742 | * @return string |
743 | 743 | */ |
744 | - function ( $src ) { |
|
744 | + function( $src ) { |
|
745 | 745 | if ( is_null( $src ) ) { |
746 | 746 | $src = ''; |
747 | 747 | } |
@@ -806,11 +806,11 @@ discard block |
||
806 | 806 | ), |
807 | 807 | ); |
808 | 808 | |
809 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
809 | + if ( ! isset( $available_status[$status] ) ) { |
|
810 | 810 | return; |
811 | 811 | } |
812 | 812 | |
813 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
813 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
814 | 814 | |
815 | 815 | $params = FrmForm::list_page_params(); |
816 | 816 | |
@@ -818,8 +818,8 @@ discard block |
||
818 | 818 | check_admin_referer( $status . '_form_' . $params['id'] ); |
819 | 819 | |
820 | 820 | $count = 0; |
821 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
822 | - ++$count; |
|
821 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
822 | + ++ $count; |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | $form_type = FrmAppHelper::get_simple_request( |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
836 | 836 | $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>' ); |
837 | 837 | |
838 | - $message = $available_status[ $status ]['message']; |
|
838 | + $message = $available_status[$status]['message']; |
|
839 | 839 | |
840 | 840 | self::display_forms_list( $params, $message ); |
841 | 841 | } |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $count = 0; |
851 | 851 | foreach ( $ids as $id ) { |
852 | 852 | if ( FrmForm::trash( $id ) ) { |
853 | - ++$count; |
|
853 | + ++ $count; |
|
854 | 854 | } |
855 | 855 | } |
856 | 856 | |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | 'type' => 'request', |
865 | 865 | ) |
866 | 866 | ); |
867 | - $message = sprintf( |
|
867 | + $message = sprintf( |
|
868 | 868 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
869 | 869 | _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' ), |
870 | 870 | $count, |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | |
886 | 886 | $count = 0; |
887 | 887 | if ( FrmForm::destroy( $params['id'] ) ) { |
888 | - ++$count; |
|
888 | + ++ $count; |
|
889 | 889 | } |
890 | 890 | |
891 | 891 | /* translators: %1$s: Number of forms */ |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | foreach ( $ids as $id ) { |
906 | 906 | $d = FrmForm::destroy( $id ); |
907 | 907 | if ( $d ) { |
908 | - ++$count; |
|
908 | + ++ $count; |
|
909 | 909 | } |
910 | 910 | } |
911 | 911 | |
@@ -1406,7 +1406,7 @@ discard block |
||
1406 | 1406 | |
1407 | 1407 | add_action( |
1408 | 1408 | 'wp_enqueue_editor', |
1409 | - function () { |
|
1409 | + function() { |
|
1410 | 1410 | wp_print_media_templates(); |
1411 | 1411 | } |
1412 | 1412 | ); |
@@ -1515,7 +1515,7 @@ discard block |
||
1515 | 1515 | |
1516 | 1516 | foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) { |
1517 | 1517 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
1518 | - unset( $sections[ $feature ] ); |
|
1518 | + unset( $sections[$feature] ); |
|
1519 | 1519 | } |
1520 | 1520 | } |
1521 | 1521 | |
@@ -1543,7 +1543,7 @@ discard block |
||
1543 | 1543 | $section['id'] = $section['anchor']; |
1544 | 1544 | } |
1545 | 1545 | |
1546 | - $sections[ $key ] = $section; |
|
1546 | + $sections[$key] = $section; |
|
1547 | 1547 | }//end foreach |
1548 | 1548 | |
1549 | 1549 | return $sections; |
@@ -1666,7 +1666,7 @@ discard block |
||
1666 | 1666 | if ( $user_fields ) { |
1667 | 1667 | $user_helpers = array(); |
1668 | 1668 | foreach ( $user_fields as $uk => $uf ) { |
1669 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1669 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1670 | 1670 | unset( $uk, $uf ); |
1671 | 1671 | } |
1672 | 1672 | |
@@ -1800,7 +1800,7 @@ discard block |
||
1800 | 1800 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1801 | 1801 | $frm_vars['js_validate_forms'] = array(); |
1802 | 1802 | } |
1803 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1803 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1804 | 1804 | } |
1805 | 1805 | |
1806 | 1806 | public static function get_email_html() { |
@@ -1984,7 +1984,7 @@ discard block |
||
1984 | 1984 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1985 | 1985 | } else { |
1986 | 1986 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1987 | - $action = $vars[ $action ]; |
|
1987 | + $action = $vars[$action]; |
|
1988 | 1988 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1989 | 1989 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1990 | 1990 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -2147,7 +2147,7 @@ discard block |
||
2147 | 2147 | $actions = array(); |
2148 | 2148 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
2149 | 2149 | if ( is_object( $form ) ) { |
2150 | - $actions[ $form->id ] = $form->name; |
|
2150 | + $actions[$form->id] = $form->name; |
|
2151 | 2151 | } |
2152 | 2152 | unset( $form ); |
2153 | 2153 | } |
@@ -2392,8 +2392,8 @@ discard block |
||
2392 | 2392 | private static function get_saved_errors( $form, $params ) { |
2393 | 2393 | global $frm_vars; |
2394 | 2394 | |
2395 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2396 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
2395 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2396 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
2397 | 2397 | } else { |
2398 | 2398 | $errors = array(); |
2399 | 2399 | } |
@@ -2415,7 +2415,7 @@ discard block |
||
2415 | 2415 | public static function just_created_entry( $form_id ) { |
2416 | 2416 | global $frm_vars; |
2417 | 2417 | |
2418 | - 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; |
|
2418 | + 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; |
|
2419 | 2419 | } |
2420 | 2420 | |
2421 | 2421 | /** |
@@ -2435,7 +2435,7 @@ discard block |
||
2435 | 2435 | private static function get_confirmation_method( $atts ) { |
2436 | 2436 | $action = FrmOnSubmitHelper::current_event( $atts ); |
2437 | 2437 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
2438 | - $method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
2438 | + $method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
2439 | 2439 | |
2440 | 2440 | if ( ! empty( $atts['entry_id'] ) ) { |
2441 | 2441 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2456,7 +2456,7 @@ discard block |
||
2456 | 2456 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
2457 | 2457 | if ( ! isset( $params['id'] ) ) { |
2458 | 2458 | global $frm_vars; |
2459 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
2459 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
2460 | 2460 | } |
2461 | 2461 | |
2462 | 2462 | $conf_method = self::get_confirmation_method( |
@@ -2538,7 +2538,7 @@ discard block |
||
2538 | 2538 | $args['success_opt'] = $opt; |
2539 | 2539 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
2540 | 2540 | |
2541 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
2541 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
2542 | 2542 | self::load_page_after_submit( $args ); |
2543 | 2543 | } elseif ( $args['conf_method'] === 'redirect' ) { |
2544 | 2544 | self::redirect_after_submit( $args ); |
@@ -2562,7 +2562,7 @@ discard block |
||
2562 | 2562 | } |
2563 | 2563 | |
2564 | 2564 | // If a redirect action has already opened the URL in a new tab, we show the default message in the current tab. |
2565 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
2565 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
2566 | 2566 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
2567 | 2567 | } |
2568 | 2568 | |
@@ -2750,7 +2750,7 @@ discard block |
||
2750 | 2750 | |
2751 | 2751 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
2752 | 2752 | |
2753 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
2753 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
2754 | 2754 | |
2755 | 2755 | /** |
2756 | 2756 | * Filters the run success action args. |
@@ -2770,8 +2770,8 @@ discard block |
||
2770 | 2770 | private static function load_page_after_submit( $args ) { |
2771 | 2771 | global $post; |
2772 | 2772 | $opt = $args['success_opt']; |
2773 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
2774 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
2773 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
2774 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
2775 | 2775 | $old_post = $post; |
2776 | 2776 | $post = $page; |
2777 | 2777 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2801,7 +2801,7 @@ discard block |
||
2801 | 2801 | add_filter( 'frm_use_wpautop', '__return_false' ); |
2802 | 2802 | |
2803 | 2803 | $opt = $args['success_opt']; |
2804 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
2804 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
2805 | 2805 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
2806 | 2806 | $success_url = do_shortcode( $success_url ); |
2807 | 2807 | |
@@ -2823,7 +2823,7 @@ discard block |
||
2823 | 2823 | // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
2824 | 2824 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
2825 | 2825 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
2826 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
2826 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
2827 | 2827 | return; |
2828 | 2828 | } |
2829 | 2829 | |
@@ -3103,7 +3103,7 @@ discard block |
||
3103 | 3103 | 'description' => false, |
3104 | 3104 | 'reset' => false, |
3105 | 3105 | ); |
3106 | - $args = wp_parse_args( $args, $defaults ); |
|
3106 | + $args = wp_parse_args( $args, $defaults ); |
|
3107 | 3107 | } |
3108 | 3108 | |
3109 | 3109 | /** |
@@ -3141,7 +3141,7 @@ discard block |
||
3141 | 3141 | $opt = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success'; |
3142 | 3142 | |
3143 | 3143 | if ( $entry_id && is_numeric( $entry_id ) ) { |
3144 | - $message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg; |
|
3144 | + $message = isset( $form->options[$opt . '_msg'] ) ? $form->options[$opt . '_msg'] : $frm_settings->success_msg; |
|
3145 | 3145 | $class = 'frm_message'; |
3146 | 3146 | } else { |
3147 | 3147 | $message = $frm_settings->failed_msg; |
@@ -3366,8 +3366,8 @@ discard block |
||
3366 | 3366 | |
3367 | 3367 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
3368 | 3368 | |
3369 | - $html = FrmAppHelper::clip( |
|
3370 | - function () { |
|
3369 | + $html = FrmAppHelper::clip( |
|
3370 | + function() { |
|
3371 | 3371 | FrmAppHelper::maybe_autocomplete_pages_options( |
3372 | 3372 | array( |
3373 | 3373 | 'field_name' => 'frm_page_dropdown', |
@@ -53,7 +53,7 @@ |
||
53 | 53 | * @return array |
54 | 54 | */ |
55 | 55 | public static function add_gdpr_field( $fields ) { |
56 | - $fields[ self::FIELD_TYPE ] = array( |
|
56 | + $fields[self::FIELD_TYPE] = array( |
|
57 | 57 | 'name' => __( 'GDPR', 'formidable' ), |
58 | 58 | 'icon' => 'frm_icon_font frm-gdpr-icon', |
59 | 59 | ); |
@@ -1356,15 +1356,15 @@ discard block |
||
1356 | 1356 | global $wp_filter; |
1357 | 1357 | |
1358 | 1358 | foreach ( $actions as $action ) { |
1359 | - if ( empty( $wp_filter[ $action ]->callbacks ) ) { |
|
1359 | + if ( empty( $wp_filter[$action]->callbacks ) ) { |
|
1360 | 1360 | continue; |
1361 | 1361 | } |
1362 | - foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) { |
|
1362 | + foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) { |
|
1363 | 1363 | foreach ( $callbacks as $callback_name => $callback ) { |
1364 | 1364 | if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) { |
1365 | 1365 | continue; |
1366 | 1366 | } |
1367 | - unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] ); |
|
1367 | + unset( $wp_filter[$action]->callbacks[$priority][$callback_name] ); |
|
1368 | 1368 | } |
1369 | 1369 | } |
1370 | 1370 | } |
@@ -1376,7 +1376,7 @@ discard block |
||
1376 | 1376 | * @return void |
1377 | 1377 | */ |
1378 | 1378 | private static function remember_custom_sort() { |
1379 | - $screen = get_current_screen(); |
|
1379 | + $screen = get_current_screen(); |
|
1380 | 1380 | if ( ! $screen ) { |
1381 | 1381 | return; |
1382 | 1382 | } |
@@ -112,7 +112,7 @@ |
||
112 | 112 | FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ), |
113 | 113 | ); |
114 | 114 | |
115 | - $class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : ''; |
|
115 | + $class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : ''; |
|
116 | 116 | |
117 | 117 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
118 | 118 | } |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
310 | 310 | } |
311 | 311 | $plugins = get_plugins(); |
312 | - if ( isset( $plugins[ $plugin ] ) && ! empty( $plugins[ $plugin ]['Version'] ) ) { |
|
313 | - return $plugins[ $plugin ]['Version']; |
|
312 | + if ( isset( $plugins[$plugin] ) && ! empty( $plugins[$plugin]['Version'] ) ) { |
|
313 | + return $plugins[$plugin]['Version']; |
|
314 | 314 | } |
315 | 315 | return false; |
316 | 316 | } |
@@ -383,8 +383,8 @@ discard block |
||
383 | 383 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
384 | 384 | |
385 | 385 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
386 | - if ( isset( $values[ $col ] ) ) { |
|
387 | - $new_values[ $col ] = $values[ $col ]; |
|
386 | + if ( isset( $values[$col] ) ) { |
|
387 | + $new_values[$col] = $values[$col]; |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
397 | 397 | |
398 | 398 | if ( isset( $values['id'] ) ) { |
399 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
399 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
400 | 400 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
401 | 401 | } |
402 | 402 | |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | foreach ( $new_values as $k => $v ) { |
406 | 406 | if ( is_array( $v ) ) { |
407 | 407 | if ( $k === 'default_value' ) { |
408 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
408 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
409 | 409 | } else { |
410 | - $new_values[ $k ] = serialize( $v ); |
|
410 | + $new_values[$k] = serialize( $v ); |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 | unset( $k, $v ); |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | } |
428 | 428 | |
429 | 429 | if ( isset( $values['id'] ) ) { |
430 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
430 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | return $new_id; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | * @param array $match Shortcode data. |
479 | 479 | * @return string |
480 | 480 | */ |
481 | - function ( $match ) { |
|
481 | + function( $match ) { |
|
482 | 482 | $attr = shortcode_parse_atts( $match[3] ); |
483 | 483 | |
484 | 484 | if ( ! is_array( $attr ) ) { |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | } |
504 | 504 | |
505 | 505 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
506 | - $safe_atts[ $key ] = $value; |
|
506 | + $safe_atts[$key] = $value; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
562 | 562 | global $frm_duplicate_ids; |
563 | 563 | |
564 | - $where = array( |
|
564 | + $where = array( |
|
565 | 565 | array( |
566 | 566 | 'or' => 1, |
567 | 567 | 'fi.form_id' => $old_form_id, |
@@ -607,8 +607,8 @@ discard block |
||
607 | 607 | |
608 | 608 | $values = apply_filters( 'frm_duplicated_field', $values ); |
609 | 609 | $new_id = self::create( $values ); |
610 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
611 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
610 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
611 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
612 | 612 | unset( $field ); |
613 | 613 | }//end foreach |
614 | 614 | } |
@@ -657,11 +657,11 @@ discard block |
||
657 | 657 | |
658 | 658 | // serialize array values |
659 | 659 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
660 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
660 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
661 | 661 | if ( 'field_options' === $opt ) { |
662 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
662 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
663 | 663 | } |
664 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
664 | + $values[$opt] = serialize( $values[$opt] ); |
|
665 | 665 | } |
666 | 666 | } |
667 | 667 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -848,8 +848,8 @@ discard block |
||
848 | 848 | continue; |
849 | 849 | } |
850 | 850 | |
851 | - $fields[ $result->id ] = $result; |
|
852 | - ++$count; |
|
851 | + $fields[$result->id] = $result; |
|
852 | + ++ $count; |
|
853 | 853 | if ( $limit == 1 ) { |
854 | 854 | $fields = $result; |
855 | 855 | break; |
@@ -900,8 +900,8 @@ discard block |
||
900 | 900 | $fields = array(); |
901 | 901 | $count = 0; |
902 | 902 | foreach ( $results as $result ) { |
903 | - ++$count; |
|
904 | - $fields[ $result->id ] = $result; |
|
903 | + ++ $count; |
|
904 | + $fields[$result->id] = $result; |
|
905 | 905 | if ( ! empty( $limit ) && $count >= $limit ) { |
906 | 906 | break; |
907 | 907 | } |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
1016 | 1016 | |
1017 | 1017 | if ( is_array( $where ) ) { |
1018 | - $args = array( |
|
1018 | + $args = array( |
|
1019 | 1019 | 'order_by' => $order_by, |
1020 | 1020 | 'limit' => $limit, |
1021 | 1021 | ); |
@@ -1048,9 +1048,9 @@ discard block |
||
1048 | 1048 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
1049 | 1049 | |
1050 | 1050 | self::prepare_options( $result ); |
1051 | - $results[ $r_key ]->field_options = $result->field_options; |
|
1052 | - $results[ $r_key ]->options = $result->options; |
|
1053 | - $results[ $r_key ]->default_value = $result->default_value; |
|
1051 | + $results[$r_key]->field_options = $result->field_options; |
|
1052 | + $results[$r_key]->options = $result->options; |
|
1053 | + $results[$r_key]->default_value = $result->default_value; |
|
1054 | 1054 | |
1055 | 1055 | unset( $r_key, $result ); |
1056 | 1056 | } |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | |
1130 | 1130 | if ( count( $next_fields ) >= self::$transient_size ) { |
1131 | 1131 | // if this transient is full, check for another |
1132 | - ++$next; |
|
1132 | + ++ $next; |
|
1133 | 1133 | self::get_next_transient( $fields, $base_name, $next ); |
1134 | 1134 | } |
1135 | 1135 | } |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | return; |
1158 | 1158 | } |
1159 | 1159 | |
1160 | - ++$next; |
|
1160 | + ++ $next; |
|
1161 | 1161 | } |
1162 | 1162 | } |
1163 | 1163 | |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | * @return bool |
1306 | 1306 | */ |
1307 | 1307 | public static function is_option_true_in_array( $field, $option ) { |
1308 | - return ! empty( $field[ $option ] ); |
|
1308 | + return ! empty( $field[$option] ); |
|
1309 | 1309 | } |
1310 | 1310 | |
1311 | 1311 | /** |
@@ -1314,7 +1314,7 @@ discard block |
||
1314 | 1314 | * @return bool |
1315 | 1315 | */ |
1316 | 1316 | public static function is_option_true_in_object( $field, $option ) { |
1317 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
1317 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
1318 | 1318 | } |
1319 | 1319 | |
1320 | 1320 | /** |
@@ -1323,7 +1323,7 @@ discard block |
||
1323 | 1323 | * @return bool |
1324 | 1324 | */ |
1325 | 1325 | public static function is_option_empty_in_array( $field, $option ) { |
1326 | - return empty( $field[ $option ] ); |
|
1326 | + return empty( $field[$option] ); |
|
1327 | 1327 | } |
1328 | 1328 | |
1329 | 1329 | /** |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | * @return bool |
1333 | 1333 | */ |
1334 | 1334 | public static function is_option_empty_in_object( $field, $option ) { |
1335 | - return empty( $field->field_options[ $option ] ); |
|
1335 | + return empty( $field->field_options[$option] ); |
|
1336 | 1336 | } |
1337 | 1337 | |
1338 | 1338 | /** |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | * @return bool |
1342 | 1342 | */ |
1343 | 1343 | public static function is_option_value_in_object( $field, $option ) { |
1344 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
1344 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
1345 | 1345 | } |
1346 | 1346 | |
1347 | 1347 | /** |
@@ -1367,10 +1367,10 @@ discard block |
||
1367 | 1367 | * @return mixed |
1368 | 1368 | */ |
1369 | 1369 | public static function get_option_in_array( $field, $option ) { |
1370 | - if ( isset( $field[ $option ] ) ) { |
|
1371 | - $this_option = $field[ $option ]; |
|
1372 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
1373 | - $this_option = $field['field_options'][ $option ]; |
|
1370 | + if ( isset( $field[$option] ) ) { |
|
1371 | + $this_option = $field[$option]; |
|
1372 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
1373 | + $this_option = $field['field_options'][$option]; |
|
1374 | 1374 | } else { |
1375 | 1375 | $this_option = ''; |
1376 | 1376 | } |
@@ -1384,7 +1384,7 @@ discard block |
||
1384 | 1384 | * @return mixed |
1385 | 1385 | */ |
1386 | 1386 | public static function get_option_in_object( $field, $option ) { |
1387 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
1387 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
1388 | 1388 | } |
1389 | 1389 | |
1390 | 1390 | /** |
@@ -322,11 +322,11 @@ discard block |
||
322 | 322 | |
323 | 323 | // Perform add or remove operation. |
324 | 324 | if ( 'add' === $operation ) { |
325 | - self::$favorite_templates[ $key ][] = $template_id; |
|
325 | + self::$favorite_templates[$key][] = $template_id; |
|
326 | 326 | } elseif ( 'remove' === $operation ) { |
327 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
327 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
328 | 328 | if ( $position !== false ) { |
329 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
329 | + unset( self::$favorite_templates[$key][$position] ); |
|
330 | 330 | } |
331 | 331 | } |
332 | 332 | |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | foreach ( self::$templates as $key => &$template ) { |
456 | 456 | // Skip the template if the categories are not set. |
457 | 457 | if ( ! isset( $template['categories'] ) || ! isset( $template['id'] ) ) { |
458 | - unset( self::$templates[ $key ] ); |
|
458 | + unset( self::$templates[$key] ); |
|
459 | 459 | continue; |
460 | 460 | } |
461 | 461 | |
@@ -469,14 +469,12 @@ discard block |
||
469 | 469 | // Add the slug to the new array. |
470 | 470 | $template['category_slugs'][] = $category_slug; |
471 | 471 | |
472 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
473 | - self::$categories[ $category_slug ] = array( |
|
472 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
473 | + self::$categories[$category_slug] = array( |
|
474 | 474 | 'name' => $category, |
475 | 475 | 'count' => 0, |
476 | 476 | ); |
477 | - } |
|
478 | - |
|
479 | - ++self::$categories[ $category_slug ]['count']; |
|
477 | + } ++self::$categories[$category_slug]['count']; |
|
480 | 478 | } |
481 | 479 | |
482 | 480 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -491,7 +489,7 @@ discard block |
||
491 | 489 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::get_license_types() ); |
492 | 490 | foreach ( $redundant_cats as $redundant_cat ) { |
493 | 491 | $category_slug = sanitize_title( $redundant_cat ); |
494 | - unset( self::$categories[ $category_slug ] ); |
|
492 | + unset( self::$categories[$category_slug] ); |
|
495 | 493 | } |
496 | 494 | |
497 | 495 | // Sort the categories by keys alphabetically. |
@@ -516,7 +514,7 @@ discard block |
||
516 | 514 | 'count' => 0, |
517 | 515 | ); |
518 | 516 | } |
519 | - $special_categories['all-items'] = array( |
|
517 | + $special_categories['all-items'] = array( |
|
520 | 518 | 'name' => __( 'All Templates', 'formidable' ), |
521 | 519 | 'count' => self::get_template_count(), |
522 | 520 | ); |
@@ -539,9 +537,9 @@ discard block |
||
539 | 537 | */ |
540 | 538 | private static function assign_featured_templates() { |
541 | 539 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
542 | - if ( isset( self::$templates[ $key ] ) ) { |
|
543 | - self::$templates[ $key ]['is_featured'] = true; |
|
544 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
540 | + if ( isset( self::$templates[$key] ) ) { |
|
541 | + self::$templates[$key]['is_featured'] = true; |
|
542 | + self::$featured_templates[] = self::$templates[$key]; |
|
545 | 543 | } |
546 | 544 | } |
547 | 545 | } |
@@ -172,7 +172,7 @@ |
||
172 | 172 | |
173 | 173 | if ( ! $required && empty( $args['value'] ) ) { |
174 | 174 | $frm_settings = FrmAppHelper::get_settings(); |
175 | - $errors[ 'field' . $args['id'] ] = str_replace( '[field_name]', is_object( $this->field ) ? $this->field->name : $this->field['name'], $frm_settings->blank_msg ); |
|
175 | + $errors['field' . $args['id']] = str_replace( '[field_name]', is_object( $this->field ) ? $this->field->name : $this->field['name'], $frm_settings->blank_msg ); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 |
@@ -208,7 +208,7 @@ |
||
208 | 208 | return ''; |
209 | 209 | } |
210 | 210 | |
211 | - return isset( $item_meta[ $field_id ] ) ? $item_meta[ $field_id ] : ''; |
|
211 | + return isset( $item_meta[$field_id] ) ? $item_meta[$field_id] : ''; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | $groups = FrmFormActionsController::form_action_groups(); |
209 | 209 | $group = 'misc'; |
210 | 210 | |
211 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
211 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
212 | 212 | $group = $action_options['group']; |
213 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
213 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
214 | 214 | $group = $this->id_base; |
215 | 215 | } else { |
216 | 216 | foreach ( $groups as $name => $check_group ) { |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | - $groups[ $group ]['id'] = $group; |
|
225 | - return $groups[ $group ]; |
|
224 | + $groups[$group]['id'] = $group; |
|
225 | + return $groups[$group]; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @return int $post_id |
334 | 334 | */ |
335 | 335 | public function maybe_create_action( $action, $forms ) { |
336 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] === 'updated' ) { |
|
336 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] === 'updated' ) { |
|
337 | 337 | // Update action only |
338 | 338 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
339 | 339 | $post_id = $this->save_settings( $action ); |
@@ -356,18 +356,18 @@ discard block |
||
356 | 356 | $switch = $this->get_global_switch_fields(); |
357 | 357 | |
358 | 358 | foreach ( (array) $action->post_content as $key => $val ) { |
359 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
360 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
359 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
360 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
361 | 361 | } elseif ( ! is_array( $val ) ) { |
362 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
362 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
364 | 364 | // loop through each value if empty |
365 | - if ( empty( $switch[ $key ] ) ) { |
|
366 | - $switch[ $key ] = array_keys( $val ); |
|
365 | + if ( empty( $switch[$key] ) ) { |
|
366 | + $switch[$key] = array_keys( $val ); |
|
367 | 367 | } |
368 | 368 | |
369 | - foreach ( $switch[ $key ] as $subkey ) { |
|
370 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
369 | + foreach ( $switch[$key] as $subkey ) { |
|
370 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | foreach ( $subkey as $subkey2 ) { |
386 | 386 | foreach ( (array) $val as $ck => $cv ) { |
387 | 387 | if ( is_array( $cv ) ) { |
388 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
389 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
390 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
388 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
389 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
390 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | } |
394 | 394 | } else { |
395 | 395 | foreach ( (array) $val as $ck => $cv ) { |
396 | 396 | if ( is_array( $cv ) ) { |
397 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
398 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
399 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
397 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
398 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
399 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
400 | 400 | } elseif ( $ck == $subkey ) { |
401 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
401 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | }//end if |
@@ -422,10 +422,10 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
425 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
425 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
426 | 426 | // Sanitizing removes scripts and <email> type of values. |
427 | 427 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
428 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
428 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
429 | 429 | } else { |
430 | 430 | return; |
431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | foreach ( $settings as $number => $new_instance ) { |
436 | 436 | $this->_set( $number ); |
437 | 437 | |
438 | - $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); |
|
438 | + $old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array(); |
|
439 | 439 | |
440 | 440 | if ( ! isset( $new_instance['post_status'] ) ) { |
441 | 441 | $new_instance['post_status'] = 'draft'; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
475 | 475 | |
476 | 476 | if ( false !== $instance ) { |
477 | - $all_instances[ $number ] = $instance; |
|
477 | + $all_instances[$number] = $instance; |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | $action_ids[] = $this->save_settings( $instance ); |
@@ -560,12 +560,12 @@ discard block |
||
560 | 560 | // some plugins/themes are formatting the post_excerpt |
561 | 561 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
562 | 562 | |
563 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
563 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
564 | 564 | continue; |
565 | 565 | } |
566 | 566 | |
567 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
568 | - $settings[ $action->ID ] = $action; |
|
567 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
568 | + $settings[$action->ID] = $action; |
|
569 | 569 | |
570 | 570 | if ( count( $settings ) >= $limit ) { |
571 | 571 | break; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | * @return int The filtered limit value. |
592 | 592 | */ |
593 | 593 | public static function get_action_limit( $form_id, $limit = 99 ) { |
594 | - $type = 'all'; |
|
594 | + $type = 'all'; |
|
595 | 595 | return (int) apply_filters( 'frm_form_action_limit', (int) $limit, compact( 'type', 'form_id' ) ); |
596 | 596 | } |
597 | 597 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | 'limit' => 99, |
615 | 615 | 'post_status' => $default_status, |
616 | 616 | ); |
617 | - $args = wp_parse_args( $args, $defaults ); |
|
617 | + $args = wp_parse_args( $args, $defaults ); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | /** |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | |
685 | 685 | $action = $this->prepare_action( $action ); |
686 | 686 | |
687 | - $settings[ $action->ID ] = $action; |
|
687 | + $settings[$action->ID] = $action; |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | if ( 1 === $limit ) { |
@@ -727,10 +727,10 @@ discard block |
||
727 | 727 | |
728 | 728 | foreach ( $default_values as $k => $vals ) { |
729 | 729 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
730 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
730 | + if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
731 | 731 | continue; |
732 | 732 | } |
733 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
733 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
734 | 734 | } |
735 | 735 | } |
736 | 736 | |
@@ -818,9 +818,9 @@ discard block |
||
818 | 818 | |
819 | 819 | // fill with existing options |
820 | 820 | foreach ( $action->post_content as $name => $val ) { |
821 | - if ( isset( $form->options[ $name ] ) ) { |
|
822 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
823 | - unset( $form->options[ $name ] ); |
|
821 | + if ( isset( $form->options[$name] ) ) { |
|
822 | + $action->post_content[$name] = $form->options[$name]; |
|
823 | + unset( $form->options[$name] ); |
|
824 | 824 | } |
825 | 825 | } |
826 | 826 | |
@@ -906,8 +906,8 @@ discard block |
||
906 | 906 | private static function get_value_from_entry( $entry, $field_id ) { |
907 | 907 | $observed_value = ''; |
908 | 908 | |
909 | - if ( isset( $entry->metas[ $field_id ] ) ) { |
|
910 | - $observed_value = $entry->metas[ $field_id ]; |
|
909 | + if ( isset( $entry->metas[$field_id] ) ) { |
|
910 | + $observed_value = $entry->metas[$field_id]; |
|
911 | 911 | } elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) { |
912 | 912 | $field = FrmField::getOne( $field_id ); |
913 | 913 | $observed_value = FrmProEntryMetaHelper::get_post_or_meta_value( |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'include' ); |
982 | 982 | return array_filter( |
983 | 983 | $form_fields, |
984 | - function ( $form_field ) { |
|
984 | + function( $form_field ) { |
|
985 | 985 | return ! FrmField::is_no_save_field( $form_field->type ); |
986 | 986 | } |
987 | 987 | ); |