Completed
Push — master ( 2f3eab...3ff0dd )
by Stiofan
13s
created
includes/wpinv-invoice-functions.php 1 patch
Braces   +21 added lines, -16 removed lines patch added patch discarded remove patch
@@ -83,8 +83,9 @@  discard block
 block discarded – undo
83 83
 
84 84
     $invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = %s LIMIT 1", $key ) );
85 85
 
86
-    if ( $invoice_id != NULL )
87
-        return $invoice_id;
86
+    if ( $invoice_id != NULL ) {
87
+            return $invoice_id;
88
+    }
88 89
 
89 90
     return 0;
90 91
 }
@@ -759,8 +760,9 @@  discard block
 block discarded – undo
759 760
 function wpinv_checkout_validate_cc_zip( $zip = 0, $country_code = '' ) {
760 761
     $ret = false;
761 762
 
762
-    if ( empty( $zip ) || empty( $country_code ) )
763
-        return $ret;
763
+    if ( empty( $zip ) || empty( $country_code ) ) {
764
+            return $ret;
765
+    }
764 766
 
765 767
     $country_code = strtoupper( $country_code );
766 768
 
@@ -922,8 +924,9 @@  discard block
 block discarded – undo
922 924
         "ZM" => "\d{5}"
923 925
     );
924 926
 
925
-    if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) )
926
-        $ret = true;
927
+    if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) ) {
928
+            $ret = true;
929
+    }
927 930
 
928 931
     return apply_filters( 'wpinv_is_zip_valid', $ret, $zip, $country_code );
929 932
 }
@@ -1249,14 +1252,15 @@  discard block
 block discarded – undo
1249 1252
 
1250 1253
     $wpinv_cpt = $_REQUEST[ 'wpinv-cpt' ];
1251 1254
 
1252
-    if ( get_query_var( 'paged' ) && 'wpi_invoice' == $wpinv_cpt )
1253
-        $args['page'] = get_query_var('paged');
1254
-    else if ( get_query_var( 'page' )  && 'wpi_invoice' == $wpinv_cpt )
1255
-        $args['page'] = get_query_var( 'page' );
1256
-    else if ( !empty( $args[ 'page' ] ) )
1257
-        $args['page'] = $args[ 'page' ];
1258
-    else
1259
-        $args['page'] = 1;
1255
+    if ( get_query_var( 'paged' ) && 'wpi_invoice' == $wpinv_cpt ) {
1256
+            $args['page'] = get_query_var('paged');
1257
+    } else if ( get_query_var( 'page' )  && 'wpi_invoice' == $wpinv_cpt ) {
1258
+            $args['page'] = get_query_var( 'page' );
1259
+    } else if ( !empty( $args[ 'page' ] ) ) {
1260
+            $args['page'] = $args[ 'page' ];
1261
+    } else {
1262
+            $args['page'] = 1;
1263
+    }
1260 1264
 
1261 1265
     /**
1262 1266
      * Generate WP_Query args. This logic will change if orders are moved to
@@ -1391,8 +1395,9 @@  discard block
 block discarded – undo
1391 1395
 
1392 1396
 	$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_key' AND meta_value = %s LIMIT 1", $key ) );
1393 1397
 
1394
-	if ( $invoice_id != NULL )
1395
-		return $invoice_id;
1398
+	if ( $invoice_id != NULL ) {
1399
+			return $invoice_id;
1400
+	}
1396 1401
 
1397 1402
 	return 0;
1398 1403
 }
Please login to merge, or discard this patch.