Passed
Push — master ( cc4fca...f27c0a )
by Stiofan
05:46
created
templates/payment-forms/elements/time.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a time input in payment form
4 4
  *
@@ -7,27 +7,27 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+    $label = empty( $label ) ? '' : wp_kses_post( $label );
13
+    $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 
15
-if ( ! empty( $required ) ) {
16
-    $label .= "<span class='text-danger'> *</span>";
15
+    if ( ! empty( $required ) ) {
16
+        $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19
-aui()->input(
20
-    array(
21
-        'name'        => esc_attr( $id ),
22
-        'id'          => esc_attr( $element_id ),
23
-        'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
-        'required'    => ! empty( $required ),
25
-        'label'       => $label,
26
-        'label_type'  => 'vertical',
27
-        'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
-        'type'        => 'time',
29
-        'class'       => $label_class,
30
-        'value'       => $query_value,
31
-    ),
32
-    true
33
-);
19
+    aui()->input(
20
+        array(
21
+            'name'        => esc_attr( $id ),
22
+            'id'          => esc_attr( $element_id ),
23
+            'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
+            'required'    => ! empty( $required ),
25
+            'label'       => $label,
26
+            'label_type'  => 'vertical',
27
+            'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
+            'type'        => 'time',
29
+            'class'       => $label_class,
30
+            'value'       => $query_value,
31
+        ),
32
+        true
33
+    );
Please login to merge, or discard this patch.
templates/payment-forms/elements/text.php 1 patch
Switch Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a text input in payment form
4 4
  *
@@ -7,26 +7,26 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+    $label = empty( $label ) ? '' : wp_kses_post( $label );
13
+    $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 
15
-if ( ! empty( $required ) ) {
16
-    $label .= "<span class='text-danger'> *</span>";
15
+    if ( ! empty( $required ) ) {
16
+        $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19
-aui()->input(
20
-    array(
21
-        'name'        => esc_attr( $id ),
22
-        'id'          => esc_attr( $element_id ),
23
-        'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
-        'required'    => ! empty( $required ),
25
-        'label'       => $label,
26
-        'label_type'  => 'vertical',
27
-        'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
-        'class'       => esc_attr( $label_class ),
29
-        'value'       => $query_value,
30
-    ),
31
-    true
32
-);
19
+    aui()->input(
20
+        array(
21
+            'name'        => esc_attr( $id ),
22
+            'id'          => esc_attr( $element_id ),
23
+            'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
+            'required'    => ! empty( $required ),
25
+            'label'       => $label,
26
+            'label_type'  => 'vertical',
27
+            'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
+            'class'       => esc_attr( $label_class ),
29
+            'value'       => $query_value,
30
+        ),
31
+        true
32
+    );
Please login to merge, or discard this patch.
templates/payment-forms/elements/address.php 1 patch
Switch Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays an address in payment form
4 4
  *
@@ -7,33 +7,33 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( empty( $fields ) ) {
13
-	return;
12
+    if ( empty( $fields ) ) {
13
+	    return;
14 14
 }
15 15
 
16
-// A prefix for all ids (so that a form can be included in the same page multiple times).
17
-$uniqid = uniqid( '_' );
16
+    // A prefix for all ids (so that a form can be included in the same page multiple times).
17
+    $uniqid = uniqid( '_' );
18 18
 
19
-// Prepare the user's country.
20
-if ( ! empty( $form->invoice ) ) {
21
-	$country = $form->invoice->get_country();
19
+    // Prepare the user's country.
20
+    if ( ! empty( $form->invoice ) ) {
21
+	    $country = $form->invoice->get_country();
22 22
 }
23 23
 
24
-if ( empty( $country ) ) {
25
-	$country = empty( $country ) ? getpaid_get_ip_country() : $country;
26
-	$country = empty( $country ) ? wpinv_get_default_country() : $country;
24
+    if ( empty( $country ) ) {
25
+	    $country = empty( $country ) ? getpaid_get_ip_country() : $country;
26
+	    $country = empty( $country ) ? wpinv_get_default_country() : $country;
27 27
 }
28 28
 
29
-// A prefix for all ids (so that a form can be included in the same page multiple times).
30
-$uniqid = uniqid( '_' );
29
+    // A prefix for all ids (so that a form can be included in the same page multiple times).
30
+    $uniqid = uniqid( '_' );
31 31
 
32
-$address_type = empty( $address_type ) ? 'billing' : $address_type;
32
+    $address_type = empty( $address_type ) ? 'billing' : $address_type;
33 33
 
34
-?>
35
-
36
-<?php if ( 'both' === $address_type ) : ?>
34
+    ?>
35
+    
36
+    <?php if ( 'both' === $address_type ) : ?>
37 37
 
38 38
 	<!-- Start Billing/Shipping Address Title -->
39 39
 	<h4 class="mb-3 getpaid-shipping-billing-address-title">
@@ -48,43 +48,43 @@  discard block
 block discarded – undo
48 48
 	<!-- End Billing Address Title -->
49 49
 
50 50
 <?php endif; ?>
51
+    
51 52
 
52
-
53
-<?php if ( 'both' === $address_type || 'billing' === $address_type ) : ?>
53
+    <?php if ( 'both' === $address_type || 'billing' === $address_type ) : ?>
54 54
 
55 55
 	<!-- Start Billing Address -->
56 56
 	<div class="getpaid-billing-address-wrapper">
57 57
 		<?php
58
-			$field_type = 'billing';
59
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
60
-			do_action( 'getpaid_after_payment_form_billing_fields', $form );
61
-		?>
58
+			    $field_type = 'billing';
59
+			    include plugin_dir_path( __FILE__ ) . 'address-fields.php';
60
+			    do_action( 'getpaid_after_payment_form_billing_fields', $form );
61
+		    ?>
62 62
 	</div>
63 63
 	<!-- End Billing Address -->
64 64
 
65 65
 <?php endif; ?>
66
+    
66 67
 
67
-
68
-<?php if ( 'both' === $address_type ) : ?>
69
-
68
+    <?php if ( 'both' === $address_type ) : ?>
69
+    
70 70
 
71 71
 	<?php
72 72
 
73
-		aui()->input(
74
-		    array(
75
-			    'type'     => 'checkbox',
76
-			    'name'     => 'same-shipping-address',
77
-			    'id'       => "shipping-toggle$uniqid",
78
-			    'required' => false,
79
-			    'label'    => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ),
80
-			    'value'    => 1,
81
-			    'checked'  => true,
82
-				'class'    => 'w-auto',
83
-		    ),
84
-			true
85
-		);
73
+		    aui()->input(
74
+		        array(
75
+			        'type'     => 'checkbox',
76
+			        'name'     => 'same-shipping-address',
77
+			        'id'       => "shipping-toggle$uniqid",
78
+			        'required' => false,
79
+			        'label'    => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ),
80
+			        'value'    => 1,
81
+			        'checked'  => true,
82
+				    'class'    => 'w-auto',
83
+		        ),
84
+			    true
85
+		    );
86 86
 
87
-	?>
87
+	    ?>
88 88
 
89 89
 
90 90
 	<!-- Start Shipping Address Title -->
@@ -95,18 +95,18 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
 <?php endif; ?>
98
-
98
+    
99 99
 
100 100
 	
101
-<?php if ( 'both' === $address_type || 'shipping' === $address_type ) : ?>
101
+    <?php if ( 'both' === $address_type || 'shipping' === $address_type ) : ?>
102 102
 
103 103
 	<!-- Start Shipping Address -->
104 104
 	<div class="getpaid-shipping-address-wrapper">
105 105
 		<?php
106
-			$field_type = 'shipping';
107
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
108
-			do_action( 'getpaid_after_payment_form_shipping_fields', $form );
109
-		?>
106
+			    $field_type = 'shipping';
107
+			    include plugin_dir_path( __FILE__ ) . 'address-fields.php';
108
+			    do_action( 'getpaid_after_payment_form_shipping_fields', $form );
109
+		    ?>
110 110
 	</div>
111 111
 	<!-- End Shipping Address -->
112 112
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/radio.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a radio in payment form
4 4
  *
@@ -7,28 +7,28 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+    $label = empty( $label ) ? '' : wp_kses_post( $label );
13
+    $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 
15
-if ( ! empty( $required ) ) {
16
-    $label .= "<span class='text-danger'> *</span>";
15
+    if ( ! empty( $required ) ) {
16
+        $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19
-aui()->radio(
20
-    array(
21
-        'name'       => esc_attr( $id ),
22
-        'id'         => esc_attr( $element_id ),
23
-        'required'   => ! empty( $required ),
24
-        'label'      => $label,
25
-        'label_type' => 'vertical',
26
-        'class'      => 'w-auto',
27
-        'inline'     => false,
28
-        'options'    => empty( $options ) ? array() : array_combine( $options, $options ),
29
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
30
-        'class'      => $label_class,
31
-        'value'      => $query_value,
32
-    ),
33
-    true
34
-);
19
+    aui()->radio(
20
+        array(
21
+            'name'       => esc_attr( $id ),
22
+            'id'         => esc_attr( $element_id ),
23
+            'required'   => ! empty( $required ),
24
+            'label'      => $label,
25
+            'label_type' => 'vertical',
26
+            'class'      => 'w-auto',
27
+            'inline'     => false,
28
+            'options'    => empty( $options ) ? array() : array_combine( $options, $options ),
29
+            'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
30
+            'class'      => $label_class,
31
+            'value'      => $query_value,
32
+        ),
33
+        true
34
+    );
Please login to merge, or discard this patch.
templates/payment-forms/elements/items.php 1 patch
Switch Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays item totals in payment form
4 4
  *
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( empty( $form->get_items() ) ) {
13
-    return;
12
+    if ( empty( $form->get_items() ) ) {
13
+        return;
14 14
 }
15 15
 
16
-if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) {
17
-    $items_type = 'checkbox';
16
+    if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) {
17
+        $items_type = 'checkbox';
18 18
 }
19 19
 
20
-if ( empty( $items_type ) ) {
21
-    $items_type = 'total';
20
+    if ( empty( $items_type ) ) {
21
+        $items_type = 'total';
22 22
 }
23 23
 
24
-do_action( 'getpaid_before_payment_form_items', $form );
24
+    do_action( 'getpaid_before_payment_form_items', $form );
25 25
 
26 26
 switch ( $items_type ) {
27 27
     case 'radio':
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
         break;
36 36
 }
37 37
 
38
-do_action( 'getpaid_before_payment_form_cart', $form );
38
+    do_action( 'getpaid_before_payment_form_cart', $form );
39 39
 
40
-// Display the cart totals.
41
-if ( ! empty( $hide_cart ) ) {
42
-    echo '<div class="d-none">';
40
+    // Display the cart totals.
41
+    if ( ! empty( $hide_cart ) ) {
42
+        echo '<div class="d-none">';
43 43
 }
44 44
 
45
-// Display the cart totals.
46
-wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) );
45
+    // Display the cart totals.
46
+    wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) );
47 47
 
48
-if ( ! empty( $hide_cart ) ) {
49
-    echo '</div>';
48
+    if ( ! empty( $hide_cart ) ) {
49
+        echo '</div>';
50 50
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/index.php 1 patch
Switch Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 # Silence is golden.
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
templates/payment-forms/elements/paragraph.php 1 patch
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a paragraph in payment form
4 4
  *
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( ! empty( $element['text'] ) ) {
13
-    echo '<p>' . wp_kses_post( trim( $element['text'] ) ) . '</p>';
12
+    if ( ! empty( $element['text'] ) ) {
13
+        echo '<p>' . wp_kses_post( trim( $element['text'] ) ) . '</p>';
14 14
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/gateway_select.php 1 patch
Switch Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a gateway select input in payment form
4 4
  *
@@ -7,29 +7,29 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-// The payment methods select title.
13
-if ( empty( $text ) ) {
14
-    $text = __( 'Select Payment Method', 'invoicing' );
12
+    // The payment methods select title.
13
+    if ( empty( $text ) ) {
14
+        $text = __( 'Select Payment Method', 'invoicing' );
15 15
 }
16 16
 
17
-// An array of active payment methods.
18
-$gateways = wpinv_get_enabled_payment_gateways( true );
17
+    // An array of active payment methods.
18
+    $gateways = wpinv_get_enabled_payment_gateways( true );
19 19
 
20
-// The current invoice id.
21
-$invoice_id     = 0;
22
-$chosen_gateway = wpinv_get_default_gateway();
20
+    // The current invoice id.
21
+    $invoice_id     = 0;
22
+    $chosen_gateway = wpinv_get_default_gateway();
23 23
 
24
-if ( ! empty( $form->invoice ) ) {
25
-    $invoice_id = $form->invoice->get_id();
26
-    $chosen_gateway = $form->invoice->get_gateway();
24
+    if ( ! empty( $form->invoice ) ) {
25
+        $invoice_id = $form->invoice->get_id();
26
+        $chosen_gateway = $form->invoice->get_gateway();
27 27
 }
28 28
 
29
-?>
30
-
29
+    ?>
30
+    
31 31
     <?php do_action( 'getpaid_before_payment_form_gateway_select', $form ); ?>
32
-    <div class="mt-4 mb-4 getpaid-gateways">
32
+        <div class="mt-4 mb-4 getpaid-gateways">
33 33
 
34 34
         <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
35 35
 
@@ -61,20 +61,20 @@  discard block
 block discarded – undo
61 61
                 <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo esc_attr( $gateway ); ?>" style="display: none;">
62 62
                     <?php
63 63
 
64
-                        $description = wpinv_get_gateway_description( $gateway );
64
+                            $description = wpinv_get_gateway_description( $gateway );
65 65
 
66
-                        if ( wpinv_is_test_mode( $gateway ) ) {
67
-						$sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) );
68
-						$description = "$description $sandbox_notice";
69
-                        }
66
+                            if ( wpinv_is_test_mode( $gateway ) ) {
67
+						    $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) );
68
+						    $description = "$description $sandbox_notice";
69
+                            }
70 70
 
71
-                        echo wp_kses_post( wpautop( $description ) );
71
+                            echo wp_kses_post( wpautop( $description ) );
72 72
 
73
-                        do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id );
74
-                        do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form );
73
+                            do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id );
74
+                            do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form );
75 75
 
76
-                    ?>
77
-                </div>
76
+                        ?>
77
+                    </div>
78 78
 
79 79
             <?php endforeach; ?>
80 80
 
@@ -82,51 +82,51 @@  discard block
 block discarded – undo
82 82
 
83 83
         <div class="getpaid-no-recurring-gateways d-none">
84 84
             <?php
85
-                aui()->alert(
86
-                    array(
87
-                        'content' => __( 'None of the available payment gateways support purchasing recurring items.', 'invoicing' ),
88
-                        'type'    => 'danger',
89
-                    ),
90
-                    true
91
-                );
92
-            ?>
85
+                    aui()->alert(
86
+                        array(
87
+                            'content' => __( 'None of the available payment gateways support purchasing recurring items.', 'invoicing' ),
88
+                            'type'    => 'danger',
89
+                        ),
90
+                        true
91
+                    );
92
+                ?>
93 93
         </div>
94 94
 
95 95
         <div class="getpaid-no-subscription-group-gateways d-none">
96 96
             <?php
97
-                aui()->alert(
98
-                    array(
99
-                        'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ),
100
-                        'type'    => 'danger',
101
-                    ),
102
-                    true
103
-                );
104
-            ?>
97
+                    aui()->alert(
98
+                        array(
99
+                            'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ),
100
+                            'type'    => 'danger',
101
+                        ),
102
+                        true
103
+                    );
104
+                ?>
105 105
         </div>
106 106
 
107 107
         <div class="getpaid-no-multiple-subscription-group-gateways d-none">
108 108
             <?php
109
-                aui()->alert(
110
-                    array(
111
-                        'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ),
112
-                        'type'    => 'danger',
113
-                    ),
114
-                    true
115
-                );
116
-            ?>
109
+                    aui()->alert(
110
+                        array(
111
+                            'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ),
112
+                            'type'    => 'danger',
113
+                        ),
114
+                        true
115
+                    );
116
+                ?>
117 117
         </div>
118 118
 
119 119
         <div class="getpaid-no-active-gateways d-none">
120 120
             <?php
121
-                aui()->alert(
122
-                    array(
123
-                        'content' => __( 'There is no active payment gateway available to process your request.', 'invoicing' ),
124
-                        'type'    => 'danger',
125
-                    ),
126
-                    true
127
-                );
128
-            ?>
129
-        </div>
121
+                    aui()->alert(
122
+                        array(
123
+                            'content' => __( 'There is no active payment gateway available to process your request.', 'invoicing' ),
124
+                            'type'    => 'danger',
125
+                        ),
126
+                        true
127
+                    );
128
+                ?>
129
+            </div>
130 130
 
131 131
         <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
132 132
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/price_select.php 1 patch
Switch Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a radio in payment form
4 4
  *
@@ -7,115 +7,115 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-// Ensure that we have options.
13
-if ( empty( $options ) ) {
14
-    return;
12
+    // Ensure that we have options.
13
+    if ( empty( $options ) ) {
14
+        return;
15 15
 }
16 16
 
17
-// Prepare price options.
18
-$options = getpaid_convert_price_string_to_options( $options );
19
-$keys    = array_keys( $options );
20
-$value   = empty( $options ) ? '' : $keys[0];
17
+    // Prepare price options.
18
+    $options = getpaid_convert_price_string_to_options( $options );
19
+    $keys    = array_keys( $options );
20
+    $value   = empty( $options ) ? '' : $keys[0];
21 21
 
22
-if ( ! empty( $query_value ) ) {
23
-    $value = $query_value;
22
+    if ( ! empty( $query_value ) ) {
23
+        $value = $query_value;
24 24
 }
25 25
 
26
-$select_type = empty( $select_type ) ? 'select' : $select_type;
27
-
28
-// Item select;
29
-if ( $select_type == 'select' ) {
30
-    aui()->select(
31
-        array(
32
-            'name'        => $id,
33
-            'id'          => esc_attr( $element_id ),
34
-            'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
35
-            'value'       => $value,
36
-            'label'       => empty( $label ) ? '' : esc_html( $label ),
37
-            'label_type'  => 'vertical',
38
-            'class'       => 'getpaid-price-select-dropdown getpaid-refresh-on-change',
39
-            'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
40
-            'options'     => $options,
41
-        ),
42
-        true
43
-    );
44
-    return;
26
+    $select_type = empty( $select_type ) ? 'select' : $select_type;
27
+
28
+    // Item select;
29
+    if ( $select_type == 'select' ) {
30
+        aui()->select(
31
+            array(
32
+                'name'        => $id,
33
+                'id'          => esc_attr( $element_id ),
34
+                'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
35
+                'value'       => $value,
36
+                'label'       => empty( $label ) ? '' : esc_html( $label ),
37
+                'label_type'  => 'vertical',
38
+                'class'       => 'getpaid-price-select-dropdown getpaid-refresh-on-change',
39
+                'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
40
+                'options'     => $options,
41
+            ),
42
+            true
43
+        );
44
+        return;
45 45
 }
46 46
 
47
-// Item radios;
48
-if ( $select_type == 'radios' ) {
49
-    aui()->radio(
50
-        array(
51
-            'name'       => esc_attr( $id ),
52
-            'id'         => esc_attr( $id ) . uniqid( '_' ),
53
-            'label'      => empty( $label ) ? '' : esc_html( $label ),
54
-            'label_type' => 'vertical',
55
-            'class'      => 'getpaid-price-select-radio getpaid-refresh-on-change w-100',
56
-            'value'      => $value,
57
-            'inline'     => false,
58
-            'options'    => $options,
59
-            'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
60
-        ),
61
-        true
62
-    );
63
-    return;
47
+    // Item radios;
48
+    if ( $select_type == 'radios' ) {
49
+        aui()->radio(
50
+            array(
51
+                'name'       => esc_attr( $id ),
52
+                'id'         => esc_attr( $id ) . uniqid( '_' ),
53
+                'label'      => empty( $label ) ? '' : esc_html( $label ),
54
+                'label_type' => 'vertical',
55
+                'class'      => 'getpaid-price-select-radio getpaid-refresh-on-change w-100',
56
+                'value'      => $value,
57
+                'inline'     => false,
58
+                'options'    => $options,
59
+                'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
60
+            ),
61
+            true
62
+        );
63
+        return;
64 64
 }
65 65
 
66 66
 
67
-// Display the label.
68
-if ( ! empty( $label ) ) {
69
-    echo '<label class="form-label">' . esc_html( $label ) . '</label>';
67
+    // Display the label.
68
+    if ( ! empty( $label ) ) {
69
+        echo '<label class="form-label">' . esc_html( $label ) . '</label>';
70 70
 }
71 71
 
72
-// Item buttons;
73
-if ( $select_type == 'buttons' || $select_type == 'circles' ) {
72
+    // Item buttons;
73
+    if ( $select_type == 'buttons' || $select_type == 'circles' ) {
74 74
 
75
-    $class = 'getpaid-price-buttons';
75
+        $class = 'getpaid-price-buttons';
76 76
 
77
-    if ( $select_type == 'circles' ) {
78
-        $class .= ' getpaid-price-circles';
79
-    }
80
-    echo "<div class='" . esc_attr( $class ) . "'>";
77
+        if ( $select_type == 'circles' ) {
78
+            $class .= ' getpaid-price-circles';
79
+        }
80
+        echo "<div class='" . esc_attr( $class ) . "'>";
81 81
 
82
-    foreach ( $options as $price => $label ) {
83
-        $_id = $id . uniqid( '_' );
82
+        foreach ( $options as $price => $label ) {
83
+            $_id = $id . uniqid( '_' );
84 84
 
85
-        $class = 'rounded';
85
+            $class = 'rounded';
86 86
 
87
-        if ( $select_type == 'circles' ) {
88
-            $class = '';
89
-        }
90
-        echo "
87
+            if ( $select_type == 'circles' ) {
88
+                $class = '';
89
+            }
90
+            echo "
91 91
             <span class='d-inline-block'>
92 92
                 <input type='radio' class='getpaid-price-select-button getpaid-refresh-on-change w-auto' id='" . esc_attr( $_id ) . "' value='" . esc_attr( $price ) . "' name='" . esc_attr( $id ) . "' " . checked( $price, $value, false ) . " />
93 93
                 <label for='" . esc_attr( $_id ) . "' class='" . esc_attr( $class ) . "'><span>" . esc_html( $label ) . '</span></label>
94 94
             </span>
95 95
             ';
96
-    }
96
+        }
97 97
 
98
-    echo '</div>';
98
+        echo '</div>';
99 99
 
100 100
 }
101 101
 
102
-// Item checkboxes;
103
-if ( $select_type == 'checkboxes' ) {
104
-    echo '<div class="form-group mb-3">';
102
+    // Item checkboxes;
103
+    if ( $select_type == 'checkboxes' ) {
104
+        echo '<div class="form-group mb-3">';
105 105
 
106
-    foreach ( $options as $price => $label ) {
107
-        echo "
106
+        foreach ( $options as $price => $label ) {
107
+            echo "
108 108
             <label class='form-label d-block'>
109 109
                 <input type='checkbox' class='getpaid-price-select-checkbox getpaid-refresh-on-change w-auto' name='" . esc_attr( $id ) . "[]' value='" . esc_attr( $price ) . "' " . checked( $price, $value, false ) . ' />
110 110
                 <span>' . esc_html( $label ) . '</span>
111 111
             </label>
112 112
             ';
113
-    }
113
+        }
114 114
 
115
-    echo '</div>';
115
+        echo '</div>';
116 116
 
117 117
 }
118 118
 
119
-if ( ! empty( $description ) ) {
120
-    echo "<small class='form-text text-muted'>" . wp_kses_post( $description ) . '</small>';
119
+    if ( ! empty( $description ) ) {
120
+        echo "<small class='form-text text-muted'>" . wp_kses_post( $description ) . '</small>';
121 121
 }
Please login to merge, or discard this patch.