@@ -65,7 +65,7 @@ |
||
65 | 65 | * |
66 | 66 | * @since 1.0 |
67 | 67 | * @uses Give_Session::get() |
68 | - * @return mixed array if errors are present, false if none found |
|
68 | + * @return string array if errors are present, false if none found |
|
69 | 69 | */ |
70 | 70 | function give_get_errors() { |
71 | 71 | return Give()->session->get( 'give_errors' ); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -29,33 +29,33 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return void |
31 | 31 | */ |
32 | -function give_print_errors( $form_id ) { |
|
32 | +function give_print_errors($form_id) { |
|
33 | 33 | |
34 | 34 | $errors = give_get_errors(); |
35 | 35 | |
36 | - $request_form_id = isset( $_REQUEST['form-id'] ) ? intval( $_REQUEST['form-id'] ) : 0; |
|
36 | + $request_form_id = isset($_REQUEST['form-id']) ? intval($_REQUEST['form-id']) : 0; |
|
37 | 37 | |
38 | 38 | //Sanity checks first: Ensure that gateway returned errors display on the appropriate form |
39 | - if ( ! isset( $_POST['give_ajax'] ) && $request_form_id !== $form_id ) { |
|
39 | + if ( ! isset($_POST['give_ajax']) && $request_form_id !== $form_id) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | |
43 | - if ( $errors ) { |
|
44 | - $classes = apply_filters( 'give_error_class', array( |
|
43 | + if ($errors) { |
|
44 | + $classes = apply_filters('give_error_class', array( |
|
45 | 45 | 'give_errors' |
46 | - ) ); |
|
47 | - echo '<div class="' . implode( ' ', $classes ) . '">'; |
|
46 | + )); |
|
47 | + echo '<div class="'.implode(' ', $classes).'">'; |
|
48 | 48 | // Loop error codes and display errors |
49 | - foreach ( $errors as $error_id => $error ) { |
|
50 | - echo '<div class="give_error" id="give_error_' . $error_id . '"><p><strong>' . esc_html__( 'Error', 'give' ) . '</strong>: ' . $error . '</p></div>'; |
|
49 | + foreach ($errors as $error_id => $error) { |
|
50 | + echo '<div class="give_error" id="give_error_'.$error_id.'"><p><strong>'.esc_html__('Error', 'give').'</strong>: '.$error.'</p></div>'; |
|
51 | 51 | } |
52 | 52 | echo '</div>'; |
53 | 53 | give_clear_errors(); |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | -add_action( 'give_donation_form_before_personal_info', 'give_print_errors' ); |
|
58 | -add_action( 'give_ajax_checkout_errors', 'give_print_errors' ); |
|
57 | +add_action('give_donation_form_before_personal_info', 'give_print_errors'); |
|
58 | +add_action('give_ajax_checkout_errors', 'give_print_errors'); |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Get Errors |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return mixed array if errors are present, false if none found |
69 | 69 | */ |
70 | 70 | function give_get_errors() { |
71 | - return Give()->session->get( 'give_errors' ); |
|
71 | + return Give()->session->get('give_errors'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return void |
86 | 86 | */ |
87 | -function give_set_error( $error_id, $error_message ) { |
|
87 | +function give_set_error($error_id, $error_message) { |
|
88 | 88 | $errors = give_get_errors(); |
89 | - if ( ! $errors ) { |
|
89 | + if ( ! $errors) { |
|
90 | 90 | $errors = array(); |
91 | 91 | } |
92 | - $errors[ $error_id ] = $error_message; |
|
93 | - Give()->session->set( 'give_errors', $errors ); |
|
92 | + $errors[$error_id] = $error_message; |
|
93 | + Give()->session->set('give_errors', $errors); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return void |
102 | 102 | */ |
103 | 103 | function give_clear_errors() { |
104 | - Give()->session->set( 'give_errors', null ); |
|
104 | + Give()->session->set('give_errors', null); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return string |
116 | 116 | */ |
117 | -function give_unset_error( $error_id ) { |
|
117 | +function give_unset_error($error_id) { |
|
118 | 118 | $errors = give_get_errors(); |
119 | - if ( $errors ) { |
|
120 | - unset( $errors[ $error_id ] ); |
|
121 | - Give()->session->set( 'give_errors', $errors ); |
|
119 | + if ($errors) { |
|
120 | + unset($errors[$error_id]); |
|
121 | + Give()->session->set('give_errors', $errors); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return string/void |
130 | 130 | */ |
131 | 131 | function _give_die_handler() { |
132 | - if ( defined( 'GIVE_UNIT_TESTS' ) ) { |
|
132 | + if (defined('GIVE_UNIT_TESTS')) { |
|
133 | 133 | return '_give_die_handler'; |
134 | 134 | } else { |
135 | 135 | die(); |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @return void |
151 | 151 | */ |
152 | -function give_die( $message = '', $title = '', $status = 400 ) { |
|
153 | - add_filter( 'wp_die_ajax_handler', '_give_die_handler', 10, 3 ); |
|
154 | - add_filter( 'wp_die_handler', '_give_die_handler', 10, 3 ); |
|
155 | - wp_die( $message, $title, array( 'response' => $status ) ); |
|
152 | +function give_die($message = '', $title = '', $status = 400) { |
|
153 | + add_filter('wp_die_ajax_handler', '_give_die_handler', 10, 3); |
|
154 | + add_filter('wp_die_handler', '_give_die_handler', 10, 3); |
|
155 | + wp_die($message, $title, array('response' => $status)); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -167,10 +167,10 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @return string $error |
169 | 169 | */ |
170 | -function give_output_error( $message, $echo = true, $error_id = 'warning' ) { |
|
171 | - $error = '<div class="give_errors" id="give_error_' . $error_id . '"><p class="give_error give_' . $error_id . '">' . $message . '</p></div>'; |
|
170 | +function give_output_error($message, $echo = true, $error_id = 'warning') { |
|
171 | + $error = '<div class="give_errors" id="give_error_'.$error_id.'"><p class="give_error give_'.$error_id.'">'.$message.'</p></div>'; |
|
172 | 172 | |
173 | - if ( $echo ) { |
|
173 | + if ($echo) { |
|
174 | 174 | echo $error; |
175 | 175 | } else { |
176 | 176 | return $error; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | //validate display_style and float_labels value |
93 | 93 | if ( ( $key == 'display_style' && ! in_array( $value, array( 'onpage', 'reveal', 'modal' ) ) ) |
94 | - || ( $key == 'float_labels' && ! in_array( $value, array( 'enabled', 'disabled' ) ) ) |
|
94 | + || ( $key == 'float_labels' && ! in_array( $value, array( 'enabled', 'disabled' ) ) ) |
|
95 | 95 | ) { |
96 | 96 | |
97 | 97 | $atts[ $key ] = ''; |
@@ -169,15 +169,15 @@ discard block |
||
169 | 169 | */ |
170 | 170 | function give_login_form_shortcode( $atts, $content = null ) { |
171 | 171 | $atts = shortcode_atts( array( |
172 | - // Add backward compatibility for redirect attribute. |
|
173 | - 'redirect' => '', |
|
172 | + // Add backward compatibility for redirect attribute. |
|
173 | + 'redirect' => '', |
|
174 | 174 | |
175 | 175 | 'login-redirect' => '', |
176 | 176 | 'logout-redirect' => '', |
177 | 177 | ), $atts, 'give_login' ); |
178 | 178 | |
179 | - // Check login-redirect attribute first, if it empty or not found then check for redirect attribute and add value of this to login-redirect attribute. |
|
180 | - $atts['login-redirect'] = ! empty( $atts['login-redirect'] ) ? $atts['login-redirect'] : ( ! empty( $atts['redirect' ] ) ? $atts['redirect'] : '' ); |
|
179 | + // Check login-redirect attribute first, if it empty or not found then check for redirect attribute and add value of this to login-redirect attribute. |
|
180 | + $atts['login-redirect'] = ! empty( $atts['login-redirect'] ) ? $atts['login-redirect'] : ( ! empty( $atts['redirect' ] ) ? $atts['redirect'] : '' ); |
|
181 | 181 | |
182 | 182 | return give_login_form( $atts['login-redirect'], $atts['logout-redirect'] ); |
183 | 183 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -25,28 +25,28 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_donation_history() { |
27 | 27 | |
28 | - $email_access = give_get_option( 'email_access' ); |
|
28 | + $email_access = give_get_option('email_access'); |
|
29 | 29 | |
30 | 30 | //Is user logged in? Does a session exist? Does an email-access token exist? |
31 | - if ( is_user_logged_in() || Give()->session->get_session_expiration() !== false || ( $email_access == 'on' && Give()->email_access->token_exists ) ) { |
|
31 | + if (is_user_logged_in() || Give()->session->get_session_expiration() !== false || ($email_access == 'on' && Give()->email_access->token_exists)) { |
|
32 | 32 | ob_start(); |
33 | - give_get_template_part( 'history', 'donations' ); |
|
33 | + give_get_template_part('history', 'donations'); |
|
34 | 34 | |
35 | 35 | return ob_get_clean(); |
36 | 36 | } //Is Email-based access enabled? |
37 | - elseif ( $email_access == 'on' ) { |
|
37 | + elseif ($email_access == 'on') { |
|
38 | 38 | |
39 | 39 | ob_start(); |
40 | - give_get_template_part( 'email', 'login-form' ); |
|
40 | + give_get_template_part('email', 'login-form'); |
|
41 | 41 | |
42 | 42 | return ob_get_clean(); |
43 | 43 | } else { |
44 | - $message = esc_html__( 'You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give' ); |
|
45 | - echo apply_filters( 'give_donation_history_nonuser_message', give_output_error( $message, false ), $message ); |
|
44 | + $message = esc_html__('You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give'); |
|
45 | + echo apply_filters('give_donation_history_nonuser_message', give_output_error($message, false), $message); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | -add_shortcode( 'donation_history', 'give_donation_history' ); |
|
49 | +add_shortcode('donation_history', 'give_donation_history'); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Donation Form Shortcode |
@@ -60,53 +60,53 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return string |
62 | 62 | */ |
63 | -function give_form_shortcode( $atts, $content = null ) { |
|
64 | - $atts = shortcode_atts( array( |
|
63 | +function give_form_shortcode($atts, $content = null) { |
|
64 | + $atts = shortcode_atts(array( |
|
65 | 65 | 'id' => '', |
66 | 66 | 'show_title' => true, |
67 | 67 | 'show_goal' => true, |
68 | 68 | 'show_content' => '', |
69 | 69 | 'float_labels' => '', |
70 | 70 | 'display_style' => '', |
71 | - ), $atts, 'give_form' ); |
|
71 | + ), $atts, 'give_form'); |
|
72 | 72 | |
73 | - foreach ( $atts as $key => $value ) { |
|
73 | + foreach ($atts as $key => $value) { |
|
74 | 74 | //convert shortcode_atts values to booleans |
75 | - if ( $key == 'show_title' ) { |
|
76 | - $atts[ $key ] = filter_var( $atts[ $key ], FILTER_VALIDATE_BOOLEAN ); |
|
77 | - } elseif ( $key == 'show_goal' ) { |
|
78 | - $atts[ $key ] = filter_var( $atts[ $key ], FILTER_VALIDATE_BOOLEAN ); |
|
75 | + if ($key == 'show_title') { |
|
76 | + $atts[$key] = filter_var($atts[$key], FILTER_VALIDATE_BOOLEAN); |
|
77 | + } elseif ($key == 'show_goal') { |
|
78 | + $atts[$key] = filter_var($atts[$key], FILTER_VALIDATE_BOOLEAN); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | //validate show_content value |
82 | - if ( $key == 'show_content' ) { |
|
83 | - if ( ! in_array( $value, array( 'none', 'above', 'below' ) ) ) { |
|
84 | - $atts[ $key ] = ''; |
|
85 | - } else if ( $value == 'above' ) { |
|
86 | - $atts[ $key ] = 'give_pre_form'; |
|
87 | - } else if ( $value == 'below' ) { |
|
88 | - $atts[ $key ] = 'give_post_form'; |
|
82 | + if ($key == 'show_content') { |
|
83 | + if ( ! in_array($value, array('none', 'above', 'below'))) { |
|
84 | + $atts[$key] = ''; |
|
85 | + } else if ($value == 'above') { |
|
86 | + $atts[$key] = 'give_pre_form'; |
|
87 | + } else if ($value == 'below') { |
|
88 | + $atts[$key] = 'give_post_form'; |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | 92 | //validate display_style and float_labels value |
93 | - if ( ( $key == 'display_style' && ! in_array( $value, array( 'onpage', 'reveal', 'modal' ) ) ) |
|
94 | - || ( $key == 'float_labels' && ! in_array( $value, array( 'enabled', 'disabled' ) ) ) |
|
93 | + if (($key == 'display_style' && ! in_array($value, array('onpage', 'reveal', 'modal'))) |
|
94 | + || ($key == 'float_labels' && ! in_array($value, array('enabled', 'disabled'))) |
|
95 | 95 | ) { |
96 | 96 | |
97 | - $atts[ $key ] = ''; |
|
97 | + $atts[$key] = ''; |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | 101 | //get the Give Form |
102 | 102 | ob_start(); |
103 | - give_get_donation_form( $atts ); |
|
103 | + give_get_donation_form($atts); |
|
104 | 104 | $final_output = ob_get_clean(); |
105 | 105 | |
106 | - return apply_filters( 'give_donate_form', $final_output, $atts ); |
|
106 | + return apply_filters('give_donate_form', $final_output, $atts); |
|
107 | 107 | } |
108 | 108 | |
109 | -add_shortcode( 'give_form', 'give_form_shortcode' ); |
|
109 | +add_shortcode('give_form', 'give_form_shortcode'); |
|
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Donation Form Goal Shortcode. |
@@ -120,37 +120,37 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @return string |
122 | 122 | */ |
123 | -function give_goal_shortcode( $atts, $content = null ) { |
|
124 | - $atts = shortcode_atts( array( |
|
123 | +function give_goal_shortcode($atts, $content = null) { |
|
124 | + $atts = shortcode_atts(array( |
|
125 | 125 | 'id' => '', |
126 | 126 | 'show_text' => true, |
127 | 127 | 'show_bar' => true, |
128 | - ), $atts, 'give_goal' ); |
|
128 | + ), $atts, 'give_goal'); |
|
129 | 129 | |
130 | 130 | |
131 | 131 | //get the Give Form. |
132 | 132 | ob_start(); |
133 | 133 | |
134 | 134 | //Sanity check 1: ensure there is an ID Provided. |
135 | - if ( empty( $atts['id'] ) ) { |
|
136 | - give_output_error( esc_html__( 'The shortcode is missing Donation Form ID attribute.', 'give' ), true ); |
|
135 | + if (empty($atts['id'])) { |
|
136 | + give_output_error(esc_html__('The shortcode is missing Donation Form ID attribute.', 'give'), true); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | //Sanity check 2: Check the form even has Goals enabled. |
140 | - $goal_option = get_post_meta( $atts['id'], '_give_goal_option', true ); |
|
141 | - if ( empty( $goal_option ) || $goal_option !== 'yes' ) { |
|
142 | - give_output_error( esc_html__( 'The form does not have Goals enabled.', 'give' ), true ); |
|
140 | + $goal_option = get_post_meta($atts['id'], '_give_goal_option', true); |
|
141 | + if (empty($goal_option) || $goal_option !== 'yes') { |
|
142 | + give_output_error(esc_html__('The form does not have Goals enabled.', 'give'), true); |
|
143 | 143 | } else { |
144 | 144 | //Passed all sanity checks: output Goal. |
145 | - give_show_goal_progress( $atts['id'], $atts ); |
|
145 | + give_show_goal_progress($atts['id'], $atts); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | $final_output = ob_get_clean(); |
149 | 149 | |
150 | - return apply_filters( 'give_goal_shortcode_output', $final_output, $atts ); |
|
150 | + return apply_filters('give_goal_shortcode_output', $final_output, $atts); |
|
151 | 151 | } |
152 | 152 | |
153 | -add_shortcode( 'give_goal', 'give_goal_shortcode' ); |
|
153 | +add_shortcode('give_goal', 'give_goal_shortcode'); |
|
154 | 154 | |
155 | 155 | |
156 | 156 | /** |
@@ -167,22 +167,22 @@ discard block |
||
167 | 167 | * @uses give_login_form() |
168 | 168 | * @return string |
169 | 169 | */ |
170 | -function give_login_form_shortcode( $atts, $content = null ) { |
|
171 | - $atts = shortcode_atts( array( |
|
170 | +function give_login_form_shortcode($atts, $content = null) { |
|
171 | + $atts = shortcode_atts(array( |
|
172 | 172 | // Add backward compatibility for redirect attribute. |
173 | 173 | 'redirect' => '', |
174 | 174 | |
175 | 175 | 'login-redirect' => '', |
176 | 176 | 'logout-redirect' => '', |
177 | - ), $atts, 'give_login' ); |
|
177 | + ), $atts, 'give_login'); |
|
178 | 178 | |
179 | 179 | // Check login-redirect attribute first, if it empty or not found then check for redirect attribute and add value of this to login-redirect attribute. |
180 | - $atts['login-redirect'] = ! empty( $atts['login-redirect'] ) ? $atts['login-redirect'] : ( ! empty( $atts['redirect' ] ) ? $atts['redirect'] : '' ); |
|
180 | + $atts['login-redirect'] = ! empty($atts['login-redirect']) ? $atts['login-redirect'] : ( ! empty($atts['redirect']) ? $atts['redirect'] : ''); |
|
181 | 181 | |
182 | - return give_login_form( $atts['login-redirect'], $atts['logout-redirect'] ); |
|
182 | + return give_login_form($atts['login-redirect'], $atts['logout-redirect']); |
|
183 | 183 | } |
184 | 184 | |
185 | -add_shortcode( 'give_login', 'give_login_form_shortcode' ); |
|
185 | +add_shortcode('give_login', 'give_login_form_shortcode'); |
|
186 | 186 | |
187 | 187 | /** |
188 | 188 | * Register Shortcode. |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | * @uses give_register_form() |
198 | 198 | * @return string |
199 | 199 | */ |
200 | -function give_register_form_shortcode( $atts, $content = null ) { |
|
201 | - $atts = shortcode_atts( array( |
|
200 | +function give_register_form_shortcode($atts, $content = null) { |
|
201 | + $atts = shortcode_atts(array( |
|
202 | 202 | 'redirect' => '', |
203 | - ), $atts, 'give_register' ); |
|
203 | + ), $atts, 'give_register'); |
|
204 | 204 | |
205 | - return give_register_form( $atts['redirect'] ); |
|
205 | + return give_register_form($atts['redirect']); |
|
206 | 206 | } |
207 | 207 | |
208 | -add_shortcode( 'give_register', 'give_register_form_shortcode' ); |
|
208 | +add_shortcode('give_register', 'give_register_form_shortcode'); |
|
209 | 209 | |
210 | 210 | |
211 | 211 | /** |
@@ -220,62 +220,62 @@ discard block |
||
220 | 220 | * |
221 | 221 | * @return string |
222 | 222 | */ |
223 | -function give_receipt_shortcode( $atts, $content = null ) { |
|
223 | +function give_receipt_shortcode($atts, $content = null) { |
|
224 | 224 | |
225 | 225 | global $give_receipt_args, $payment; |
226 | 226 | |
227 | - $give_receipt_args = shortcode_atts( array( |
|
228 | - 'error' => esc_html__( 'You are missing the payment key to view this donation receipt.', 'give' ), |
|
227 | + $give_receipt_args = shortcode_atts(array( |
|
228 | + 'error' => esc_html__('You are missing the payment key to view this donation receipt.', 'give'), |
|
229 | 229 | 'price' => true, |
230 | 230 | 'donor' => true, |
231 | 231 | 'date' => true, |
232 | 232 | 'payment_key' => false, |
233 | 233 | 'payment_method' => true, |
234 | 234 | 'payment_id' => true |
235 | - ), $atts, 'give_receipt' ); |
|
235 | + ), $atts, 'give_receipt'); |
|
236 | 236 | |
237 | 237 | //set $session var |
238 | 238 | $session = give_get_purchase_session(); |
239 | 239 | |
240 | 240 | //set payment key var |
241 | - if ( isset( $_GET['payment_key'] ) ) { |
|
242 | - $payment_key = urldecode( $_GET['payment_key'] ); |
|
243 | - } elseif ( $session ) { |
|
241 | + if (isset($_GET['payment_key'])) { |
|
242 | + $payment_key = urldecode($_GET['payment_key']); |
|
243 | + } elseif ($session) { |
|
244 | 244 | $payment_key = $session['purchase_key']; |
245 | - } elseif ( $give_receipt_args['payment_key'] ) { |
|
245 | + } elseif ($give_receipt_args['payment_key']) { |
|
246 | 246 | $payment_key = $give_receipt_args['payment_key']; |
247 | 247 | } |
248 | 248 | |
249 | - $email_access = give_get_option( 'email_access' ); |
|
249 | + $email_access = give_get_option('email_access'); |
|
250 | 250 | |
251 | 251 | // No payment_key found & Email Access is Turned on: |
252 | - if ( ! isset( $payment_key ) && $email_access == 'on' && ! Give()->email_access->token_exists ) { |
|
252 | + if ( ! isset($payment_key) && $email_access == 'on' && ! Give()->email_access->token_exists) { |
|
253 | 253 | |
254 | 254 | ob_start(); |
255 | 255 | |
256 | - give_get_template_part( 'email-login-form' ); |
|
256 | + give_get_template_part('email-login-form'); |
|
257 | 257 | |
258 | 258 | return ob_get_clean(); |
259 | 259 | |
260 | - } elseif ( ! isset( $payment_key ) ) { |
|
260 | + } elseif ( ! isset($payment_key)) { |
|
261 | 261 | |
262 | - return give_output_error( $give_receipt_args['error'], false, 'error' ); |
|
262 | + return give_output_error($give_receipt_args['error'], false, 'error'); |
|
263 | 263 | |
264 | 264 | } |
265 | 265 | |
266 | - $payment_id = give_get_purchase_id_by_key( $payment_key ); |
|
267 | - $user_can_view = give_can_view_receipt( $payment_key ); |
|
266 | + $payment_id = give_get_purchase_id_by_key($payment_key); |
|
267 | + $user_can_view = give_can_view_receipt($payment_key); |
|
268 | 268 | |
269 | 269 | // Key was provided, but user is logged out. Offer them the ability to login and view the receipt. |
270 | - if ( ! $user_can_view && $email_access == 'on' && ! Give()->email_access->token_exists ) { |
|
270 | + if ( ! $user_can_view && $email_access == 'on' && ! Give()->email_access->token_exists) { |
|
271 | 271 | |
272 | 272 | ob_start(); |
273 | 273 | |
274 | - give_get_template_part( 'email-login-form' ); |
|
274 | + give_get_template_part('email-login-form'); |
|
275 | 275 | |
276 | 276 | return ob_get_clean(); |
277 | 277 | |
278 | - } elseif ( ! $user_can_view ) { |
|
278 | + } elseif ( ! $user_can_view) { |
|
279 | 279 | |
280 | 280 | global $give_login_redirect; |
281 | 281 | |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | |
284 | 284 | ob_start(); |
285 | 285 | |
286 | - give_output_error( apply_filters( 'give_must_be_logged_in_error_message', esc_html__( 'You must be logged in to view this donation receipt.', 'give' ) ) ); |
|
286 | + give_output_error(apply_filters('give_must_be_logged_in_error_message', esc_html__('You must be logged in to view this donation receipt.', 'give'))); |
|
287 | 287 | |
288 | - give_get_template_part( 'shortcode', 'login' ); |
|
288 | + give_get_template_part('shortcode', 'login'); |
|
289 | 289 | |
290 | 290 | $login_form = ob_get_clean(); |
291 | 291 | |
@@ -300,13 +300,13 @@ discard block |
||
300 | 300 | * or if user is logged in and the user can view sensitive shop data. |
301 | 301 | * |
302 | 302 | */ |
303 | - if ( ! apply_filters( 'give_user_can_view_receipt', $user_can_view, $give_receipt_args ) ) { |
|
304 | - return give_output_error( $give_receipt_args['error'], false, 'error' ); |
|
303 | + if ( ! apply_filters('give_user_can_view_receipt', $user_can_view, $give_receipt_args)) { |
|
304 | + return give_output_error($give_receipt_args['error'], false, 'error'); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | ob_start(); |
308 | 308 | |
309 | - give_get_template_part( 'shortcode', 'receipt' ); |
|
309 | + give_get_template_part('shortcode', 'receipt'); |
|
310 | 310 | |
311 | 311 | $display = ob_get_clean(); |
312 | 312 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | } |
317 | 317 | |
318 | -add_shortcode( 'give_receipt', 'give_receipt_shortcode' ); |
|
318 | +add_shortcode('give_receipt', 'give_receipt_shortcode'); |
|
319 | 319 | |
320 | 320 | /** |
321 | 321 | * Profile Editor Shortcode. |
@@ -335,18 +335,18 @@ discard block |
||
335 | 335 | * |
336 | 336 | * @return string Output generated from the profile editor |
337 | 337 | */ |
338 | -function give_profile_editor_shortcode( $atts, $content = null ) { |
|
338 | +function give_profile_editor_shortcode($atts, $content = null) { |
|
339 | 339 | |
340 | 340 | ob_start(); |
341 | 341 | |
342 | - give_get_template_part( 'shortcode', 'profile-editor' ); |
|
342 | + give_get_template_part('shortcode', 'profile-editor'); |
|
343 | 343 | |
344 | 344 | $display = ob_get_clean(); |
345 | 345 | |
346 | 346 | return $display; |
347 | 347 | } |
348 | 348 | |
349 | -add_shortcode( 'give_profile_editor', 'give_profile_editor_shortcode' ); |
|
349 | +add_shortcode('give_profile_editor', 'give_profile_editor_shortcode'); |
|
350 | 350 | |
351 | 351 | /** |
352 | 352 | * Process Profile Updater Form. |
@@ -359,30 +359,30 @@ discard block |
||
359 | 359 | * |
360 | 360 | * @return bool |
361 | 361 | */ |
362 | -function give_process_profile_editor_updates( $data ) { |
|
362 | +function give_process_profile_editor_updates($data) { |
|
363 | 363 | // Profile field change request |
364 | - if ( empty( $_POST['give_profile_editor_submit'] ) && ! is_user_logged_in() ) { |
|
364 | + if (empty($_POST['give_profile_editor_submit']) && ! is_user_logged_in()) { |
|
365 | 365 | return false; |
366 | 366 | } |
367 | 367 | |
368 | 368 | // Nonce security |
369 | - if ( ! wp_verify_nonce( $data['give_profile_editor_nonce'], 'give-profile-editor-nonce' ) ) { |
|
369 | + if ( ! wp_verify_nonce($data['give_profile_editor_nonce'], 'give-profile-editor-nonce')) { |
|
370 | 370 | return false; |
371 | 371 | } |
372 | 372 | |
373 | 373 | $user_id = get_current_user_id(); |
374 | - $old_user_data = get_userdata( $user_id ); |
|
375 | - |
|
376 | - $display_name = isset( $data['give_display_name'] ) ? sanitize_text_field( $data['give_display_name'] ) : $old_user_data->display_name; |
|
377 | - $first_name = isset( $data['give_first_name'] ) ? sanitize_text_field( $data['give_first_name'] ) : $old_user_data->first_name; |
|
378 | - $last_name = isset( $data['give_last_name'] ) ? sanitize_text_field( $data['give_last_name'] ) : $old_user_data->last_name; |
|
379 | - $email = isset( $data['give_email'] ) ? sanitize_email( $data['give_email'] ) : $old_user_data->user_email; |
|
380 | - $line1 = ( isset( $data['give_address_line1'] ) ? sanitize_text_field( $data['give_address_line1'] ) : '' ); |
|
381 | - $line2 = ( isset( $data['give_address_line2'] ) ? sanitize_text_field( $data['give_address_line2'] ) : '' ); |
|
382 | - $city = ( isset( $data['give_address_city'] ) ? sanitize_text_field( $data['give_address_city'] ) : '' ); |
|
383 | - $state = ( isset( $data['give_address_state'] ) ? sanitize_text_field( $data['give_address_state'] ) : '' ); |
|
384 | - $zip = ( isset( $data['give_address_zip'] ) ? sanitize_text_field( $data['give_address_zip'] ) : '' ); |
|
385 | - $country = ( isset( $data['give_address_country'] ) ? sanitize_text_field( $data['give_address_country'] ) : '' ); |
|
374 | + $old_user_data = get_userdata($user_id); |
|
375 | + |
|
376 | + $display_name = isset($data['give_display_name']) ? sanitize_text_field($data['give_display_name']) : $old_user_data->display_name; |
|
377 | + $first_name = isset($data['give_first_name']) ? sanitize_text_field($data['give_first_name']) : $old_user_data->first_name; |
|
378 | + $last_name = isset($data['give_last_name']) ? sanitize_text_field($data['give_last_name']) : $old_user_data->last_name; |
|
379 | + $email = isset($data['give_email']) ? sanitize_email($data['give_email']) : $old_user_data->user_email; |
|
380 | + $line1 = (isset($data['give_address_line1']) ? sanitize_text_field($data['give_address_line1']) : ''); |
|
381 | + $line2 = (isset($data['give_address_line2']) ? sanitize_text_field($data['give_address_line2']) : ''); |
|
382 | + $city = (isset($data['give_address_city']) ? sanitize_text_field($data['give_address_city']) : ''); |
|
383 | + $state = (isset($data['give_address_state']) ? sanitize_text_field($data['give_address_state']) : ''); |
|
384 | + $zip = (isset($data['give_address_zip']) ? sanitize_text_field($data['give_address_zip']) : ''); |
|
385 | + $country = (isset($data['give_address_country']) ? sanitize_text_field($data['give_address_country']) : ''); |
|
386 | 386 | |
387 | 387 | $userdata = array( |
388 | 388 | 'ID' => $user_id, |
@@ -410,38 +410,38 @@ discard block |
||
410 | 410 | * @param int $user_id The ID of the user. |
411 | 411 | * @param array $userdata User info, including ID, first name, last name, display name and email. |
412 | 412 | */ |
413 | - do_action( 'give_pre_update_user_profile', $user_id, $userdata ); |
|
413 | + do_action('give_pre_update_user_profile', $user_id, $userdata); |
|
414 | 414 | |
415 | 415 | // New password |
416 | - if ( ! empty( $data['give_new_user_pass1'] ) ) { |
|
417 | - if ( $data['give_new_user_pass1'] !== $data['give_new_user_pass2'] ) { |
|
418 | - give_set_error( 'password_mismatch', esc_html__( 'The passwords you entered do not match. Please try again.', 'give' ) ); |
|
416 | + if ( ! empty($data['give_new_user_pass1'])) { |
|
417 | + if ($data['give_new_user_pass1'] !== $data['give_new_user_pass2']) { |
|
418 | + give_set_error('password_mismatch', esc_html__('The passwords you entered do not match. Please try again.', 'give')); |
|
419 | 419 | } else { |
420 | 420 | $userdata['user_pass'] = $data['give_new_user_pass1']; |
421 | 421 | } |
422 | 422 | } |
423 | 423 | |
424 | 424 | // Make sure the new email doesn't belong to another user |
425 | - if ( $email != $old_user_data->user_email ) { |
|
426 | - if ( email_exists( $email ) ) { |
|
427 | - give_set_error( 'email_exists', esc_html__( 'The email you entered belongs to another user. Please use another.', 'give' ) ); |
|
425 | + if ($email != $old_user_data->user_email) { |
|
426 | + if (email_exists($email)) { |
|
427 | + give_set_error('email_exists', esc_html__('The email you entered belongs to another user. Please use another.', 'give')); |
|
428 | 428 | } |
429 | 429 | } |
430 | 430 | |
431 | 431 | // Check for errors |
432 | 432 | $errors = give_get_errors(); |
433 | 433 | |
434 | - if ( $errors ) { |
|
434 | + if ($errors) { |
|
435 | 435 | // Send back to the profile editor if there are errors |
436 | - wp_redirect( $data['give_redirect'] ); |
|
436 | + wp_redirect($data['give_redirect']); |
|
437 | 437 | give_die(); |
438 | 438 | } |
439 | 439 | |
440 | 440 | // Update the user |
441 | - $meta = update_user_meta( $user_id, '_give_user_address', $address ); |
|
442 | - $updated = wp_update_user( $userdata ); |
|
441 | + $meta = update_user_meta($user_id, '_give_user_address', $address); |
|
442 | + $updated = wp_update_user($userdata); |
|
443 | 443 | |
444 | - if ( $updated ) { |
|
444 | + if ($updated) { |
|
445 | 445 | |
446 | 446 | /** |
447 | 447 | * Fires after updating user profile. |
@@ -451,13 +451,13 @@ discard block |
||
451 | 451 | * @param int $user_id The ID of the user. |
452 | 452 | * @param array $userdata User info, including ID, first name, last name, display name and email. |
453 | 453 | */ |
454 | - do_action( 'give_user_profile_updated', $user_id, $userdata ); |
|
455 | - wp_redirect( add_query_arg( 'updated', 'true', $data['give_redirect'] ) ); |
|
454 | + do_action('give_user_profile_updated', $user_id, $userdata); |
|
455 | + wp_redirect(add_query_arg('updated', 'true', $data['give_redirect'])); |
|
456 | 456 | give_die(); |
457 | 457 | } |
458 | 458 | |
459 | 459 | return false; |
460 | 460 | } |
461 | 461 | |
462 | -add_action( 'give_edit_user_profile', 'give_process_profile_editor_updates' ); |
|
462 | +add_action('give_edit_user_profile', 'give_process_profile_editor_updates'); |
|
463 | 463 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return bool true if has variable prices, false otherwise |
25 | 25 | */ |
26 | -function give_has_variable_prices( $form_id = 0 ) { |
|
26 | +function give_has_variable_prices($form_id = 0) { |
|
27 | 27 | |
28 | - if ( empty( $form_id ) ) { |
|
28 | + if (empty($form_id)) { |
|
29 | 29 | return false; |
30 | 30 | } |
31 | 31 | |
32 | - $form = new Give_Donate_Form( $form_id ); |
|
32 | + $form = new Give_Donate_Form($form_id); |
|
33 | 33 | |
34 | 34 | return $form->has_variable_prices(); |
35 | 35 | } |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @return array Variable prices |
46 | 46 | */ |
47 | -function give_get_variable_prices( $form_id = 0 ) { |
|
47 | +function give_get_variable_prices($form_id = 0) { |
|
48 | 48 | |
49 | - if ( empty( $form_id ) ) { |
|
49 | + if (empty($form_id)) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
53 | - $form = new Give_Donate_Form( $form_id ); |
|
53 | + $form = new Give_Donate_Form($form_id); |
|
54 | 54 | |
55 | 55 | return $form->prices; |
56 | 56 | |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return string $default_price |
69 | 69 | */ |
70 | -function give_get_default_multilevel_amount( $form_id ) { |
|
70 | +function give_get_default_multilevel_amount($form_id) { |
|
71 | 71 | $default_price = '1.00'; |
72 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
72 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
73 | 73 | |
74 | - foreach ( $prices as $price ) { |
|
74 | + foreach ($prices as $price) { |
|
75 | 75 | |
76 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
76 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
77 | 77 | $default_price = $price['_give_amount']; |
78 | 78 | } |
79 | 79 | |
@@ -94,15 +94,15 @@ discard block |
||
94 | 94 | * @return string $default_price |
95 | 95 | * @since 1.0 |
96 | 96 | */ |
97 | -function give_get_default_form_amount( $form_id ) { |
|
97 | +function give_get_default_form_amount($form_id) { |
|
98 | 98 | |
99 | - if ( give_has_variable_prices( $form_id ) ) { |
|
99 | + if (give_has_variable_prices($form_id)) { |
|
100 | 100 | |
101 | - $default_amount = give_get_default_multilevel_amount( $form_id ); |
|
101 | + $default_amount = give_get_default_multilevel_amount($form_id); |
|
102 | 102 | |
103 | 103 | } else { |
104 | 104 | |
105 | - $default_amount = get_post_meta( $form_id, '_give_set_price', true ); |
|
105 | + $default_amount = get_post_meta($form_id, '_give_set_price', true); |
|
106 | 106 | |
107 | 107 | } |
108 | 108 | |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return bool |
125 | 125 | */ |
126 | -function give_is_custom_price_mode( $form_id = 0 ) { |
|
126 | +function give_is_custom_price_mode($form_id = 0) { |
|
127 | 127 | |
128 | - if ( empty( $form_id ) ) { |
|
128 | + if (empty($form_id)) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
132 | - $form = new Give_Donate_Form( $form_id ); |
|
132 | + $form = new Give_Donate_Form($form_id); |
|
133 | 133 | |
134 | 134 | return $form->is_custom_price_mode(); |
135 | 135 | } |
136 | 136 | \ No newline at end of file |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public $error = ''; |
24 | 24 | |
25 | 25 | private $verify_throttle; |
26 | - private $token_expiration; |
|
26 | + private $token_expiration; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Give_Email_Access constructor. |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @return bool |
244 | 244 | */ |
245 | 245 | function is_valid_verify_key( $token ) { |
246 | - /* @var WPDB $wpdb */ |
|
246 | + /* @var WPDB $wpdb */ |
|
247 | 247 | global $wpdb; |
248 | 248 | |
249 | 249 | // See if the verify_key exists |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function __construct() { |
99 | 99 | |
100 | 100 | // get it started |
101 | - add_action( 'init', array( $this, 'init' ) ); |
|
101 | + add_action('init', array($this, 'init')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -113,30 +113,30 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function init() { |
115 | 115 | |
116 | - $is_enabled = give_get_option( 'email_access' ); |
|
116 | + $is_enabled = give_get_option('email_access'); |
|
117 | 117 | |
118 | 118 | //Non-logged in users only |
119 | - if ( is_user_logged_in() || $is_enabled !== 'on' || is_admin() ) { |
|
119 | + if (is_user_logged_in() || $is_enabled !== 'on' || is_admin()) { |
|
120 | 120 | return; |
121 | 121 | } |
122 | 122 | |
123 | 123 | //Are db columns setup? |
124 | - $is_setup = give_get_option( 'email_access_installed' ); |
|
125 | - if ( empty( $is_setup ) ) { |
|
124 | + $is_setup = give_get_option('email_access_installed'); |
|
125 | + if (empty($is_setup)) { |
|
126 | 126 | $this->create_columns(); |
127 | 127 | } |
128 | 128 | |
129 | 129 | // Timeouts |
130 | - $this->verify_throttle = apply_filters( 'give_nl_verify_throttle', 300 ); |
|
131 | - $this->token_expiration = apply_filters( 'give_nl_token_expiration', 7200 ); |
|
130 | + $this->verify_throttle = apply_filters('give_nl_verify_throttle', 300); |
|
131 | + $this->token_expiration = apply_filters('give_nl_token_expiration', 7200); |
|
132 | 132 | |
133 | 133 | // Setup login |
134 | 134 | $this->check_for_token(); |
135 | 135 | |
136 | - if ( $this->token_exists ) { |
|
137 | - add_filter( 'give_can_view_receipt', '__return_true' ); |
|
138 | - add_filter( 'give_user_pending_verification', '__return_false' ); |
|
139 | - add_filter( 'give_get_users_purchases_args', array( $this, 'users_purchases_args' ) ); |
|
136 | + if ($this->token_exists) { |
|
137 | + add_filter('give_can_view_receipt', '__return_true'); |
|
138 | + add_filter('give_user_pending_verification', '__return_false'); |
|
139 | + add_filter('give_get_users_purchases_args', array($this, 'users_purchases_args')); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -150,25 +150,25 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return bool |
152 | 152 | */ |
153 | - public function can_send_email( $customer_id ) { |
|
153 | + public function can_send_email($customer_id) { |
|
154 | 154 | /* @var WPDB $wpdb */ |
155 | 155 | global $wpdb; |
156 | 156 | |
157 | 157 | // Prevent multiple emails within X minutes |
158 | - $throttle = date( 'Y-m-d H:i:s', time() - $this->verify_throttle ); |
|
158 | + $throttle = date('Y-m-d H:i:s', time() - $this->verify_throttle); |
|
159 | 159 | |
160 | 160 | // Does a user row exist? |
161 | 161 | $exists = (int) $wpdb->get_var( |
162 | - $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}give_customers WHERE id = %d", $customer_id ) |
|
162 | + $wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}give_customers WHERE id = %d", $customer_id) |
|
163 | 163 | ); |
164 | 164 | |
165 | - if ( 0 < $exists ) { |
|
165 | + if (0 < $exists) { |
|
166 | 166 | $row_id = (int) $wpdb->get_var( |
167 | - $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d AND (verify_throttle < %s OR verify_key = '') LIMIT 1", $customer_id, $throttle ) |
|
167 | + $wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d AND (verify_throttle < %s OR verify_key = '') LIMIT 1", $customer_id, $throttle) |
|
168 | 168 | ); |
169 | 169 | |
170 | - if ( $row_id < 1 ) { |
|
171 | - give_set_error( 'give_email_access_attempts_exhausted', esc_html__( 'Please wait a few minutes before requesting a new email access link.', 'give' ) ); |
|
170 | + if ($row_id < 1) { |
|
171 | + give_set_error('give_email_access_attempts_exhausted', esc_html__('Please wait a few minutes before requesting a new email access link.', 'give')); |
|
172 | 172 | |
173 | 173 | return false; |
174 | 174 | } |
@@ -188,34 +188,34 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @return void |
190 | 190 | */ |
191 | - public function send_email( $customer_id, $email ) { |
|
191 | + public function send_email($customer_id, $email) { |
|
192 | 192 | |
193 | - $verify_key = wp_generate_password( 20, false ); |
|
193 | + $verify_key = wp_generate_password(20, false); |
|
194 | 194 | |
195 | 195 | // Generate a new verify key |
196 | - $this->set_verify_key( $customer_id, $email, $verify_key ); |
|
196 | + $this->set_verify_key($customer_id, $email, $verify_key); |
|
197 | 197 | |
198 | 198 | // Get the purchase history URL |
199 | - $page_id = give_get_option( 'history_page' ); |
|
199 | + $page_id = give_get_option('history_page'); |
|
200 | 200 | |
201 | - $access_url = add_query_arg( array( |
|
201 | + $access_url = add_query_arg(array( |
|
202 | 202 | 'give_nl' => $verify_key, |
203 | - ), get_permalink( $page_id ) ); |
|
203 | + ), get_permalink($page_id)); |
|
204 | 204 | |
205 | 205 | //Nice subject and message |
206 | - $subject = apply_filters( 'give_email_access_token_subject', sprintf( esc_html__( 'Your Access Link to %s', 'give' ), get_bloginfo( 'name' ) ) ); |
|
206 | + $subject = apply_filters('give_email_access_token_subject', sprintf(esc_html__('Your Access Link to %s', 'give'), get_bloginfo('name'))); |
|
207 | 207 | |
208 | - $message = esc_html__( 'You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give' ) . "\n\n"; |
|
209 | - $message .= '<a href="' . esc_url( $access_url ) . '" target="_blank">' . esc_html__( 'Access My Donation Details »', 'give' ) . '</a>' . "\n\n"; |
|
208 | + $message = esc_html__('You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give')."\n\n"; |
|
209 | + $message .= '<a href="'.esc_url($access_url).'" target="_blank">'.esc_html__('Access My Donation Details »', 'give').'</a>'."\n\n"; |
|
210 | 210 | $message .= "\n\n"; |
211 | - $message .= esc_html__( 'Sincerely,', 'give' ) . "\n"; |
|
212 | - $message .= get_bloginfo( 'name' ) . "\n"; |
|
211 | + $message .= esc_html__('Sincerely,', 'give')."\n"; |
|
212 | + $message .= get_bloginfo('name')."\n"; |
|
213 | 213 | |
214 | - $message = apply_filters( 'give_email_access_token_message', $message ); |
|
214 | + $message = apply_filters('give_email_access_token_message', $message); |
|
215 | 215 | |
216 | 216 | // Send the email |
217 | - Give()->emails->__set( 'heading', apply_filters( 'give_email_access_token_heading', esc_html__( 'Your Access Link', 'give' ) ) ); |
|
218 | - Give()->emails->send( $email, $subject, $message ); |
|
217 | + Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', esc_html__('Your Access Link', 'give'))); |
|
218 | + Give()->emails->send($email, $subject, $message); |
|
219 | 219 | |
220 | 220 | } |
221 | 221 | |
@@ -229,24 +229,24 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function check_for_token() { |
231 | 231 | |
232 | - $token = isset( $_GET['give_nl'] ) ? $_GET['give_nl'] : ''; |
|
232 | + $token = isset($_GET['give_nl']) ? $_GET['give_nl'] : ''; |
|
233 | 233 | |
234 | 234 | // Check for cookie |
235 | - if ( empty( $token ) ) { |
|
236 | - $token = isset( $_COOKIE['give_nl'] ) ? $_COOKIE['give_nl'] : ''; |
|
235 | + if (empty($token)) { |
|
236 | + $token = isset($_COOKIE['give_nl']) ? $_COOKIE['give_nl'] : ''; |
|
237 | 237 | } |
238 | 238 | |
239 | - if ( ! empty( $token ) ) { |
|
240 | - if ( ! $this->is_valid_token( $token ) ) { |
|
241 | - if ( ! $this->is_valid_verify_key( $token ) ) { |
|
239 | + if ( ! empty($token)) { |
|
240 | + if ( ! $this->is_valid_token($token)) { |
|
241 | + if ( ! $this->is_valid_verify_key($token)) { |
|
242 | 242 | return; |
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | 246 | $this->token_exists = true; |
247 | 247 | // Set cookie |
248 | - $lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time(); |
|
249 | - @setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false ); |
|
248 | + $lifetime = current_time('timestamp') + Give()->session->set_expiration_time(); |
|
249 | + @setcookie('give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false); |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
@@ -260,18 +260,18 @@ discard block |
||
260 | 260 | * |
261 | 261 | * @return bool |
262 | 262 | */ |
263 | - public function is_valid_token( $token ) { |
|
263 | + public function is_valid_token($token) { |
|
264 | 264 | |
265 | 265 | global $wpdb; |
266 | 266 | |
267 | 267 | // Make sure token isn't expired |
268 | - $expires = date( 'Y-m-d H:i:s', time() - $this->token_expiration ); |
|
268 | + $expires = date('Y-m-d H:i:s', time() - $this->token_expiration); |
|
269 | 269 | |
270 | 270 | $email = $wpdb->get_var( |
271 | - $wpdb->prepare( "SELECT email FROM {$wpdb->prefix}give_customers WHERE token = %s AND verify_throttle >= %s LIMIT 1", $token, $expires ) |
|
271 | + $wpdb->prepare("SELECT email FROM {$wpdb->prefix}give_customers WHERE token = %s AND verify_throttle >= %s LIMIT 1", $token, $expires) |
|
272 | 272 | ); |
273 | 273 | |
274 | - if ( ! empty( $email ) ) { |
|
274 | + if ( ! empty($email)) { |
|
275 | 275 | $this->token_email = $email; |
276 | 276 | $this->token = $token; |
277 | 277 | |
@@ -279,8 +279,8 @@ discard block |
||
279 | 279 | } |
280 | 280 | |
281 | 281 | //Set error only if email access form isn't being submitted |
282 | - if ( ! isset( $_POST['give_email'] ) && ! isset( $_POST['_wpnonce'] ) ) { |
|
283 | - give_set_error( 'give_email_token_expired', apply_filters( 'give_email_token_expired_message', 'Your access token has expired. Please request a new one below:', 'give' ) ); |
|
282 | + if ( ! isset($_POST['give_email']) && ! isset($_POST['_wpnonce'])) { |
|
283 | + give_set_error('give_email_token_expired', apply_filters('give_email_token_expired_message', 'Your access token has expired. Please request a new one below:', 'give')); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -300,25 +300,25 @@ discard block |
||
300 | 300 | * |
301 | 301 | * @return void |
302 | 302 | */ |
303 | - public function set_verify_key( $customer_id, $email, $verify_key ) { |
|
303 | + public function set_verify_key($customer_id, $email, $verify_key) { |
|
304 | 304 | global $wpdb; |
305 | 305 | |
306 | - $now = date( 'Y-m-d H:i:s' ); |
|
306 | + $now = date('Y-m-d H:i:s'); |
|
307 | 307 | |
308 | 308 | // Insert or update? |
309 | 309 | $row_id = (int) $wpdb->get_var( |
310 | - $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id ) |
|
310 | + $wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id) |
|
311 | 311 | ); |
312 | 312 | |
313 | 313 | // Update |
314 | - if ( ! empty( $row_id ) ) { |
|
314 | + if ( ! empty($row_id)) { |
|
315 | 315 | $wpdb->query( |
316 | - $wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id ) |
|
316 | + $wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id) |
|
317 | 317 | ); |
318 | 318 | } // Insert |
319 | 319 | else { |
320 | 320 | $wpdb->query( |
321 | - $wpdb->prepare( "INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now ) |
|
321 | + $wpdb->prepare("INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now) |
|
322 | 322 | ); |
323 | 323 | } |
324 | 324 | } |
@@ -333,21 +333,21 @@ discard block |
||
333 | 333 | * |
334 | 334 | * @return bool |
335 | 335 | */ |
336 | - public function is_valid_verify_key( $token ) { |
|
336 | + public function is_valid_verify_key($token) { |
|
337 | 337 | /* @var WPDB $wpdb */ |
338 | 338 | global $wpdb; |
339 | 339 | |
340 | 340 | // See if the verify_key exists |
341 | 341 | $row = $wpdb->get_row( |
342 | - $wpdb->prepare( "SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token ) |
|
342 | + $wpdb->prepare("SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token) |
|
343 | 343 | ); |
344 | 344 | |
345 | - $now = date( 'Y-m-d H:i:s' ); |
|
345 | + $now = date('Y-m-d H:i:s'); |
|
346 | 346 | |
347 | 347 | // Set token |
348 | - if ( ! empty( $row ) ) { |
|
348 | + if ( ! empty($row)) { |
|
349 | 349 | $wpdb->query( |
350 | - $wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id ) |
|
350 | + $wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id) |
|
351 | 351 | ); |
352 | 352 | |
353 | 353 | $this->token_email = $row->email; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | * |
372 | 372 | * @return mixed |
373 | 373 | */ |
374 | - public function users_purchases_args( $args ) { |
|
374 | + public function users_purchases_args($args) { |
|
375 | 375 | $args['user'] = $this->token_email; |
376 | 376 | |
377 | 377 | return $args; |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | global $wpdb; |
393 | 393 | |
394 | 394 | //Create columns in customers table |
395 | - $query = $wpdb->query( "ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`" ); |
|
395 | + $query = $wpdb->query("ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`"); |
|
396 | 396 | |
397 | 397 | //Columns added properly |
398 | - if ( $query ) { |
|
399 | - give_update_option( 'email_access_installed', 1 ); |
|
398 | + if ($query) { |
|
399 | + give_update_option('email_access_installed', 1); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | } |
@@ -64,11 +64,14 @@ |
||
64 | 64 | }, 250 ); |
65 | 65 | </script> |
66 | 66 | |
67 | - <?php else : ?> |
|
67 | + <?php else { |
|
68 | + : ?> |
|
68 | 69 | |
69 | 70 | <div id="give-upgrade-status"> |
70 | 71 | <p style="font-size: 20px;max-width: 900px;"> |
71 | - <?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
72 | + <?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); |
|
73 | +} |
|
74 | +?> |
|
72 | 75 | <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
73 | 76 | </p> |
74 | 77 | </div> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | * @return void |
22 | 22 | */ |
23 | 23 | function give_upgrades_screen() { |
24 | - $action = isset( $_GET['give-upgrade'] ) ? sanitize_text_field( $_GET['give-upgrade'] ) : ''; |
|
25 | - $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; |
|
26 | - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; |
|
27 | - $custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0; |
|
28 | - $number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100; |
|
29 | - $steps = round( ( $total / $number ), 0 ); |
|
24 | + $action = isset($_GET['give-upgrade']) ? sanitize_text_field($_GET['give-upgrade']) : ''; |
|
25 | + $step = isset($_GET['step']) ? absint($_GET['step']) : 1; |
|
26 | + $total = isset($_GET['total']) ? absint($_GET['total']) : false; |
|
27 | + $custom = isset($_GET['custom']) ? absint($_GET['custom']) : 0; |
|
28 | + $number = isset($_GET['number']) ? absint($_GET['number']) : 100; |
|
29 | + $steps = round(($total / $number), 0); |
|
30 | 30 | |
31 | 31 | $doing_upgrade_args = array( |
32 | 32 | 'page' => 'give-upgrades', |
@@ -36,25 +36,25 @@ discard block |
||
36 | 36 | 'custom' => $custom, |
37 | 37 | 'steps' => $steps |
38 | 38 | ); |
39 | - update_option( 'give_doing_upgrade', $doing_upgrade_args ); |
|
40 | - if ( $step > $steps ) { |
|
39 | + update_option('give_doing_upgrade', $doing_upgrade_args); |
|
40 | + if ($step > $steps) { |
|
41 | 41 | // Prevent a weird case where the estimate was off. Usually only a couple. |
42 | 42 | $steps = $step; |
43 | 43 | } |
44 | 44 | ?> |
45 | 45 | <div class="wrap"> |
46 | - <h1><?php esc_html_e( 'Give - Upgrades', 'give' ); ?></h1> |
|
46 | + <h1><?php esc_html_e('Give - Upgrades', 'give'); ?></h1> |
|
47 | 47 | |
48 | - <?php if ( ! empty( $action ) ) : ?> |
|
48 | + <?php if ( ! empty($action)) : ?> |
|
49 | 49 | |
50 | 50 | <div id="give-upgrade-status"> |
51 | - <p style="font-size: 20px;max-width: 900px;"><?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
52 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
51 | + <p style="font-size: 20px;max-width: 900px;"><?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?> |
|
52 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
53 | 53 | </p> |
54 | 54 | |
55 | - <?php if ( ! empty( $total ) ) : ?> |
|
55 | + <?php if ( ! empty($total)) : ?> |
|
56 | 56 | <p> |
57 | - <strong><?php printf( esc_html__( 'Step %d of approximately %d running', 'give' ), $step, $steps ); ?></strong> |
|
57 | + <strong><?php printf(esc_html__('Step %d of approximately %d running', 'give'), $step, $steps); ?></strong> |
|
58 | 58 | </p> |
59 | 59 | <?php endif; ?> |
60 | 60 | </div> |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | |
69 | 69 | <div id="give-upgrade-status"> |
70 | 70 | <p style="font-size: 20px;max-width: 900px;"> |
71 | - <?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?> |
|
72 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
71 | + <?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?> |
|
72 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style=" position: relative; top: 3px; left: 6px;" /> |
|
73 | 73 | </p> |
74 | 74 | </div> |
75 | 75 | <script type="text/javascript"> |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
18 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export.php'; |
|
19 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-actions.php'; |
|
18 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export.php'; |
|
19 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-actions.php'; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Process batch exports via ajax |
@@ -26,79 +26,79 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function give_do_ajax_export() { |
28 | 28 | |
29 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; |
|
29 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php'; |
|
30 | 30 | |
31 | - parse_str( $_POST['form'], $form ); |
|
31 | + parse_str($_POST['form'], $form); |
|
32 | 32 | |
33 | 33 | $_REQUEST = $form = (array) $form; |
34 | 34 | |
35 | - if ( ! wp_verify_nonce( $_REQUEST['give_ajax_export'], 'give_ajax_export' ) ) { |
|
36 | - die( '-2' ); |
|
35 | + if ( ! wp_verify_nonce($_REQUEST['give_ajax_export'], 'give_ajax_export')) { |
|
36 | + die('-2'); |
|
37 | 37 | } |
38 | 38 | |
39 | - do_action( 'give_batch_export_class_include', $form['give-export-class'] ); |
|
39 | + do_action('give_batch_export_class_include', $form['give-export-class']); |
|
40 | 40 | |
41 | - $step = absint( $_POST['step'] ); |
|
42 | - $class = sanitize_text_field( $form['give-export-class'] ); |
|
41 | + $step = absint($_POST['step']); |
|
42 | + $class = sanitize_text_field($form['give-export-class']); |
|
43 | 43 | |
44 | - $export = new $class( $step ); |
|
44 | + $export = new $class($step); |
|
45 | 45 | |
46 | - if ( ! $export->can_export() ) { |
|
47 | - die( '-1' ); |
|
46 | + if ( ! $export->can_export()) { |
|
47 | + die('-1'); |
|
48 | 48 | } |
49 | 49 | |
50 | - if ( ! $export->is_writable ) { |
|
50 | + if ( ! $export->is_writable) { |
|
51 | 51 | $json_args = array( |
52 | 52 | 'error' => true, |
53 | - 'message' => esc_html__( 'Export location or file not writable.', 'give' ) |
|
53 | + 'message' => esc_html__('Export location or file not writable.', 'give') |
|
54 | 54 | ); |
55 | 55 | echo json_encode($json_args); |
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | |
59 | - $export->set_properties( $_REQUEST ); |
|
59 | + $export->set_properties($_REQUEST); |
|
60 | 60 | |
61 | 61 | $export->pre_fetch(); |
62 | 62 | |
63 | - $ret = $export->process_step( $step ); |
|
63 | + $ret = $export->process_step($step); |
|
64 | 64 | |
65 | 65 | $percentage = $export->get_percentage_complete(); |
66 | 66 | |
67 | - if ( $ret ) { |
|
67 | + if ($ret) { |
|
68 | 68 | |
69 | 69 | $step += 1; |
70 | - echo json_encode( array( 'step' => $step, 'percentage' => $percentage ) ); |
|
70 | + echo json_encode(array('step' => $step, 'percentage' => $percentage)); |
|
71 | 71 | exit; |
72 | 72 | |
73 | - } elseif ( true === $export->is_empty ) { |
|
73 | + } elseif (true === $export->is_empty) { |
|
74 | 74 | |
75 | - echo json_encode( array( |
|
75 | + echo json_encode(array( |
|
76 | 76 | 'error' => true, |
77 | - 'message' => esc_html__( 'No data found for export parameters.', 'give' ) |
|
78 | - ) ); |
|
77 | + 'message' => esc_html__('No data found for export parameters.', 'give') |
|
78 | + )); |
|
79 | 79 | exit; |
80 | 80 | |
81 | - } elseif ( true === $export->done && true === $export->is_void ) { |
|
81 | + } elseif (true === $export->done && true === $export->is_void) { |
|
82 | 82 | |
83 | - $message = ! empty( $export->message ) ? $export->message : esc_html__( 'Batch Processing Complete', 'give' ); |
|
84 | - echo json_encode( array( 'success' => true, 'message' => $message ) ); |
|
83 | + $message = ! empty($export->message) ? $export->message : esc_html__('Batch Processing Complete', 'give'); |
|
84 | + echo json_encode(array('success' => true, 'message' => $message)); |
|
85 | 85 | exit; |
86 | 86 | |
87 | 87 | } else { |
88 | 88 | |
89 | - $args = array_merge( $_REQUEST, array( |
|
89 | + $args = array_merge($_REQUEST, array( |
|
90 | 90 | 'step' => $step, |
91 | 91 | 'class' => $class, |
92 | - 'nonce' => wp_create_nonce( 'give-batch-export' ), |
|
92 | + 'nonce' => wp_create_nonce('give-batch-export'), |
|
93 | 93 | 'give_action' => 'form_batch_export', |
94 | - ) ); |
|
94 | + )); |
|
95 | 95 | |
96 | - $download_url = add_query_arg( $args, admin_url() ); |
|
96 | + $download_url = add_query_arg($args, admin_url()); |
|
97 | 97 | |
98 | - echo json_encode( array( 'step' => 'done', 'url' => $download_url ) ); |
|
98 | + echo json_encode(array('step' => 'done', 'url' => $download_url)); |
|
99 | 99 | exit; |
100 | 100 | |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | -add_action( 'wp_ajax_give_do_ajax_export', 'give_do_ajax_export' ); |
|
104 | +add_action('wp_ajax_give_do_ajax_export', 'give_do_ajax_export'); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -29,31 +29,31 @@ discard block |
||
29 | 29 | global $give_settings_page, $give_payments_page, $give_reports_page, $give_add_ons_page, $give_upgrades_screen, $give_donors_page; |
30 | 30 | |
31 | 31 | //Payments |
32 | - $give_payment = get_post_type_object( 'give_payment' ); |
|
33 | - $give_payments_page = add_submenu_page( 'edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page' ); |
|
32 | + $give_payment = get_post_type_object('give_payment'); |
|
33 | + $give_payments_page = add_submenu_page('edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page'); |
|
34 | 34 | |
35 | 35 | //Donors |
36 | - $give_donors_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donors', 'give' ), esc_html__( 'Donors', 'give' ), 'view_give_reports', 'give-donors', 'give_customers_page' ); |
|
36 | + $give_donors_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donors', 'give'), esc_html__('Donors', 'give'), 'view_give_reports', 'give-donors', 'give_customers_page'); |
|
37 | 37 | |
38 | 38 | //Reports` |
39 | - $give_reports_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donation Reports', 'give' ), esc_html__( 'Reports', 'give' ), 'view_give_reports', 'give-reports', 'give_reports_page' ); |
|
39 | + $give_reports_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donation Reports', 'give'), esc_html__('Reports', 'give'), 'view_give_reports', 'give-reports', 'give_reports_page'); |
|
40 | 40 | |
41 | 41 | //Settings |
42 | - $give_settings_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Settings', 'give' ), esc_html__( 'Settings', 'give' ), 'manage_give_settings', 'give-settings', array( |
|
42 | + $give_settings_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Settings', 'give'), esc_html__('Settings', 'give'), 'manage_give_settings', 'give-settings', array( |
|
43 | 43 | Give()->give_settings, |
44 | 44 | 'admin_page_display' |
45 | - ) ); |
|
45 | + )); |
|
46 | 46 | |
47 | 47 | //Add-ons |
48 | - $give_add_ons_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Add-ons', 'give' ), esc_html__( 'Add-ons', 'give' ), 'install_plugins', 'give-addons', 'give_add_ons_page' ); |
|
48 | + $give_add_ons_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Add-ons', 'give'), esc_html__('Add-ons', 'give'), 'install_plugins', 'give-addons', 'give_add_ons_page'); |
|
49 | 49 | |
50 | 50 | //Upgrades |
51 | - $give_upgrades_screen = add_submenu_page( null, esc_html__( 'Give Upgrades', 'give' ), esc_html__( 'Give Upgrades', 'give' ), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen' ); |
|
51 | + $give_upgrades_screen = add_submenu_page(null, esc_html__('Give Upgrades', 'give'), esc_html__('Give Upgrades', 'give'), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen'); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | } |
55 | 55 | |
56 | -add_action( 'admin_menu', 'give_add_options_links', 10 ); |
|
56 | +add_action('admin_menu', 'give_add_options_links', 10); |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Determines whether the current admin page is a Give admin page. |
@@ -68,224 +68,224 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return bool True if Give admin page. |
70 | 70 | */ |
71 | -function give_is_admin_page( $passed_page = '', $passed_view = '' ) { |
|
71 | +function give_is_admin_page($passed_page = '', $passed_view = '') { |
|
72 | 72 | |
73 | 73 | global $pagenow, $typenow; |
74 | 74 | |
75 | 75 | $found = false; |
76 | - $post_type = isset( $_GET['post_type'] ) ? strtolower( $_GET['post_type'] ) : false; |
|
77 | - $action = isset( $_GET['action'] ) ? strtolower( $_GET['action'] ) : false; |
|
78 | - $taxonomy = isset( $_GET['taxonomy'] ) ? strtolower( $_GET['taxonomy'] ) : false; |
|
79 | - $page = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false; |
|
80 | - $view = isset( $_GET['view'] ) ? strtolower( $_GET['view'] ) : false; |
|
81 | - $tab = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : false; |
|
76 | + $post_type = isset($_GET['post_type']) ? strtolower($_GET['post_type']) : false; |
|
77 | + $action = isset($_GET['action']) ? strtolower($_GET['action']) : false; |
|
78 | + $taxonomy = isset($_GET['taxonomy']) ? strtolower($_GET['taxonomy']) : false; |
|
79 | + $page = isset($_GET['page']) ? strtolower($_GET['page']) : false; |
|
80 | + $view = isset($_GET['view']) ? strtolower($_GET['view']) : false; |
|
81 | + $tab = isset($_GET['tab']) ? strtolower($_GET['tab']) : false; |
|
82 | 82 | |
83 | - switch ( $passed_page ) { |
|
83 | + switch ($passed_page) { |
|
84 | 84 | case 'give_forms': |
85 | - switch ( $passed_view ) { |
|
85 | + switch ($passed_view) { |
|
86 | 86 | case 'list-table': |
87 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' ) { |
|
87 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php') { |
|
88 | 88 | $found = true; |
89 | 89 | } |
90 | 90 | break; |
91 | 91 | case 'edit': |
92 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post.php' ) { |
|
92 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post.php') { |
|
93 | 93 | $found = true; |
94 | 94 | } |
95 | 95 | break; |
96 | 96 | case 'new': |
97 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post-new.php' ) { |
|
97 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post-new.php') { |
|
98 | 98 | $found = true; |
99 | 99 | } |
100 | 100 | break; |
101 | 101 | default: |
102 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) || 'give_forms' === $post_type || ( 'post-new.php' == $pagenow && 'give_forms' === $post_type ) ) { |
|
102 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) || 'give_forms' === $post_type || ('post-new.php' == $pagenow && 'give_forms' === $post_type)) { |
|
103 | 103 | $found = true; |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | } |
107 | 107 | break; |
108 | 108 | case 'categories': |
109 | - switch ( $passed_view ) { |
|
109 | + switch ($passed_view) { |
|
110 | 110 | case 'list-table': |
111 | 111 | case 'new': |
112 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy ) { |
|
112 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy) { |
|
113 | 113 | $found = true; |
114 | 114 | } |
115 | 115 | break; |
116 | 116 | case 'edit': |
117 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy ) { |
|
117 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy) { |
|
118 | 118 | $found = true; |
119 | 119 | } |
120 | 120 | break; |
121 | 121 | default: |
122 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy ) { |
|
122 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy) { |
|
123 | 123 | $found = true; |
124 | 124 | } |
125 | 125 | break; |
126 | 126 | } |
127 | 127 | break; |
128 | 128 | case 'tags': |
129 | - switch ( $passed_view ) { |
|
129 | + switch ($passed_view) { |
|
130 | 130 | case 'list-table': |
131 | 131 | case 'new': |
132 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy ) { |
|
132 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy) { |
|
133 | 133 | $found = true; |
134 | 134 | } |
135 | 135 | break; |
136 | 136 | case 'edit': |
137 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy ) { |
|
137 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy) { |
|
138 | 138 | $found = true; |
139 | 139 | } |
140 | 140 | break; |
141 | 141 | default: |
142 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy ) { |
|
142 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy) { |
|
143 | 143 | $found = true; |
144 | 144 | } |
145 | 145 | break; |
146 | 146 | } |
147 | 147 | break; |
148 | 148 | case 'payments': |
149 | - switch ( $passed_view ) { |
|
149 | + switch ($passed_view) { |
|
150 | 150 | case 'list-table': |
151 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view ) { |
|
151 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view) { |
|
152 | 152 | $found = true; |
153 | 153 | } |
154 | 154 | break; |
155 | 155 | case 'edit': |
156 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view ) { |
|
156 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view) { |
|
157 | 157 | $found = true; |
158 | 158 | } |
159 | 159 | break; |
160 | 160 | default: |
161 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page ) { |
|
161 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page) { |
|
162 | 162 | $found = true; |
163 | 163 | } |
164 | 164 | break; |
165 | 165 | } |
166 | 166 | break; |
167 | 167 | case 'reports': |
168 | - switch ( $passed_view ) { |
|
168 | + switch ($passed_view) { |
|
169 | 169 | // If you want to do something like enqueue a script on a particular report's duration, look at $_GET[ 'range' ] |
170 | 170 | case 'earnings': |
171 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && ( 'earnings' === $view || '-1' === $view || false === $view ) ) { |
|
171 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && ('earnings' === $view || '-1' === $view || false === $view)) { |
|
172 | 172 | $found = true; |
173 | 173 | } |
174 | 174 | break; |
175 | 175 | case 'donors': |
176 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view ) { |
|
176 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view) { |
|
177 | 177 | $found = true; |
178 | 178 | } |
179 | 179 | break; |
180 | 180 | case 'gateways': |
181 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view ) { |
|
181 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view) { |
|
182 | 182 | $found = true; |
183 | 183 | } |
184 | 184 | break; |
185 | 185 | case 'export': |
186 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view ) { |
|
186 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view) { |
|
187 | 187 | $found = true; |
188 | 188 | } |
189 | 189 | break; |
190 | 190 | case 'logs': |
191 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view ) { |
|
191 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view) { |
|
192 | 192 | $found = true; |
193 | 193 | } |
194 | 194 | break; |
195 | 195 | default: |
196 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) { |
|
196 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) { |
|
197 | 197 | $found = true; |
198 | 198 | } |
199 | 199 | break; |
200 | 200 | } |
201 | 201 | break; |
202 | 202 | case 'settings': |
203 | - switch ( $passed_view ) { |
|
203 | + switch ($passed_view) { |
|
204 | 204 | case 'general': |
205 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && ( 'general' === $tab || false === $tab ) ) { |
|
205 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && ('general' === $tab || false === $tab)) { |
|
206 | 206 | $found = true; |
207 | 207 | } |
208 | 208 | break; |
209 | 209 | case 'gateways': |
210 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab ) { |
|
210 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab) { |
|
211 | 211 | $found = true; |
212 | 212 | } |
213 | 213 | break; |
214 | 214 | case 'emails': |
215 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab ) { |
|
215 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab) { |
|
216 | 216 | $found = true; |
217 | 217 | } |
218 | 218 | break; |
219 | 219 | case 'display': |
220 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab ) { |
|
220 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab) { |
|
221 | 221 | $found = true; |
222 | 222 | } |
223 | 223 | break; |
224 | 224 | case 'licenses': |
225 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab ) { |
|
225 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab) { |
|
226 | 226 | $found = true; |
227 | 227 | } |
228 | 228 | break; |
229 | 229 | case 'api': |
230 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab ) { |
|
230 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab) { |
|
231 | 231 | $found = true; |
232 | 232 | } |
233 | 233 | break; |
234 | 234 | case 'advanced': |
235 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab ) { |
|
235 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab) { |
|
236 | 236 | $found = true; |
237 | 237 | } |
238 | 238 | break; |
239 | 239 | case 'system_info': |
240 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab ) { |
|
240 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab) { |
|
241 | 241 | $found = true; |
242 | 242 | } |
243 | 243 | break; |
244 | 244 | default: |
245 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page ) { |
|
245 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page) { |
|
246 | 246 | $found = true; |
247 | 247 | } |
248 | 248 | break; |
249 | 249 | } |
250 | 250 | break; |
251 | 251 | case 'addons': |
252 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-addons' === $page ) { |
|
252 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-addons' === $page) { |
|
253 | 253 | $found = true; |
254 | 254 | } |
255 | 255 | break; |
256 | 256 | case 'donors': |
257 | - switch ( $passed_view ) { |
|
257 | + switch ($passed_view) { |
|
258 | 258 | case 'list-table': |
259 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view ) { |
|
259 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view) { |
|
260 | 260 | $found = true; |
261 | 261 | } |
262 | 262 | break; |
263 | 263 | case 'overview': |
264 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view ) { |
|
264 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view) { |
|
265 | 265 | $found = true; |
266 | 266 | } |
267 | 267 | break; |
268 | 268 | case 'notes': |
269 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view ) { |
|
269 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view) { |
|
270 | 270 | $found = true; |
271 | 271 | } |
272 | 272 | break; |
273 | 273 | default: |
274 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page ) { |
|
274 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page) { |
|
275 | 275 | $found = true; |
276 | 276 | } |
277 | 277 | break; |
278 | 278 | } |
279 | 279 | break; |
280 | 280 | case 'reports': |
281 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) { |
|
281 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) { |
|
282 | 282 | $found = true; |
283 | 283 | } |
284 | 284 | break; |
285 | 285 | default: |
286 | 286 | global $give_payments_page, $give_settings_page, $give_reports_page, $give_system_info_page, $give_add_ons_page, $give_settings_export, $give_upgrades_screen, $give_customers_page; |
287 | 287 | |
288 | - $admin_pages = apply_filters( 'give_admin_pages', array( |
|
288 | + $admin_pages = apply_filters('give_admin_pages', array( |
|
289 | 289 | $give_payments_page, |
290 | 290 | $give_settings_page, |
291 | 291 | $give_reports_page, |
@@ -294,18 +294,18 @@ discard block |
||
294 | 294 | $give_upgrades_screen, |
295 | 295 | $give_settings_export, |
296 | 296 | $give_customers_page |
297 | - ) ); |
|
298 | - if ( 'give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow ) { |
|
297 | + )); |
|
298 | + if ('give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) { |
|
299 | 299 | $found = true; |
300 | - if ( 'give-upgrades' === $page ) { |
|
300 | + if ('give-upgrades' === $page) { |
|
301 | 301 | $found = false; |
302 | 302 | } |
303 | - } elseif ( in_array( $pagenow, $admin_pages ) ) { |
|
303 | + } elseif (in_array($pagenow, $admin_pages)) { |
|
304 | 304 | $found = true; |
305 | 305 | } |
306 | 306 | break; |
307 | 307 | } |
308 | 308 | |
309 | - return (bool) apply_filters( 'give_is_admin_page', $found, $page, $view, $passed_page, $passed_view ); |
|
309 | + return (bool) apply_filters('give_is_admin_page', $found, $page, $view, $passed_page, $passed_view); |
|
310 | 310 | |
311 | 311 | } |
312 | 312 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | */ |
24 | 24 | function give_get_country() { |
25 | 25 | global $give_options; |
26 | - $country = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US'; |
|
26 | + $country = isset($give_options['base_country']) ? $give_options['base_country'] : 'US'; |
|
27 | 27 | |
28 | - return apply_filters( 'give_give_country', $country ); |
|
28 | + return apply_filters('give_give_country', $country); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function give_get_state() { |
38 | 38 | global $give_options; |
39 | - $state = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false; |
|
39 | + $state = isset($give_options['base_state']) ? $give_options['base_state'] : false; |
|
40 | 40 | |
41 | - return apply_filters( 'give_give_state', $state ); |
|
41 | + return apply_filters('give_give_state', $state); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return mixed|void A list of states for the shop's base country |
52 | 52 | */ |
53 | -function give_get_states( $country = null ) { |
|
53 | +function give_get_states($country = null) { |
|
54 | 54 | global $give_options; |
55 | 55 | |
56 | - if ( empty( $country ) ) { |
|
56 | + if (empty($country)) { |
|
57 | 57 | $country = give_get_country(); |
58 | 58 | } |
59 | 59 | |
60 | - switch ( $country ) : |
|
60 | + switch ($country) : |
|
61 | 61 | |
62 | 62 | case 'US' : |
63 | 63 | $states = give_get_states_list(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | endswitch; |
109 | 109 | |
110 | - return apply_filters( 'give_give_states', $states ); |
|
110 | + return apply_filters('give_give_states', $states); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -120,253 +120,253 @@ discard block |
||
120 | 120 | function give_get_country_list() { |
121 | 121 | $countries = array( |
122 | 122 | '' => '', |
123 | - 'US' => esc_html__( 'United States', 'give' ), |
|
124 | - 'CA' => esc_html__( 'Canada', 'give' ), |
|
125 | - 'GB' => esc_html__( 'United Kingdom', 'give' ), |
|
126 | - 'AF' => esc_html__( 'Afghanistan', 'give' ), |
|
127 | - 'AL' => esc_html__( 'Albania', 'give' ), |
|
128 | - 'DZ' => esc_html__( 'Algeria', 'give' ), |
|
129 | - 'AS' => esc_html__( 'American Samoa', 'give' ), |
|
130 | - 'AD' => esc_html__( 'Andorra', 'give' ), |
|
131 | - 'AO' => esc_html__( 'Angola', 'give' ), |
|
132 | - 'AI' => esc_html__( 'Anguilla', 'give' ), |
|
133 | - 'AQ' => esc_html__( 'Antarctica', 'give' ), |
|
134 | - 'AG' => esc_html__( 'Antigua and Barbuda', 'give' ), |
|
135 | - 'AR' => esc_html__( 'Argentina', 'give' ), |
|
136 | - 'AM' => esc_html__( 'Armenia', 'give' ), |
|
137 | - 'AW' => esc_html__( 'Aruba', 'give' ), |
|
138 | - 'AU' => esc_html__( 'Australia', 'give' ), |
|
139 | - 'AT' => esc_html__( 'Austria', 'give' ), |
|
140 | - 'AZ' => esc_html__( 'Azerbaijan', 'give' ), |
|
141 | - 'BS' => esc_html__( 'Bahamas', 'give'), |
|
142 | - 'BH' => esc_html__( 'Bahrain', 'give' ), |
|
143 | - 'BD' => esc_html__( 'Bangladesh', 'give' ), |
|
144 | - 'BB' => esc_html__( 'Barbados', 'give' ), |
|
145 | - 'BY' => esc_html__( 'Belarus', 'give' ), |
|
146 | - 'BE' => esc_html__( 'Belgium', 'give' ), |
|
147 | - 'BZ' => esc_html__( 'Belize', 'give' ), |
|
148 | - 'BJ' => esc_html__( 'Benin', 'give' ), |
|
149 | - 'BM' => esc_html__( 'Bermuda', 'give' ), |
|
150 | - 'BT' => esc_html__( 'Bhutan', 'give' ), |
|
151 | - 'BO' => esc_html__( 'Bolivia', 'give' ), |
|
152 | - 'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ), |
|
153 | - 'BW' => esc_html__( 'Botswana', 'give' ), |
|
154 | - 'BV' => esc_html__( 'Bouvet Island', 'give' ), |
|
155 | - 'BR' => esc_html__( 'Brazil', 'give' ), |
|
156 | - 'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ), |
|
157 | - 'BN' => esc_html__( 'Brunei Darrussalam', 'give' ), |
|
158 | - 'BG' => esc_html__( 'Bulgaria', 'give' ), |
|
159 | - 'BF' => esc_html__( 'Burkina Faso', 'give' ), |
|
160 | - 'BI' => esc_html__( 'Burundi', 'give' ), |
|
161 | - 'KH' => esc_html__( 'Cambodia', 'give' ), |
|
162 | - 'CM' => esc_html__( 'Cameroon', 'give' ), |
|
163 | - 'CV' => esc_html__( 'Cape Verde', 'give' ), |
|
164 | - 'KY' => esc_html__( 'Cayman Islands', 'give' ), |
|
165 | - 'CF' => esc_html__( 'Central African Republic', 'give' ), |
|
166 | - 'TD' => esc_html__( 'Chad', 'give' ), |
|
167 | - 'CL' => esc_html__( 'Chile', 'give' ), |
|
168 | - 'CN' => esc_html__( 'China', 'give' ), |
|
169 | - 'CX' => esc_html__( 'Christmas Island', 'give' ), |
|
170 | - 'CC' => esc_html__( 'Cocos Islands', 'give' ), |
|
171 | - 'CO' => esc_html__( 'Colombia', 'give' ), |
|
172 | - 'KM' => esc_html__( 'Comoros', 'give' ), |
|
173 | - 'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ), |
|
174 | - 'CG' => esc_html__( 'Congo, Republic of', 'give' ), |
|
175 | - 'CK' => esc_html__( 'Cook Islands', 'give' ), |
|
176 | - 'CR' => esc_html__( 'Costa Rica', 'give' ), |
|
177 | - 'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ), |
|
178 | - 'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ), |
|
179 | - 'CU' => esc_html__( 'Cuba', 'give' ), |
|
180 | - 'CY' => esc_html__( 'Cyprus Island', 'give' ), |
|
181 | - 'CZ' => esc_html__( 'Czech Republic', 'give' ), |
|
182 | - 'DK' => esc_html__( 'Denmark', 'give' ), |
|
183 | - 'DJ' => esc_html__( 'Djibouti', 'give' ), |
|
184 | - 'DM' => esc_html__( 'Dominica', 'give' ), |
|
185 | - 'DO' => esc_html__( 'Dominican Republic', 'give' ), |
|
186 | - 'TP' => esc_html__( 'East Timor', 'give' ), |
|
187 | - 'EC' => esc_html__( 'Ecuador', 'give' ), |
|
188 | - 'EG' => esc_html__( 'Egypt', 'give' ), |
|
189 | - 'GQ' => esc_html__( 'Equatorial Guinea', 'give' ), |
|
190 | - 'SV' => esc_html__( 'El Salvador', 'give' ), |
|
191 | - 'ER' => esc_html__( 'Eritrea', 'give' ), |
|
192 | - 'EE' => esc_html__( 'Estonia', 'give' ), |
|
193 | - 'ET' => esc_html__( 'Ethiopia', 'give' ), |
|
194 | - 'FK' => esc_html__( 'Falkland Islands', 'give' ), |
|
195 | - 'FO' => esc_html__( 'Faroe Islands', 'give' ), |
|
196 | - 'FJ' => esc_html__( 'Fiji', 'give' ), |
|
197 | - 'FI' => esc_html__( 'Finland', 'give' ), |
|
198 | - 'FR' => esc_html__( 'France', 'give' ), |
|
199 | - 'GF' => esc_html__( 'French Guiana', 'give' ), |
|
200 | - 'PF' => esc_html__( 'French Polynesia', 'give' ), |
|
201 | - 'TF' => esc_html__( 'French Southern Territories', 'give' ), |
|
202 | - 'GA' => esc_html__( 'Gabon', 'give' ), |
|
203 | - 'GM' => esc_html__( 'Gambia', 'give' ), |
|
204 | - 'GE' => esc_html__( 'Georgia', 'give' ), |
|
205 | - 'DE' => esc_html__( 'Germany', 'give' ), |
|
206 | - 'GR' => esc_html__( 'Greece', 'give' ), |
|
207 | - 'GH' => esc_html__( 'Ghana', 'give' ), |
|
208 | - 'GI' => esc_html__( 'Gibraltar', 'give' ), |
|
209 | - 'GL' => esc_html__( 'Greenland', 'give' ), |
|
210 | - 'GD' => esc_html__( 'Grenada', 'give' ), |
|
211 | - 'GP' => esc_html__( 'Guadeloupe', 'give' ), |
|
212 | - 'GU' => esc_html__( 'Guam', 'give' ), |
|
213 | - 'GT' => esc_html__( 'Guatemala', 'give' ), |
|
214 | - 'GG' => esc_html__( 'Guernsey', 'give' ), |
|
215 | - 'GN' => esc_html__( 'Guinea', 'give' ), |
|
216 | - 'GW' => esc_html__( 'Guinea-Bissau', 'give' ), |
|
217 | - 'GY' => esc_html__( 'Guyana', 'give' ), |
|
218 | - 'HT' => esc_html__( 'Haiti', 'give' ), |
|
219 | - 'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ), |
|
220 | - 'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ), |
|
221 | - 'HN' => esc_html__( 'Honduras', 'give' ), |
|
222 | - 'HK' => esc_html__( 'Hong Kong', 'give' ), |
|
223 | - 'HU' => esc_html__( 'Hungary', 'give' ), |
|
224 | - 'IS' => esc_html__( 'Iceland', 'give' ), |
|
225 | - 'IN' => esc_html__( 'India', 'give' ), |
|
226 | - 'ID' => esc_html__( 'Indonesia', 'give' ), |
|
227 | - 'IR' => esc_html__( 'Iran', 'give' ), |
|
228 | - 'IQ' => esc_html__( 'Iraq', 'give' ), |
|
229 | - 'IE' => esc_html__( 'Ireland', 'give' ), |
|
230 | - 'IM' => esc_html__( 'Isle of Man', 'give' ), |
|
231 | - 'IL' => esc_html__( 'Israel', 'give' ), |
|
232 | - 'IT' => esc_html__( 'Italy', 'give' ), |
|
233 | - 'JM' => esc_html__( 'Jamaica', 'give' ), |
|
234 | - 'JP' => esc_html__( 'Japan', 'give' ), |
|
235 | - 'JE' => esc_html__( 'Jersey', 'give' ), |
|
236 | - 'JO' => esc_html__( 'Jordan', 'give' ), |
|
237 | - 'KZ' => esc_html__( 'Kazakhstan', 'give' ), |
|
238 | - 'KE' => esc_html__( 'Kenya', 'give' ), |
|
239 | - 'KI' => esc_html__( 'Kiribati', 'give' ), |
|
240 | - 'KW' => esc_html__( 'Kuwait', 'give' ), |
|
241 | - 'KG' => esc_html__( 'Kyrgyzstan', 'give' ), |
|
242 | - 'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ), |
|
243 | - 'LV' => esc_html__( 'Latvia', 'give' ), |
|
244 | - 'LB' => esc_html__( 'Lebanon', 'give' ), |
|
245 | - 'LS' => esc_html__( 'Lesotho', 'give' ), |
|
246 | - 'LR' => esc_html__( 'Liberia', 'give' ), |
|
247 | - 'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ), |
|
248 | - 'LI' => esc_html__( 'Liechtenstein', 'give' ), |
|
249 | - 'LT' => esc_html__( 'Lithuania', 'give' ), |
|
250 | - 'LU' => esc_html__( 'Luxembourg', 'give' ), |
|
251 | - 'MO' => esc_html__( 'Macau', 'give' ), |
|
252 | - 'MK' => esc_html__( 'Macedonia', 'give' ), |
|
253 | - 'MG' => esc_html__( 'Madagascar', 'give' ), |
|
254 | - 'MW' => esc_html__( 'Malawi', 'give' ), |
|
255 | - 'MY' => esc_html__( 'Malaysia', 'give' ), |
|
256 | - 'MV' => esc_html__( 'Maldives', 'give' ), |
|
257 | - 'ML' => esc_html__( 'Mali', 'give' ), |
|
258 | - 'MT' => esc_html__( 'Malta', 'give' ), |
|
259 | - 'MH' => esc_html__( 'Marshall Islands', 'give' ), |
|
260 | - 'MQ' => esc_html__( 'Martinique', 'give' ), |
|
261 | - 'MR' => esc_html__( 'Mauritania', 'give' ), |
|
262 | - 'MU' => esc_html__( 'Mauritius', 'give' ), |
|
263 | - 'YT' => esc_html__( 'Mayotte', 'give' ), |
|
264 | - 'MX' => esc_html__( 'Mexico', 'give' ), |
|
265 | - 'FM' => esc_html__( 'Micronesia', 'give' ), |
|
266 | - 'MD' => esc_html__( 'Moldova, Republic of', 'give' ), |
|
267 | - 'MC' => esc_html__( 'Monaco', 'give' ), |
|
268 | - 'MN' => esc_html__( 'Mongolia', 'give' ), |
|
269 | - 'ME' => esc_html__( 'Montenegro', 'give' ), |
|
270 | - 'MS' => esc_html__( 'Montserrat', 'give' ), |
|
271 | - 'MA' => esc_html__( 'Morocco', 'give' ), |
|
272 | - 'MZ' => esc_html__( 'Mozambique', 'give' ), |
|
273 | - 'MM' => esc_html__( 'Myanmar', 'give' ), |
|
274 | - 'NA' => esc_html__( 'Namibia', 'give' ), |
|
275 | - 'NR' => esc_html__( 'Nauru', 'give' ), |
|
276 | - 'NP' => esc_html__( 'Nepal', 'give' ), |
|
277 | - 'NL' => esc_html__( 'Netherlands', 'give' ), |
|
278 | - 'AN' => esc_html__( 'Netherlands Antilles', 'give' ), |
|
279 | - 'NC' => esc_html__( 'New Caledonia', 'give' ), |
|
280 | - 'NZ' => esc_html__( 'New Zealand', 'give' ), |
|
281 | - 'NI' => esc_html__( 'Nicaragua', 'give' ), |
|
282 | - 'NE' => esc_html__( 'Niger', 'give' ), |
|
283 | - 'NG' => esc_html__( 'Nigeria', 'give' ), |
|
284 | - 'NU' => esc_html__( 'Niue', 'give' ), |
|
285 | - 'NF' => esc_html__( 'Norfolk Island', 'give' ), |
|
286 | - 'KP' => esc_html__( 'North Korea', 'give' ), |
|
287 | - 'MP' => esc_html__( 'Northern Mariana Islands', 'give' ), |
|
288 | - 'NO' => esc_html__( 'Norway', 'give' ), |
|
289 | - 'OM' => esc_html__( 'Oman', 'give' ), |
|
290 | - 'PK' => esc_html__( 'Pakistan', 'give' ), |
|
291 | - 'PW' => esc_html__( 'Palau', 'give' ), |
|
292 | - 'PS' => esc_html__( 'Palestinian Territories', 'give' ), |
|
293 | - 'PA' => esc_html__( 'Panama', 'give' ), |
|
294 | - 'PG' => esc_html__( 'Papua New Guinea', 'give' ), |
|
295 | - 'PY' => esc_html__( 'Paraguay', 'give' ), |
|
296 | - 'PE' => esc_html__( 'Peru', 'give' ), |
|
297 | - 'PH' => esc_html__( 'Phillipines', 'give' ), |
|
298 | - 'PN' => esc_html__( 'Pitcairn Island', 'give' ), |
|
299 | - 'PL' => esc_html__( 'Poland', 'give' ), |
|
300 | - 'PT' => esc_html__( 'Portugal', 'give' ), |
|
301 | - 'PR' => esc_html__( 'Puerto Rico', 'give' ), |
|
302 | - 'QA' => esc_html__( 'Qatar', 'give' ), |
|
303 | - 'RE' => esc_html__( 'Reunion Island', 'give' ), |
|
304 | - 'RO' => esc_html__( 'Romania', 'give' ), |
|
305 | - 'RU' => esc_html__( 'Russian Federation', 'give' ), |
|
306 | - 'RW' => esc_html__( 'Rwanda', 'give' ), |
|
307 | - 'SH' => esc_html__( 'Saint Helena', 'give' ), |
|
308 | - 'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ), |
|
309 | - 'LC' => esc_html__( 'Saint Lucia', 'give' ), |
|
310 | - 'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ), |
|
311 | - 'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ), |
|
312 | - 'SM' => esc_html__( 'San Marino', 'give' ), |
|
313 | - 'ST' => esc_html__( 'Sao Tome and Principe', 'give' ), |
|
314 | - 'SA' => esc_html__( 'Saudi Arabia', 'give' ), |
|
315 | - 'SN' => esc_html__( 'Senegal', 'give' ), |
|
316 | - 'RS' => esc_html__( 'Serbia', 'give' ), |
|
317 | - 'SC' => esc_html__( 'Seychelles', 'give' ), |
|
318 | - 'SL' => esc_html__( 'Sierra Leone', 'give' ), |
|
319 | - 'SG' => esc_html__( 'Singapore', 'give' ), |
|
320 | - 'SK' => esc_html__( 'Slovak Republic', 'give' ), |
|
321 | - 'SI' => esc_html__( 'Slovenia', 'give' ), |
|
322 | - 'SB' => esc_html__( 'Solomon Islands', 'give' ), |
|
323 | - 'SO' => esc_html__( 'Somalia', 'give' ), |
|
324 | - 'ZA' => esc_html__( 'South Africa', 'give' ), |
|
325 | - 'GS' => esc_html__( 'South Georgia', 'give' ), |
|
326 | - 'KR' => esc_html__( 'South Korea', 'give' ), |
|
327 | - 'ES' => esc_html__( 'Spain', 'give' ), |
|
328 | - 'LK' => esc_html__( 'Sri Lanka', 'give' ), |
|
329 | - 'SD' => esc_html__( 'Sudan', 'give' ), |
|
330 | - 'SR' => esc_html__( 'Suriname', 'give' ), |
|
331 | - 'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ), |
|
332 | - 'SZ' => esc_html__( 'Swaziland', 'give' ), |
|
333 | - 'SE' => esc_html__( 'Sweden', 'give' ), |
|
334 | - 'CH' => esc_html__( 'Switzerland', 'give' ), |
|
335 | - 'SY' => esc_html__( 'Syrian Arab Republic', 'give' ), |
|
336 | - 'TW' => esc_html__( 'Taiwan', 'give' ), |
|
337 | - 'TJ' => esc_html__( 'Tajikistan', 'give' ), |
|
338 | - 'TZ' => esc_html__( 'Tanzania', 'give' ), |
|
339 | - 'TG' => esc_html__( 'Togo', 'give' ), |
|
340 | - 'TK' => esc_html__( 'Tokelau', 'give' ), |
|
341 | - 'TO' => esc_html__( 'Tonga', 'give' ), |
|
342 | - 'TH' => esc_html__( 'Thailand', 'give' ), |
|
343 | - 'TT' => esc_html__( 'Trinidad and Tobago', 'give' ), |
|
344 | - 'TN' => esc_html__( 'Tunisia', 'give' ), |
|
345 | - 'TR' => esc_html__( 'Turkey', 'give' ), |
|
346 | - 'TM' => esc_html__( 'Turkmenistan', 'give' ), |
|
347 | - 'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ), |
|
348 | - 'TV' => esc_html__( 'Tuvalu', 'give' ), |
|
349 | - 'UG' => esc_html__( 'Uganda', 'give' ), |
|
350 | - 'UA' => esc_html__( 'Ukraine', 'give' ), |
|
351 | - 'AE' => esc_html__( 'United Arab Emirates', 'give' ), |
|
352 | - 'UY' => esc_html__( 'Uruguay', 'give' ), |
|
353 | - 'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ), |
|
354 | - 'UZ' => esc_html__( 'Uzbekistan', 'give' ), |
|
355 | - 'VU' => esc_html__( 'Vanuatu', 'give' ), |
|
356 | - 'VE' => esc_html__( 'Venezuela', 'give' ), |
|
357 | - 'VN' => esc_html__( 'Vietnam', 'give' ), |
|
358 | - 'VG' => esc_html__( 'Virgin Islands (British)', 'give' ), |
|
359 | - 'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ), |
|
360 | - 'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ), |
|
361 | - 'EH' => esc_html__( 'Western Sahara', 'give' ), |
|
362 | - 'WS' => esc_html__( 'Western Samoa', 'give' ), |
|
363 | - 'YE' => esc_html__( 'Yemen', 'give' ), |
|
364 | - 'YU' => esc_html__( 'Yugoslavia', 'give' ), |
|
365 | - 'ZM' => esc_html__( 'Zambia', 'give' ), |
|
366 | - 'ZW' => esc_html__( 'Zimbabwe', 'give' ) |
|
123 | + 'US' => esc_html__('United States', 'give'), |
|
124 | + 'CA' => esc_html__('Canada', 'give'), |
|
125 | + 'GB' => esc_html__('United Kingdom', 'give'), |
|
126 | + 'AF' => esc_html__('Afghanistan', 'give'), |
|
127 | + 'AL' => esc_html__('Albania', 'give'), |
|
128 | + 'DZ' => esc_html__('Algeria', 'give'), |
|
129 | + 'AS' => esc_html__('American Samoa', 'give'), |
|
130 | + 'AD' => esc_html__('Andorra', 'give'), |
|
131 | + 'AO' => esc_html__('Angola', 'give'), |
|
132 | + 'AI' => esc_html__('Anguilla', 'give'), |
|
133 | + 'AQ' => esc_html__('Antarctica', 'give'), |
|
134 | + 'AG' => esc_html__('Antigua and Barbuda', 'give'), |
|
135 | + 'AR' => esc_html__('Argentina', 'give'), |
|
136 | + 'AM' => esc_html__('Armenia', 'give'), |
|
137 | + 'AW' => esc_html__('Aruba', 'give'), |
|
138 | + 'AU' => esc_html__('Australia', 'give'), |
|
139 | + 'AT' => esc_html__('Austria', 'give'), |
|
140 | + 'AZ' => esc_html__('Azerbaijan', 'give'), |
|
141 | + 'BS' => esc_html__('Bahamas', 'give'), |
|
142 | + 'BH' => esc_html__('Bahrain', 'give'), |
|
143 | + 'BD' => esc_html__('Bangladesh', 'give'), |
|
144 | + 'BB' => esc_html__('Barbados', 'give'), |
|
145 | + 'BY' => esc_html__('Belarus', 'give'), |
|
146 | + 'BE' => esc_html__('Belgium', 'give'), |
|
147 | + 'BZ' => esc_html__('Belize', 'give'), |
|
148 | + 'BJ' => esc_html__('Benin', 'give'), |
|
149 | + 'BM' => esc_html__('Bermuda', 'give'), |
|
150 | + 'BT' => esc_html__('Bhutan', 'give'), |
|
151 | + 'BO' => esc_html__('Bolivia', 'give'), |
|
152 | + 'BA' => esc_html__('Bosnia and Herzegovina', 'give'), |
|
153 | + 'BW' => esc_html__('Botswana', 'give'), |
|
154 | + 'BV' => esc_html__('Bouvet Island', 'give'), |
|
155 | + 'BR' => esc_html__('Brazil', 'give'), |
|
156 | + 'IO' => esc_html__('British Indian Ocean Territory', 'give'), |
|
157 | + 'BN' => esc_html__('Brunei Darrussalam', 'give'), |
|
158 | + 'BG' => esc_html__('Bulgaria', 'give'), |
|
159 | + 'BF' => esc_html__('Burkina Faso', 'give'), |
|
160 | + 'BI' => esc_html__('Burundi', 'give'), |
|
161 | + 'KH' => esc_html__('Cambodia', 'give'), |
|
162 | + 'CM' => esc_html__('Cameroon', 'give'), |
|
163 | + 'CV' => esc_html__('Cape Verde', 'give'), |
|
164 | + 'KY' => esc_html__('Cayman Islands', 'give'), |
|
165 | + 'CF' => esc_html__('Central African Republic', 'give'), |
|
166 | + 'TD' => esc_html__('Chad', 'give'), |
|
167 | + 'CL' => esc_html__('Chile', 'give'), |
|
168 | + 'CN' => esc_html__('China', 'give'), |
|
169 | + 'CX' => esc_html__('Christmas Island', 'give'), |
|
170 | + 'CC' => esc_html__('Cocos Islands', 'give'), |
|
171 | + 'CO' => esc_html__('Colombia', 'give'), |
|
172 | + 'KM' => esc_html__('Comoros', 'give'), |
|
173 | + 'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'), |
|
174 | + 'CG' => esc_html__('Congo, Republic of', 'give'), |
|
175 | + 'CK' => esc_html__('Cook Islands', 'give'), |
|
176 | + 'CR' => esc_html__('Costa Rica', 'give'), |
|
177 | + 'CI' => esc_html__('Cote d\'Ivoire', 'give'), |
|
178 | + 'HR' => esc_html__('Croatia/Hrvatska', 'give'), |
|
179 | + 'CU' => esc_html__('Cuba', 'give'), |
|
180 | + 'CY' => esc_html__('Cyprus Island', 'give'), |
|
181 | + 'CZ' => esc_html__('Czech Republic', 'give'), |
|
182 | + 'DK' => esc_html__('Denmark', 'give'), |
|
183 | + 'DJ' => esc_html__('Djibouti', 'give'), |
|
184 | + 'DM' => esc_html__('Dominica', 'give'), |
|
185 | + 'DO' => esc_html__('Dominican Republic', 'give'), |
|
186 | + 'TP' => esc_html__('East Timor', 'give'), |
|
187 | + 'EC' => esc_html__('Ecuador', 'give'), |
|
188 | + 'EG' => esc_html__('Egypt', 'give'), |
|
189 | + 'GQ' => esc_html__('Equatorial Guinea', 'give'), |
|
190 | + 'SV' => esc_html__('El Salvador', 'give'), |
|
191 | + 'ER' => esc_html__('Eritrea', 'give'), |
|
192 | + 'EE' => esc_html__('Estonia', 'give'), |
|
193 | + 'ET' => esc_html__('Ethiopia', 'give'), |
|
194 | + 'FK' => esc_html__('Falkland Islands', 'give'), |
|
195 | + 'FO' => esc_html__('Faroe Islands', 'give'), |
|
196 | + 'FJ' => esc_html__('Fiji', 'give'), |
|
197 | + 'FI' => esc_html__('Finland', 'give'), |
|
198 | + 'FR' => esc_html__('France', 'give'), |
|
199 | + 'GF' => esc_html__('French Guiana', 'give'), |
|
200 | + 'PF' => esc_html__('French Polynesia', 'give'), |
|
201 | + 'TF' => esc_html__('French Southern Territories', 'give'), |
|
202 | + 'GA' => esc_html__('Gabon', 'give'), |
|
203 | + 'GM' => esc_html__('Gambia', 'give'), |
|
204 | + 'GE' => esc_html__('Georgia', 'give'), |
|
205 | + 'DE' => esc_html__('Germany', 'give'), |
|
206 | + 'GR' => esc_html__('Greece', 'give'), |
|
207 | + 'GH' => esc_html__('Ghana', 'give'), |
|
208 | + 'GI' => esc_html__('Gibraltar', 'give'), |
|
209 | + 'GL' => esc_html__('Greenland', 'give'), |
|
210 | + 'GD' => esc_html__('Grenada', 'give'), |
|
211 | + 'GP' => esc_html__('Guadeloupe', 'give'), |
|
212 | + 'GU' => esc_html__('Guam', 'give'), |
|
213 | + 'GT' => esc_html__('Guatemala', 'give'), |
|
214 | + 'GG' => esc_html__('Guernsey', 'give'), |
|
215 | + 'GN' => esc_html__('Guinea', 'give'), |
|
216 | + 'GW' => esc_html__('Guinea-Bissau', 'give'), |
|
217 | + 'GY' => esc_html__('Guyana', 'give'), |
|
218 | + 'HT' => esc_html__('Haiti', 'give'), |
|
219 | + 'HM' => esc_html__('Heard and McDonald Islands', 'give'), |
|
220 | + 'VA' => esc_html__('Holy See (City Vatican State)', 'give'), |
|
221 | + 'HN' => esc_html__('Honduras', 'give'), |
|
222 | + 'HK' => esc_html__('Hong Kong', 'give'), |
|
223 | + 'HU' => esc_html__('Hungary', 'give'), |
|
224 | + 'IS' => esc_html__('Iceland', 'give'), |
|
225 | + 'IN' => esc_html__('India', 'give'), |
|
226 | + 'ID' => esc_html__('Indonesia', 'give'), |
|
227 | + 'IR' => esc_html__('Iran', 'give'), |
|
228 | + 'IQ' => esc_html__('Iraq', 'give'), |
|
229 | + 'IE' => esc_html__('Ireland', 'give'), |
|
230 | + 'IM' => esc_html__('Isle of Man', 'give'), |
|
231 | + 'IL' => esc_html__('Israel', 'give'), |
|
232 | + 'IT' => esc_html__('Italy', 'give'), |
|
233 | + 'JM' => esc_html__('Jamaica', 'give'), |
|
234 | + 'JP' => esc_html__('Japan', 'give'), |
|
235 | + 'JE' => esc_html__('Jersey', 'give'), |
|
236 | + 'JO' => esc_html__('Jordan', 'give'), |
|
237 | + 'KZ' => esc_html__('Kazakhstan', 'give'), |
|
238 | + 'KE' => esc_html__('Kenya', 'give'), |
|
239 | + 'KI' => esc_html__('Kiribati', 'give'), |
|
240 | + 'KW' => esc_html__('Kuwait', 'give'), |
|
241 | + 'KG' => esc_html__('Kyrgyzstan', 'give'), |
|
242 | + 'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'), |
|
243 | + 'LV' => esc_html__('Latvia', 'give'), |
|
244 | + 'LB' => esc_html__('Lebanon', 'give'), |
|
245 | + 'LS' => esc_html__('Lesotho', 'give'), |
|
246 | + 'LR' => esc_html__('Liberia', 'give'), |
|
247 | + 'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'), |
|
248 | + 'LI' => esc_html__('Liechtenstein', 'give'), |
|
249 | + 'LT' => esc_html__('Lithuania', 'give'), |
|
250 | + 'LU' => esc_html__('Luxembourg', 'give'), |
|
251 | + 'MO' => esc_html__('Macau', 'give'), |
|
252 | + 'MK' => esc_html__('Macedonia', 'give'), |
|
253 | + 'MG' => esc_html__('Madagascar', 'give'), |
|
254 | + 'MW' => esc_html__('Malawi', 'give'), |
|
255 | + 'MY' => esc_html__('Malaysia', 'give'), |
|
256 | + 'MV' => esc_html__('Maldives', 'give'), |
|
257 | + 'ML' => esc_html__('Mali', 'give'), |
|
258 | + 'MT' => esc_html__('Malta', 'give'), |
|
259 | + 'MH' => esc_html__('Marshall Islands', 'give'), |
|
260 | + 'MQ' => esc_html__('Martinique', 'give'), |
|
261 | + 'MR' => esc_html__('Mauritania', 'give'), |
|
262 | + 'MU' => esc_html__('Mauritius', 'give'), |
|
263 | + 'YT' => esc_html__('Mayotte', 'give'), |
|
264 | + 'MX' => esc_html__('Mexico', 'give'), |
|
265 | + 'FM' => esc_html__('Micronesia', 'give'), |
|
266 | + 'MD' => esc_html__('Moldova, Republic of', 'give'), |
|
267 | + 'MC' => esc_html__('Monaco', 'give'), |
|
268 | + 'MN' => esc_html__('Mongolia', 'give'), |
|
269 | + 'ME' => esc_html__('Montenegro', 'give'), |
|
270 | + 'MS' => esc_html__('Montserrat', 'give'), |
|
271 | + 'MA' => esc_html__('Morocco', 'give'), |
|
272 | + 'MZ' => esc_html__('Mozambique', 'give'), |
|
273 | + 'MM' => esc_html__('Myanmar', 'give'), |
|
274 | + 'NA' => esc_html__('Namibia', 'give'), |
|
275 | + 'NR' => esc_html__('Nauru', 'give'), |
|
276 | + 'NP' => esc_html__('Nepal', 'give'), |
|
277 | + 'NL' => esc_html__('Netherlands', 'give'), |
|
278 | + 'AN' => esc_html__('Netherlands Antilles', 'give'), |
|
279 | + 'NC' => esc_html__('New Caledonia', 'give'), |
|
280 | + 'NZ' => esc_html__('New Zealand', 'give'), |
|
281 | + 'NI' => esc_html__('Nicaragua', 'give'), |
|
282 | + 'NE' => esc_html__('Niger', 'give'), |
|
283 | + 'NG' => esc_html__('Nigeria', 'give'), |
|
284 | + 'NU' => esc_html__('Niue', 'give'), |
|
285 | + 'NF' => esc_html__('Norfolk Island', 'give'), |
|
286 | + 'KP' => esc_html__('North Korea', 'give'), |
|
287 | + 'MP' => esc_html__('Northern Mariana Islands', 'give'), |
|
288 | + 'NO' => esc_html__('Norway', 'give'), |
|
289 | + 'OM' => esc_html__('Oman', 'give'), |
|
290 | + 'PK' => esc_html__('Pakistan', 'give'), |
|
291 | + 'PW' => esc_html__('Palau', 'give'), |
|
292 | + 'PS' => esc_html__('Palestinian Territories', 'give'), |
|
293 | + 'PA' => esc_html__('Panama', 'give'), |
|
294 | + 'PG' => esc_html__('Papua New Guinea', 'give'), |
|
295 | + 'PY' => esc_html__('Paraguay', 'give'), |
|
296 | + 'PE' => esc_html__('Peru', 'give'), |
|
297 | + 'PH' => esc_html__('Phillipines', 'give'), |
|
298 | + 'PN' => esc_html__('Pitcairn Island', 'give'), |
|
299 | + 'PL' => esc_html__('Poland', 'give'), |
|
300 | + 'PT' => esc_html__('Portugal', 'give'), |
|
301 | + 'PR' => esc_html__('Puerto Rico', 'give'), |
|
302 | + 'QA' => esc_html__('Qatar', 'give'), |
|
303 | + 'RE' => esc_html__('Reunion Island', 'give'), |
|
304 | + 'RO' => esc_html__('Romania', 'give'), |
|
305 | + 'RU' => esc_html__('Russian Federation', 'give'), |
|
306 | + 'RW' => esc_html__('Rwanda', 'give'), |
|
307 | + 'SH' => esc_html__('Saint Helena', 'give'), |
|
308 | + 'KN' => esc_html__('Saint Kitts and Nevis', 'give'), |
|
309 | + 'LC' => esc_html__('Saint Lucia', 'give'), |
|
310 | + 'PM' => esc_html__('Saint Pierre and Miquelon', 'give'), |
|
311 | + 'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'), |
|
312 | + 'SM' => esc_html__('San Marino', 'give'), |
|
313 | + 'ST' => esc_html__('Sao Tome and Principe', 'give'), |
|
314 | + 'SA' => esc_html__('Saudi Arabia', 'give'), |
|
315 | + 'SN' => esc_html__('Senegal', 'give'), |
|
316 | + 'RS' => esc_html__('Serbia', 'give'), |
|
317 | + 'SC' => esc_html__('Seychelles', 'give'), |
|
318 | + 'SL' => esc_html__('Sierra Leone', 'give'), |
|
319 | + 'SG' => esc_html__('Singapore', 'give'), |
|
320 | + 'SK' => esc_html__('Slovak Republic', 'give'), |
|
321 | + 'SI' => esc_html__('Slovenia', 'give'), |
|
322 | + 'SB' => esc_html__('Solomon Islands', 'give'), |
|
323 | + 'SO' => esc_html__('Somalia', 'give'), |
|
324 | + 'ZA' => esc_html__('South Africa', 'give'), |
|
325 | + 'GS' => esc_html__('South Georgia', 'give'), |
|
326 | + 'KR' => esc_html__('South Korea', 'give'), |
|
327 | + 'ES' => esc_html__('Spain', 'give'), |
|
328 | + 'LK' => esc_html__('Sri Lanka', 'give'), |
|
329 | + 'SD' => esc_html__('Sudan', 'give'), |
|
330 | + 'SR' => esc_html__('Suriname', 'give'), |
|
331 | + 'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'), |
|
332 | + 'SZ' => esc_html__('Swaziland', 'give'), |
|
333 | + 'SE' => esc_html__('Sweden', 'give'), |
|
334 | + 'CH' => esc_html__('Switzerland', 'give'), |
|
335 | + 'SY' => esc_html__('Syrian Arab Republic', 'give'), |
|
336 | + 'TW' => esc_html__('Taiwan', 'give'), |
|
337 | + 'TJ' => esc_html__('Tajikistan', 'give'), |
|
338 | + 'TZ' => esc_html__('Tanzania', 'give'), |
|
339 | + 'TG' => esc_html__('Togo', 'give'), |
|
340 | + 'TK' => esc_html__('Tokelau', 'give'), |
|
341 | + 'TO' => esc_html__('Tonga', 'give'), |
|
342 | + 'TH' => esc_html__('Thailand', 'give'), |
|
343 | + 'TT' => esc_html__('Trinidad and Tobago', 'give'), |
|
344 | + 'TN' => esc_html__('Tunisia', 'give'), |
|
345 | + 'TR' => esc_html__('Turkey', 'give'), |
|
346 | + 'TM' => esc_html__('Turkmenistan', 'give'), |
|
347 | + 'TC' => esc_html__('Turks and Caicos Islands', 'give'), |
|
348 | + 'TV' => esc_html__('Tuvalu', 'give'), |
|
349 | + 'UG' => esc_html__('Uganda', 'give'), |
|
350 | + 'UA' => esc_html__('Ukraine', 'give'), |
|
351 | + 'AE' => esc_html__('United Arab Emirates', 'give'), |
|
352 | + 'UY' => esc_html__('Uruguay', 'give'), |
|
353 | + 'UM' => esc_html__('US Minor Outlying Islands', 'give'), |
|
354 | + 'UZ' => esc_html__('Uzbekistan', 'give'), |
|
355 | + 'VU' => esc_html__('Vanuatu', 'give'), |
|
356 | + 'VE' => esc_html__('Venezuela', 'give'), |
|
357 | + 'VN' => esc_html__('Vietnam', 'give'), |
|
358 | + 'VG' => esc_html__('Virgin Islands (British)', 'give'), |
|
359 | + 'VI' => esc_html__('Virgin Islands (USA)', 'give'), |
|
360 | + 'WF' => esc_html__('Wallis and Futuna Islands', 'give'), |
|
361 | + 'EH' => esc_html__('Western Sahara', 'give'), |
|
362 | + 'WS' => esc_html__('Western Samoa', 'give'), |
|
363 | + 'YE' => esc_html__('Yemen', 'give'), |
|
364 | + 'YU' => esc_html__('Yugoslavia', 'give'), |
|
365 | + 'ZM' => esc_html__('Zambia', 'give'), |
|
366 | + 'ZW' => esc_html__('Zimbabwe', 'give') |
|
367 | 367 | ); |
368 | 368 | |
369 | - return apply_filters( 'give_countries', $countries ); |
|
369 | + return apply_filters('give_countries', $countries); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | 'AP' => 'Armed Forces - Pacific' |
448 | 448 | ); |
449 | 449 | |
450 | - return apply_filters( 'give_us_states', $states ); |
|
450 | + return apply_filters('give_us_states', $states); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
@@ -460,22 +460,22 @@ discard block |
||
460 | 460 | function give_get_provinces_list() { |
461 | 461 | $provinces = array( |
462 | 462 | '' => '', |
463 | - 'AB' => esc_html__('Alberta', 'give' ), |
|
464 | - 'BC' => esc_html__('British Columbia', 'give' ), |
|
465 | - 'MB' => esc_html__('Manitoba', 'give' ), |
|
466 | - 'NB' => esc_html__('New Brunswick', 'give' ), |
|
467 | - 'NL' => esc_html__('Newfoundland and Labrador', 'give' ), |
|
468 | - 'NS' => esc_html__('Nova Scotia', 'give' ), |
|
469 | - 'NT' => esc_html__('Northwest Territories', 'give' ), |
|
470 | - 'NU' => esc_html__('Nunavut', 'give' ), |
|
471 | - 'ON' => esc_html__('Ontario', 'give' ), |
|
472 | - 'PE' => esc_html__('Prince Edward Island', 'give' ), |
|
473 | - 'QC' => esc_html__('Quebec', 'give' ), |
|
474 | - 'SK' => esc_html__('Saskatchewan', 'give' ), |
|
475 | - 'YT' => esc_html__('Yukon', 'give' ) |
|
463 | + 'AB' => esc_html__('Alberta', 'give'), |
|
464 | + 'BC' => esc_html__('British Columbia', 'give'), |
|
465 | + 'MB' => esc_html__('Manitoba', 'give'), |
|
466 | + 'NB' => esc_html__('New Brunswick', 'give'), |
|
467 | + 'NL' => esc_html__('Newfoundland and Labrador', 'give'), |
|
468 | + 'NS' => esc_html__('Nova Scotia', 'give'), |
|
469 | + 'NT' => esc_html__('Northwest Territories', 'give'), |
|
470 | + 'NU' => esc_html__('Nunavut', 'give'), |
|
471 | + 'ON' => esc_html__('Ontario', 'give'), |
|
472 | + 'PE' => esc_html__('Prince Edward Island', 'give'), |
|
473 | + 'QC' => esc_html__('Quebec', 'give'), |
|
474 | + 'SK' => esc_html__('Saskatchewan', 'give'), |
|
475 | + 'YT' => esc_html__('Yukon', 'give') |
|
476 | 476 | ); |
477 | 477 | |
478 | - return apply_filters( 'give_canada_provinces', $provinces ); |
|
478 | + return apply_filters('give_canada_provinces', $provinces); |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | /** |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | 'WA' => 'Western Australia' |
498 | 498 | ); |
499 | 499 | |
500 | - return apply_filters( 'give_australian_states', $states ); |
|
500 | + return apply_filters('give_australian_states', $states); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | /** |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | 'TO' => 'Tocantins' |
539 | 539 | ); |
540 | 540 | |
541 | - return apply_filters( 'give_brazil_states', $states ); |
|
541 | + return apply_filters('give_brazil_states', $states); |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | /** |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | 'NEW TERRITORIES' => 'New Territories' |
556 | 556 | ); |
557 | 557 | |
558 | - return apply_filters( 'give_hong_kong_states', $states ); |
|
558 | + return apply_filters('give_hong_kong_states', $states); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | /** |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | 'ZA' => 'Zala' |
590 | 590 | ); |
591 | 591 | |
592 | - return apply_filters( 'give_hungary_states', $states ); |
|
592 | + return apply_filters('give_hungary_states', $states); |
|
593 | 593 | } |
594 | 594 | |
595 | 595 | /** |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | 'CN32' => 'Xinjiang / 新疆' |
636 | 636 | ); |
637 | 637 | |
638 | - return apply_filters( 'give_chinese_states', $states ); |
|
638 | + return apply_filters('give_chinese_states', $states); |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | /** |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | 'WC' => 'West Coast' |
665 | 665 | ); |
666 | 666 | |
667 | - return apply_filters( 'give_new_zealand_states', $states ); |
|
667 | + return apply_filters('give_new_zealand_states', $states); |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | /** |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | 'PB' => 'Papua Barat' |
713 | 713 | ); |
714 | 714 | |
715 | - return apply_filters( 'give_indonesia_states', $states ); |
|
715 | + return apply_filters('give_indonesia_states', $states); |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | /** |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | 'PY' => 'Pondicherry (Puducherry)' |
763 | 763 | ); |
764 | 764 | |
765 | - return apply_filters( 'give_indian_states', $states ); |
|
765 | + return apply_filters('give_indian_states', $states); |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | /** |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | 'PJY' => 'W.P. Putrajaya' |
793 | 793 | ); |
794 | 794 | |
795 | - return apply_filters( 'give_malaysian_states', $states ); |
|
795 | + return apply_filters('give_malaysian_states', $states); |
|
796 | 796 | } |
797 | 797 | |
798 | 798 | /** |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | 'WC' => 'Western Cape' |
816 | 816 | ); |
817 | 817 | |
818 | - return apply_filters( 'give_south_african_states', $states ); |
|
818 | + return apply_filters('give_south_african_states', $states); |
|
819 | 819 | } |
820 | 820 | |
821 | 821 | /** |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | 'TH-35' => 'Yasothon (ยโสธร)' |
907 | 907 | ); |
908 | 908 | |
909 | - return apply_filters( 'give_thailand_states', $states ); |
|
909 | + return apply_filters('give_thailand_states', $states); |
|
910 | 910 | } |
911 | 911 | |
912 | 912 | /** |
@@ -918,59 +918,59 @@ discard block |
||
918 | 918 | function give_get_spain_states_list() { |
919 | 919 | $states = array( |
920 | 920 | '' => '', |
921 | - 'C' => esc_html__( 'A Coruña', 'give' ), |
|
922 | - 'VI' => esc_html__( 'Araba', 'give' ), |
|
923 | - 'AB' => esc_html__( 'Albacete', 'give' ), |
|
924 | - 'A' => esc_html__( 'Alicante', 'give' ), |
|
925 | - 'AL' => esc_html__( 'Almería', 'give' ), |
|
926 | - 'O' => esc_html__( 'Asturias', 'give' ), |
|
927 | - 'AV' => esc_html__( 'Ávila', 'give' ), |
|
928 | - 'BA' => esc_html__( 'Badajoz', 'give' ), |
|
929 | - 'PM' => esc_html__( 'Baleares', 'give' ), |
|
930 | - 'B' => esc_html__( 'Barcelona', 'give' ), |
|
931 | - 'BU' => esc_html__( 'Burgos', 'give' ), |
|
932 | - 'CC' => esc_html__( 'Cáceres', 'give' ), |
|
933 | - 'CA' => esc_html__( 'Cádiz', 'give' ), |
|
934 | - 'S' => esc_html__( 'Cantabria', 'give' ), |
|
935 | - 'CS' => esc_html__( 'Castellón', 'give' ), |
|
936 | - 'CE' => esc_html__( 'Ceuta', 'give' ), |
|
937 | - 'CR' => esc_html__( 'Ciudad Real', 'give' ), |
|
938 | - 'CO' => esc_html__( 'Córdoba', 'give' ), |
|
939 | - 'CU' => esc_html__( 'Cuenca', 'give' ), |
|
940 | - 'GI' => esc_html__( 'Girona', 'give' ), |
|
941 | - 'GR' => esc_html__( 'Granada', 'give' ), |
|
942 | - 'GU' => esc_html__( 'Guadalajara', 'give' ), |
|
943 | - 'SS' => esc_html__( 'Gipuzkoa', 'give' ), |
|
944 | - 'H' => esc_html__( 'Huelva', 'give' ), |
|
945 | - 'HU' => esc_html__( 'Huesca', 'give' ), |
|
946 | - 'J' => esc_html__( 'Jaén', 'give' ), |
|
947 | - 'LO' => esc_html__( 'La Rioja', 'give' ), |
|
948 | - 'GC' => esc_html__( 'Las Palmas', 'give' ), |
|
949 | - 'LE' => esc_html__( 'León', 'give' ), |
|
950 | - 'L' => esc_html__( 'Lleida', 'give' ), |
|
951 | - 'LU' => esc_html__( 'Lugo', 'give' ), |
|
952 | - 'M' => esc_html__( 'Madrid', 'give' ), |
|
953 | - 'MA' => esc_html__( 'Málaga', 'give' ), |
|
954 | - 'ML' => esc_html__( 'Melilla', 'give' ), |
|
955 | - 'MU' => esc_html__( 'Murcia', 'give' ), |
|
956 | - 'NA' => esc_html__( 'Navarra', 'give' ), |
|
957 | - 'OR' => esc_html__( 'Ourense', 'give' ), |
|
958 | - 'P' => esc_html__( 'Palencia', 'give' ), |
|
959 | - 'PO' => esc_html__( 'Pontevedra', 'give' ), |
|
960 | - 'SA' => esc_html__( 'Salamanca', 'give' ), |
|
961 | - 'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ), |
|
962 | - 'SG' => esc_html__( 'Segovia', 'give' ), |
|
963 | - 'SE' => esc_html__( 'Sevilla', 'give' ), |
|
964 | - 'SO' => esc_html__( 'Soria', 'give' ), |
|
965 | - 'T' => esc_html__( 'Tarragona', 'give' ), |
|
966 | - 'TE' => esc_html__( 'Teruel', 'give' ), |
|
967 | - 'TO' => esc_html__( 'Toledo', 'give' ), |
|
968 | - 'V' => esc_html__( 'Valencia', 'give' ), |
|
969 | - 'VA' => esc_html__( 'Valladolid', 'give' ), |
|
970 | - 'BI' => esc_html__( 'Bizkaia', 'give' ), |
|
971 | - 'ZA' => esc_html__( 'Zamora', 'give' ), |
|
972 | - 'Z' => esc_html__( 'Zaragoza', 'give' ) |
|
921 | + 'C' => esc_html__('A Coruña', 'give'), |
|
922 | + 'VI' => esc_html__('Araba', 'give'), |
|
923 | + 'AB' => esc_html__('Albacete', 'give'), |
|
924 | + 'A' => esc_html__('Alicante', 'give'), |
|
925 | + 'AL' => esc_html__('Almería', 'give'), |
|
926 | + 'O' => esc_html__('Asturias', 'give'), |
|
927 | + 'AV' => esc_html__('Ávila', 'give'), |
|
928 | + 'BA' => esc_html__('Badajoz', 'give'), |
|
929 | + 'PM' => esc_html__('Baleares', 'give'), |
|
930 | + 'B' => esc_html__('Barcelona', 'give'), |
|
931 | + 'BU' => esc_html__('Burgos', 'give'), |
|
932 | + 'CC' => esc_html__('Cáceres', 'give'), |
|
933 | + 'CA' => esc_html__('Cádiz', 'give'), |
|
934 | + 'S' => esc_html__('Cantabria', 'give'), |
|
935 | + 'CS' => esc_html__('Castellón', 'give'), |
|
936 | + 'CE' => esc_html__('Ceuta', 'give'), |
|
937 | + 'CR' => esc_html__('Ciudad Real', 'give'), |
|
938 | + 'CO' => esc_html__('Córdoba', 'give'), |
|
939 | + 'CU' => esc_html__('Cuenca', 'give'), |
|
940 | + 'GI' => esc_html__('Girona', 'give'), |
|
941 | + 'GR' => esc_html__('Granada', 'give'), |
|
942 | + 'GU' => esc_html__('Guadalajara', 'give'), |
|
943 | + 'SS' => esc_html__('Gipuzkoa', 'give'), |
|
944 | + 'H' => esc_html__('Huelva', 'give'), |
|
945 | + 'HU' => esc_html__('Huesca', 'give'), |
|
946 | + 'J' => esc_html__('Jaén', 'give'), |
|
947 | + 'LO' => esc_html__('La Rioja', 'give'), |
|
948 | + 'GC' => esc_html__('Las Palmas', 'give'), |
|
949 | + 'LE' => esc_html__('León', 'give'), |
|
950 | + 'L' => esc_html__('Lleida', 'give'), |
|
951 | + 'LU' => esc_html__('Lugo', 'give'), |
|
952 | + 'M' => esc_html__('Madrid', 'give'), |
|
953 | + 'MA' => esc_html__('Málaga', 'give'), |
|
954 | + 'ML' => esc_html__('Melilla', 'give'), |
|
955 | + 'MU' => esc_html__('Murcia', 'give'), |
|
956 | + 'NA' => esc_html__('Navarra', 'give'), |
|
957 | + 'OR' => esc_html__('Ourense', 'give'), |
|
958 | + 'P' => esc_html__('Palencia', 'give'), |
|
959 | + 'PO' => esc_html__('Pontevedra', 'give'), |
|
960 | + 'SA' => esc_html__('Salamanca', 'give'), |
|
961 | + 'TF' => esc_html__('Santa Cruz de Tenerife', 'give'), |
|
962 | + 'SG' => esc_html__('Segovia', 'give'), |
|
963 | + 'SE' => esc_html__('Sevilla', 'give'), |
|
964 | + 'SO' => esc_html__('Soria', 'give'), |
|
965 | + 'T' => esc_html__('Tarragona', 'give'), |
|
966 | + 'TE' => esc_html__('Teruel', 'give'), |
|
967 | + 'TO' => esc_html__('Toledo', 'give'), |
|
968 | + 'V' => esc_html__('Valencia', 'give'), |
|
969 | + 'VA' => esc_html__('Valladolid', 'give'), |
|
970 | + 'BI' => esc_html__('Bizkaia', 'give'), |
|
971 | + 'ZA' => esc_html__('Zamora', 'give'), |
|
972 | + 'Z' => esc_html__('Zaragoza', 'give') |
|
973 | 973 | ); |
974 | 974 | |
975 | - return apply_filters( 'give_spain_states', $states ); |
|
975 | + return apply_filters('give_spain_states', $states); |
|
976 | 976 | } |
@@ -42,16 +42,16 @@ |
||
42 | 42 | 'minWidth' => 320, |
43 | 43 | 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ), |
44 | 44 | ), |
45 | - array( |
|
46 | - 'type' => 'container', |
|
47 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
48 | - ), |
|
49 | - array( |
|
50 | - 'type' => 'textbox', |
|
51 | - 'name' => 'logout-redirect', |
|
52 | - 'minWidth' => 320, |
|
53 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
54 | - ), |
|
45 | + array( |
|
46 | + 'type' => 'container', |
|
47 | + 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
48 | + ), |
|
49 | + array( |
|
50 | + 'type' => 'textbox', |
|
51 | + 'name' => 'logout-redirect', |
|
52 | + 'minWidth' => 320, |
|
53 | + 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
54 | + ), |
|
55 | 55 | ); |
56 | 56 | } |
57 | 57 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct() { |
23 | 23 | |
24 | - $this->shortcode['title'] = esc_html__( 'Login', 'give' ); |
|
25 | - $this->shortcode['label'] = esc_html__( 'Login', 'give' ); |
|
24 | + $this->shortcode['title'] = esc_html__('Login', 'give'); |
|
25 | + $this->shortcode['label'] = esc_html__('Login', 'give'); |
|
26 | 26 | |
27 | - parent::__construct( 'give_login' ); |
|
27 | + parent::__construct('give_login'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -37,23 +37,23 @@ discard block |
||
37 | 37 | return array( |
38 | 38 | array( |
39 | 39 | 'type' => 'container', |
40 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Login Redirect URL (optional):', 'give' ) ), |
|
40 | + 'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Login Redirect URL (optional):', 'give')), |
|
41 | 41 | ), |
42 | 42 | array( |
43 | 43 | 'type' => 'textbox', |
44 | 44 | 'name' => 'login-redirect', |
45 | 45 | 'minWidth' => 320, |
46 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ), |
|
46 | + 'tooltip' => esc_attr__('Enter an URL here to redirect to after login.', 'give'), |
|
47 | 47 | ), |
48 | 48 | array( |
49 | 49 | 'type' => 'container', |
50 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
50 | + 'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Logout Redirect URL (optional):', 'give')), |
|
51 | 51 | ), |
52 | 52 | array( |
53 | 53 | 'type' => 'textbox', |
54 | 54 | 'name' => 'logout-redirect', |
55 | 55 | 'minWidth' => 320, |
56 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
56 | + 'tooltip' => esc_attr__('Enter an URL here to redirect to after logout.', 'give'), |
|
57 | 57 | ), |
58 | 58 | ); |
59 | 59 | } |