@@ -127,7 +127,7 @@ |
||
| 127 | 127 | * @return bool |
| 128 | 128 | */ |
| 129 | 129 | private static function check_free_segments( $who ) { |
| 130 | - $segments = array( |
|
| 130 | + $segments = array( |
|
| 131 | 131 | 'free_first_1', |
| 132 | 132 | 'free_first_2_3', |
| 133 | 133 | 'free_first_4_7', |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Validate the number format. |
| 64 | 64 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
| 65 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ( $args['value'] === '' ) { |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | $maxnum = FrmField::get_option( $this->field, 'maxnum' ); |
| 75 | 75 | |
| 76 | 76 | if ( $minnum !== '' && $value < $minnum ) { |
| 77 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' ); |
|
| 77 | + $errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' ); |
|
| 78 | 78 | } elseif ( $maxnum !== '' && $value > $maxnum ) { |
| 79 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' ); |
|
| 79 | + $errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->validate_step( $errors, $args ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | 97 | protected function validate_step( &$errors, $args ) { |
| 98 | - if ( isset( $errors[ 'field' . $args['id'] ] ) ) { |
|
| 98 | + if ( isset( $errors['field' . $args['id']] ) ) { |
|
| 99 | 99 | // Don't need to check if value is invalid before. |
| 100 | 100 | return; |
| 101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $errors[ 'field' . $args['id'] ] = sprintf( |
|
| 113 | + $errors['field' . $args['id']] = sprintf( |
|
| 114 | 114 | // Translators: %1$s: the first nearest value; %2$s: the second nearest value. |
| 115 | 115 | __( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ), |
| 116 | 116 | is_numeric( $result[0] ) ? floatval( $result[0] ) : $result[0], |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $page = $this->get_pagenum(); |
| 29 | 29 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
| 30 | 30 | |
| 31 | - $mode = self::get_param( |
|
| 31 | + $mode = self::get_param( |
|
| 32 | 32 | array( |
| 33 | 33 | 'param' => 'mode', |
| 34 | 34 | 'default' => 'list', |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'default' => 'name', |
| 41 | 41 | ) |
| 42 | 42 | ); |
| 43 | - $order = self::get_param( |
|
| 43 | + $order = self::get_param( |
|
| 44 | 44 | array( |
| 45 | 45 | 'param' => 'order', |
| 46 | 46 | 'default' => 'ASC', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | FrmAppController::apply_saved_sort_preference( $orderby, $order ); |
| 51 | 51 | |
| 52 | - $start = self::get_param( |
|
| 52 | + $start = self::get_param( |
|
| 53 | 53 | array( |
| 54 | 54 | 'param' => 'start', |
| 55 | 55 | 'default' => ( $page - 1 ) * $per_page, |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $counts = FrmForm::get_count(); |
| 182 | 182 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
| 183 | 183 | |
| 184 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
| 184 | + if ( isset( $statuses[$form_type] ) ) { |
|
| 185 | 185 | $counts->$form_type = $this->total_items; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | if ( $counts->{$status} || 'draft' !== $status ) { |
| 204 | 204 | /* translators: %1$s: Status, %2$s: Number of items */ |
| 205 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 205 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | unset( $status, $name ); |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | private function get_actions( &$actions, $item, $edit_link ) { |
| 405 | 405 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
| 406 | 406 | foreach ( $new_actions as $link => $action ) { |
| 407 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 407 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | if ( 'trash' === $this->status ) { |
@@ -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(); |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | * @param string|null $src |
| 740 | 740 | * @return string |
| 741 | 741 | */ |
| 742 | - function ( $src ) { |
|
| 742 | + function( $src ) { |
|
| 743 | 743 | if ( is_null( $src ) ) { |
| 744 | 744 | $src = ''; |
| 745 | 745 | } |
@@ -804,11 +804,11 @@ discard block |
||
| 804 | 804 | ), |
| 805 | 805 | ); |
| 806 | 806 | |
| 807 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
| 807 | + if ( ! isset( $available_status[$status] ) ) { |
|
| 808 | 808 | return; |
| 809 | 809 | } |
| 810 | 810 | |
| 811 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
| 811 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
| 812 | 812 | |
| 813 | 813 | $params = FrmForm::list_page_params(); |
| 814 | 814 | |
@@ -816,8 +816,8 @@ discard block |
||
| 816 | 816 | check_admin_referer( $status . '_form_' . $params['id'] ); |
| 817 | 817 | |
| 818 | 818 | $count = 0; |
| 819 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
| 820 | - ++$count; |
|
| 819 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
| 820 | + ++ $count; |
|
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | $form_type = FrmAppHelper::get_simple_request( |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 834 | 834 | $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>' ); |
| 835 | 835 | |
| 836 | - $message = $available_status[ $status ]['message']; |
|
| 836 | + $message = $available_status[$status]['message']; |
|
| 837 | 837 | |
| 838 | 838 | self::display_forms_list( $params, $message ); |
| 839 | 839 | } |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $count = 0; |
| 849 | 849 | foreach ( $ids as $id ) { |
| 850 | 850 | if ( FrmForm::trash( $id ) ) { |
| 851 | - ++$count; |
|
| 851 | + ++ $count; |
|
| 852 | 852 | } |
| 853 | 853 | } |
| 854 | 854 | |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | 'type' => 'request', |
| 863 | 863 | ) |
| 864 | 864 | ); |
| 865 | - $message = sprintf( |
|
| 865 | + $message = sprintf( |
|
| 866 | 866 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 867 | 867 | _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' ), |
| 868 | 868 | $count, |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | |
| 884 | 884 | $count = 0; |
| 885 | 885 | if ( FrmForm::destroy( $params['id'] ) ) { |
| 886 | - ++$count; |
|
| 886 | + ++ $count; |
|
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | /* translators: %1$s: Number of forms */ |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | foreach ( $ids as $id ) { |
| 904 | 904 | $d = FrmForm::destroy( $id ); |
| 905 | 905 | if ( $d ) { |
| 906 | - ++$count; |
|
| 906 | + ++ $count; |
|
| 907 | 907 | } |
| 908 | 908 | } |
| 909 | 909 | |
@@ -1404,7 +1404,7 @@ discard block |
||
| 1404 | 1404 | |
| 1405 | 1405 | add_action( |
| 1406 | 1406 | 'wp_enqueue_editor', |
| 1407 | - function () { |
|
| 1407 | + function() { |
|
| 1408 | 1408 | wp_print_media_templates(); |
| 1409 | 1409 | } |
| 1410 | 1410 | ); |
@@ -1535,7 +1535,7 @@ discard block |
||
| 1535 | 1535 | $section['id'] = $section['anchor']; |
| 1536 | 1536 | } |
| 1537 | 1537 | |
| 1538 | - $sections[ $key ] = $section; |
|
| 1538 | + $sections[$key] = $section; |
|
| 1539 | 1539 | }//end foreach |
| 1540 | 1540 | |
| 1541 | 1541 | return $sections; |
@@ -1658,7 +1658,7 @@ discard block |
||
| 1658 | 1658 | if ( $user_fields ) { |
| 1659 | 1659 | $user_helpers = array(); |
| 1660 | 1660 | foreach ( $user_fields as $uk => $uf ) { |
| 1661 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
| 1661 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
| 1662 | 1662 | unset( $uk, $uf ); |
| 1663 | 1663 | } |
| 1664 | 1664 | |
@@ -1792,7 +1792,7 @@ discard block |
||
| 1792 | 1792 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
| 1793 | 1793 | $frm_vars['js_validate_forms'] = array(); |
| 1794 | 1794 | } |
| 1795 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
| 1795 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
| 1796 | 1796 | } |
| 1797 | 1797 | |
| 1798 | 1798 | public static function get_email_html() { |
@@ -1976,7 +1976,7 @@ discard block |
||
| 1976 | 1976 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
| 1977 | 1977 | } else { |
| 1978 | 1978 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
| 1979 | - $action = $vars[ $action ]; |
|
| 1979 | + $action = $vars[$action]; |
|
| 1980 | 1980 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1981 | 1981 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1982 | 1982 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -2159,7 +2159,7 @@ discard block |
||
| 2159 | 2159 | $actions = array(); |
| 2160 | 2160 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
| 2161 | 2161 | if ( is_object( $form ) ) { |
| 2162 | - $actions[ $form->id ] = $form->name; |
|
| 2162 | + $actions[$form->id] = $form->name; |
|
| 2163 | 2163 | } |
| 2164 | 2164 | unset( $form ); |
| 2165 | 2165 | } |
@@ -2404,8 +2404,8 @@ discard block |
||
| 2404 | 2404 | private static function get_saved_errors( $form, $params ) { |
| 2405 | 2405 | global $frm_vars; |
| 2406 | 2406 | |
| 2407 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2408 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
| 2407 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2408 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
| 2409 | 2409 | } else { |
| 2410 | 2410 | $errors = array(); |
| 2411 | 2411 | } |
@@ -2427,7 +2427,7 @@ discard block |
||
| 2427 | 2427 | public static function just_created_entry( $form_id ) { |
| 2428 | 2428 | global $frm_vars; |
| 2429 | 2429 | |
| 2430 | - 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; |
|
| 2430 | + 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; |
|
| 2431 | 2431 | } |
| 2432 | 2432 | |
| 2433 | 2433 | /** |
@@ -2447,7 +2447,7 @@ discard block |
||
| 2447 | 2447 | private static function get_confirmation_method( $atts ) { |
| 2448 | 2448 | $action = FrmOnSubmitHelper::current_event( $atts ); |
| 2449 | 2449 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
| 2450 | - $method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 2450 | + $method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 2451 | 2451 | |
| 2452 | 2452 | if ( ! empty( $atts['entry_id'] ) ) { |
| 2453 | 2453 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2468,7 +2468,7 @@ discard block |
||
| 2468 | 2468 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
| 2469 | 2469 | if ( ! isset( $params['id'] ) ) { |
| 2470 | 2470 | global $frm_vars; |
| 2471 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
| 2471 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
| 2472 | 2472 | } |
| 2473 | 2473 | |
| 2474 | 2474 | $conf_method = self::get_confirmation_method( |
@@ -2550,7 +2550,7 @@ discard block |
||
| 2550 | 2550 | $args['success_opt'] = $opt; |
| 2551 | 2551 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
| 2552 | 2552 | |
| 2553 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
| 2553 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
| 2554 | 2554 | self::load_page_after_submit( $args ); |
| 2555 | 2555 | } elseif ( $args['conf_method'] === 'redirect' ) { |
| 2556 | 2556 | self::redirect_after_submit( $args ); |
@@ -2574,7 +2574,7 @@ discard block |
||
| 2574 | 2574 | } |
| 2575 | 2575 | |
| 2576 | 2576 | // If a redirect action has already opened the URL in a new tab, we show the default message in the current tab. |
| 2577 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
| 2577 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
| 2578 | 2578 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
| 2579 | 2579 | } |
| 2580 | 2580 | |
@@ -2762,7 +2762,7 @@ discard block |
||
| 2762 | 2762 | |
| 2763 | 2763 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
| 2764 | 2764 | |
| 2765 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
| 2765 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
| 2766 | 2766 | |
| 2767 | 2767 | /** |
| 2768 | 2768 | * Filters the run success action args. |
@@ -2782,8 +2782,8 @@ discard block |
||
| 2782 | 2782 | private static function load_page_after_submit( $args ) { |
| 2783 | 2783 | global $post; |
| 2784 | 2784 | $opt = $args['success_opt']; |
| 2785 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
| 2786 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
| 2785 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
| 2786 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
| 2787 | 2787 | $old_post = $post; |
| 2788 | 2788 | $post = $page; |
| 2789 | 2789 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2813,7 +2813,7 @@ discard block |
||
| 2813 | 2813 | add_filter( 'frm_use_wpautop', '__return_false' ); |
| 2814 | 2814 | |
| 2815 | 2815 | $opt = $args['success_opt']; |
| 2816 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
| 2816 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
| 2817 | 2817 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
| 2818 | 2818 | $success_url = do_shortcode( $success_url ); |
| 2819 | 2819 | |
@@ -2835,7 +2835,7 @@ discard block |
||
| 2835 | 2835 | // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
| 2836 | 2836 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
| 2837 | 2837 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
| 2838 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
| 2838 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
| 2839 | 2839 | return; |
| 2840 | 2840 | } |
| 2841 | 2841 | |
@@ -3115,7 +3115,7 @@ discard block |
||
| 3115 | 3115 | 'description' => false, |
| 3116 | 3116 | 'reset' => false, |
| 3117 | 3117 | ); |
| 3118 | - $args = wp_parse_args( $args, $defaults ); |
|
| 3118 | + $args = wp_parse_args( $args, $defaults ); |
|
| 3119 | 3119 | } |
| 3120 | 3120 | |
| 3121 | 3121 | /** |
@@ -3153,7 +3153,7 @@ discard block |
||
| 3153 | 3153 | $opt = $args['success_opt'] ?? 'success'; |
| 3154 | 3154 | |
| 3155 | 3155 | if ( $entry_id && is_numeric( $entry_id ) ) { |
| 3156 | - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg; |
|
| 3156 | + $message = $form->options[$opt . '_msg'] ?? $frm_settings->success_msg; |
|
| 3157 | 3157 | $class = 'frm_message'; |
| 3158 | 3158 | } else { |
| 3159 | 3159 | $message = $frm_settings->failed_msg; |
@@ -3378,8 +3378,8 @@ discard block |
||
| 3378 | 3378 | |
| 3379 | 3379 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 3380 | 3380 | |
| 3381 | - $html = FrmAppHelper::clip( |
|
| 3382 | - function () { |
|
| 3381 | + $html = FrmAppHelper::clip( |
|
| 3382 | + function() { |
|
| 3383 | 3383 | FrmAppHelper::maybe_autocomplete_pages_options( |
| 3384 | 3384 | array( |
| 3385 | 3385 | '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 | ); |
@@ -76,10 +76,10 @@ |
||
| 76 | 76 | foreach ( $pro_fields as $field_key => $field_type ) { |
| 77 | 77 | |
| 78 | 78 | if ( isset( $field_type['section'] ) ) { |
| 79 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
|
| 80 | - $field_sections[ $field_type['section'] ] = array(); |
|
| 79 | + if ( ! isset( $field_sections[$field_type['section']] ) ) { |
|
| 80 | + $field_sections[$field_type['section']] = array(); |
|
| 81 | 81 | } |
| 82 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
|
| 82 | + $field_sections[$field_type['section']][$field_key] = $field_type; |
|
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -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 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | foreach ( $skipped_keys as $skipped_key ) { |
| 129 | - unset( $data[ $skipped_key ] ); |
|
| 129 | + unset( $data[$skipped_key] ); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $data; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | foreach ( $pass_settings as $setting ) { |
| 226 | 226 | if ( isset( $settings_list->$setting ) ) { |
| 227 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
| 227 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | $message_settings = array(); |
| 262 | 262 | foreach ( $messages as $message ) { |
| 263 | - $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1; |
|
| 263 | + $message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | return $message_settings; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 282 | 282 | if ( isset( $settings_list->$frm_role ) ) { |
| 283 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
| 283 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
@@ -351,9 +351,9 @@ discard block |
||
| 351 | 351 | ); |
| 352 | 352 | |
| 353 | 353 | foreach ( $settings as $setting ) { |
| 354 | - if ( isset( $form->options[ $setting ] ) ) { |
|
| 354 | + if ( isset( $form->options[$setting] ) ) { |
|
| 355 | 355 | if ( 'custom_style' === $setting ) { |
| 356 | - $style->id = $form->options[ $setting ]; |
|
| 356 | + $style->id = $form->options[$setting]; |
|
| 357 | 357 | |
| 358 | 358 | if ( ! $style->id ) { |
| 359 | 359 | $style_name = 0; |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | $style_name = $style_post ? $style_post->post_name : 'formidable-style'; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - $new_form[ $setting ] = $style_name; |
|
| 367 | + $new_form[$setting] = $style_name; |
|
| 368 | 368 | } else { |
| 369 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
| 369 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | } |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args ); |
| 427 | 427 | foreach ( $fields as $k => $field ) { |
| 428 | 428 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
| 429 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
| 429 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
| 430 | 430 | } |
| 431 | 431 | return $fields; |
| 432 | 432 | } |
@@ -160,7 +160,7 @@ |
||
| 160 | 160 | * @return object|string |
| 161 | 161 | */ |
| 162 | 162 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
| 163 | - $body = array( |
|
| 163 | + $body = array( |
|
| 164 | 164 | 'frm_square_api_action' => $action, |
| 165 | 165 | 'frm_square_api_mode' => FrmSquareLiteAppHelper::active_mode(), |
| 166 | 166 | ); |