Move variable declaration outside foreach loop

This commit is contained in:
Alfredo Sumaran 2021-05-17 18:26:16 -05:00
parent 79db2d95a0
commit f20e8ab567
1 changed files with 2 additions and 2 deletions

View File

@ -679,14 +679,14 @@ class WC_Checkout {
// phpcs:enable WordPress.Security.NonceVerification.Missing // phpcs:enable WordPress.Security.NonceVerification.Missing
$skipped = array(); $skipped = array();
$form_was_shown = isset( $_POST['woocommerce-process-checkout-nonce'] );
foreach ( $this->get_checkout_fields() as $fieldset_key => $fieldset ) { foreach ( $this->get_checkout_fields() as $fieldset_key => $fieldset ) {
if ( $this->maybe_skip_fieldset( $fieldset_key, $data ) ) { if ( $this->maybe_skip_fieldset( $fieldset_key, $data ) ) {
$skipped[] = $fieldset_key; $skipped[] = $fieldset_key;
continue; continue;
} }
$form_was_shown = isset( $_REQUEST['woocommerce-process-checkout-nonce'] );
foreach ( $fieldset as $key => $field ) { foreach ( $fieldset as $key => $field ) {
$type = sanitize_title( isset( $field['type'] ) ? $field['type'] : 'text' ); $type = sanitize_title( isset( $field['type'] ) ? $field['type'] : 'text' );