@@ -7,24 +7,24 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | $value = ''; |
13 | 13 | |
14 | -if ( is_user_logged_in() ) { |
|
14 | +if (is_user_logged_in()) { |
|
15 | 15 | $user = wp_get_current_user(); |
16 | - $value = sanitize_email( $user->user_email ); |
|
16 | + $value = sanitize_email($user->user_email); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | echo aui()->input( |
20 | 20 | array( |
21 | 21 | 'name' => 'billing_email', |
22 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
23 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
24 | - 'required' => ! empty( $required ), |
|
25 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
22 | + 'id' => esc_attr($id) . uniqid('_'), |
|
23 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
24 | + 'required' => !empty($required), |
|
25 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
26 | 26 | 'label_type' => 'vertical', |
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
27 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
28 | 28 | 'type' => 'email', |
29 | 29 | 'value' => $value, |
30 | 30 | ) |
@@ -7,17 +7,17 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $text ) ) { |
|
13 | - $text = __( 'Your IP address is:', 'invoicing' ); |
|
12 | +if (empty($text)) { |
|
13 | + $text = __('Your IP address is:', 'invoicing'); |
|
14 | 14 | } |
15 | 15 | |
16 | -$ip_address = sanitize_text_field( wpinv_get_ip() ); |
|
17 | -$url = esc_url( getpaid_ip_location_url( $ip_address ) ); |
|
16 | +$ip_address = sanitize_text_field(wpinv_get_ip()); |
|
17 | +$url = esc_url(getpaid_ip_location_url($ip_address)); |
|
18 | 18 | |
19 | 19 | ?> |
20 | 20 | <div class="form-group getpaid-ip-info"> |
21 | - <span><?php echo wp_kses_post( $text ); ?></span> |
|
21 | + <span><?php echo wp_kses_post($text); ?></span> |
|
22 | 22 | <a target='_blank' href='<?php echo $url; ?>'><?php echo $ip_address; ?> <i class='fa fa-external-link-square' aria-hidden='true'></i></a> |
23 | 23 | </div> |
@@ -7,29 +7,29 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Cart table columns. |
13 | 13 | $columns = array( |
14 | - 'name' => __( 'Item', 'invoicing' ), |
|
15 | - 'price' => __( 'Price', 'invoicing' ), |
|
16 | - 'quantity' => __( 'Quantity', 'invoicing' ), |
|
17 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
14 | + 'name' => __('Item', 'invoicing'), |
|
15 | + 'price' => __('Price', 'invoicing'), |
|
16 | + 'quantity' => __('Quantity', 'invoicing'), |
|
17 | + 'subtotal' => __('Subtotal', 'invoicing'), |
|
18 | 18 | ); |
19 | 19 | |
20 | -if ( ! empty( $form->invoice ) ) { |
|
21 | - $columns = getpaid_invoice_item_columns( $form->invoice ); |
|
20 | +if (!empty($form->invoice)) { |
|
21 | + $columns = getpaid_invoice_item_columns($form->invoice); |
|
22 | 22 | } |
23 | 23 | |
24 | -$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form ); |
|
24 | +$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form); |
|
25 | 25 | |
26 | 26 | ?> |
27 | 27 | <div class="getpaid-payment-form-items-cart border"> |
28 | 28 | <div class="getpaid-payment-form-items-cart-header"> |
29 | 29 | <div class="form-row"> |
30 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
31 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>"> |
|
32 | - <?php echo sanitize_text_field( $label ); ?> |
|
30 | + <?php foreach ($columns as $key => $label) : ?> |
|
31 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>"> |
|
32 | + <?php echo sanitize_text_field($label); ?> |
|
33 | 33 | </div> |
34 | 34 | <?php endforeach; ?> |
35 | 35 | </div> |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | <?php |
38 | 38 | |
39 | 39 | // Display the item totals. |
40 | - foreach ( $form->get_items() as $item ) { |
|
41 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
40 | + foreach ($form->get_items() as $item) { |
|
41 | + wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // Display the cart totals. |
45 | - wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
45 | + wpinv_get_template('payment-forms/cart-totals.php', compact('form')); |
|
46 | 46 | |
47 | 47 | ?> |
48 | 48 | </div> |
@@ -7,77 +7,77 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -do_action( 'getpaid_before_payment_form_cart_item', $form, $item ); |
|
12 | +do_action('getpaid_before_payment_form_cart_item', $form, $item); |
|
13 | 13 | |
14 | 14 | $currency = wpinv_get_currency(); |
15 | -if ( ! empty( $form->invoice ) ) { |
|
15 | +if (!empty($form->invoice)) { |
|
16 | 16 | $currency = $form->invoice->get_currency(); |
17 | 17 | } |
18 | 18 | |
19 | 19 | ?> |
20 | -<div class='getpaid-payment-form-items-cart-item getpaid-<?php echo $item->is_required() ? 'required' : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'> |
|
20 | +<div class='getpaid-payment-form-items-cart-item getpaid-<?php echo $item->is_required() ? 'required' : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'> |
|
21 | 21 | <div class="form-row"> |
22 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
23 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>-<?php echo $item->get_id(); ?>"> |
|
22 | + <?php foreach ($columns as $key => $label) : ?> |
|
23 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>-<?php echo $item->get_id(); ?>"> |
|
24 | 24 | <?php |
25 | - do_action( "getpaid_payment_form_cart_item_$key", $form, $item ); |
|
25 | + do_action("getpaid_payment_form_cart_item_$key", $form, $item); |
|
26 | 26 | |
27 | 27 | // Item name. |
28 | - if ( 'name' == $key ) { |
|
29 | - echo sanitize_text_field( $item->get_name() ); |
|
28 | + if ('name' == $key) { |
|
29 | + echo sanitize_text_field($item->get_name()); |
|
30 | 30 | $description = $item->get_description(); |
31 | 31 | |
32 | - if ( ! empty( $description ) ) { |
|
33 | - $description = wp_kses_post( $description ); |
|
32 | + if (!empty($description)) { |
|
33 | + $description = wp_kses_post($description); |
|
34 | 34 | echo "<small class='form-text text-muted pr-2 m-0'>$description</small>"; |
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | 38 | // Item price. |
39 | - if ( 'price' == $key ) { |
|
39 | + if ('price' == $key) { |
|
40 | 40 | |
41 | 41 | // Set the currency position. |
42 | 42 | $position = wpinv_currency_position(); |
43 | 43 | |
44 | - if ( $position == 'left_space' ) { |
|
44 | + if ($position == 'left_space') { |
|
45 | 45 | $position = 'left'; |
46 | 46 | } |
47 | 47 | |
48 | - if ( $position == 'right_space' ) { |
|
48 | + if ($position == 'right_space') { |
|
49 | 49 | $position = 'right'; |
50 | 50 | } |
51 | 51 | |
52 | - if ( $item->user_can_set_their_price() ) { |
|
52 | + if ($item->user_can_set_their_price()) { |
|
53 | 53 | ?> |
54 | 54 | <div class="input-group input-group-sm"> |
55 | - <?php if( 'left' == $position ) : ?> |
|
55 | + <?php if ('left' == $position) : ?> |
|
56 | 56 | <div class="input-group-prepend"> |
57 | - <span class="input-group-text"><?php echo wpinv_currency_symbol( $currency ); ?></span> |
|
57 | + <span class="input-group-text"><?php echo wpinv_currency_symbol($currency); ?></span> |
|
58 | 58 | </div> |
59 | 59 | <?php endif; ?> |
60 | - <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo esc_attr( $item->get_price() ); ?>" placeholder="<?php echo esc_attr( $item->get_minimum_price() ); ?>" class="getpaid-item-price-input"> |
|
60 | + <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo esc_attr($item->get_price()); ?>" placeholder="<?php echo esc_attr($item->get_minimum_price()); ?>" class="getpaid-item-price-input"> |
|
61 | 61 | |
62 | - <?php if( 'left' != $position ) : ?> |
|
62 | + <?php if ('left' != $position) : ?> |
|
63 | 63 | <div class="input-group-append"> |
64 | - <span class="input-group-text"><?php echo wpinv_currency_symbol( $currency ); ?></span> |
|
64 | + <span class="input-group-text"><?php echo wpinv_currency_symbol($currency); ?></span> |
|
65 | 65 | </div> |
66 | 66 | <?php endif; ?> |
67 | 67 | </div> |
68 | 68 | <?php |
69 | 69 | } else { |
70 | - echo wpinv_price( wpinv_format_amount( $item->get_price() ), $currency ); |
|
70 | + echo wpinv_price(wpinv_format_amount($item->get_price()), $currency); |
|
71 | 71 | ?> |
72 | - <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr( $item->get_price() ); ?>'> |
|
72 | + <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr($item->get_price()); ?>'> |
|
73 | 73 | <?php |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | 77 | // Item quantity. |
78 | - if ( 'quantity' == $key ) { |
|
78 | + if ('quantity' == $key) { |
|
79 | 79 | |
80 | - if ( $item->allows_quantities() ) { |
|
80 | + if ($item->allows_quantities()) { |
|
81 | 81 | ?> |
82 | 82 | <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][quantity]' type='number' class='getpaid-item-quantity-input pr-1' value='<?php echo (int) $item->get_qantity(); ?>' min='1' required> |
83 | 83 | <?php |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | // Item sub total. |
94 | - if ( 'subtotal' == $key ) { |
|
95 | - echo wpinv_price( wpinv_format_amount( $item->get_sub_total() ), $currency ); |
|
94 | + if ('subtotal' == $key) { |
|
95 | + echo wpinv_price(wpinv_format_amount($item->get_sub_total()), $currency); |
|
96 | 96 | } |
97 | 97 | ?> |
98 | 98 | </div> |
@@ -100,4 +100,4 @@ discard block |
||
100 | 100 | </div> |
101 | 101 | </div> |
102 | 102 | <?php |
103 | -do_action( 'getpaid_payment_form_cart_item', $form, $item ); |
|
103 | +do_action('getpaid_payment_form_cart_item', $form, $item); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | |
13 | 13 | ?><!DOCTYPE html> |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | |
17 | 17 | <head> |
18 | 18 | |
19 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
19 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
20 | 20 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" > |
21 | 21 | |
22 | 22 | <meta name="robots" content="noindex,nofollow"> |
23 | 23 | |
24 | 24 | <link rel="profile" href="https://gmpg.org/xfn/11"> |
25 | 25 | |
26 | - <title><?php _e( 'GetPaid GeoLocation', 'invoicing' ); ?></title> |
|
26 | + <title><?php _e('GetPaid GeoLocation', 'invoicing'); ?></title> |
|
27 | 27 | |
28 | 28 | <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> |
29 | 29 | <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', |
70 | 70 | osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors', |
71 | 71 | osm = L.tileLayer( osmUrl, { maxZoom: 18, attribution: osmAttrib } ), |
72 | - latlng = new L.LatLng( <?php echo sanitize_text_field( $latitude );?>, <?php echo sanitize_text_field( $longitude );?> ); |
|
72 | + latlng = new L.LatLng( <?php echo sanitize_text_field($latitude); ?>, <?php echo sanitize_text_field($longitude); ?> ); |
|
73 | 73 | |
74 | 74 | var map = new L.Map( 'map', {center: latlng, zoom: 18, layers: [osm]}); |
75 | 75 | |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | map.addLayer(marker); |
78 | 78 | |
79 | 79 | marker |
80 | - .bindPopup("<p><?php echo esc_attr( $address );?></p>") |
|
80 | + .bindPopup("<p><?php echo esc_attr($address); ?></p>") |
|
81 | 81 | .openPopup(); |
82 | 82 | </script> |
83 | 83 | |
84 | - <div style="height:100px"><?php echo wp_kses_post( $content ); ?></div> |
|
84 | + <div style="height:100px"><?php echo wp_kses_post($content); ?></div> |
|
85 | 85 | |
86 | 86 | </body> |
87 | 87 |