Completed
Push — master ( 2f3eab...3ff0dd )
by Stiofan
13s
created
templates/wpinv-invoice-history.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) {
3
-	exit;
3
+    exit;
4 4
 }
5 5
 
6 6
 if ( !( $user_id = get_current_user_id() ) ) {
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 		<tbody>
32 32
 			<?php foreach ( $user_invoices->invoices as $invoice ) {
33
-				?>
33
+                ?>
34 34
 				<tr class="wpinv-item wpinv-item-<?php echo $invoice_status = $invoice->get_status(); ?>">
35 35
 					<?php foreach ( wpinv_get_user_invoices_columns() as $column_id => $column_name ) : ?>
36 36
 						<td class="<?php echo esc_attr( $column_id ); ?> <?php echo (!empty($column_name['class']) ? $column_name['class'] : '');?>" data-title="<?php echo esc_attr( $column_name['title'] ); ?>">
@@ -53,31 +53,31 @@  discard block
 block discarded – undo
53 53
 
54 54
 							<?php elseif ( 'invoice-actions' === $column_id ) : ?>
55 55
 								<?php
56
-									$actions = array(
57
-										'pay'    => array(
58
-											'url'  => $invoice->get_checkout_payment_url(),
59
-											'name' => __( 'Pay Now', 'invoicing' ),
56
+                                    $actions = array(
57
+                                        'pay'    => array(
58
+                                            'url'  => $invoice->get_checkout_payment_url(),
59
+                                            'name' => __( 'Pay Now', 'invoicing' ),
60 60
                                             'class' => 'btn-success'
61
-										),
61
+                                        ),
62 62
                                         'print'   => array(
63
-											'url'  => $invoice->get_view_url(),
64
-											'name' => __( 'Print', 'invoicing' ),
63
+                                            'url'  => $invoice->get_view_url(),
64
+                                            'name' => __( 'Print', 'invoicing' ),
65 65
                                             'class' => 'btn-primary',
66 66
                                             'attrs' => 'target="_blank"'
67
-										)
68
-									);
67
+                                        )
68
+                                    );
69 69
 
70
-									if ( ! $invoice->needs_payment() ) {
71
-										unset( $actions['pay'] );
72
-									}
70
+                                    if ( ! $invoice->needs_payment() ) {
71
+                                        unset( $actions['pay'] );
72
+                                    }
73 73
 
74
-									if ( $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice ) ) {
75
-										foreach ( $actions as $key => $action ) {
76
-											$class = !empty($action['class']) ? sanitize_html_class($action['class']) : '';
74
+                                    if ( $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice ) ) {
75
+                                        foreach ( $actions as $key => $action ) {
76
+                                            $class = !empty($action['class']) ? sanitize_html_class($action['class']) : '';
77 77
                                             echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm ' . $class . ' ' . sanitize_html_class( $key ) . '" ' . ( !empty($action['attrs']) ? $action['attrs'] : '' ) . '>' . $action['name'] . '</a>';
78
-										}
79
-									}
80
-								?>
78
+                                        }
79
+                                    }
80
+                                ?>
81 81
 							<?php endif; ?>
82 82
 						</td>
83 83
 					<?php endforeach; ?>
@@ -91,17 +91,17 @@  discard block
 block discarded – undo
91 91
 	<?php if ( 1 < $user_invoices->max_num_pages ) : ?>
92 92
 		<div class="invoicing-Pagination">
93 93
 			<?php
94
-			$big = 999999;
95
-			echo paginate_links( array(
96
-				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
97
-				'format'  => '?paged=%#%',
98
-				'current' => max( 1, get_query_var( 'paged' ) ),
99
-				'total'   => $user_invoices->max_num_pages,
94
+            $big = 999999;
95
+            echo paginate_links( array(
96
+                'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
97
+                'format'  => '?paged=%#%',
98
+                'current' => max( 1, get_query_var( 'paged' ) ),
99
+                'total'   => $user_invoices->max_num_pages,
100 100
                 'add_args' => array(
101 101
                     'wpinv-cpt' => 'wpi_invoice',
102 102
                 )
103
-			) );
104
-			?>
103
+            ) );
104
+            ?>
105 105
 		</div>
106 106
 	<?php endif; ?>
107 107
 
Please login to merge, or discard this patch.
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.