@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | private static function has_dark_background( $style ) { |
| 146 | 146 | $key = 'fieldset_bg_color'; |
| 147 | 147 | |
| 148 | - if ( empty( $style->post_content[ $key ] ) ) { |
|
| 148 | + if ( empty( $style->post_content[$key] ) ) { |
|
| 149 | 149 | return false; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $color = $style->post_content[ $key ]; |
|
| 152 | + $color = $style->post_content[$key]; |
|
| 153 | 153 | |
| 154 | 154 | if ( 0 === strpos( $color, 'rgba' ) ) { |
| 155 | 155 | preg_match_all( '/([\\d.]+)/', $color, $matches ); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @param stdClass $style_object |
| 214 | 214 | * @param array $style |
| 215 | 215 | */ |
| 216 | - $param_filter = function ( $params, $args ) use ( $style_object, $style ) { |
|
| 216 | + $param_filter = function( $params, $args ) use ( $style_object, $style ) { |
|
| 217 | 217 | if ( $args['style'] !== $style_object ) { |
| 218 | 218 | return $params; |
| 219 | 219 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | ), |
| 227 | 227 | '/style-templates/' . $style['slug'] |
| 228 | 228 | ); |
| 229 | - $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
| 229 | + $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
| 230 | 230 | return $params; |
| 231 | 231 | }; |
| 232 | 232 | } else { |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * |
| 239 | 239 | * @return array |
| 240 | 240 | */ |
| 241 | - $param_filter = function ( $params ) use ( $style ) { |
|
| 241 | + $param_filter = function( $params ) use ( $style ) { |
|
| 242 | 242 | $params['data-template-key'] = $style['slug']; |
| 243 | 243 | return $params; |
| 244 | 244 | }; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | continue; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - $value = $style->post_content[ $key ]; |
|
| 294 | + $value = $style->post_content[$key]; |
|
| 295 | 295 | |
| 296 | 296 | $is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent'; |
| 297 | 297 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | * |
| 415 | 415 | * @return void |
| 416 | 416 | */ |
| 417 | - function ( $style, $key ) { |
|
| 417 | + function( $style, $key ) { |
|
| 418 | 418 | if ( ! is_numeric( $key ) ) { |
| 419 | 419 | // Skip active_sub/expires keys. |
| 420 | 420 | return; |
@@ -443,10 +443,10 @@ discard block |
||
| 443 | 443 | * |
| 444 | 444 | * @return void |
| 445 | 445 | */ |
| 446 | - function ( $style ) use ( &$count ) { |
|
| 446 | + function( $style ) use ( &$count ) { |
|
| 447 | 447 | $hidden = $count > self::PAGE_SIZE - 1; |
| 448 | 448 | $this->echo_style_card( $style, $hidden ); |
| 449 | - ++$count; |
|
| 449 | + ++ $count; |
|
| 450 | 450 | } |
| 451 | 451 | ); |
| 452 | 452 | |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | * |
| 508 | 508 | * @return bool |
| 509 | 509 | */ |
| 510 | - function ( $style ) { |
|
| 510 | + function( $style ) { |
|
| 511 | 511 | return $this->default_style->ID !== $style->ID; |
| 512 | 512 | } |
| 513 | 513 | ); |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | return $this->get_pagenum(); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - if ( isset( $this->_pagination_args[ $key ] ) ) { |
|
| 250 | - return $this->_pagination_args[ $key ]; |
|
| 249 | + if ( isset( $this->_pagination_args[$key] ) ) { |
|
| 250 | + return $this->_pagination_args[$key]; |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
@@ -297,8 +297,8 @@ discard block |
||
| 297 | 297 | * @return void |
| 298 | 298 | */ |
| 299 | 299 | private function hidden_search_inputs( $param_name ) { |
| 300 | - if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
|
| 301 | - $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
|
| 300 | + if ( ! empty( $_REQUEST[$param_name] ) ) { |
|
| 301 | + $value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) ); |
|
| 302 | 302 | echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />'; |
| 303 | 303 | } |
| 304 | 304 | } |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | echo "<ul class='subsubsub'>\n"; |
| 342 | 342 | |
| 343 | 343 | foreach ( $views as $class => $view ) { |
| 344 | - $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 344 | + $views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 345 | 345 | } |
| 346 | 346 | echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 347 | 347 | echo '</ul>'; |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; |
| 512 | 512 | |
| 513 | 513 | foreach ( $actions as $action => $link ) { |
| 514 | - ++$i; |
|
| 514 | + ++ $i; |
|
| 515 | 515 | $sep = $i === $action_count ? '' : ' | '; |
| 516 | 516 | $out .= "<span class='$action'>$link$sep</span>"; |
| 517 | 517 | } |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | 'next' => __( 'Next page', 'formidable' ), |
| 752 | 752 | ); |
| 753 | 753 | |
| 754 | - return $labels[ $link ]; |
|
| 754 | + return $labels[$link]; |
|
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | private function current_url() { |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | |
| 857 | 857 | // If the primary column doesn't exist fall back to the |
| 858 | 858 | // first non-checkbox column. |
| 859 | - if ( ! isset( $columns[ $default ] ) ) { |
|
| 859 | + if ( ! isset( $columns[$default] ) ) { |
|
| 860 | 860 | $default = self::get_default_primary_column_name(); |
| 861 | 861 | } |
| 862 | 862 | |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | */ |
| 871 | 871 | $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); |
| 872 | 872 | |
| 873 | - if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { |
|
| 873 | + if ( empty( $column ) || ! isset( $columns[$column] ) ) { |
|
| 874 | 874 | $column = $default; |
| 875 | 875 | } |
| 876 | 876 | |
@@ -892,7 +892,7 @@ discard block |
||
| 892 | 892 | $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); |
| 893 | 893 | |
| 894 | 894 | foreach ( $this->_column_headers as $key => $value ) { |
| 895 | - $column_headers[ $key ] = $value; |
|
| 895 | + $column_headers[$key] = $value; |
|
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | return $column_headers; |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | $data[1] = false; |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | - $sortable[ $id ] = $data; |
|
| 930 | + $sortable[$id] = $data; |
|
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | $primary = $this->get_primary_column_name(); |
@@ -986,7 +986,7 @@ discard block |
||
| 986 | 986 | static $cb_counter = 1; |
| 987 | 987 | $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>'; |
| 988 | 988 | $columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />'; |
| 989 | - ++$cb_counter; |
|
| 989 | + ++ $cb_counter; |
|
| 990 | 990 | } |
| 991 | 991 | |
| 992 | 992 | foreach ( $columns as $column_key => $column_display_name ) { |
@@ -1008,8 +1008,8 @@ discard block |
||
| 1008 | 1008 | $class[] = 'column-primary'; |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | - if ( isset( $sortable[ $column_key ] ) ) { |
|
| 1012 | - list( $orderby, $desc_first ) = $sortable[ $column_key ]; |
|
| 1011 | + if ( isset( $sortable[$column_key] ) ) { |
|
| 1012 | + list( $orderby, $desc_first ) = $sortable[$column_key]; |
|
| 1013 | 1013 | |
| 1014 | 1014 | if ( $current_orderby == $orderby ) { |
| 1015 | 1015 | // The sorted column. The `aria-sort` attribute must be set only on the sorted column. |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false. |
| 1130 | 1130 | */ |
| 1131 | 1131 | protected function should_display( $args, $settings ) { |
| 1132 | - return ! isset( $args[ $settings ] ) || false !== $args[ $settings ]; |
|
| 1132 | + return ! isset( $args[$settings] ) || false !== $args[$settings]; |
|
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | /** |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | 'convertkit' => 'convertkit', |
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | - $icon = array_key_exists( $slug, $icons_map ) ? 'frm_' . $icons_map[ $slug ] . '_icon' : 'frm_logo_icon'; |
|
| 181 | + $icon = array_key_exists( $slug, $icons_map ) ? 'frm_' . $icons_map[$slug] . '_icon' : 'frm_logo_icon'; |
|
| 182 | 182 | |
| 183 | 183 | if ( 'ai' === $slug ) { |
| 184 | 184 | $icon = str_replace( '_', '-', $icon ); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | ?> |
| 292 | 292 | <span style="color: <?php echo esc_attr( $color ); ?>;"> |
| 293 | 293 | <?php |
| 294 | - for ( $i = 0; $i < 5; $i++ ) { |
|
| 294 | + for ( $i = 0; $i < 5; $i ++ ) { |
|
| 295 | 295 | echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 296 | 296 | } |
| 297 | 297 | ?> |
@@ -247,17 +247,17 @@ discard block |
||
| 247 | 247 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
| 248 | 248 | |
| 249 | 249 | if ( ! $action || ! is_object( $action ) ) { |
| 250 | - $form_options[ $opt . 'action' ] = self::get_default_action_type(); |
|
| 251 | - $form_options[ $opt . 'msg' ] = self::get_default_msg(); |
|
| 250 | + $form_options[$opt . 'action'] = self::get_default_action_type(); |
|
| 251 | + $form_options[$opt . 'msg'] = self::get_default_msg(); |
|
| 252 | 252 | |
| 253 | 253 | return; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - $form_options[ $opt . 'action' ] = $action->post_content['success_action'] ?? 'message'; |
|
| 256 | + $form_options[$opt . 'action'] = $action->post_content['success_action'] ?? 'message'; |
|
| 257 | 257 | |
| 258 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
| 258 | + switch ( $form_options[$opt . 'action'] ) { |
|
| 259 | 259 | case 'redirect': |
| 260 | - $form_options[ $opt . 'url' ] = $action->post_content['success_url'] ?? ''; |
|
| 260 | + $form_options[$opt . 'url'] = $action->post_content['success_url'] ?? ''; |
|
| 261 | 261 | $form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] ); |
| 262 | 262 | $form_options['redirect_delay'] = ! empty( $action->post_content['redirect_delay'] ); |
| 263 | 263 | $form_options['redirect_delay_time'] = $action->post_content['redirect_delay_time']; |
@@ -265,11 +265,11 @@ discard block |
||
| 265 | 265 | break; |
| 266 | 266 | |
| 267 | 267 | case 'page': |
| 268 | - $form_options[ $opt . 'page_id' ] = $action->post_content['success_page_id'] ?? ''; |
|
| 268 | + $form_options[$opt . 'page_id'] = $action->post_content['success_page_id'] ?? ''; |
|
| 269 | 269 | break; |
| 270 | 270 | |
| 271 | 271 | default: |
| 272 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
| 272 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
| 273 | 273 | $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
| 274 | 274 | } |
| 275 | 275 | } |
@@ -363,20 +363,20 @@ discard block |
||
| 363 | 363 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
| 364 | 364 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
| 365 | 365 | $data = array( |
| 366 | - 'success_action' => $form_options[ $opt . 'action' ] ?? self::get_default_action_type(), |
|
| 366 | + 'success_action' => $form_options[$opt . 'action'] ?? self::get_default_action_type(), |
|
| 367 | 367 | ); |
| 368 | 368 | |
| 369 | 369 | switch ( $data['success_action'] ) { |
| 370 | 370 | case 'redirect': |
| 371 | - $data['success_url'] = $form_options[ $opt . 'url' ] ?? ''; |
|
| 371 | + $data['success_url'] = $form_options[$opt . 'url'] ?? ''; |
|
| 372 | 372 | break; |
| 373 | 373 | |
| 374 | 374 | case 'page': |
| 375 | - $data['success_page_id'] = $form_options[ $opt . 'page_id' ] ?? ''; |
|
| 375 | + $data['success_page_id'] = $form_options[$opt . 'page_id'] ?? ''; |
|
| 376 | 376 | break; |
| 377 | 377 | |
| 378 | 378 | default: |
| 379 | - $data['success_msg'] = $form_options[ $opt . 'msg' ] ?? self::get_default_msg(); |
|
| 379 | + $data['success_msg'] = $form_options[$opt . 'msg'] ?? self::get_default_msg(); |
|
| 380 | 380 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
| 381 | 381 | } |
| 382 | 382 | |
@@ -230,7 +230,7 @@ |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if ( false !== $this->parent_li ) { |
| 233 | - ++$this->current_field_count; |
|
| 233 | + ++ $this->current_field_count; |
|
| 234 | 234 | $this->current_list_size += $this->active_field_size; |
| 235 | 235 | |
| 236 | 236 | if ( 12 === $this->current_list_size ) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function read_until( $char ) { |
| 53 | 53 | $value = ''; |
| 54 | 54 | |
| 55 | - while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) { |
|
| 55 | + while ( $this->pos <= $this->max && ( $one = $this->string[$this->pos ++] ) !== $char ) { |
|
| 56 | 56 | $value .= $one; |
| 57 | 57 | } |
| 58 | 58 | return $value; |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | public function read( $count ) { |
| 71 | 71 | $value = ''; |
| 72 | 72 | |
| 73 | - while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[ $this->pos ] ) || '0' === $one ) ) { |
|
| 73 | + while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[$this->pos] ) || '0' === $one ) ) { |
|
| 74 | 74 | $value .= $one; |
| 75 | 75 | $this->pos += 1; |
| 76 | - --$count; |
|
| 76 | + -- $count; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | if ( $intent_is_processing ) { |
| 63 | 63 | // Append an additional processing message to the end of the success message. |
| 64 | - $filter = function ( $message ) { |
|
| 64 | + $filter = function( $message ) { |
|
| 65 | 65 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
| 66 | 66 | $message .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>'; |
| 67 | 67 | return $message; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 172 | 172 | $atts['entry_id'] = $atts['entry']->id; |
| 173 | 173 | $opt = 'success_action'; |
| 174 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 174 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 175 | 175 | |
| 176 | 176 | $actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' ); |
| 177 | 177 | |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public static function get_payment_intents( $name ) { |
| 271 | 271 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 272 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 272 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 273 | 273 | return array(); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 276 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 277 | 277 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 278 | 278 | return $intents; |
| 279 | 279 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | self::format_form_data( $form ); |
| 302 | 302 | |
| 303 | 303 | $form_id = absint( $form['form_id'] ); |
| 304 | - $intents = $form[ 'frmintent' . $form_id ] ?? array(); |
|
| 304 | + $intents = $form['frmintent' . $form_id] ?? array(); |
|
| 305 | 305 | |
| 306 | 306 | if ( empty( $intents ) ) { |
| 307 | 307 | wp_die(); |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | $intents = array( $intents ); |
| 312 | 312 | } else { |
| 313 | 313 | foreach ( $intents as $k => $intent ) { |
| 314 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 315 | - $intents[ $k ] = $intent[ $k ]; |
|
| 314 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 315 | + $intents[$k] = $intent[$k]; |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | if ( $saved->metadata->action != $action->ID ) { |
| 375 | 375 | continue; |
| 376 | 376 | } |
| 377 | - $intents[ $k ] = array( |
|
| 377 | + $intents[$k] = array( |
|
| 378 | 378 | 'id' => $intent, |
| 379 | 379 | 'action' => $action->ID, |
| 380 | 380 | ); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | if ( $k === 'item_meta' ) { |
| 422 | 422 | foreach ( $v as $f => $value ) { |
| 423 | 423 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 424 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 424 | + $entry->metas[absint( $f )] = $value; |
|
| 425 | 425 | } |
| 426 | 426 | } else { |
| 427 | 427 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -447,14 +447,14 @@ discard block |
||
| 447 | 447 | foreach ( $form as $input ) { |
| 448 | 448 | $key = $input['name']; |
| 449 | 449 | |
| 450 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 451 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 452 | - $formatted[ $key ][] = $input['value']; |
|
| 450 | + if ( isset( $formatted[$key] ) ) { |
|
| 451 | + if ( is_array( $formatted[$key] ) ) { |
|
| 452 | + $formatted[$key][] = $input['value']; |
|
| 453 | 453 | } else { |
| 454 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 454 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 455 | 455 | } |
| 456 | 456 | } else { |
| 457 | - $formatted[ $key ] = $input['value']; |
|
| 457 | + $formatted[$key] = $input['value']; |
|
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | |
| 707 | 707 | foreach ( $actions as $k => $action ) { |
| 708 | 708 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 709 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 709 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | |
@@ -295,14 +295,14 @@ |
||
| 295 | 295 | $defaults = $this->get_defaults(); |
| 296 | 296 | |
| 297 | 297 | foreach ( $defaults as $val => $default ) { |
| 298 | - if ( isset( $values[ $val ] ) ) { |
|
| 298 | + if ( isset( $values[$val] ) ) { |
|
| 299 | 299 | if ( $default['sanitize'] === 'float' ) { |
| 300 | - $new_values[ $val ] = (float) $values[ $val ]; |
|
| 300 | + $new_values[$val] = (float) $values[$val]; |
|
| 301 | 301 | } elseif ( ! empty( $default['sanitize'] ) ) { |
| 302 | - $new_values[ $val ] = call_user_func( $default['sanitize'], $values[ $val ] ); |
|
| 302 | + $new_values[$val] = call_user_func( $default['sanitize'], $values[$val] ); |
|
| 303 | 303 | } |
| 304 | 304 | } elseif ( $values['action'] === 'create' ) { |
| 305 | - $new_values[ $val ] = $default['default']; |
|
| 305 | + $new_values[$val] = $default['default']; |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) ); |
| 79 | 79 | |
| 80 | 80 | if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) { |
| 81 | - unset( $payment_actions[ $k ] ); |
|
| 81 | + unset( $payment_actions[$k] ); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | return $payment_actions; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'run_triggers' => false, |
| 118 | 118 | 'show_errors' => true, |
| 119 | 119 | ); |
| 120 | - $atts = compact( 'action', 'entry', 'form' ); |
|
| 120 | + $atts = compact( 'action', 'entry', 'form' ); |
|
| 121 | 121 | |
| 122 | 122 | $amount = self::prepare_amount( $action->post_content['amount'], $atts ); |
| 123 | 123 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | // Gateway is a radio button but it should always be an array in the database for |
| 319 | 319 | // compatibility with the payments submodule where it is a checkbox. |
| 320 | - $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
| 320 | + $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
| 321 | 321 | |
| 322 | 322 | $is_stripe = in_array( 'stripe', $settings['gateway'], true ); |
| 323 | 323 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | |
| 524 | 524 | foreach ( $settings as $k => $s ) { |
| 525 | 525 | if ( is_string( $s ) ) { |
| 526 | - $settings[ $k ] = str_replace( $disallowed, '', $s ); |
|
| 526 | + $settings[$k] = str_replace( $disallowed, '', $s ); |
|
| 527 | 527 | } |
| 528 | 528 | } |
| 529 | 529 | |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | * @return array |
| 653 | 653 | */ |
| 654 | 654 | public static function remove_cc_validation( $errors, $field, $values ) { |
| 655 | - $has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 655 | + $has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 656 | 656 | |
| 657 | 657 | if ( ! $has_processed ) { |
| 658 | 658 | return $errors; |
@@ -660,12 +660,12 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | $field_id = $field->temp_id ?? $field->id; |
| 662 | 662 | |
| 663 | - if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) { |
|
| 664 | - unset( $errors[ 'field' . $field_id . '-cc' ] ); |
|
| 663 | + if ( isset( $errors['field' . $field_id . '-cc'] ) ) { |
|
| 664 | + unset( $errors['field' . $field_id . '-cc'] ); |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | - if ( isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 668 | - unset( $errors[ 'field' . $field_id ] ); |
|
| 667 | + if ( isset( $errors['field' . $field_id] ) ) { |
|
| 668 | + unset( $errors['field' . $field_id] ); |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | return $errors; |