@@ -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 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -add_action( 'give_manual_cc_form', '__return_false' ); |
|
23 | +add_action('give_manual_cc_form', '__return_false'); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Processes the donation data and uses the Manual Payment gateway to record |
@@ -32,44 +32,44 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | -function give_manual_payment( $purchase_data ) { |
|
35 | +function give_manual_payment($purchase_data) { |
|
36 | 36 | |
37 | - if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) { |
|
38 | - wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
37 | + if ( ! wp_verify_nonce($purchase_data['gateway_nonce'], 'give-gateway')) { |
|
38 | + wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | //Create payment_data array |
42 | 42 | $payment_data = array( |
43 | 43 | 'price' => $purchase_data['price'], |
44 | 44 | 'give_form_title' => $purchase_data['post_data']['give-form-title'], |
45 | - 'give_form_id' => intval( $purchase_data['post_data']['give-form-id'] ), |
|
45 | + 'give_form_id' => intval($purchase_data['post_data']['give-form-id']), |
|
46 | 46 | 'give_price_id' => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '', |
47 | 47 | 'date' => $purchase_data['date'], |
48 | 48 | 'user_email' => $purchase_data['user_email'], |
49 | 49 | 'purchase_key' => $purchase_data['purchase_key'], |
50 | - 'currency' => give_get_currency( $purchase_data['post_data']['give-form-id'], $purchase_data ), |
|
50 | + 'currency' => give_get_currency($purchase_data['post_data']['give-form-id'], $purchase_data), |
|
51 | 51 | 'user_info' => $purchase_data['user_info'], |
52 | 52 | 'status' => 'pending' |
53 | 53 | ); |
54 | 54 | // Record the pending payment |
55 | - $payment = give_insert_payment( $payment_data ); |
|
55 | + $payment = give_insert_payment($payment_data); |
|
56 | 56 | |
57 | - if ( $payment ) { |
|
58 | - give_update_payment_status( $payment, 'publish' ); |
|
57 | + if ($payment) { |
|
58 | + give_update_payment_status($payment, 'publish'); |
|
59 | 59 | give_send_to_success_page(); |
60 | 60 | } else { |
61 | 61 | give_record_gateway_error( |
62 | - esc_html__( 'Payment Error', 'give' ), |
|
62 | + esc_html__('Payment Error', 'give'), |
|
63 | 63 | sprintf( |
64 | 64 | /* translators: %s: payment data */ |
65 | - esc_html__( 'The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give' ), |
|
66 | - json_encode( $payment_data ) |
|
65 | + esc_html__('The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give'), |
|
66 | + json_encode($payment_data) |
|
67 | 67 | ), |
68 | 68 | $payment |
69 | 69 | ); |
70 | 70 | // If errors are present, send the user back to the donation page so they can be corrected |
71 | - give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] ); |
|
71 | + give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | -add_action( 'give_gateway_manual', 'give_manual_payment' ); |
|
75 | +add_action('give_gateway_manual', 'give_manual_payment'); |
@@ -258,7 +258,7 @@ |
||
258 | 258 | * @access public |
259 | 259 | * @since 1.0 |
260 | 260 | * |
261 | - * @return mixed string If search is present, false otherwise. |
|
261 | + * @return string|false string If search is present, false otherwise. |
|
262 | 262 | */ |
263 | 263 | public function get_search() { |
264 | 264 | return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false; |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
19 | 19 | // Load WP_List_Table if not loaded. |
20 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
21 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
20 | +if ( ! class_exists('WP_List_Table')) { |
|
21 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | public function __construct() { |
62 | 62 | |
63 | 63 | // Set parent defaults. |
64 | - parent::__construct( array( |
|
65 | - 'singular' => __( 'Donor', 'give' ), // Singular name of the listed records. |
|
66 | - 'plural' => __( 'Donors', 'give' ), // Plural name of the listed records. |
|
64 | + parent::__construct(array( |
|
65 | + 'singular' => __('Donor', 'give'), // Singular name of the listed records. |
|
66 | + 'plural' => __('Donors', 'give'), // Plural name of the listed records. |
|
67 | 67 | 'ajax' => false, // Does this table support ajax?. |
68 | - ) ); |
|
68 | + )); |
|
69 | 69 | |
70 | 70 | } |
71 | 71 | |
@@ -80,23 +80,23 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return void |
82 | 82 | */ |
83 | - public function search_box( $text, $input_id ) { |
|
84 | - $input_id = $input_id . '-search-input'; |
|
83 | + public function search_box($text, $input_id) { |
|
84 | + $input_id = $input_id.'-search-input'; |
|
85 | 85 | |
86 | - if ( ! empty( $_REQUEST['orderby'] ) ) { |
|
87 | - echo sprintf( '<input type="hidden" name="orderby" value="%1$s" />', esc_attr( $_REQUEST['orderby'] ) ); |
|
86 | + if ( ! empty($_REQUEST['orderby'])) { |
|
87 | + echo sprintf('<input type="hidden" name="orderby" value="%1$s" />', esc_attr($_REQUEST['orderby'])); |
|
88 | 88 | } |
89 | 89 | |
90 | - if ( ! empty( $_REQUEST['order'] ) ) { |
|
91 | - echo sprintf( '<input type="hidden" name="order" value="%1$s" />', esc_attr( $_REQUEST['order'] ) ); |
|
90 | + if ( ! empty($_REQUEST['order'])) { |
|
91 | + echo sprintf('<input type="hidden" name="order" value="%1$s" />', esc_attr($_REQUEST['order'])); |
|
92 | 92 | } |
93 | 93 | ?> |
94 | 94 | <p class="search-box" role="search"> |
95 | 95 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
96 | 96 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/> |
97 | - <?php submit_button( $text, 'button', false, false, array( |
|
97 | + <?php submit_button($text, 'button', false, false, array( |
|
98 | 98 | 'ID' => 'search-submit', |
99 | - ) ); ?> |
|
99 | + )); ?> |
|
100 | 100 | </p> |
101 | 101 | <?php |
102 | 102 | } |
@@ -112,32 +112,32 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @return string Column Name. |
114 | 114 | */ |
115 | - public function column_default( $donor, $column_name ) { |
|
115 | + public function column_default($donor, $column_name) { |
|
116 | 116 | |
117 | - switch ( $column_name ) { |
|
117 | + switch ($column_name) { |
|
118 | 118 | |
119 | 119 | case 'num_donations' : |
120 | 120 | $value = sprintf( |
121 | 121 | '<a href="%s">%s</a>', |
122 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor['id'] ) ), |
|
123 | - esc_html( $donor['num_donations'] ) |
|
122 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint($donor['id'])), |
|
123 | + esc_html($donor['num_donations']) |
|
124 | 124 | ); |
125 | 125 | break; |
126 | 126 | |
127 | 127 | case 'amount_spent' : |
128 | - $value = give_currency_filter( give_format_amount( $donor[ $column_name ], array( 'sanitize' => false ) ) ); |
|
128 | + $value = give_currency_filter(give_format_amount($donor[$column_name], array('sanitize' => false))); |
|
129 | 129 | break; |
130 | 130 | |
131 | 131 | case 'date_created' : |
132 | - $value = date_i18n( give_date_format(), strtotime( $donor['date_created'] ) ); |
|
132 | + $value = date_i18n(give_date_format(), strtotime($donor['date_created'])); |
|
133 | 133 | break; |
134 | 134 | |
135 | 135 | default: |
136 | - $value = isset( $donor[ $column_name ] ) ? $donor[ $column_name ] : null; |
|
136 | + $value = isset($donor[$column_name]) ? $donor[$column_name] : null; |
|
137 | 137 | break; |
138 | 138 | } |
139 | 139 | |
140 | - return apply_filters( "give_donors_column_{$column_name}", $value, $donor['id'] ); |
|
140 | + return apply_filters("give_donors_column_{$column_name}", $value, $donor['id']); |
|
141 | 141 | |
142 | 142 | } |
143 | 143 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @return string |
153 | 153 | */ |
154 | - public function column_cb( $donor ){ |
|
154 | + public function column_cb($donor) { |
|
155 | 155 | return sprintf( |
156 | 156 | '<input class="donor-selector" type="checkbox" name="%1$s[]" value="%2$d" data-name="%3$s" />', |
157 | 157 | $this->_args['singular'], |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @return string |
172 | 172 | */ |
173 | - public function column_name( $donor ) { |
|
174 | - $name = '#' . $donor['id'] . ' '; |
|
175 | - $name .= ! empty( $donor['name'] ) ? $donor['name'] : '<em>' . __( 'Unnamed Donor', 'give' ) . '</em>'; |
|
176 | - $view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ); |
|
177 | - $actions = $this->get_row_actions( $donor ); |
|
173 | + public function column_name($donor) { |
|
174 | + $name = '#'.$donor['id'].' '; |
|
175 | + $name .= ! empty($donor['name']) ? $donor['name'] : '<em>'.__('Unnamed Donor', 'give').'</em>'; |
|
176 | + $view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor['id']); |
|
177 | + $actions = $this->get_row_actions($donor); |
|
178 | 178 | |
179 | - return '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>' . $this->row_actions( $actions ); |
|
179 | + return '<a href="'.esc_url($view_url).'">'.$name.'</a>'.$this->row_actions($actions); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | public function get_columns() { |
191 | 191 | $columns = array( |
192 | 192 | 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text. |
193 | - 'name' => __( 'Name', 'give' ), |
|
194 | - 'email' => __( 'Email', 'give' ), |
|
195 | - 'num_donations' => __( 'Donations', 'give' ), |
|
196 | - 'amount_spent' => __( 'Total Donated', 'give' ), |
|
197 | - 'date_created' => __( 'Date Created', 'give' ), |
|
193 | + 'name' => __('Name', 'give'), |
|
194 | + 'email' => __('Email', 'give'), |
|
195 | + 'num_donations' => __('Donations', 'give'), |
|
196 | + 'amount_spent' => __('Total Donated', 'give'), |
|
197 | + 'date_created' => __('Date Created', 'give'), |
|
198 | 198 | ); |
199 | 199 | |
200 | - return apply_filters( 'give_list_donors_columns', $columns ); |
|
200 | + return apply_filters('give_list_donors_columns', $columns); |
|
201 | 201 | |
202 | 202 | } |
203 | 203 | |
@@ -211,13 +211,13 @@ discard block |
||
211 | 211 | public function get_sortable_columns() { |
212 | 212 | |
213 | 213 | $columns = array( |
214 | - 'date_created' => array( 'date_created', true ), |
|
215 | - 'name' => array( 'name', true ), |
|
216 | - 'num_donations' => array( 'purchase_count', false ), |
|
217 | - 'amount_spent' => array( 'purchase_value', false ), |
|
214 | + 'date_created' => array('date_created', true), |
|
215 | + 'name' => array('name', true), |
|
216 | + 'num_donations' => array('purchase_count', false), |
|
217 | + 'amount_spent' => array('purchase_value', false), |
|
218 | 218 | ); |
219 | 219 | |
220 | - return apply_filters( 'give_list_donors_sortable_columns', $columns ); |
|
220 | + return apply_filters('give_list_donors_sortable_columns', $columns); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
@@ -230,15 +230,15 @@ discard block |
||
230 | 230 | * |
231 | 231 | * @return array An array of action links. |
232 | 232 | */ |
233 | - public function get_row_actions( $donor ) { |
|
233 | + public function get_row_actions($donor) { |
|
234 | 234 | |
235 | 235 | $actions = array( |
236 | - 'view' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ), sprintf( esc_attr__( 'View "%s"', 'give' ), $donor['name'] ), __( 'View Donor', 'give' ) ), |
|
237 | - 'notes' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor['id'] ), sprintf( esc_attr__( 'Notes for "%s"', 'give' ), $donor['name'] ), __( 'Notes', 'give' ) ), |
|
238 | - 'delete' => sprintf( '<a class="%1$s" data-id="%2$s" href="#" aria-label="%3$s">%4$s</a>', 'give-single-donor-delete', $donor['id'],sprintf( esc_attr__( 'Delete "%s"', 'give' ), $donor['name'] ), __( 'Delete', 'give' ) ), |
|
236 | + 'view' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor['id']), sprintf(esc_attr__('View "%s"', 'give'), $donor['name']), __('View Donor', 'give')), |
|
237 | + 'notes' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor['id']), sprintf(esc_attr__('Notes for "%s"', 'give'), $donor['name']), __('Notes', 'give')), |
|
238 | + 'delete' => sprintf('<a class="%1$s" data-id="%2$s" href="#" aria-label="%3$s">%4$s</a>', 'give-single-donor-delete', $donor['id'], sprintf(esc_attr__('Delete "%s"', 'give'), $donor['name']), __('Delete', 'give')), |
|
239 | 239 | ); |
240 | 240 | |
241 | - return apply_filters( 'give_donor_row_actions', $actions, $donor ); |
|
241 | + return apply_filters('give_donor_row_actions', $actions, $donor); |
|
242 | 242 | |
243 | 243 | } |
244 | 244 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @return int Current page number. |
252 | 252 | */ |
253 | 253 | public function get_paged() { |
254 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
254 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * @return mixed string If search is present, false otherwise. |
264 | 264 | */ |
265 | 265 | public function get_search() { |
266 | - return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false; |
|
266 | + return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public function get_bulk_actions() { |
278 | 278 | $actions = array( |
279 | - 'delete' => __( 'Delete', 'give' ), |
|
279 | + 'delete' => __('Delete', 'give'), |
|
280 | 280 | ); |
281 | 281 | return $actions; |
282 | 282 | } |
@@ -289,19 +289,19 @@ discard block |
||
289 | 289 | * @access protected |
290 | 290 | * @since 1.8.16 |
291 | 291 | */ |
292 | - protected function display_tablenav( $which ) { |
|
293 | - if ( 'top' === $which ) { |
|
294 | - wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false ); |
|
292 | + protected function display_tablenav($which) { |
|
293 | + if ('top' === $which) { |
|
294 | + wp_nonce_field('bulk-'.$this->_args['plural'], '_wpnonce', false); |
|
295 | 295 | } |
296 | 296 | ?> |
297 | - <div class="tablenav <?php echo esc_attr( $which ); ?>"> |
|
298 | - <?php if ( $this->has_items() ): ?> |
|
297 | + <div class="tablenav <?php echo esc_attr($which); ?>"> |
|
298 | + <?php if ($this->has_items()): ?> |
|
299 | 299 | <div class="alignleft actions bulkactions"> |
300 | - <?php $this->bulk_actions( $which ); ?> |
|
300 | + <?php $this->bulk_actions($which); ?> |
|
301 | 301 | </div> |
302 | 302 | <?php endif; |
303 | - $this->extra_tablenav( $which ); |
|
304 | - $this->pagination( $which ); |
|
303 | + $this->extra_tablenav($which); |
|
304 | + $this->pagination($which); |
|
305 | 305 | ?> |
306 | 306 | <br class="clear" /> |
307 | 307 | </div> |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | |
323 | 323 | // Get donor query. |
324 | 324 | $args = $this->get_donor_query(); |
325 | - $donors = Give()->donors->get_donors( $args ); |
|
325 | + $donors = Give()->donors->get_donors($args); |
|
326 | 326 | |
327 | - if ( $donors ) { |
|
327 | + if ($donors) { |
|
328 | 328 | |
329 | - foreach ( $donors as $donor ) { |
|
329 | + foreach ($donors as $donor) { |
|
330 | 330 | |
331 | - $user_id = ! empty( $donor->user_id ) ? intval( $donor->user_id ) : 0; |
|
331 | + $user_id = ! empty($donor->user_id) ? intval($donor->user_id) : 0; |
|
332 | 332 | |
333 | 333 | $data[] = array( |
334 | 334 | 'id' => $donor->id, |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | } |
344 | 344 | |
345 | - return apply_filters( 'give_donors_column_query_data', $data ); |
|
345 | + return apply_filters('give_donors_column_query_data', $data); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | |
358 | 358 | $_donor_query['number'] = - 1; |
359 | 359 | $_donor_query['offset'] = 0; |
360 | - $donors = Give()->donors->get_donors( $_donor_query ); |
|
360 | + $donors = Give()->donors->get_donors($_donor_query); |
|
361 | 361 | |
362 | - return count( $donors ); |
|
362 | + return count($donors); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | /** |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function get_donor_query() { |
374 | 374 | $paged = $this->get_paged(); |
375 | - $offset = $this->per_page * ( $paged - 1 ); |
|
375 | + $offset = $this->per_page * ($paged - 1); |
|
376 | 376 | $search = $this->get_search(); |
377 | - $order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC'; |
|
378 | - $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id'; |
|
377 | + $order = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC'; |
|
378 | + $orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id'; |
|
379 | 379 | |
380 | 380 | $args = array( |
381 | 381 | 'number' => $this->per_page, |
@@ -384,10 +384,10 @@ discard block |
||
384 | 384 | 'orderby' => $orderby, |
385 | 385 | ); |
386 | 386 | |
387 | - if ( $search ) { |
|
388 | - if ( is_email( $search ) ) { |
|
387 | + if ($search) { |
|
388 | + if (is_email($search)) { |
|
389 | 389 | $args['email'] = $search; |
390 | - } elseif ( is_numeric( $search ) ) { |
|
390 | + } elseif (is_numeric($search)) { |
|
391 | 391 | $args['id'] = $search; |
392 | 392 | } else { |
393 | 393 | $args['name'] = $search; |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | * @since 1.8.17 |
406 | 406 | * @access public |
407 | 407 | */ |
408 | - public function single_row( $item ) { |
|
409 | - echo sprintf( '<tr id="donor-%1$d" data-id="%2$d" data-name="%3$s">', $item['id'], $item['id'], $item['name'] ); |
|
410 | - $this->single_row_columns( $item ); |
|
408 | + public function single_row($item) { |
|
409 | + echo sprintf('<tr id="donor-%1$d" data-id="%2$d" data-name="%3$s">', $item['id'], $item['id'], $item['name']); |
|
410 | + $this->single_row_columns($item); |
|
411 | 411 | echo '</tr>'; |
412 | 412 | } |
413 | 413 | |
@@ -420,11 +420,11 @@ discard block |
||
420 | 420 | public function display() { |
421 | 421 | $singular = $this->_args['singular']; |
422 | 422 | |
423 | - $this->display_tablenav( 'top' ); |
|
423 | + $this->display_tablenav('top'); |
|
424 | 424 | |
425 | - $this->screen->render_screen_reader_content( 'heading_list' ); |
|
425 | + $this->screen->render_screen_reader_content('heading_list'); |
|
426 | 426 | ?> |
427 | - <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> |
|
427 | + <table class="wp-list-table <?php echo implode(' ', $this->get_table_classes()); ?>"> |
|
428 | 428 | <thead> |
429 | 429 | <tr> |
430 | 430 | <?php $this->print_column_headers(); ?> |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | </thead> |
433 | 433 | |
434 | 434 | <tbody id="the-list"<?php |
435 | - if ( $singular ) { |
|
435 | + if ($singular) { |
|
436 | 436 | echo " data-wp-lists='list:$singular'"; |
437 | 437 | } ?>> |
438 | 438 | <tr class="hidden"></tr> |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | <td colspan="6" class="colspanchange"> |
441 | 441 | |
442 | 442 | <fieldset class="inline-edit-col-left"> |
443 | - <legend class="inline-edit-legend"><?php _e( 'BULK DELETE', 'give' ); ?></legend> |
|
443 | + <legend class="inline-edit-legend"><?php _e('BULK DELETE', 'give'); ?></legend> |
|
444 | 444 | <div class="inline-edit-col"> |
445 | 445 | <div id="bulk-titles"> |
446 | 446 | <div id="give-bulk-donors" class="give-bulk-donors"> |
@@ -453,22 +453,22 @@ discard block |
||
453 | 453 | <div class="inline-edit-col"> |
454 | 454 | <label> |
455 | 455 | <input id="give-delete-donor-confirm" type="checkbox" name="give-delete-donor-confirm"/> |
456 | - <?php _e( 'Are you sure you want to delete the selected donor(s)?', 'give' ); ?> |
|
456 | + <?php _e('Are you sure you want to delete the selected donor(s)?', 'give'); ?> |
|
457 | 457 | </label> |
458 | 458 | <label> |
459 | 459 | <input id="give-delete-donor-records" type="checkbox" name="give-delete-donor-records"/> |
460 | - <?php _e( 'Delete all associated donations and records?', 'give' ); ?> |
|
460 | + <?php _e('Delete all associated donations and records?', 'give'); ?> |
|
461 | 461 | </label> |
462 | 462 | </div> |
463 | 463 | </fieldset> |
464 | 464 | |
465 | 465 | <p class="submit inline-edit-save"> |
466 | 466 | <input type="hidden" name="give_action" value="delete_donor"/> |
467 | - <input type="hidden" name="s" value="<?php echo ( ! empty( $_GET['s'] ) ) ? $_GET['s'] : ''; ?>"/> |
|
468 | - <input type="hidden" name="orderby" value="<?php echo ( ! empty( $_GET['orderby'] ) ) ? $_GET['orderby'] : 'id'; ?>"/> |
|
469 | - <input type="hidden" name="order" value="<?php echo ( ! empty( $_GET['order'] ) ) ? $_GET['order'] : 'desc'; ?>"/> |
|
470 | - <button type="button" id="give-bulk-delete-cancel" class="button cancel alignleft"><?php _e( 'Cancel', 'give' ); ?></button> |
|
471 | - <input type="submit" id="give-bulk-delete-button" disabled class="button button-primary alignright" value="<?php _e( 'Delete', 'give' ); ?>"> |
|
467 | + <input type="hidden" name="s" value="<?php echo ( ! empty($_GET['s'])) ? $_GET['s'] : ''; ?>"/> |
|
468 | + <input type="hidden" name="orderby" value="<?php echo ( ! empty($_GET['orderby'])) ? $_GET['orderby'] : 'id'; ?>"/> |
|
469 | + <input type="hidden" name="order" value="<?php echo ( ! empty($_GET['order'])) ? $_GET['order'] : 'desc'; ?>"/> |
|
470 | + <button type="button" id="give-bulk-delete-cancel" class="button cancel alignleft"><?php _e('Cancel', 'give'); ?></button> |
|
471 | + <input type="submit" id="give-bulk-delete-button" disabled class="button button-primary alignright" value="<?php _e('Delete', 'give'); ?>"> |
|
472 | 472 | <br class="clear"> |
473 | 473 | </p> |
474 | 474 | </td> |
@@ -478,13 +478,13 @@ discard block |
||
478 | 478 | |
479 | 479 | <tfoot> |
480 | 480 | <tr> |
481 | - <?php $this->print_column_headers( false ); ?> |
|
481 | + <?php $this->print_column_headers(false); ?> |
|
482 | 482 | </tr> |
483 | 483 | </tfoot> |
484 | 484 | |
485 | 485 | </table> |
486 | 486 | <?php |
487 | - $this->display_tablenav( 'bottom' ); |
|
487 | + $this->display_tablenav('bottom'); |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | /** |
@@ -501,16 +501,16 @@ discard block |
||
501 | 501 | $hidden = array(); // No hidden columns. |
502 | 502 | $sortable = $this->get_sortable_columns(); |
503 | 503 | |
504 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
504 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
505 | 505 | |
506 | 506 | $this->items = $this->donor_data(); |
507 | 507 | |
508 | 508 | $this->total = $this->get_donor_count(); |
509 | 509 | |
510 | - $this->set_pagination_args( array( |
|
510 | + $this->set_pagination_args(array( |
|
511 | 511 | 'total_items' => $this->total, |
512 | 512 | 'per_page' => $this->per_page, |
513 | - 'total_pages' => ceil( $this->total / $this->per_page ), |
|
514 | - ) ); |
|
513 | + 'total_pages' => ceil($this->total / $this->per_page), |
|
514 | + )); |
|
515 | 515 | } |
516 | 516 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @since 1.0 |
23 | 23 | * |
24 | - * @return array|bool $output Response messages |
|
24 | + * @return false|null $output Response messages |
|
25 | 25 | */ |
26 | 26 | function give_edit_donor( $args ) { |
27 | 27 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * |
228 | 228 | * @since 1.0 |
229 | 229 | * |
230 | - * @return int Whether it was a successful deletion. |
|
230 | + * @return false|null Whether it was a successful deletion. |
|
231 | 231 | */ |
232 | 232 | function give_donor_delete( $args ) { |
233 | 233 | |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | * |
522 | 522 | * @since 1.7 |
523 | 523 | * |
524 | - * @return bool|null |
|
524 | + * @return false|null |
|
525 | 525 | */ |
526 | 526 | function give_remove_donor_email() { |
527 | 527 | if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * |
566 | 566 | * @since 1.7 |
567 | 567 | * |
568 | - * @return bool|null |
|
568 | + * @return false|null |
|
569 | 569 | */ |
570 | 570 | function give_set_donor_primary_email() { |
571 | 571 | if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
@@ -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,33 +23,33 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return array|bool $output Response messages |
25 | 25 | */ |
26 | -function give_edit_donor( $args ) { |
|
26 | +function give_edit_donor($args) { |
|
27 | 27 | |
28 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
28 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
29 | 29 | |
30 | - if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
31 | - wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
30 | + if ( ! is_admin() || ! current_user_can($donor_edit_role)) { |
|
31 | + wp_die(__('You do not have permission to edit this donor.', 'give'), __('Error', 'give'), array( |
|
32 | 32 | 'response' => 403, |
33 | - ) ); |
|
33 | + )); |
|
34 | 34 | } |
35 | 35 | |
36 | - if ( empty( $args ) ) { |
|
36 | + if (empty($args)) { |
|
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
40 | - $donor_info = give_clean( $args['customerinfo'] ); |
|
40 | + $donor_info = give_clean($args['customerinfo']); |
|
41 | 41 | $donor_id = (int) $args['customerinfo']['id']; |
42 | 42 | $nonce = $args['_wpnonce']; |
43 | 43 | |
44 | - if ( ! wp_verify_nonce( $nonce, 'edit-donor' ) ) { |
|
45 | - wp_die( __( 'Cheatin’ uh?', 'give' ), __( 'Error', 'give' ), array( |
|
44 | + if ( ! wp_verify_nonce($nonce, 'edit-donor')) { |
|
45 | + wp_die(__('Cheatin’ uh?', 'give'), __('Error', 'give'), array( |
|
46 | 46 | 'response' => 400, |
47 | - ) ); |
|
47 | + )); |
|
48 | 48 | } |
49 | 49 | |
50 | - $donor = new Give_Donor( $donor_id ); |
|
50 | + $donor = new Give_Donor($donor_id); |
|
51 | 51 | |
52 | - if ( empty( $donor->id ) ) { |
|
52 | + if (empty($donor->id)) { |
|
53 | 53 | return false; |
54 | 54 | } |
55 | 55 | |
@@ -64,39 +64,39 @@ discard block |
||
64 | 64 | 'country' => '', |
65 | 65 | ); |
66 | 66 | |
67 | - $donor_info = wp_parse_args( $donor_info, $defaults ); |
|
67 | + $donor_info = wp_parse_args($donor_info, $defaults); |
|
68 | 68 | |
69 | - if ( (int) $donor_info['user_id'] !== (int) $donor->user_id ) { |
|
69 | + if ((int) $donor_info['user_id'] !== (int) $donor->user_id) { |
|
70 | 70 | |
71 | 71 | // Make sure we don't already have this user attached to a donor. |
72 | - if ( ! empty( $donor_info['user_id'] ) && false !== Give()->donors->get_donor_by( 'user_id', $donor_info['user_id'] ) ) { |
|
73 | - give_set_error( 'give-invalid-donor-user_id', sprintf( __( 'The User ID #%d is already associated with a different donor.', 'give' ), $donor_info['user_id'] ) ); |
|
72 | + if ( ! empty($donor_info['user_id']) && false !== Give()->donors->get_donor_by('user_id', $donor_info['user_id'])) { |
|
73 | + give_set_error('give-invalid-donor-user_id', sprintf(__('The User ID #%d is already associated with a different donor.', 'give'), $donor_info['user_id'])); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // Make sure it's actually a user. |
77 | - $user = get_user_by( 'id', $donor_info['user_id'] ); |
|
78 | - if ( ! empty( $donor_info['user_id'] ) && false === $user ) { |
|
79 | - give_set_error( 'give-invalid-user_id', sprintf( __( 'The User ID #%d does not exist. Please assign an existing user.', 'give' ), $donor_info['user_id'] ) ); |
|
77 | + $user = get_user_by('id', $donor_info['user_id']); |
|
78 | + if ( ! empty($donor_info['user_id']) && false === $user) { |
|
79 | + give_set_error('give-invalid-user_id', sprintf(__('The User ID #%d does not exist. Please assign an existing user.', 'give'), $donor_info['user_id'])); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | - if ( give_get_errors() ) { |
|
83 | + if (give_get_errors()) { |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
87 | 87 | // If First name of donor is empty, then fetch the current first name of donor. |
88 | - if ( empty( $donor_info['first_name'] ) ) { |
|
88 | + if (empty($donor_info['first_name'])) { |
|
89 | 89 | $donor_info['first_name'] = $donor->get_first_name(); |
90 | 90 | } |
91 | 91 | |
92 | 92 | // Sanitize the inputs. |
93 | 93 | $donor_data = array(); |
94 | - $donor_data['name'] = trim( "{$donor_info['first_name']} {$donor_info['last_name']}" ); |
|
94 | + $donor_data['name'] = trim("{$donor_info['first_name']} {$donor_info['last_name']}"); |
|
95 | 95 | $donor_data['first_name'] = $donor_info['first_name']; |
96 | 96 | $donor_data['last_name'] = $donor_info['last_name']; |
97 | 97 | $donor_data['user_id'] = $donor_info['user_id']; |
98 | 98 | |
99 | - $donor_data = apply_filters( 'give_edit_donor_info', $donor_data, $donor_id ); |
|
99 | + $donor_data = apply_filters('give_edit_donor_info', $donor_data, $donor_id); |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Filter the address |
@@ -104,28 +104,28 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @since 1.0 |
106 | 106 | */ |
107 | - $address = apply_filters( 'give_edit_donor_address', array(), $donor_id ); |
|
107 | + $address = apply_filters('give_edit_donor_address', array(), $donor_id); |
|
108 | 108 | |
109 | - $donor_data = give_clean( $donor_data ); |
|
110 | - $address = give_clean( $address ); |
|
109 | + $donor_data = give_clean($donor_data); |
|
110 | + $address = give_clean($address); |
|
111 | 111 | |
112 | - $output = give_connect_user_donor_profile( $donor, $donor_data, $address ); |
|
112 | + $output = give_connect_user_donor_profile($donor, $donor_data, $address); |
|
113 | 113 | |
114 | - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
|
115 | - header( 'Content-Type: application/json' ); |
|
116 | - echo json_encode( $output ); |
|
114 | + if (defined('DOING_AJAX') && DOING_AJAX) { |
|
115 | + header('Content-Type: application/json'); |
|
116 | + echo json_encode($output); |
|
117 | 117 | wp_die(); |
118 | 118 | } |
119 | 119 | |
120 | - if ( $output['success'] ) { |
|
121 | - wp_redirect( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}&give-message=profile-updated" ) ); |
|
120 | + if ($output['success']) { |
|
121 | + wp_redirect(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}&give-message=profile-updated")); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | exit; |
125 | 125 | |
126 | 126 | } |
127 | 127 | |
128 | -add_action( 'give_edit-donor', 'give_edit_donor', 10, 1 ); |
|
128 | +add_action('give_edit-donor', 'give_edit_donor', 10, 1); |
|
129 | 129 | |
130 | 130 | /** |
131 | 131 | * Save a donor note. |
@@ -136,40 +136,40 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @return int The Note ID that was saved, or 0 if nothing was saved. |
138 | 138 | */ |
139 | -function give_donor_save_note( $args ) { |
|
139 | +function give_donor_save_note($args) { |
|
140 | 140 | |
141 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
141 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
142 | 142 | |
143 | - if ( ! is_admin() || ! current_user_can( $donor_view_role ) ) { |
|
144 | - wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
143 | + if ( ! is_admin() || ! current_user_can($donor_view_role)) { |
|
144 | + wp_die(__('You do not have permission to edit this donor.', 'give'), __('Error', 'give'), array( |
|
145 | 145 | 'response' => 403, |
146 | - ) ); |
|
146 | + )); |
|
147 | 147 | } |
148 | 148 | |
149 | - if ( empty( $args ) ) { |
|
149 | + if (empty($args)) { |
|
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | |
153 | - $donor_note = trim( give_clean( $args['donor_note'] ) ); |
|
153 | + $donor_note = trim(give_clean($args['donor_note'])); |
|
154 | 154 | $donor_id = (int) $args['customer_id']; |
155 | 155 | $nonce = $args['add_donor_note_nonce']; |
156 | 156 | |
157 | - if ( ! wp_verify_nonce( $nonce, 'add-donor-note' ) ) { |
|
158 | - wp_die( __( 'Cheatin’ uh?', 'give' ), __( 'Error', 'give' ), array( |
|
157 | + if ( ! wp_verify_nonce($nonce, 'add-donor-note')) { |
|
158 | + wp_die(__('Cheatin’ uh?', 'give'), __('Error', 'give'), array( |
|
159 | 159 | 'response' => 400, |
160 | - ) ); |
|
160 | + )); |
|
161 | 161 | } |
162 | 162 | |
163 | - if ( empty( $donor_note ) ) { |
|
164 | - give_set_error( 'empty-donor-note', __( 'A note is required.', 'give' ) ); |
|
163 | + if (empty($donor_note)) { |
|
164 | + give_set_error('empty-donor-note', __('A note is required.', 'give')); |
|
165 | 165 | } |
166 | 166 | |
167 | - if ( give_get_errors() ) { |
|
167 | + if (give_get_errors()) { |
|
168 | 168 | return false; |
169 | 169 | } |
170 | 170 | |
171 | - $donor = new Give_Donor( $donor_id ); |
|
172 | - $new_note = $donor->add_note( $donor_note ); |
|
171 | + $donor = new Give_Donor($donor_id); |
|
172 | + $new_note = $donor->add_note($donor_note); |
|
173 | 173 | |
174 | 174 | /** |
175 | 175 | * Fires before inserting donor note. |
@@ -179,22 +179,22 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @since 1.0 |
181 | 181 | */ |
182 | - do_action( 'give_pre_insert_donor_note', $donor_id, $new_note ); |
|
182 | + do_action('give_pre_insert_donor_note', $donor_id, $new_note); |
|
183 | 183 | |
184 | - if ( ! empty( $new_note ) && ! empty( $donor->id ) ) { |
|
184 | + if ( ! empty($new_note) && ! empty($donor->id)) { |
|
185 | 185 | |
186 | 186 | ob_start(); |
187 | 187 | ?> |
188 | 188 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
189 | 189 | <span class="note-content-wrap"> |
190 | - <?php echo stripslashes( $new_note ); ?> |
|
190 | + <?php echo stripslashes($new_note); ?> |
|
191 | 191 | </span> |
192 | 192 | </div> |
193 | 193 | <?php |
194 | 194 | $output = ob_get_contents(); |
195 | 195 | ob_end_clean(); |
196 | 196 | |
197 | - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
|
197 | + if (defined('DOING_AJAX') && DOING_AJAX) { |
|
198 | 198 | echo $output; |
199 | 199 | exit; |
200 | 200 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | } |
209 | 209 | |
210 | -add_action( 'give_add-donor-note', 'give_donor_save_note', 10, 1 ); |
|
210 | +add_action('give_add-donor-note', 'give_donor_save_note', 10, 1); |
|
211 | 211 | |
212 | 212 | /** |
213 | 213 | * Delete a donor. |
@@ -218,41 +218,41 @@ discard block |
||
218 | 218 | * |
219 | 219 | * @return int Whether it was a successful deletion. |
220 | 220 | */ |
221 | -function give_donor_delete( $args ) { |
|
221 | +function give_donor_delete($args) { |
|
222 | 222 | |
223 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
223 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
224 | 224 | |
225 | - if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
226 | - wp_die( __( 'You do not have permission to delete donors.', 'give' ), __( 'Error', 'give' ), array( |
|
225 | + if ( ! is_admin() || ! current_user_can($donor_edit_role)) { |
|
226 | + wp_die(__('You do not have permission to delete donors.', 'give'), __('Error', 'give'), array( |
|
227 | 227 | 'response' => 403, |
228 | - ) ); |
|
228 | + )); |
|
229 | 229 | } |
230 | 230 | |
231 | - if ( empty( $args ) ) { |
|
231 | + if (empty($args)) { |
|
232 | 232 | return false; |
233 | 233 | } |
234 | 234 | |
235 | 235 | $donor_id = (int) $args['customer_id']; |
236 | - $confirm = ! empty( $args['give-donor-delete-confirm'] ) ? true : false; |
|
237 | - $remove_data = ! empty( $args['give-donor-delete-records'] ) ? true : false; |
|
236 | + $confirm = ! empty($args['give-donor-delete-confirm']) ? true : false; |
|
237 | + $remove_data = ! empty($args['give-donor-delete-records']) ? true : false; |
|
238 | 238 | $nonce = $args['_wpnonce']; |
239 | 239 | |
240 | - if ( ! wp_verify_nonce( $nonce, 'delete-donor' ) ) { |
|
241 | - wp_die( __( 'Cheatin’ uh?', 'give' ), __( 'Error', 'give' ), array( |
|
240 | + if ( ! wp_verify_nonce($nonce, 'delete-donor')) { |
|
241 | + wp_die(__('Cheatin’ uh?', 'give'), __('Error', 'give'), array( |
|
242 | 242 | 'response' => 400, |
243 | - ) ); |
|
243 | + )); |
|
244 | 244 | } |
245 | 245 | |
246 | - if ( ! $confirm ) { |
|
247 | - give_set_error( 'donor-delete-no-confirm', __( 'Please confirm you want to delete this donor.', 'give' ) ); |
|
246 | + if ( ! $confirm) { |
|
247 | + give_set_error('donor-delete-no-confirm', __('Please confirm you want to delete this donor.', 'give')); |
|
248 | 248 | } |
249 | 249 | |
250 | - if ( give_get_errors() ) { |
|
251 | - wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id ) ); |
|
250 | + if (give_get_errors()) { |
|
251 | + wp_redirect(admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor_id)); |
|
252 | 252 | exit; |
253 | 253 | } |
254 | 254 | |
255 | - $donor = new Give_Donor( $donor_id ); |
|
255 | + $donor = new Give_Donor($donor_id); |
|
256 | 256 | |
257 | 257 | /** |
258 | 258 | * Fires before deleting donor. |
@@ -263,50 +263,50 @@ discard block |
||
263 | 263 | * |
264 | 264 | * @since 1.0 |
265 | 265 | */ |
266 | - do_action( 'give_pre_delete_donor', $donor_id, $confirm, $remove_data ); |
|
266 | + do_action('give_pre_delete_donor', $donor_id, $confirm, $remove_data); |
|
267 | 267 | |
268 | - if ( $donor->id > 0 ) { |
|
268 | + if ($donor->id > 0) { |
|
269 | 269 | |
270 | - $payments_array = explode( ',', $donor->payment_ids ); |
|
271 | - $success = Give()->donors->delete( $donor->id ); |
|
270 | + $payments_array = explode(',', $donor->payment_ids); |
|
271 | + $success = Give()->donors->delete($donor->id); |
|
272 | 272 | |
273 | - if ( $success ) { |
|
273 | + if ($success) { |
|
274 | 274 | |
275 | - if ( $remove_data ) { |
|
275 | + if ($remove_data) { |
|
276 | 276 | |
277 | 277 | // Remove all donations, logs, etc. |
278 | - foreach ( $payments_array as $payment_id ) { |
|
279 | - give_delete_donation( $payment_id ); |
|
278 | + foreach ($payments_array as $payment_id) { |
|
279 | + give_delete_donation($payment_id); |
|
280 | 280 | } |
281 | 281 | } else { |
282 | 282 | |
283 | 283 | // Just set the donations to customer_id of 0. |
284 | - foreach ( $payments_array as $payment_id ) { |
|
285 | - give_update_payment_meta( $payment_id, '_give_payment_donor_id', 0 ); |
|
284 | + foreach ($payments_array as $payment_id) { |
|
285 | + give_update_payment_meta($payment_id, '_give_payment_donor_id', 0); |
|
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | - $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&give-message=donor-deleted' ); |
|
289 | + $redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&give-message=donor-deleted'); |
|
290 | 290 | |
291 | 291 | } else { |
292 | 292 | |
293 | - give_set_error( 'give-donor-delete-failed', __( 'Error deleting donor.', 'give' ) ); |
|
294 | - $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor_id ); |
|
293 | + give_set_error('give-donor-delete-failed', __('Error deleting donor.', 'give')); |
|
294 | + $redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor_id); |
|
295 | 295 | |
296 | 296 | } |
297 | 297 | } else { |
298 | 298 | |
299 | - give_set_error( 'give-donor-delete-invalid-id', __( 'Invalid Donor ID.', 'give' ) ); |
|
300 | - $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); |
|
299 | + give_set_error('give-donor-delete-invalid-id', __('Invalid Donor ID.', 'give')); |
|
300 | + $redirect = admin_url('edit.php?post_type=give_forms&page=give-donors'); |
|
301 | 301 | |
302 | 302 | } |
303 | 303 | |
304 | - wp_redirect( $redirect ); |
|
304 | + wp_redirect($redirect); |
|
305 | 305 | exit; |
306 | 306 | |
307 | 307 | } |
308 | 308 | |
309 | -add_action( 'give_delete-donor', 'give_donor_delete', 10, 1 ); |
|
309 | +add_action('give_delete-donor', 'give_donor_delete', 10, 1); |
|
310 | 310 | |
311 | 311 | /** |
312 | 312 | * Disconnect a user ID from a donor |
@@ -317,17 +317,17 @@ discard block |
||
317 | 317 | * |
318 | 318 | * @return bool|array If the disconnect was successful. |
319 | 319 | */ |
320 | -function give_disconnect_donor_user_id( $args ) { |
|
320 | +function give_disconnect_donor_user_id($args) { |
|
321 | 321 | |
322 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
322 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
323 | 323 | |
324 | - if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
325 | - wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
324 | + if ( ! is_admin() || ! current_user_can($donor_edit_role)) { |
|
325 | + wp_die(__('You do not have permission to edit this donor.', 'give'), __('Error', 'give'), array( |
|
326 | 326 | 'response' => 403, |
327 | - ) ); |
|
327 | + )); |
|
328 | 328 | } |
329 | 329 | |
330 | - if ( empty( $args ) ) { |
|
330 | + if (empty($args)) { |
|
331 | 331 | return false; |
332 | 332 | } |
333 | 333 | |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | |
336 | 336 | $nonce = $args['_wpnonce']; |
337 | 337 | |
338 | - if ( ! wp_verify_nonce( $nonce, 'edit-donor' ) ) { |
|
339 | - wp_die( __( 'Cheatin’ uh?', 'give' ), __( 'Error', 'give' ), array( |
|
338 | + if ( ! wp_verify_nonce($nonce, 'edit-donor')) { |
|
339 | + wp_die(__('Cheatin’ uh?', 'give'), __('Error', 'give'), array( |
|
340 | 340 | 'response' => 400, |
341 | - ) ); |
|
341 | + )); |
|
342 | 342 | } |
343 | 343 | |
344 | - $donor = new Give_Donor( $donor_id ); |
|
345 | - if ( empty( $donor->id ) ) { |
|
344 | + $donor = new Give_Donor($donor_id); |
|
345 | + if (empty($donor->id)) { |
|
346 | 346 | return false; |
347 | 347 | } |
348 | 348 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | * |
357 | 357 | * @since 1.0 |
358 | 358 | */ |
359 | - do_action( 'give_pre_donor_disconnect_user_id', $donor_id, $user_id ); |
|
359 | + do_action('give_pre_donor_disconnect_user_id', $donor_id, $user_id); |
|
360 | 360 | |
361 | 361 | $output = array(); |
362 | 362 | $donor_args = array( |
@@ -365,19 +365,19 @@ discard block |
||
365 | 365 | |
366 | 366 | |
367 | 367 | $output['success'] = true; |
368 | - if ( ! $donor->update( $donor_args ) ) { |
|
369 | - update_user_meta( $user_id, '_give_is_donor_disconnected', true ); |
|
370 | - update_user_meta( $user_id, '_give_disconnected_donor_id', $donor->id ); |
|
371 | - $donor->update_meta( '_give_disconnected_user_id', $user_id ); |
|
368 | + if ( ! $donor->update($donor_args)) { |
|
369 | + update_user_meta($user_id, '_give_is_donor_disconnected', true); |
|
370 | + update_user_meta($user_id, '_give_disconnected_donor_id', $donor->id); |
|
371 | + $donor->update_meta('_give_disconnected_user_id', $user_id); |
|
372 | 372 | |
373 | 373 | $output['success'] = true; |
374 | 374 | |
375 | 375 | } else { |
376 | 376 | $output['success'] = false; |
377 | - give_set_error( 'give-disconnect-user-fail', __( 'Failed to disconnect user from donor.', 'give' ) ); |
|
377 | + give_set_error('give-disconnect-user-fail', __('Failed to disconnect user from donor.', 'give')); |
|
378 | 378 | } |
379 | 379 | |
380 | - $output['redirect'] = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' ) . $donor_id; |
|
380 | + $output['redirect'] = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id=').$donor_id; |
|
381 | 381 | |
382 | 382 | /** |
383 | 383 | * Fires after disconnecting user ID from a donor. |
@@ -386,11 +386,11 @@ discard block |
||
386 | 386 | * |
387 | 387 | * @since 1.0 |
388 | 388 | */ |
389 | - do_action( 'give_post_donor_disconnect_user_id', $donor_id ); |
|
389 | + do_action('give_post_donor_disconnect_user_id', $donor_id); |
|
390 | 390 | |
391 | - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
|
392 | - header( 'Content-Type: application/json' ); |
|
393 | - echo json_encode( $output ); |
|
391 | + if (defined('DOING_AJAX') && DOING_AJAX) { |
|
392 | + header('Content-Type: application/json'); |
|
393 | + echo json_encode($output); |
|
394 | 394 | wp_die(); |
395 | 395 | } |
396 | 396 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | |
399 | 399 | } |
400 | 400 | |
401 | -add_action( 'give_disconnect-userid', 'give_disconnect_donor_user_id', 10, 1 ); |
|
401 | +add_action('give_disconnect-userid', 'give_disconnect_donor_user_id', 10, 1); |
|
402 | 402 | |
403 | 403 | /** |
404 | 404 | * Add an email address to the donor from within the admin and log a donor note. |
@@ -409,86 +409,86 @@ discard block |
||
409 | 409 | * |
410 | 410 | * @return mixed If DOING_AJAX echos out JSON, otherwise returns array of success (bool) and message (string). |
411 | 411 | */ |
412 | -function give_add_donor_email( $args ) { |
|
412 | +function give_add_donor_email($args) { |
|
413 | 413 | |
414 | 414 | $donor_id = ''; |
415 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
415 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
416 | 416 | |
417 | - if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
418 | - wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array( |
|
417 | + if ( ! is_admin() || ! current_user_can($donor_edit_role)) { |
|
418 | + wp_die(__('You do not have permission to edit this donor.', 'give'), __('Error', 'give'), array( |
|
419 | 419 | 'response' => 403, |
420 | - ) ); |
|
420 | + )); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | $output = array(); |
424 | - if ( empty( $args ) || empty( $args['email'] ) || empty( $args['customer_id'] ) ) { |
|
424 | + if (empty($args) || empty($args['email']) || empty($args['customer_id'])) { |
|
425 | 425 | $output['success'] = false; |
426 | - if ( empty( $args['email'] ) ) { |
|
427 | - $output['message'] = __( 'Email address is required.', 'give' ); |
|
428 | - } elseif ( empty( $args['customer_id'] ) ) { |
|
429 | - $output['message'] = __( 'Donor ID is required.', 'give' ); |
|
426 | + if (empty($args['email'])) { |
|
427 | + $output['message'] = __('Email address is required.', 'give'); |
|
428 | + } elseif (empty($args['customer_id'])) { |
|
429 | + $output['message'] = __('Donor ID is required.', 'give'); |
|
430 | 430 | } else { |
431 | - $output['message'] = __( 'An error has occurred. Please try again.', 'give' ); |
|
431 | + $output['message'] = __('An error has occurred. Please try again.', 'give'); |
|
432 | 432 | } |
433 | - } elseif ( ! wp_verify_nonce( $args['_wpnonce'], 'give_add_donor_email' ) ) { |
|
433 | + } elseif ( ! wp_verify_nonce($args['_wpnonce'], 'give_add_donor_email')) { |
|
434 | 434 | $output = array( |
435 | 435 | 'success' => false, |
436 | - 'message' => __( 'Nonce verification failed.', 'give' ), |
|
436 | + 'message' => __('Nonce verification failed.', 'give'), |
|
437 | 437 | ); |
438 | - } elseif ( ! is_email( $args['email'] ) ) { |
|
438 | + } elseif ( ! is_email($args['email'])) { |
|
439 | 439 | $output = array( |
440 | 440 | 'success' => false, |
441 | - 'message' => __( 'Invalid email.', 'give' ), |
|
441 | + 'message' => __('Invalid email.', 'give'), |
|
442 | 442 | ); |
443 | 443 | } else { |
444 | - $email = sanitize_email( $args['email'] ); |
|
444 | + $email = sanitize_email($args['email']); |
|
445 | 445 | $donor_id = (int) $args['customer_id']; |
446 | 446 | $primary = 'true' === $args['primary'] ? true : false; |
447 | - $donor = new Give_Donor( $donor_id ); |
|
448 | - if ( false === $donor->add_email( $email, $primary ) ) { |
|
449 | - if ( in_array( $email, $donor->emails ) ) { |
|
447 | + $donor = new Give_Donor($donor_id); |
|
448 | + if (false === $donor->add_email($email, $primary)) { |
|
449 | + if (in_array($email, $donor->emails)) { |
|
450 | 450 | $output = array( |
451 | 451 | 'success' => false, |
452 | - 'message' => __( 'Email already associated with this donor.', 'give' ), |
|
452 | + 'message' => __('Email already associated with this donor.', 'give'), |
|
453 | 453 | ); |
454 | 454 | } else { |
455 | 455 | $output = array( |
456 | 456 | 'success' => false, |
457 | - 'message' => __( 'Email address is already associated with another donor.', 'give' ), |
|
457 | + 'message' => __('Email address is already associated with another donor.', 'give'), |
|
458 | 458 | ); |
459 | 459 | } |
460 | 460 | } else { |
461 | - $redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&give-message=email-added' ); |
|
461 | + $redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor_id.'&give-message=email-added'); |
|
462 | 462 | $output = array( |
463 | 463 | 'success' => true, |
464 | - 'message' => __( 'Email successfully added to donor.', 'give' ), |
|
464 | + 'message' => __('Email successfully added to donor.', 'give'), |
|
465 | 465 | 'redirect' => $redirect, |
466 | 466 | ); |
467 | 467 | |
468 | 468 | $user = wp_get_current_user(); |
469 | - $user_login = ! empty( $user->user_login ) ? $user->user_login : __( 'System', 'give' ); |
|
470 | - $donor_note = sprintf( __( 'Email address %1$s added by %2$s', 'give' ), $email, $user_login ); |
|
471 | - $donor->add_note( $donor_note ); |
|
469 | + $user_login = ! empty($user->user_login) ? $user->user_login : __('System', 'give'); |
|
470 | + $donor_note = sprintf(__('Email address %1$s added by %2$s', 'give'), $email, $user_login); |
|
471 | + $donor->add_note($donor_note); |
|
472 | 472 | |
473 | - if ( $primary ) { |
|
474 | - $donor_note = sprintf( __( 'Email address %1$s set as primary by %2$s', 'give' ), $email, $user_login ); |
|
475 | - $donor->add_note( $donor_note ); |
|
473 | + if ($primary) { |
|
474 | + $donor_note = sprintf(__('Email address %1$s set as primary by %2$s', 'give'), $email, $user_login); |
|
475 | + $donor->add_note($donor_note); |
|
476 | 476 | } |
477 | 477 | } |
478 | 478 | } // End if(). |
479 | 479 | |
480 | - do_action( 'give_post_add_donor_email', $donor_id, $args ); |
|
480 | + do_action('give_post_add_donor_email', $donor_id, $args); |
|
481 | 481 | |
482 | - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
|
483 | - header( 'Content-Type: application/json' ); |
|
484 | - echo json_encode( $output ); |
|
482 | + if (defined('DOING_AJAX') && DOING_AJAX) { |
|
483 | + header('Content-Type: application/json'); |
|
484 | + echo json_encode($output); |
|
485 | 485 | wp_die(); |
486 | 486 | } |
487 | 487 | |
488 | 488 | return $output; |
489 | 489 | } |
490 | 490 | |
491 | -add_action( 'give_add_donor_email', 'give_add_donor_email', 10, 1 ); |
|
491 | +add_action('give_add_donor_email', 'give_add_donor_email', 10, 1); |
|
492 | 492 | |
493 | 493 | |
494 | 494 | /** |
@@ -499,39 +499,39 @@ discard block |
||
499 | 499 | * @return bool|null |
500 | 500 | */ |
501 | 501 | function give_remove_donor_email() { |
502 | - if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
502 | + if (empty($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
503 | 503 | return false; |
504 | 504 | } |
505 | - if ( empty( $_GET['email'] ) || ! is_email( $_GET['email'] ) ) { |
|
505 | + if (empty($_GET['email']) || ! is_email($_GET['email'])) { |
|
506 | 506 | return false; |
507 | 507 | } |
508 | - if ( empty( $_GET['_wpnonce'] ) ) { |
|
508 | + if (empty($_GET['_wpnonce'])) { |
|
509 | 509 | return false; |
510 | 510 | } |
511 | 511 | |
512 | 512 | $nonce = $_GET['_wpnonce']; |
513 | - if ( ! wp_verify_nonce( $nonce, 'give-remove-donor-email' ) ) { |
|
514 | - wp_die( __( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( |
|
513 | + if ( ! wp_verify_nonce($nonce, 'give-remove-donor-email')) { |
|
514 | + wp_die(__('Nonce verification failed', 'give'), __('Error', 'give'), array( |
|
515 | 515 | 'response' => 403, |
516 | - ) ); |
|
516 | + )); |
|
517 | 517 | } |
518 | 518 | |
519 | - $donor = new Give_Donor( $_GET['id'] ); |
|
520 | - if ( $donor->remove_email( $_GET['email'] ) ) { |
|
521 | - $url = add_query_arg( 'give-message', 'email-removed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); |
|
519 | + $donor = new Give_Donor($_GET['id']); |
|
520 | + if ($donor->remove_email($_GET['email'])) { |
|
521 | + $url = add_query_arg('give-message', 'email-removed', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id)); |
|
522 | 522 | $user = wp_get_current_user(); |
523 | - $user_login = ! empty( $user->user_login ) ? $user->user_login : __( 'System', 'give' ); |
|
524 | - $donor_note = sprintf( __( 'Email address %1$s removed by %2$s', 'give' ), $_GET['email'], $user_login ); |
|
525 | - $donor->add_note( $donor_note ); |
|
523 | + $user_login = ! empty($user->user_login) ? $user->user_login : __('System', 'give'); |
|
524 | + $donor_note = sprintf(__('Email address %1$s removed by %2$s', 'give'), $_GET['email'], $user_login); |
|
525 | + $donor->add_note($donor_note); |
|
526 | 526 | } else { |
527 | - $url = add_query_arg( 'give-message', 'email-remove-failed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); |
|
527 | + $url = add_query_arg('give-message', 'email-remove-failed', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id)); |
|
528 | 528 | } |
529 | 529 | |
530 | - wp_safe_redirect( $url ); |
|
530 | + wp_safe_redirect($url); |
|
531 | 531 | exit; |
532 | 532 | } |
533 | 533 | |
534 | -add_action( 'give_remove_donor_email', 'give_remove_donor_email', 10 ); |
|
534 | +add_action('give_remove_donor_email', 'give_remove_donor_email', 10); |
|
535 | 535 | |
536 | 536 | |
537 | 537 | /** |
@@ -543,44 +543,44 @@ discard block |
||
543 | 543 | * @return bool|null |
544 | 544 | */ |
545 | 545 | function give_set_donor_primary_email() { |
546 | - if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
546 | + if (empty($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
547 | 547 | return false; |
548 | 548 | } |
549 | 549 | |
550 | - if ( empty( $_GET['email'] ) || ! is_email( $_GET['email'] ) ) { |
|
550 | + if (empty($_GET['email']) || ! is_email($_GET['email'])) { |
|
551 | 551 | return false; |
552 | 552 | } |
553 | 553 | |
554 | - if ( empty( $_GET['_wpnonce'] ) ) { |
|
554 | + if (empty($_GET['_wpnonce'])) { |
|
555 | 555 | return false; |
556 | 556 | } |
557 | 557 | |
558 | 558 | $nonce = $_GET['_wpnonce']; |
559 | 559 | |
560 | - if ( ! wp_verify_nonce( $nonce, 'give-set-donor-primary-email' ) ) { |
|
561 | - wp_die( __( 'Nonce verification failed', 'give' ), __( 'Error', 'give' ), array( |
|
560 | + if ( ! wp_verify_nonce($nonce, 'give-set-donor-primary-email')) { |
|
561 | + wp_die(__('Nonce verification failed', 'give'), __('Error', 'give'), array( |
|
562 | 562 | 'response' => 403, |
563 | - ) ); |
|
563 | + )); |
|
564 | 564 | } |
565 | 565 | |
566 | - $donor = new Give_Donor( $_GET['id'] ); |
|
566 | + $donor = new Give_Donor($_GET['id']); |
|
567 | 567 | |
568 | - if ( $donor->set_primary_email( $_GET['email'] ) ) { |
|
569 | - $url = add_query_arg( 'give-message', 'primary-email-updated', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); |
|
568 | + if ($donor->set_primary_email($_GET['email'])) { |
|
569 | + $url = add_query_arg('give-message', 'primary-email-updated', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id)); |
|
570 | 570 | $user = wp_get_current_user(); |
571 | - $user_login = ! empty( $user->user_login ) ? $user->user_login : __( 'System', 'give' ); |
|
572 | - $donor_note = sprintf( __( 'Email address %1$s set as primary by %2$s', 'give' ), $_GET['email'], $user_login ); |
|
571 | + $user_login = ! empty($user->user_login) ? $user->user_login : __('System', 'give'); |
|
572 | + $donor_note = sprintf(__('Email address %1$s set as primary by %2$s', 'give'), $_GET['email'], $user_login); |
|
573 | 573 | |
574 | - $donor->add_note( $donor_note ); |
|
574 | + $donor->add_note($donor_note); |
|
575 | 575 | } else { |
576 | - $url = add_query_arg( 'give-message', 'primary-email-failed', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ); |
|
576 | + $url = add_query_arg('give-message', 'primary-email-failed', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id)); |
|
577 | 577 | } |
578 | 578 | |
579 | - wp_safe_redirect( $url ); |
|
579 | + wp_safe_redirect($url); |
|
580 | 580 | exit; |
581 | 581 | } |
582 | 582 | |
583 | -add_action( 'give_set_donor_primary_email', 'give_set_donor_primary_email', 10 ); |
|
583 | +add_action('give_set_donor_primary_email', 'give_set_donor_primary_email', 10); |
|
584 | 584 | |
585 | 585 | /** |
586 | 586 | * Delete Donor using Bulk Actions. |
@@ -591,57 +591,57 @@ discard block |
||
591 | 591 | * |
592 | 592 | * @return void |
593 | 593 | */ |
594 | -function give_delete_donor( $args ) { |
|
594 | +function give_delete_donor($args) { |
|
595 | 595 | |
596 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
596 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
597 | 597 | |
598 | - if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) { |
|
599 | - wp_die( __( 'You do not have permission to delete donors.', 'give' ), __( 'Error', 'give' ), array( |
|
598 | + if ( ! is_admin() || ! current_user_can($donor_edit_role)) { |
|
599 | + wp_die(__('You do not have permission to delete donors.', 'give'), __('Error', 'give'), array( |
|
600 | 600 | 'response' => 403, |
601 | - ) ); |
|
601 | + )); |
|
602 | 602 | } |
603 | 603 | |
604 | 604 | $give_args = array(); |
605 | - $donor_ids = ( ! empty( $_GET['donor'] ) && is_array( $_GET['donor'] ) && count( $_GET['donor'] ) > 0 ) ? $_GET['donor'] : array(); |
|
606 | - $delete_donor = ! empty( $_GET['give-delete-donor-confirm'] ) ? $_GET['give-delete-donor-confirm'] : ''; |
|
607 | - $delete_donations = ! empty( $_GET['give-delete-donor-records'] ) ? $_GET['give-delete-donor-records'] : ''; |
|
608 | - $search_keyword = ! empty( $_GET['s'] ) ? $_GET['s'] : ''; |
|
609 | - $give_args['orderby'] = ! empty( $_GET['orderby'] ) ? $_GET['orderby'] : 'id'; |
|
610 | - $give_args['order'] = ! empty( $_GET['order'] ) ? $_GET['order'] : 'desc'; |
|
605 | + $donor_ids = ( ! empty($_GET['donor']) && is_array($_GET['donor']) && count($_GET['donor']) > 0) ? $_GET['donor'] : array(); |
|
606 | + $delete_donor = ! empty($_GET['give-delete-donor-confirm']) ? $_GET['give-delete-donor-confirm'] : ''; |
|
607 | + $delete_donations = ! empty($_GET['give-delete-donor-records']) ? $_GET['give-delete-donor-records'] : ''; |
|
608 | + $search_keyword = ! empty($_GET['s']) ? $_GET['s'] : ''; |
|
609 | + $give_args['orderby'] = ! empty($_GET['orderby']) ? $_GET['orderby'] : 'id'; |
|
610 | + $give_args['order'] = ! empty($_GET['order']) ? $_GET['order'] : 'desc'; |
|
611 | 611 | $nonce = $args['_wpnonce']; |
612 | 612 | |
613 | 613 | // Verify Nonce for deleting bulk donors. |
614 | - if ( ! wp_verify_nonce( $nonce, 'bulk-donors' ) ) { |
|
615 | - wp_die( __( 'Cheatin’ uh?', 'give' ), __( 'Error', 'give' ), array( |
|
614 | + if ( ! wp_verify_nonce($nonce, 'bulk-donors')) { |
|
615 | + wp_die(__('Cheatin’ uh?', 'give'), __('Error', 'give'), array( |
|
616 | 616 | 'response' => 400, |
617 | - ) ); |
|
617 | + )); |
|
618 | 618 | } |
619 | 619 | |
620 | - if( count( $donor_ids ) > 0 ) { |
|
621 | - foreach ( $donor_ids as $donor_id ) { |
|
622 | - $donor = new Give_Donor( $donor_id ); |
|
620 | + if (count($donor_ids) > 0) { |
|
621 | + foreach ($donor_ids as $donor_id) { |
|
622 | + $donor = new Give_Donor($donor_id); |
|
623 | 623 | |
624 | - if ( $donor->id > 0 ) { |
|
624 | + if ($donor->id > 0) { |
|
625 | 625 | |
626 | - if( $delete_donor ) { |
|
627 | - $donor_deleted = Give()->donors->delete( $donor->id ); |
|
626 | + if ($delete_donor) { |
|
627 | + $donor_deleted = Give()->donors->delete($donor->id); |
|
628 | 628 | |
629 | - if ( $donor_deleted ) { |
|
630 | - $donation_ids = explode( ',', $donor->payment_ids ); |
|
629 | + if ($donor_deleted) { |
|
630 | + $donation_ids = explode(',', $donor->payment_ids); |
|
631 | 631 | |
632 | - if( $delete_donations ) { |
|
632 | + if ($delete_donations) { |
|
633 | 633 | |
634 | 634 | // Remove all donations, logs, etc. |
635 | - foreach ( $donation_ids as $donation_id ) { |
|
636 | - give_delete_donation( $donation_id ); |
|
635 | + foreach ($donation_ids as $donation_id) { |
|
636 | + give_delete_donation($donation_id); |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | $give_args['give-message'] = 'donor-donations-deleted'; |
640 | 640 | } else { |
641 | 641 | |
642 | 642 | // Just set the donations to customer_id of 0. |
643 | - foreach ( $donation_ids as $donation_id ) { |
|
644 | - give_update_payment_meta( $donation_id, '_give_payment_customer_id', 0 ); |
|
643 | + foreach ($donation_ids as $donation_id) { |
|
644 | + give_update_payment_meta($donation_id, '_give_payment_customer_id', 0); |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | $give_args['give-message'] = 'donor-deleted'; |
@@ -658,13 +658,13 @@ discard block |
||
658 | 658 | } |
659 | 659 | |
660 | 660 | // Add Search Keyword on redirection, if it exists. |
661 | - if ( ! empty( $search_keyword ) ) { |
|
661 | + if ( ! empty($search_keyword)) { |
|
662 | 662 | $give_args['s'] = $search_keyword; |
663 | 663 | } |
664 | 664 | |
665 | - wp_redirect( add_query_arg( $give_args, admin_url( 'edit.php?post_type=give_forms&page=give-donors' ) ) ); |
|
665 | + wp_redirect(add_query_arg($give_args, admin_url('edit.php?post_type=give_forms&page=give-donors'))); |
|
666 | 666 | give_die(); |
667 | 667 | } |
668 | 668 | } |
669 | 669 | |
670 | -add_action( 'give_delete_donor', 'give_delete_donor' ); |
|
671 | 670 | \ No newline at end of file |
671 | +add_action('give_delete_donor', 'give_delete_donor'); |
|
672 | 672 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | // Exit if accessed directly. |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | * 'testing' => false, // (required) Never leave as "true" in production!!! |
33 | 33 | * } |
34 | 34 | */ |
35 | - function __construct( $_banner_details ) { |
|
35 | + function __construct($_banner_details) { |
|
36 | 36 | $current_user = wp_get_current_user(); |
37 | 37 | |
38 | 38 | $this->plugin_activate_by = 0; |
39 | 39 | $this->banner_details = $_banner_details; |
40 | - $this->test_mode = ( $this->banner_details['testing'] == 'true' ) ? true : false; |
|
41 | - $this->nag_meta_key = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] ); |
|
42 | - $this->activate_by_meta_key = 'give_addon_' . sanitize_title( $this->banner_details['name'] ) . '_active_by_user'; |
|
40 | + $this->test_mode = ($this->banner_details['testing'] == 'true') ? true : false; |
|
41 | + $this->nag_meta_key = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']); |
|
42 | + $this->activate_by_meta_key = 'give_addon_'.sanitize_title($this->banner_details['name']).'_active_by_user'; |
|
43 | 43 | |
44 | 44 | //Get current user |
45 | 45 | $this->user_id = $current_user->ID; |
@@ -62,19 +62,19 @@ discard block |
||
62 | 62 | public function init() { |
63 | 63 | |
64 | 64 | //Testing? |
65 | - if ( $this->test_mode ) { |
|
66 | - delete_user_meta( $this->user_id, $this->nag_meta_key ); |
|
65 | + if ($this->test_mode) { |
|
66 | + delete_user_meta($this->user_id, $this->nag_meta_key); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | //Get the current page to add the notice to |
70 | - add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) ); |
|
71 | - add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) ); |
|
70 | + add_action('current_screen', array($this, 'give_addon_notice_ignore')); |
|
71 | + add_action('admin_notices', array($this, 'give_addon_activation_admin_notice')); |
|
72 | 72 | |
73 | 73 | // File path of addon must be included in banner detail other addon activate meta will not delete. |
74 | 74 | $file_name = $this->get_plugin_file_name(); |
75 | 75 | |
76 | - if ( ! empty( $file_name ) ) { |
|
77 | - add_action( 'deactivate_' . $file_name, array( $this, 'remove_addon_activate_meta' ) ); |
|
76 | + if ( ! empty($file_name)) { |
|
77 | + add_action('deactivate_'.$file_name, array($this, 'remove_addon_activate_meta')); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | private function is_plugin_page() { |
90 | 90 | $screen = get_current_screen(); |
91 | 91 | |
92 | - return ( $screen->parent_file === 'plugins.php' ); |
|
92 | + return ($screen->parent_file === 'plugins.php'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | public function give_addon_activation_admin_notice() { |
103 | 103 | |
104 | 104 | // Bailout. |
105 | - if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) { |
|
105 | + if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by) { |
|
106 | 106 | return; |
107 | 107 | } |
108 | 108 | |
109 | 109 | // If the user hasn't already dismissed the alert, output activation banner. |
110 | - if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) { |
|
110 | + if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) { |
|
111 | 111 | |
112 | 112 | $this->print_css(); |
113 | 113 | |
@@ -125,44 +125,44 @@ discard block |
||
125 | 125 | <h3><?php |
126 | 126 | printf( |
127 | 127 | /* translators: %s: Add-on name */ |
128 | - esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ), |
|
129 | - '<span>' . $this->banner_details['name'] . '</span>' |
|
128 | + esc_html__("Thank you for installing Give's %s Add-on!", 'give'), |
|
129 | + '<span>'.$this->banner_details['name'].'</span>' |
|
130 | 130 | ); |
131 | 131 | ?></h3> |
132 | 132 | |
133 | 133 | <a href="<?php |
134 | 134 | //The Dismiss Button. |
135 | - $nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0'; |
|
136 | - echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span |
|
135 | + $nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0'; |
|
136 | + echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span |
|
137 | 137 | class="dashicons dashicons-dismiss"></span></a> |
138 | 138 | |
139 | 139 | <div class="alert-actions"> |
140 | 140 | |
141 | 141 | <?php //Point them to your settings page. |
142 | - if ( isset( $this->banner_details['settings_url'] ) ) { ?> |
|
142 | + if (isset($this->banner_details['settings_url'])) { ?> |
|
143 | 143 | <a href="<?php echo $this->banner_details['settings_url']; ?>"> |
144 | - <span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?> |
|
144 | + <span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?> |
|
145 | 145 | </a> |
146 | 146 | <?php } ?> |
147 | 147 | |
148 | 148 | <?php |
149 | 149 | // Show them how to configure the Addon. |
150 | - if ( isset( $this->banner_details['documentation_url'] ) ) { ?> |
|
150 | + if (isset($this->banner_details['documentation_url'])) { ?> |
|
151 | 151 | <a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank"> |
152 | 152 | <span class="dashicons dashicons-media-text"></span><?php |
153 | 153 | printf( |
154 | 154 | /* translators: %s: Add-on name */ |
155 | - esc_html__( 'Documentation: %s Add-on', 'give' ), |
|
155 | + esc_html__('Documentation: %s Add-on', 'give'), |
|
156 | 156 | $this->banner_details['name'] |
157 | 157 | ); |
158 | 158 | ?></a> |
159 | 159 | <?php } ?> |
160 | 160 | <?php |
161 | 161 | //Let them signup for plugin updates |
162 | - if ( isset( $this->banner_details['support_url'] ) ) { ?> |
|
162 | + if (isset($this->banner_details['support_url'])) { ?> |
|
163 | 163 | |
164 | 164 | <a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank"> |
165 | - <span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?> |
|
165 | + <span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?> |
|
166 | 166 | </a> |
167 | 167 | |
168 | 168 | <?php } ?> |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | |
177 | 177 | |
178 | 178 | // Register notice. |
179 | - Give()->notices->register_notice( array( |
|
180 | - 'id' => 'give_' . sanitize_title( $this->banner_details['name'] ) . '_notice', |
|
179 | + Give()->notices->register_notice(array( |
|
180 | + 'id' => 'give_'.sanitize_title($this->banner_details['name']).'_notice', |
|
181 | 181 | 'type' => 'updated', |
182 | 182 | 'description_html' => $notice_html, |
183 | 183 | 'show' => true, |
184 | - ) ); |
|
184 | + )); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @since 1.8.16 |
193 | 193 | * @access private |
194 | 194 | */ |
195 | - private function print_css(){ |
|
195 | + private function print_css() { |
|
196 | 196 | ?> |
197 | 197 | <style> |
198 | 198 | div.give-addon-alert.updated { |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not. |
281 | 281 | * See here: http://codex.wordpress.org/Function_Reference/add_user_meta |
282 | 282 | */ |
283 | - if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) { |
|
283 | + if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) { |
|
284 | 284 | |
285 | 285 | //Get the global user |
286 | 286 | $current_user = wp_get_current_user(); |
287 | 287 | $user_id = $current_user->ID; |
288 | 288 | |
289 | - add_user_meta( $user_id, $this->nag_meta_key, 'true', true ); |
|
289 | + add_user_meta($user_id, $this->nag_meta_key, 'true', true); |
|
290 | 290 | } |
291 | 291 | } |
292 | 292 | |
@@ -297,11 +297,11 @@ discard block |
||
297 | 297 | * @access private |
298 | 298 | */ |
299 | 299 | private function add_addon_activate_meta() { |
300 | - $user_id = get_option( $this->activate_by_meta_key ); |
|
300 | + $user_id = get_option($this->activate_by_meta_key); |
|
301 | 301 | $this->plugin_activate_by = (int) $user_id; |
302 | 302 | |
303 | - if ( ! $user_id ) { |
|
304 | - add_option( $this->activate_by_meta_key, $this->user_id, '', 'no' ); |
|
303 | + if ( ! $user_id) { |
|
304 | + add_option($this->activate_by_meta_key, $this->user_id, '', 'no'); |
|
305 | 305 | $this->plugin_activate_by = (int) $this->user_id; |
306 | 306 | } |
307 | 307 | } |
@@ -314,10 +314,10 @@ discard block |
||
314 | 314 | * @access public |
315 | 315 | */ |
316 | 316 | public function remove_addon_activate_meta() { |
317 | - $user_id = get_option( $this->activate_by_meta_key ); |
|
317 | + $user_id = get_option($this->activate_by_meta_key); |
|
318 | 318 | |
319 | - if ( $user_id ) { |
|
320 | - delete_option( $this->activate_by_meta_key ); |
|
319 | + if ($user_id) { |
|
320 | + delete_option($this->activate_by_meta_key); |
|
321 | 321 | } |
322 | 322 | } |
323 | 323 | |
@@ -330,39 +330,39 @@ discard block |
||
330 | 330 | * @return mixed |
331 | 331 | */ |
332 | 332 | private function get_plugin_file_name() { |
333 | - $active_plugins = get_option( 'active_plugins' ); |
|
333 | + $active_plugins = get_option('active_plugins'); |
|
334 | 334 | $file_name = ''; |
335 | 335 | |
336 | 336 | try { |
337 | 337 | |
338 | 338 | // Check addon file path. |
339 | - if ( ! empty( $this->banner_details['file'] ) ) { |
|
339 | + if ( ! empty($this->banner_details['file'])) { |
|
340 | 340 | $file_name = ''; |
341 | - if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) { |
|
342 | - $file_path = array_pop( $file_path ); |
|
343 | - $file_name = current( explode( '/', $file_path ) ); |
|
341 | + if ($file_path = explode('/plugins/', $this->banner_details['file'])) { |
|
342 | + $file_path = array_pop($file_path); |
|
343 | + $file_name = current(explode('/', $file_path)); |
|
344 | 344 | } |
345 | 345 | |
346 | - if ( empty( $file_name ) ) { |
|
346 | + if (empty($file_name)) { |
|
347 | 347 | return false; |
348 | 348 | } |
349 | 349 | |
350 | - foreach ( $active_plugins as $plugin ) { |
|
351 | - if ( false !== strpos( $plugin, $file_name ) ) { |
|
350 | + foreach ($active_plugins as $plugin) { |
|
351 | + if (false !== strpos($plugin, $file_name)) { |
|
352 | 352 | $file_name = $plugin; |
353 | 353 | break; |
354 | 354 | } |
355 | 355 | } |
356 | - } elseif ( WP_DEBUG ) { |
|
357 | - throw new Exception( __( "File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give' ) ); |
|
356 | + } elseif (WP_DEBUG) { |
|
357 | + throw new Exception(__("File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give')); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | // Check plugin path calculated by addon file path. |
361 | - if ( empty( $file_name ) && WP_DEBUG ) { |
|
362 | - throw new Exception( __( "Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give' ) ); |
|
361 | + if (empty($file_name) && WP_DEBUG) { |
|
362 | + throw new Exception(__("Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give')); |
|
363 | 363 | } |
364 | 364 | |
365 | - } catch ( Exception $e ) { |
|
365 | + } catch (Exception $e) { |
|
366 | 366 | echo $e->getMessage(); |
367 | 367 | } |
368 | 368 |
@@ -65,18 +65,18 @@ discard block |
||
65 | 65 | * |
66 | 66 | * @param $args |
67 | 67 | */ |
68 | - public function __construct( $args ) { |
|
68 | + public function __construct($args) { |
|
69 | 69 | |
70 | 70 | // Only for admins. |
71 | - if ( ! is_admin() ) { |
|
71 | + if ( ! is_admin()) { |
|
72 | 72 | return; |
73 | 73 | } |
74 | 74 | |
75 | - foreach ( $args as $key => $arg ) { |
|
75 | + foreach ($args as $key => $arg) { |
|
76 | 76 | $this->$key = $arg; |
77 | 77 | } |
78 | 78 | |
79 | - add_action( 'admin_init', array( $this, 'init' ) ); |
|
79 | + add_action('admin_init', array($this, 'init')); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | } |
@@ -87,19 +87,19 @@ discard block |
||
87 | 87 | function init() { |
88 | 88 | |
89 | 89 | // First get user's locale (4.7+). |
90 | - $this->locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale(); |
|
90 | + $this->locale = function_exists('get_user_locale') ? get_user_locale() : get_locale(); |
|
91 | 91 | |
92 | 92 | // This plugin is en_US native. |
93 | - if ( 'en_US' === $this->locale ) { |
|
93 | + if ('en_US' === $this->locale) { |
|
94 | 94 | return; |
95 | 95 | } |
96 | 96 | |
97 | 97 | if ( |
98 | 98 | ! $this->hide_promo() |
99 | - && ( ! empty( $_GET['post_type'] ) && 'give_forms' === $_GET['post_type'] ) |
|
100 | - && ( ! empty( $_GET['page'] ) && 'give-settings' === $_GET['page'] ) |
|
99 | + && ( ! empty($_GET['post_type']) && 'give_forms' === $_GET['post_type']) |
|
100 | + && ( ! empty($_GET['page']) && 'give-settings' === $_GET['page']) |
|
101 | 101 | ) { |
102 | - add_action( $this->hook, array( $this, 'promo' ) ); |
|
102 | + add_action($this->hook, array($this, 'promo')); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | * @return bool |
113 | 113 | */ |
114 | 114 | private function hide_promo() { |
115 | - $hide_promo = Give_Cache::get( 'give_i18n_give_promo_hide', true ); |
|
116 | - if ( ! $hide_promo ) { |
|
117 | - if ( filter_input( INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT ) === 1 ) { |
|
115 | + $hide_promo = Give_Cache::get('give_i18n_give_promo_hide', true); |
|
116 | + if ( ! $hide_promo) { |
|
117 | + if (filter_input(INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT) === 1) { |
|
118 | 118 | // No expiration time, so this would normally not expire, but it wouldn't be copied to other sites etc. |
119 | - Give_Cache::set( 'give_i18n_give_promo_hide', true, null, true ); |
|
119 | + Give_Cache::set('give_i18n_give_promo_hide', true, null, true); |
|
120 | 120 | $hide_promo = true; |
121 | 121 | } |
122 | 122 | } |
@@ -135,20 +135,20 @@ discard block |
||
135 | 135 | $message = false; |
136 | 136 | |
137 | 137 | // Using a translation less than 90% complete. |
138 | - if ( $this->translation_exists && $this->translation_loaded && $this->percent_translated < 90 ) { |
|
139 | - $message = __( 'As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help %5$s to %1$s!', 'give' ); |
|
140 | - } elseif ( ! $this->translation_loaded && $this->translation_exists ) { |
|
141 | - $message = __( 'You\'re using WordPress in %1$s. While %2$s has been %3$d%% translated to %1$s, it has not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', 'give' ); |
|
142 | - } elseif ( ! $this->translation_exists ) { |
|
143 | - $message = __( 'You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', 'give' ); |
|
138 | + if ($this->translation_exists && $this->translation_loaded && $this->percent_translated < 90) { |
|
139 | + $message = __('As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help %5$s to %1$s!', 'give'); |
|
140 | + } elseif ( ! $this->translation_loaded && $this->translation_exists) { |
|
141 | + $message = __('You\'re using WordPress in %1$s. While %2$s has been %3$d%% translated to %1$s, it has not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', 'give'); |
|
142 | + } elseif ( ! $this->translation_exists) { |
|
143 | + $message = __('You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', 'give'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | // Links. |
147 | - $registration_link = sprintf( '<a href="%1$s" target="_blank">%2$s</a>', 'https://wordpress.org/support/register.php', esc_html__( 'WordPress.org', 'give' ) ); |
|
148 | - $translations_link = sprintf( '<a href="%1$s" target="_blank">%2$s</a>', 'https://translate.wordpress.org/projects/wp-plugins/give', esc_html__( 'complete the translation', 'give' ) ); |
|
147 | + $registration_link = sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://wordpress.org/support/register.php', esc_html__('WordPress.org', 'give')); |
|
148 | + $translations_link = sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://translate.wordpress.org/projects/wp-plugins/give', esc_html__('complete the translation', 'give')); |
|
149 | 149 | |
150 | 150 | // Message. |
151 | - $message = sprintf( $message, $this->locale_name, 'Give', $this->percent_translated, $registration_link, $translations_link ); |
|
151 | + $message = sprintf($message, $this->locale_name, 'Give', $this->percent_translated, $registration_link, $translations_link); |
|
152 | 152 | |
153 | 153 | return $message; |
154 | 154 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $this->translation_details(); |
163 | 163 | $message = $this->promo_message(); |
164 | 164 | |
165 | - if ( $message ) { |
|
165 | + if ($message) { |
|
166 | 166 | $this->print_css(); |
167 | 167 | |
168 | 168 | ob_start(); |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | style="font-size: 110px; text-decoration: none;"></span></a> |
174 | 174 | |
175 | 175 | <div class="give-i18n-notice-content"> |
176 | - <a href="<?php echo esc_url( add_query_arg( array( 'remove_i18n_promo' => '1' ) ) ); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
176 | + <a href="<?php echo esc_url(add_query_arg(array('remove_i18n_promo' => '1'))); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
177 | 177 | |
178 | - <h2 style="margin: 10px 0;"><?php printf( esc_html__( 'Help Translate Give to %s', 'give' ), $this->locale_name ); ?></h2> |
|
178 | + <h2 style="margin: 10px 0;"><?php printf(esc_html__('Help Translate Give to %s', 'give'), $this->locale_name); ?></h2> |
|
179 | 179 | <p><?php echo $message; ?></p> |
180 | 180 | <p> |
181 | - <a href="https://wordpress.org/support/register.php" target="_blank"><?php _e( 'Register now »', 'give' ); ?></a> |
|
181 | + <a href="https://wordpress.org/support/register.php" target="_blank"><?php _e('Register now »', 'give'); ?></a> |
|
182 | 182 | </p> |
183 | 183 | </div> |
184 | 184 | </div> |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | $notice_html = ob_get_clean(); |
188 | 188 | |
189 | 189 | // Register notice. |
190 | - Give()->notices->register_notice( array( |
|
190 | + Give()->notices->register_notice(array( |
|
191 | 191 | 'id' => 'give-i18n-notice', |
192 | 192 | 'type' => 'updated', |
193 | 193 | 'description_html' => $notice_html, |
194 | 194 | 'show' => true, |
195 | - ) ); |
|
195 | + )); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
@@ -274,11 +274,11 @@ discard block |
||
274 | 274 | */ |
275 | 275 | private function find_or_initialize_translation_details() { |
276 | 276 | |
277 | - $set = Give_Cache::get( "give_i18n_give_{$this->locale}", true ); |
|
277 | + $set = Give_Cache::get("give_i18n_give_{$this->locale}", true); |
|
278 | 278 | |
279 | - if ( ! $set ) { |
|
279 | + if ( ! $set) { |
|
280 | 280 | $set = $this->retrieve_translation_details(); |
281 | - Give_Cache::set( "give_i18n_give_{$this->locale}", $set, DAY_IN_SECONDS, true ); |
|
281 | + Give_Cache::set("give_i18n_give_{$this->locale}", $set, DAY_IN_SECONDS, true); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | return $set; |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | private function translation_details() { |
293 | 293 | $set = $this->find_or_initialize_translation_details(); |
294 | 294 | |
295 | - $this->translation_exists = ! is_null( $set ); |
|
296 | - $this->translation_loaded = is_textdomain_loaded( 'give' ); |
|
295 | + $this->translation_exists = ! is_null($set); |
|
296 | + $this->translation_loaded = is_textdomain_loaded('give'); |
|
297 | 297 | |
298 | - $this->parse_translation_set( $set ); |
|
298 | + $this->parse_translation_set($set); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -307,26 +307,26 @@ discard block |
||
307 | 307 | */ |
308 | 308 | private function retrieve_translation_details() { |
309 | 309 | |
310 | - $api_url = trailingslashit( $this->glotpress_url ); |
|
310 | + $api_url = trailingslashit($this->glotpress_url); |
|
311 | 311 | |
312 | - $resp = wp_remote_get( $api_url ); |
|
312 | + $resp = wp_remote_get($api_url); |
|
313 | 313 | |
314 | - if ( is_wp_error( $resp ) || wp_remote_retrieve_response_code( $resp ) === '404' ) { |
|
314 | + if (is_wp_error($resp) || wp_remote_retrieve_response_code($resp) === '404') { |
|
315 | 315 | return null; |
316 | 316 | } |
317 | 317 | |
318 | - $body = wp_remote_retrieve_body( $resp ); |
|
319 | - unset( $resp ); |
|
318 | + $body = wp_remote_retrieve_body($resp); |
|
319 | + unset($resp); |
|
320 | 320 | |
321 | - if ( $body ) { |
|
322 | - $body = json_decode( $body ); |
|
321 | + if ($body) { |
|
322 | + $body = json_decode($body); |
|
323 | 323 | |
324 | - foreach ( $body->translation_sets as $set ) { |
|
325 | - if ( ! property_exists( $set, 'wp_locale' ) ) { |
|
324 | + foreach ($body->translation_sets as $set) { |
|
325 | + if ( ! property_exists($set, 'wp_locale')) { |
|
326 | 326 | continue; |
327 | 327 | } |
328 | 328 | |
329 | - if ( $this->locale == $set->wp_locale ) { |
|
329 | + if ($this->locale == $set->wp_locale) { |
|
330 | 330 | return $set; |
331 | 331 | } |
332 | 332 | } |
@@ -342,8 +342,8 @@ discard block |
||
342 | 342 | * |
343 | 343 | * @access private |
344 | 344 | */ |
345 | - private function parse_translation_set( $set ) { |
|
346 | - if ( $this->translation_exists && is_object( $set ) ) { |
|
345 | + private function parse_translation_set($set) { |
|
346 | + if ($this->translation_exists && is_object($set)) { |
|
347 | 347 | $this->locale_name = $set->name; |
348 | 348 | $this->percent_translated = $set->percent_translated; |
349 | 349 | } else { |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | } |
354 | 354 | } |
355 | 355 | |
356 | -$give_i18n = new Give_i18n_Banner( array( |
|
356 | +$give_i18n = new Give_i18n_Banner(array( |
|
357 | 357 | 'hook' => 'admin_notices', |
358 | 358 | 'glotpress_url' => 'https://translate.wordpress.org/api/projects/wp-plugins/give/stable/', |
359 | - ) ); |
|
359 | + )); |
@@ -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 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function give_get_country() { |
24 | 24 | $give_options = give_get_settings(); |
25 | - $country = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US'; |
|
25 | + $country = isset($give_options['base_country']) ? $give_options['base_country'] : 'US'; |
|
26 | 26 | |
27 | - return apply_filters( 'give_give_country', $country ); |
|
27 | + return apply_filters('give_give_country', $country); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function give_get_state() { |
37 | 37 | $give_options = give_get_settings(); |
38 | - $state = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false; |
|
38 | + $state = isset($give_options['base_state']) ? $give_options['base_state'] : false; |
|
39 | 39 | |
40 | - return apply_filters( 'give_give_state', $state ); |
|
40 | + return apply_filters('give_give_state', $state); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return mixed A list of states for the site's base country. |
51 | 51 | */ |
52 | -function give_get_states( $country = null ) { |
|
52 | +function give_get_states($country = null) { |
|
53 | 53 | // If Country have no states return empty array. |
54 | 54 | $states = array(); |
55 | 55 | |
56 | 56 | // Check if Country Code is empty or not. |
57 | - if ( empty( $country ) ) { |
|
57 | + if (empty($country)) { |
|
58 | 58 | // Get defalut country code that is being set by the admin. |
59 | 59 | $country = give_get_country(); |
60 | 60 | } |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | $states_list = give_states_list(); |
64 | 64 | |
65 | 65 | // Check if $country code exists in the array key. |
66 | - if ( array_key_exists( $country, $states_list ) ) { |
|
67 | - $states = $states_list[ $country ]; |
|
66 | + if (array_key_exists($country, $states_list)) { |
|
67 | + $states = $states_list[$country]; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param string $query Database count query |
74 | 74 | */ |
75 | - return (array) apply_filters( 'give_give_states', $states ); |
|
75 | + return (array) apply_filters('give_give_states', $states); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -84,253 +84,253 @@ discard block |
||
84 | 84 | function give_get_country_list() { |
85 | 85 | $countries = array( |
86 | 86 | '' => '', |
87 | - 'US' => esc_html__( 'United States', 'give' ), |
|
88 | - 'CA' => esc_html__( 'Canada', 'give' ), |
|
89 | - 'GB' => esc_html__( 'United Kingdom', 'give' ), |
|
90 | - 'AF' => esc_html__( 'Afghanistan', 'give' ), |
|
91 | - 'AL' => esc_html__( 'Albania', 'give' ), |
|
92 | - 'DZ' => esc_html__( 'Algeria', 'give' ), |
|
93 | - 'AS' => esc_html__( 'American Samoa', 'give' ), |
|
94 | - 'AD' => esc_html__( 'Andorra', 'give' ), |
|
95 | - 'AO' => esc_html__( 'Angola', 'give' ), |
|
96 | - 'AI' => esc_html__( 'Anguilla', 'give' ), |
|
97 | - 'AQ' => esc_html__( 'Antarctica', 'give' ), |
|
98 | - 'AG' => esc_html__( 'Antigua and Barbuda', 'give' ), |
|
99 | - 'AR' => esc_html__( 'Argentina', 'give' ), |
|
100 | - 'AM' => esc_html__( 'Armenia', 'give' ), |
|
101 | - 'AW' => esc_html__( 'Aruba', 'give' ), |
|
102 | - 'AU' => esc_html__( 'Australia', 'give' ), |
|
103 | - 'AT' => esc_html__( 'Austria', 'give' ), |
|
104 | - 'AZ' => esc_html__( 'Azerbaijan', 'give' ), |
|
105 | - 'BS' => esc_html__( 'Bahamas', 'give' ), |
|
106 | - 'BH' => esc_html__( 'Bahrain', 'give' ), |
|
107 | - 'BD' => esc_html__( 'Bangladesh', 'give' ), |
|
108 | - 'BB' => esc_html__( 'Barbados', 'give' ), |
|
109 | - 'BY' => esc_html__( 'Belarus', 'give' ), |
|
110 | - 'BE' => esc_html__( 'Belgium', 'give' ), |
|
111 | - 'BZ' => esc_html__( 'Belize', 'give' ), |
|
112 | - 'BJ' => esc_html__( 'Benin', 'give' ), |
|
113 | - 'BM' => esc_html__( 'Bermuda', 'give' ), |
|
114 | - 'BT' => esc_html__( 'Bhutan', 'give' ), |
|
115 | - 'BO' => esc_html__( 'Bolivia', 'give' ), |
|
116 | - 'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ), |
|
117 | - 'BW' => esc_html__( 'Botswana', 'give' ), |
|
118 | - 'BV' => esc_html__( 'Bouvet Island', 'give' ), |
|
119 | - 'BR' => esc_html__( 'Brazil', 'give' ), |
|
120 | - 'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ), |
|
121 | - 'BN' => esc_html__( 'Brunei Darrussalam', 'give' ), |
|
122 | - 'BG' => esc_html__( 'Bulgaria', 'give' ), |
|
123 | - 'BF' => esc_html__( 'Burkina Faso', 'give' ), |
|
124 | - 'BI' => esc_html__( 'Burundi', 'give' ), |
|
125 | - 'KH' => esc_html__( 'Cambodia', 'give' ), |
|
126 | - 'CM' => esc_html__( 'Cameroon', 'give' ), |
|
127 | - 'CV' => esc_html__( 'Cape Verde', 'give' ), |
|
128 | - 'KY' => esc_html__( 'Cayman Islands', 'give' ), |
|
129 | - 'CF' => esc_html__( 'Central African Republic', 'give' ), |
|
130 | - 'TD' => esc_html__( 'Chad', 'give' ), |
|
131 | - 'CL' => esc_html__( 'Chile', 'give' ), |
|
132 | - 'CN' => esc_html__( 'China', 'give' ), |
|
133 | - 'CX' => esc_html__( 'Christmas Island', 'give' ), |
|
134 | - 'CC' => esc_html__( 'Cocos Islands', 'give' ), |
|
135 | - 'CO' => esc_html__( 'Colombia', 'give' ), |
|
136 | - 'KM' => esc_html__( 'Comoros', 'give' ), |
|
137 | - 'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ), |
|
138 | - 'CG' => esc_html__( 'Congo, Republic of', 'give' ), |
|
139 | - 'CK' => esc_html__( 'Cook Islands', 'give' ), |
|
140 | - 'CR' => esc_html__( 'Costa Rica', 'give' ), |
|
141 | - 'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ), |
|
142 | - 'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ), |
|
143 | - 'CU' => esc_html__( 'Cuba', 'give' ), |
|
144 | - 'CY' => esc_html__( 'Cyprus Island', 'give' ), |
|
145 | - 'CZ' => esc_html__( 'Czech Republic', 'give' ), |
|
146 | - 'DK' => esc_html__( 'Denmark', 'give' ), |
|
147 | - 'DJ' => esc_html__( 'Djibouti', 'give' ), |
|
148 | - 'DM' => esc_html__( 'Dominica', 'give' ), |
|
149 | - 'DO' => esc_html__( 'Dominican Republic', 'give' ), |
|
150 | - 'TP' => esc_html__( 'East Timor', 'give' ), |
|
151 | - 'EC' => esc_html__( 'Ecuador', 'give' ), |
|
152 | - 'EG' => esc_html__( 'Egypt', 'give' ), |
|
153 | - 'GQ' => esc_html__( 'Equatorial Guinea', 'give' ), |
|
154 | - 'SV' => esc_html__( 'El Salvador', 'give' ), |
|
155 | - 'ER' => esc_html__( 'Eritrea', 'give' ), |
|
156 | - 'EE' => esc_html__( 'Estonia', 'give' ), |
|
157 | - 'ET' => esc_html__( 'Ethiopia', 'give' ), |
|
158 | - 'FK' => esc_html__( 'Falkland Islands', 'give' ), |
|
159 | - 'FO' => esc_html__( 'Faroe Islands', 'give' ), |
|
160 | - 'FJ' => esc_html__( 'Fiji', 'give' ), |
|
161 | - 'FI' => esc_html__( 'Finland', 'give' ), |
|
162 | - 'FR' => esc_html__( 'France', 'give' ), |
|
163 | - 'GF' => esc_html__( 'French Guiana', 'give' ), |
|
164 | - 'PF' => esc_html__( 'French Polynesia', 'give' ), |
|
165 | - 'TF' => esc_html__( 'French Southern Territories', 'give' ), |
|
166 | - 'GA' => esc_html__( 'Gabon', 'give' ), |
|
167 | - 'GM' => esc_html__( 'Gambia', 'give' ), |
|
168 | - 'GE' => esc_html__( 'Georgia', 'give' ), |
|
169 | - 'DE' => esc_html__( 'Germany', 'give' ), |
|
170 | - 'GR' => esc_html__( 'Greece', 'give' ), |
|
171 | - 'GH' => esc_html__( 'Ghana', 'give' ), |
|
172 | - 'GI' => esc_html__( 'Gibraltar', 'give' ), |
|
173 | - 'GL' => esc_html__( 'Greenland', 'give' ), |
|
174 | - 'GD' => esc_html__( 'Grenada', 'give' ), |
|
175 | - 'GP' => esc_html__( 'Guadeloupe', 'give' ), |
|
176 | - 'GU' => esc_html__( 'Guam', 'give' ), |
|
177 | - 'GT' => esc_html__( 'Guatemala', 'give' ), |
|
178 | - 'GG' => esc_html__( 'Guernsey', 'give' ), |
|
179 | - 'GN' => esc_html__( 'Guinea', 'give' ), |
|
180 | - 'GW' => esc_html__( 'Guinea-Bissau', 'give' ), |
|
181 | - 'GY' => esc_html__( 'Guyana', 'give' ), |
|
182 | - 'HT' => esc_html__( 'Haiti', 'give' ), |
|
183 | - 'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ), |
|
184 | - 'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ), |
|
185 | - 'HN' => esc_html__( 'Honduras', 'give' ), |
|
186 | - 'HK' => esc_html__( 'Hong Kong', 'give' ), |
|
187 | - 'HU' => esc_html__( 'Hungary', 'give' ), |
|
188 | - 'IS' => esc_html__( 'Iceland', 'give' ), |
|
189 | - 'IN' => esc_html__( 'India', 'give' ), |
|
190 | - 'ID' => esc_html__( 'Indonesia', 'give' ), |
|
191 | - 'IR' => esc_html__( 'Iran', 'give' ), |
|
192 | - 'IQ' => esc_html__( 'Iraq', 'give' ), |
|
193 | - 'IE' => esc_html__( 'Ireland', 'give' ), |
|
194 | - 'IM' => esc_html__( 'Isle of Man', 'give' ), |
|
195 | - 'IL' => esc_html__( 'Israel', 'give' ), |
|
196 | - 'IT' => esc_html__( 'Italy', 'give' ), |
|
197 | - 'JM' => esc_html__( 'Jamaica', 'give' ), |
|
198 | - 'JP' => esc_html__( 'Japan', 'give' ), |
|
199 | - 'JE' => esc_html__( 'Jersey', 'give' ), |
|
200 | - 'JO' => esc_html__( 'Jordan', 'give' ), |
|
201 | - 'KZ' => esc_html__( 'Kazakhstan', 'give' ), |
|
202 | - 'KE' => esc_html__( 'Kenya', 'give' ), |
|
203 | - 'KI' => esc_html__( 'Kiribati', 'give' ), |
|
204 | - 'KW' => esc_html__( 'Kuwait', 'give' ), |
|
205 | - 'KG' => esc_html__( 'Kyrgyzstan', 'give' ), |
|
206 | - 'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ), |
|
207 | - 'LV' => esc_html__( 'Latvia', 'give' ), |
|
208 | - 'LB' => esc_html__( 'Lebanon', 'give' ), |
|
209 | - 'LS' => esc_html__( 'Lesotho', 'give' ), |
|
210 | - 'LR' => esc_html__( 'Liberia', 'give' ), |
|
211 | - 'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ), |
|
212 | - 'LI' => esc_html__( 'Liechtenstein', 'give' ), |
|
213 | - 'LT' => esc_html__( 'Lithuania', 'give' ), |
|
214 | - 'LU' => esc_html__( 'Luxembourg', 'give' ), |
|
215 | - 'MO' => esc_html__( 'Macau', 'give' ), |
|
216 | - 'MK' => esc_html__( 'Macedonia', 'give' ), |
|
217 | - 'MG' => esc_html__( 'Madagascar', 'give' ), |
|
218 | - 'MW' => esc_html__( 'Malawi', 'give' ), |
|
219 | - 'MY' => esc_html__( 'Malaysia', 'give' ), |
|
220 | - 'MV' => esc_html__( 'Maldives', 'give' ), |
|
221 | - 'ML' => esc_html__( 'Mali', 'give' ), |
|
222 | - 'MT' => esc_html__( 'Malta', 'give' ), |
|
223 | - 'MH' => esc_html__( 'Marshall Islands', 'give' ), |
|
224 | - 'MQ' => esc_html__( 'Martinique', 'give' ), |
|
225 | - 'MR' => esc_html__( 'Mauritania', 'give' ), |
|
226 | - 'MU' => esc_html__( 'Mauritius', 'give' ), |
|
227 | - 'YT' => esc_html__( 'Mayotte', 'give' ), |
|
228 | - 'MX' => esc_html__( 'Mexico', 'give' ), |
|
229 | - 'FM' => esc_html__( 'Micronesia', 'give' ), |
|
230 | - 'MD' => esc_html__( 'Moldova, Republic of', 'give' ), |
|
231 | - 'MC' => esc_html__( 'Monaco', 'give' ), |
|
232 | - 'MN' => esc_html__( 'Mongolia', 'give' ), |
|
233 | - 'ME' => esc_html__( 'Montenegro', 'give' ), |
|
234 | - 'MS' => esc_html__( 'Montserrat', 'give' ), |
|
235 | - 'MA' => esc_html__( 'Morocco', 'give' ), |
|
236 | - 'MZ' => esc_html__( 'Mozambique', 'give' ), |
|
237 | - 'MM' => esc_html__( 'Myanmar', 'give' ), |
|
238 | - 'NA' => esc_html__( 'Namibia', 'give' ), |
|
239 | - 'NR' => esc_html__( 'Nauru', 'give' ), |
|
240 | - 'NP' => esc_html__( 'Nepal', 'give' ), |
|
241 | - 'NL' => esc_html__( 'Netherlands', 'give' ), |
|
242 | - 'AN' => esc_html__( 'Netherlands Antilles', 'give' ), |
|
243 | - 'NC' => esc_html__( 'New Caledonia', 'give' ), |
|
244 | - 'NZ' => esc_html__( 'New Zealand', 'give' ), |
|
245 | - 'NI' => esc_html__( 'Nicaragua', 'give' ), |
|
246 | - 'NE' => esc_html__( 'Niger', 'give' ), |
|
247 | - 'NG' => esc_html__( 'Nigeria', 'give' ), |
|
248 | - 'NU' => esc_html__( 'Niue', 'give' ), |
|
249 | - 'NF' => esc_html__( 'Norfolk Island', 'give' ), |
|
250 | - 'KP' => esc_html__( 'North Korea', 'give' ), |
|
251 | - 'MP' => esc_html__( 'Northern Mariana Islands', 'give' ), |
|
252 | - 'NO' => esc_html__( 'Norway', 'give' ), |
|
253 | - 'OM' => esc_html__( 'Oman', 'give' ), |
|
254 | - 'PK' => esc_html__( 'Pakistan', 'give' ), |
|
255 | - 'PW' => esc_html__( 'Palau', 'give' ), |
|
256 | - 'PS' => esc_html__( 'Palestinian Territories', 'give' ), |
|
257 | - 'PA' => esc_html__( 'Panama', 'give' ), |
|
258 | - 'PG' => esc_html__( 'Papua New Guinea', 'give' ), |
|
259 | - 'PY' => esc_html__( 'Paraguay', 'give' ), |
|
260 | - 'PE' => esc_html__( 'Peru', 'give' ), |
|
261 | - 'PH' => esc_html__( 'Philippines', 'give' ), |
|
262 | - 'PN' => esc_html__( 'Pitcairn Island', 'give' ), |
|
263 | - 'PL' => esc_html__( 'Poland', 'give' ), |
|
264 | - 'PT' => esc_html__( 'Portugal', 'give' ), |
|
265 | - 'PR' => esc_html__( 'Puerto Rico', 'give' ), |
|
266 | - 'QA' => esc_html__( 'Qatar', 'give' ), |
|
267 | - 'RE' => esc_html__( 'Reunion Island', 'give' ), |
|
268 | - 'RO' => esc_html__( 'Romania', 'give' ), |
|
269 | - 'RU' => esc_html__( 'Russian Federation', 'give' ), |
|
270 | - 'RW' => esc_html__( 'Rwanda', 'give' ), |
|
271 | - 'SH' => esc_html__( 'Saint Helena', 'give' ), |
|
272 | - 'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ), |
|
273 | - 'LC' => esc_html__( 'Saint Lucia', 'give' ), |
|
274 | - 'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ), |
|
275 | - 'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ), |
|
276 | - 'SM' => esc_html__( 'San Marino', 'give' ), |
|
277 | - 'ST' => esc_html__( 'Sao Tome and Principe', 'give' ), |
|
278 | - 'SA' => esc_html__( 'Saudi Arabia', 'give' ), |
|
279 | - 'SN' => esc_html__( 'Senegal', 'give' ), |
|
280 | - 'RS' => esc_html__( 'Serbia', 'give' ), |
|
281 | - 'SC' => esc_html__( 'Seychelles', 'give' ), |
|
282 | - 'SL' => esc_html__( 'Sierra Leone', 'give' ), |
|
283 | - 'SG' => esc_html__( 'Singapore', 'give' ), |
|
284 | - 'SK' => esc_html__( 'Slovak Republic', 'give' ), |
|
285 | - 'SI' => esc_html__( 'Slovenia', 'give' ), |
|
286 | - 'SB' => esc_html__( 'Solomon Islands', 'give' ), |
|
287 | - 'SO' => esc_html__( 'Somalia', 'give' ), |
|
288 | - 'ZA' => esc_html__( 'South Africa', 'give' ), |
|
289 | - 'GS' => esc_html__( 'South Georgia', 'give' ), |
|
290 | - 'KR' => esc_html__( 'South Korea', 'give' ), |
|
291 | - 'ES' => esc_html__( 'Spain', 'give' ), |
|
292 | - 'LK' => esc_html__( 'Sri Lanka', 'give' ), |
|
293 | - 'SD' => esc_html__( 'Sudan', 'give' ), |
|
294 | - 'SR' => esc_html__( 'Suriname', 'give' ), |
|
295 | - 'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ), |
|
296 | - 'SZ' => esc_html__( 'Swaziland', 'give' ), |
|
297 | - 'SE' => esc_html__( 'Sweden', 'give' ), |
|
298 | - 'CH' => esc_html__( 'Switzerland', 'give' ), |
|
299 | - 'SY' => esc_html__( 'Syrian Arab Republic', 'give' ), |
|
300 | - 'TW' => esc_html__( 'Taiwan', 'give' ), |
|
301 | - 'TJ' => esc_html__( 'Tajikistan', 'give' ), |
|
302 | - 'TZ' => esc_html__( 'Tanzania', 'give' ), |
|
303 | - 'TG' => esc_html__( 'Togo', 'give' ), |
|
304 | - 'TK' => esc_html__( 'Tokelau', 'give' ), |
|
305 | - 'TO' => esc_html__( 'Tonga', 'give' ), |
|
306 | - 'TH' => esc_html__( 'Thailand', 'give' ), |
|
307 | - 'TT' => esc_html__( 'Trinidad and Tobago', 'give' ), |
|
308 | - 'TN' => esc_html__( 'Tunisia', 'give' ), |
|
309 | - 'TR' => esc_html__( 'Turkey', 'give' ), |
|
310 | - 'TM' => esc_html__( 'Turkmenistan', 'give' ), |
|
311 | - 'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ), |
|
312 | - 'TV' => esc_html__( 'Tuvalu', 'give' ), |
|
313 | - 'UG' => esc_html__( 'Uganda', 'give' ), |
|
314 | - 'UA' => esc_html__( 'Ukraine', 'give' ), |
|
315 | - 'AE' => esc_html__( 'United Arab Emirates', 'give' ), |
|
316 | - 'UY' => esc_html__( 'Uruguay', 'give' ), |
|
317 | - 'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ), |
|
318 | - 'UZ' => esc_html__( 'Uzbekistan', 'give' ), |
|
319 | - 'VU' => esc_html__( 'Vanuatu', 'give' ), |
|
320 | - 'VE' => esc_html__( 'Venezuela', 'give' ), |
|
321 | - 'VN' => esc_html__( 'Vietnam', 'give' ), |
|
322 | - 'VG' => esc_html__( 'Virgin Islands (British)', 'give' ), |
|
323 | - 'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ), |
|
324 | - 'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ), |
|
325 | - 'EH' => esc_html__( 'Western Sahara', 'give' ), |
|
326 | - 'WS' => esc_html__( 'Western Samoa', 'give' ), |
|
327 | - 'YE' => esc_html__( 'Yemen', 'give' ), |
|
328 | - 'YU' => esc_html__( 'Yugoslavia', 'give' ), |
|
329 | - 'ZM' => esc_html__( 'Zambia', 'give' ), |
|
330 | - 'ZW' => esc_html__( 'Zimbabwe', 'give' ), |
|
87 | + 'US' => esc_html__('United States', 'give'), |
|
88 | + 'CA' => esc_html__('Canada', 'give'), |
|
89 | + 'GB' => esc_html__('United Kingdom', 'give'), |
|
90 | + 'AF' => esc_html__('Afghanistan', 'give'), |
|
91 | + 'AL' => esc_html__('Albania', 'give'), |
|
92 | + 'DZ' => esc_html__('Algeria', 'give'), |
|
93 | + 'AS' => esc_html__('American Samoa', 'give'), |
|
94 | + 'AD' => esc_html__('Andorra', 'give'), |
|
95 | + 'AO' => esc_html__('Angola', 'give'), |
|
96 | + 'AI' => esc_html__('Anguilla', 'give'), |
|
97 | + 'AQ' => esc_html__('Antarctica', 'give'), |
|
98 | + 'AG' => esc_html__('Antigua and Barbuda', 'give'), |
|
99 | + 'AR' => esc_html__('Argentina', 'give'), |
|
100 | + 'AM' => esc_html__('Armenia', 'give'), |
|
101 | + 'AW' => esc_html__('Aruba', 'give'), |
|
102 | + 'AU' => esc_html__('Australia', 'give'), |
|
103 | + 'AT' => esc_html__('Austria', 'give'), |
|
104 | + 'AZ' => esc_html__('Azerbaijan', 'give'), |
|
105 | + 'BS' => esc_html__('Bahamas', 'give'), |
|
106 | + 'BH' => esc_html__('Bahrain', 'give'), |
|
107 | + 'BD' => esc_html__('Bangladesh', 'give'), |
|
108 | + 'BB' => esc_html__('Barbados', 'give'), |
|
109 | + 'BY' => esc_html__('Belarus', 'give'), |
|
110 | + 'BE' => esc_html__('Belgium', 'give'), |
|
111 | + 'BZ' => esc_html__('Belize', 'give'), |
|
112 | + 'BJ' => esc_html__('Benin', 'give'), |
|
113 | + 'BM' => esc_html__('Bermuda', 'give'), |
|
114 | + 'BT' => esc_html__('Bhutan', 'give'), |
|
115 | + 'BO' => esc_html__('Bolivia', 'give'), |
|
116 | + 'BA' => esc_html__('Bosnia and Herzegovina', 'give'), |
|
117 | + 'BW' => esc_html__('Botswana', 'give'), |
|
118 | + 'BV' => esc_html__('Bouvet Island', 'give'), |
|
119 | + 'BR' => esc_html__('Brazil', 'give'), |
|
120 | + 'IO' => esc_html__('British Indian Ocean Territory', 'give'), |
|
121 | + 'BN' => esc_html__('Brunei Darrussalam', 'give'), |
|
122 | + 'BG' => esc_html__('Bulgaria', 'give'), |
|
123 | + 'BF' => esc_html__('Burkina Faso', 'give'), |
|
124 | + 'BI' => esc_html__('Burundi', 'give'), |
|
125 | + 'KH' => esc_html__('Cambodia', 'give'), |
|
126 | + 'CM' => esc_html__('Cameroon', 'give'), |
|
127 | + 'CV' => esc_html__('Cape Verde', 'give'), |
|
128 | + 'KY' => esc_html__('Cayman Islands', 'give'), |
|
129 | + 'CF' => esc_html__('Central African Republic', 'give'), |
|
130 | + 'TD' => esc_html__('Chad', 'give'), |
|
131 | + 'CL' => esc_html__('Chile', 'give'), |
|
132 | + 'CN' => esc_html__('China', 'give'), |
|
133 | + 'CX' => esc_html__('Christmas Island', 'give'), |
|
134 | + 'CC' => esc_html__('Cocos Islands', 'give'), |
|
135 | + 'CO' => esc_html__('Colombia', 'give'), |
|
136 | + 'KM' => esc_html__('Comoros', 'give'), |
|
137 | + 'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'), |
|
138 | + 'CG' => esc_html__('Congo, Republic of', 'give'), |
|
139 | + 'CK' => esc_html__('Cook Islands', 'give'), |
|
140 | + 'CR' => esc_html__('Costa Rica', 'give'), |
|
141 | + 'CI' => esc_html__('Cote d\'Ivoire', 'give'), |
|
142 | + 'HR' => esc_html__('Croatia/Hrvatska', 'give'), |
|
143 | + 'CU' => esc_html__('Cuba', 'give'), |
|
144 | + 'CY' => esc_html__('Cyprus Island', 'give'), |
|
145 | + 'CZ' => esc_html__('Czech Republic', 'give'), |
|
146 | + 'DK' => esc_html__('Denmark', 'give'), |
|
147 | + 'DJ' => esc_html__('Djibouti', 'give'), |
|
148 | + 'DM' => esc_html__('Dominica', 'give'), |
|
149 | + 'DO' => esc_html__('Dominican Republic', 'give'), |
|
150 | + 'TP' => esc_html__('East Timor', 'give'), |
|
151 | + 'EC' => esc_html__('Ecuador', 'give'), |
|
152 | + 'EG' => esc_html__('Egypt', 'give'), |
|
153 | + 'GQ' => esc_html__('Equatorial Guinea', 'give'), |
|
154 | + 'SV' => esc_html__('El Salvador', 'give'), |
|
155 | + 'ER' => esc_html__('Eritrea', 'give'), |
|
156 | + 'EE' => esc_html__('Estonia', 'give'), |
|
157 | + 'ET' => esc_html__('Ethiopia', 'give'), |
|
158 | + 'FK' => esc_html__('Falkland Islands', 'give'), |
|
159 | + 'FO' => esc_html__('Faroe Islands', 'give'), |
|
160 | + 'FJ' => esc_html__('Fiji', 'give'), |
|
161 | + 'FI' => esc_html__('Finland', 'give'), |
|
162 | + 'FR' => esc_html__('France', 'give'), |
|
163 | + 'GF' => esc_html__('French Guiana', 'give'), |
|
164 | + 'PF' => esc_html__('French Polynesia', 'give'), |
|
165 | + 'TF' => esc_html__('French Southern Territories', 'give'), |
|
166 | + 'GA' => esc_html__('Gabon', 'give'), |
|
167 | + 'GM' => esc_html__('Gambia', 'give'), |
|
168 | + 'GE' => esc_html__('Georgia', 'give'), |
|
169 | + 'DE' => esc_html__('Germany', 'give'), |
|
170 | + 'GR' => esc_html__('Greece', 'give'), |
|
171 | + 'GH' => esc_html__('Ghana', 'give'), |
|
172 | + 'GI' => esc_html__('Gibraltar', 'give'), |
|
173 | + 'GL' => esc_html__('Greenland', 'give'), |
|
174 | + 'GD' => esc_html__('Grenada', 'give'), |
|
175 | + 'GP' => esc_html__('Guadeloupe', 'give'), |
|
176 | + 'GU' => esc_html__('Guam', 'give'), |
|
177 | + 'GT' => esc_html__('Guatemala', 'give'), |
|
178 | + 'GG' => esc_html__('Guernsey', 'give'), |
|
179 | + 'GN' => esc_html__('Guinea', 'give'), |
|
180 | + 'GW' => esc_html__('Guinea-Bissau', 'give'), |
|
181 | + 'GY' => esc_html__('Guyana', 'give'), |
|
182 | + 'HT' => esc_html__('Haiti', 'give'), |
|
183 | + 'HM' => esc_html__('Heard and McDonald Islands', 'give'), |
|
184 | + 'VA' => esc_html__('Holy See (City Vatican State)', 'give'), |
|
185 | + 'HN' => esc_html__('Honduras', 'give'), |
|
186 | + 'HK' => esc_html__('Hong Kong', 'give'), |
|
187 | + 'HU' => esc_html__('Hungary', 'give'), |
|
188 | + 'IS' => esc_html__('Iceland', 'give'), |
|
189 | + 'IN' => esc_html__('India', 'give'), |
|
190 | + 'ID' => esc_html__('Indonesia', 'give'), |
|
191 | + 'IR' => esc_html__('Iran', 'give'), |
|
192 | + 'IQ' => esc_html__('Iraq', 'give'), |
|
193 | + 'IE' => esc_html__('Ireland', 'give'), |
|
194 | + 'IM' => esc_html__('Isle of Man', 'give'), |
|
195 | + 'IL' => esc_html__('Israel', 'give'), |
|
196 | + 'IT' => esc_html__('Italy', 'give'), |
|
197 | + 'JM' => esc_html__('Jamaica', 'give'), |
|
198 | + 'JP' => esc_html__('Japan', 'give'), |
|
199 | + 'JE' => esc_html__('Jersey', 'give'), |
|
200 | + 'JO' => esc_html__('Jordan', 'give'), |
|
201 | + 'KZ' => esc_html__('Kazakhstan', 'give'), |
|
202 | + 'KE' => esc_html__('Kenya', 'give'), |
|
203 | + 'KI' => esc_html__('Kiribati', 'give'), |
|
204 | + 'KW' => esc_html__('Kuwait', 'give'), |
|
205 | + 'KG' => esc_html__('Kyrgyzstan', 'give'), |
|
206 | + 'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'), |
|
207 | + 'LV' => esc_html__('Latvia', 'give'), |
|
208 | + 'LB' => esc_html__('Lebanon', 'give'), |
|
209 | + 'LS' => esc_html__('Lesotho', 'give'), |
|
210 | + 'LR' => esc_html__('Liberia', 'give'), |
|
211 | + 'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'), |
|
212 | + 'LI' => esc_html__('Liechtenstein', 'give'), |
|
213 | + 'LT' => esc_html__('Lithuania', 'give'), |
|
214 | + 'LU' => esc_html__('Luxembourg', 'give'), |
|
215 | + 'MO' => esc_html__('Macau', 'give'), |
|
216 | + 'MK' => esc_html__('Macedonia', 'give'), |
|
217 | + 'MG' => esc_html__('Madagascar', 'give'), |
|
218 | + 'MW' => esc_html__('Malawi', 'give'), |
|
219 | + 'MY' => esc_html__('Malaysia', 'give'), |
|
220 | + 'MV' => esc_html__('Maldives', 'give'), |
|
221 | + 'ML' => esc_html__('Mali', 'give'), |
|
222 | + 'MT' => esc_html__('Malta', 'give'), |
|
223 | + 'MH' => esc_html__('Marshall Islands', 'give'), |
|
224 | + 'MQ' => esc_html__('Martinique', 'give'), |
|
225 | + 'MR' => esc_html__('Mauritania', 'give'), |
|
226 | + 'MU' => esc_html__('Mauritius', 'give'), |
|
227 | + 'YT' => esc_html__('Mayotte', 'give'), |
|
228 | + 'MX' => esc_html__('Mexico', 'give'), |
|
229 | + 'FM' => esc_html__('Micronesia', 'give'), |
|
230 | + 'MD' => esc_html__('Moldova, Republic of', 'give'), |
|
231 | + 'MC' => esc_html__('Monaco', 'give'), |
|
232 | + 'MN' => esc_html__('Mongolia', 'give'), |
|
233 | + 'ME' => esc_html__('Montenegro', 'give'), |
|
234 | + 'MS' => esc_html__('Montserrat', 'give'), |
|
235 | + 'MA' => esc_html__('Morocco', 'give'), |
|
236 | + 'MZ' => esc_html__('Mozambique', 'give'), |
|
237 | + 'MM' => esc_html__('Myanmar', 'give'), |
|
238 | + 'NA' => esc_html__('Namibia', 'give'), |
|
239 | + 'NR' => esc_html__('Nauru', 'give'), |
|
240 | + 'NP' => esc_html__('Nepal', 'give'), |
|
241 | + 'NL' => esc_html__('Netherlands', 'give'), |
|
242 | + 'AN' => esc_html__('Netherlands Antilles', 'give'), |
|
243 | + 'NC' => esc_html__('New Caledonia', 'give'), |
|
244 | + 'NZ' => esc_html__('New Zealand', 'give'), |
|
245 | + 'NI' => esc_html__('Nicaragua', 'give'), |
|
246 | + 'NE' => esc_html__('Niger', 'give'), |
|
247 | + 'NG' => esc_html__('Nigeria', 'give'), |
|
248 | + 'NU' => esc_html__('Niue', 'give'), |
|
249 | + 'NF' => esc_html__('Norfolk Island', 'give'), |
|
250 | + 'KP' => esc_html__('North Korea', 'give'), |
|
251 | + 'MP' => esc_html__('Northern Mariana Islands', 'give'), |
|
252 | + 'NO' => esc_html__('Norway', 'give'), |
|
253 | + 'OM' => esc_html__('Oman', 'give'), |
|
254 | + 'PK' => esc_html__('Pakistan', 'give'), |
|
255 | + 'PW' => esc_html__('Palau', 'give'), |
|
256 | + 'PS' => esc_html__('Palestinian Territories', 'give'), |
|
257 | + 'PA' => esc_html__('Panama', 'give'), |
|
258 | + 'PG' => esc_html__('Papua New Guinea', 'give'), |
|
259 | + 'PY' => esc_html__('Paraguay', 'give'), |
|
260 | + 'PE' => esc_html__('Peru', 'give'), |
|
261 | + 'PH' => esc_html__('Philippines', 'give'), |
|
262 | + 'PN' => esc_html__('Pitcairn Island', 'give'), |
|
263 | + 'PL' => esc_html__('Poland', 'give'), |
|
264 | + 'PT' => esc_html__('Portugal', 'give'), |
|
265 | + 'PR' => esc_html__('Puerto Rico', 'give'), |
|
266 | + 'QA' => esc_html__('Qatar', 'give'), |
|
267 | + 'RE' => esc_html__('Reunion Island', 'give'), |
|
268 | + 'RO' => esc_html__('Romania', 'give'), |
|
269 | + 'RU' => esc_html__('Russian Federation', 'give'), |
|
270 | + 'RW' => esc_html__('Rwanda', 'give'), |
|
271 | + 'SH' => esc_html__('Saint Helena', 'give'), |
|
272 | + 'KN' => esc_html__('Saint Kitts and Nevis', 'give'), |
|
273 | + 'LC' => esc_html__('Saint Lucia', 'give'), |
|
274 | + 'PM' => esc_html__('Saint Pierre and Miquelon', 'give'), |
|
275 | + 'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'), |
|
276 | + 'SM' => esc_html__('San Marino', 'give'), |
|
277 | + 'ST' => esc_html__('Sao Tome and Principe', 'give'), |
|
278 | + 'SA' => esc_html__('Saudi Arabia', 'give'), |
|
279 | + 'SN' => esc_html__('Senegal', 'give'), |
|
280 | + 'RS' => esc_html__('Serbia', 'give'), |
|
281 | + 'SC' => esc_html__('Seychelles', 'give'), |
|
282 | + 'SL' => esc_html__('Sierra Leone', 'give'), |
|
283 | + 'SG' => esc_html__('Singapore', 'give'), |
|
284 | + 'SK' => esc_html__('Slovak Republic', 'give'), |
|
285 | + 'SI' => esc_html__('Slovenia', 'give'), |
|
286 | + 'SB' => esc_html__('Solomon Islands', 'give'), |
|
287 | + 'SO' => esc_html__('Somalia', 'give'), |
|
288 | + 'ZA' => esc_html__('South Africa', 'give'), |
|
289 | + 'GS' => esc_html__('South Georgia', 'give'), |
|
290 | + 'KR' => esc_html__('South Korea', 'give'), |
|
291 | + 'ES' => esc_html__('Spain', 'give'), |
|
292 | + 'LK' => esc_html__('Sri Lanka', 'give'), |
|
293 | + 'SD' => esc_html__('Sudan', 'give'), |
|
294 | + 'SR' => esc_html__('Suriname', 'give'), |
|
295 | + 'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'), |
|
296 | + 'SZ' => esc_html__('Swaziland', 'give'), |
|
297 | + 'SE' => esc_html__('Sweden', 'give'), |
|
298 | + 'CH' => esc_html__('Switzerland', 'give'), |
|
299 | + 'SY' => esc_html__('Syrian Arab Republic', 'give'), |
|
300 | + 'TW' => esc_html__('Taiwan', 'give'), |
|
301 | + 'TJ' => esc_html__('Tajikistan', 'give'), |
|
302 | + 'TZ' => esc_html__('Tanzania', 'give'), |
|
303 | + 'TG' => esc_html__('Togo', 'give'), |
|
304 | + 'TK' => esc_html__('Tokelau', 'give'), |
|
305 | + 'TO' => esc_html__('Tonga', 'give'), |
|
306 | + 'TH' => esc_html__('Thailand', 'give'), |
|
307 | + 'TT' => esc_html__('Trinidad and Tobago', 'give'), |
|
308 | + 'TN' => esc_html__('Tunisia', 'give'), |
|
309 | + 'TR' => esc_html__('Turkey', 'give'), |
|
310 | + 'TM' => esc_html__('Turkmenistan', 'give'), |
|
311 | + 'TC' => esc_html__('Turks and Caicos Islands', 'give'), |
|
312 | + 'TV' => esc_html__('Tuvalu', 'give'), |
|
313 | + 'UG' => esc_html__('Uganda', 'give'), |
|
314 | + 'UA' => esc_html__('Ukraine', 'give'), |
|
315 | + 'AE' => esc_html__('United Arab Emirates', 'give'), |
|
316 | + 'UY' => esc_html__('Uruguay', 'give'), |
|
317 | + 'UM' => esc_html__('US Minor Outlying Islands', 'give'), |
|
318 | + 'UZ' => esc_html__('Uzbekistan', 'give'), |
|
319 | + 'VU' => esc_html__('Vanuatu', 'give'), |
|
320 | + 'VE' => esc_html__('Venezuela', 'give'), |
|
321 | + 'VN' => esc_html__('Vietnam', 'give'), |
|
322 | + 'VG' => esc_html__('Virgin Islands (British)', 'give'), |
|
323 | + 'VI' => esc_html__('Virgin Islands (USA)', 'give'), |
|
324 | + 'WF' => esc_html__('Wallis and Futuna Islands', 'give'), |
|
325 | + 'EH' => esc_html__('Western Sahara', 'give'), |
|
326 | + 'WS' => esc_html__('Western Samoa', 'give'), |
|
327 | + 'YE' => esc_html__('Yemen', 'give'), |
|
328 | + 'YU' => esc_html__('Yugoslavia', 'give'), |
|
329 | + 'ZM' => esc_html__('Zambia', 'give'), |
|
330 | + 'ZW' => esc_html__('Zimbabwe', 'give'), |
|
331 | 331 | ); |
332 | 332 | |
333 | - return (array) apply_filters( 'give_countries', $countries ); |
|
333 | + return (array) apply_filters('give_countries', $countries); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | * |
385 | 385 | * @param array $states Contain the list of states in array key format where key of the array is there respected country code. |
386 | 386 | */ |
387 | - return (array) apply_filters( 'give_states_list', $states ); |
|
387 | + return (array) apply_filters('give_states_list', $states); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
@@ -399,9 +399,9 @@ discard block |
||
399 | 399 | function give_no_states_country_list() { |
400 | 400 | $country_list = array(); |
401 | 401 | $locale = give_get_country_locale(); |
402 | - foreach ( $locale as $key => $value ) { |
|
403 | - if ( ! empty( $value['state'] ) && isset( $value['state']['hidden'] ) && true === $value['state']['hidden'] ) { |
|
404 | - $country_list[ $key ] = $value['state']; |
|
402 | + foreach ($locale as $key => $value) { |
|
403 | + if ( ! empty($value['state']) && isset($value['state']['hidden']) && true === $value['state']['hidden']) { |
|
404 | + $country_list[$key] = $value['state']; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * |
413 | 413 | * @param array $country Contain key as there country code & value as there country name. |
414 | 414 | */ |
415 | - return (array) apply_filters( 'give_no_states_country_list', $country_list ); |
|
415 | + return (array) apply_filters('give_no_states_country_list', $country_list); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -427,9 +427,9 @@ discard block |
||
427 | 427 | function give_states_not_required_country_list() { |
428 | 428 | $country_list = array(); |
429 | 429 | $locale = give_get_country_locale(); |
430 | - foreach ( $locale as $key => $value ) { |
|
431 | - if ( ! empty( $value['state'] ) && isset( $value['state']['required'] ) && false === $value['state']['required'] ) { |
|
432 | - $country_list[ $key ] = $value['state']; |
|
430 | + foreach ($locale as $key => $value) { |
|
431 | + if ( ! empty($value['state']) && isset($value['state']['required']) && false === $value['state']['required']) { |
|
432 | + $country_list[$key] = $value['state']; |
|
433 | 433 | } |
434 | 434 | } |
435 | 435 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | * |
441 | 441 | * @param array $country Contain key as there country code & value as there country name. |
442 | 442 | */ |
443 | - return (array) apply_filters( 'give_states_not_required_country_list', $country_list ); |
|
443 | + return (array) apply_filters('give_states_not_required_country_list', $country_list); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
@@ -452,11 +452,11 @@ discard block |
||
452 | 452 | * |
453 | 453 | * @return string|bool |
454 | 454 | */ |
455 | -function give_get_country_name_by_key( $key ) { |
|
455 | +function give_get_country_name_by_key($key) { |
|
456 | 456 | $country_list = give_get_country_list(); |
457 | 457 | |
458 | - if ( array_key_exists( $key, $country_list ) ) { |
|
459 | - return $country_list[ $key ]; |
|
458 | + if (array_key_exists($key, $country_list)) { |
|
459 | + return $country_list[$key]; |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | return false; |
@@ -471,14 +471,14 @@ discard block |
||
471 | 471 | */ |
472 | 472 | function give_get_states_label() { |
473 | 473 | $country_states_label = array(); |
474 | - $default_label = __( 'State', 'give' ); |
|
474 | + $default_label = __('State', 'give'); |
|
475 | 475 | $locale = give_get_country_locale(); |
476 | - foreach ( $locale as $key => $value ) { |
|
476 | + foreach ($locale as $key => $value) { |
|
477 | 477 | $label = $default_label; |
478 | - if ( ! empty( $value['state'] ) && ! empty( $value['state']['label'] ) ) { |
|
478 | + if ( ! empty($value['state']) && ! empty($value['state']['label'])) { |
|
479 | 479 | $label = $value['state']['label']; |
480 | 480 | } |
481 | - $country_states_label[ $key ] = $label; |
|
481 | + $country_states_label[$key] = $label; |
|
482 | 482 | } |
483 | 483 | |
484 | 484 | /** |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | * |
489 | 489 | * @param array $country Contain key as there country code & value as there country name. |
490 | 490 | */ |
491 | - return (array) apply_filters( 'give_get_states_label', $country_states_label ); |
|
491 | + return (array) apply_filters('give_get_states_label', $country_states_label); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | /** |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | * @return array |
500 | 500 | */ |
501 | 501 | function give_get_country_locale() { |
502 | - return (array) apply_filters( 'give_get_country_locale', array( |
|
502 | + return (array) apply_filters('give_get_country_locale', array( |
|
503 | 503 | 'AE' => array( |
504 | 504 | 'state' => array( |
505 | 505 | 'required' => false, |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | ), |
520 | 520 | 'AU' => array( |
521 | 521 | 'state' => array( |
522 | - 'label' => __( 'State', 'give' ), |
|
522 | + 'label' => __('State', 'give'), |
|
523 | 523 | ), |
524 | 524 | ), |
525 | 525 | 'AX' => array( |
@@ -529,13 +529,13 @@ discard block |
||
529 | 529 | ), |
530 | 530 | 'BD' => array( |
531 | 531 | 'state' => array( |
532 | - 'label' => __( 'District', 'give' ), |
|
532 | + 'label' => __('District', 'give'), |
|
533 | 533 | ), |
534 | 534 | ), |
535 | 535 | 'BE' => array( |
536 | 536 | 'state' => array( |
537 | 537 | 'required' => false, |
538 | - 'label' => __( 'Province', 'give' ), |
|
538 | + 'label' => __('Province', 'give'), |
|
539 | 539 | 'hidden' => true, |
540 | 540 | ), |
541 | 541 | ), |
@@ -546,24 +546,24 @@ discard block |
||
546 | 546 | ), |
547 | 547 | 'CA' => array( |
548 | 548 | 'state' => array( |
549 | - 'label' => __( 'Province', 'give' ), |
|
549 | + 'label' => __('Province', 'give'), |
|
550 | 550 | ), |
551 | 551 | ), |
552 | 552 | 'CH' => array( |
553 | 553 | 'state' => array( |
554 | - 'label' => __( 'Canton', 'give' ), |
|
554 | + 'label' => __('Canton', 'give'), |
|
555 | 555 | 'required' => false, |
556 | 556 | 'hidden' => true, |
557 | 557 | ), |
558 | 558 | ), |
559 | 559 | 'CL' => array( |
560 | 560 | 'state' => array( |
561 | - 'label' => __( 'Region', 'give' ), |
|
561 | + 'label' => __('Region', 'give'), |
|
562 | 562 | ), |
563 | 563 | ), |
564 | 564 | 'CN' => array( |
565 | 565 | 'state' => array( |
566 | - 'label' => __( 'Province', 'give' ), |
|
566 | + 'label' => __('Province', 'give'), |
|
567 | 567 | ), |
568 | 568 | ), |
569 | 569 | 'CZ' => array( |
@@ -614,23 +614,23 @@ discard block |
||
614 | 614 | ), |
615 | 615 | 'HK' => array( |
616 | 616 | 'state' => array( |
617 | - 'label' => __( 'Region', 'give' ), |
|
617 | + 'label' => __('Region', 'give'), |
|
618 | 618 | ), |
619 | 619 | ), |
620 | 620 | 'HU' => array( |
621 | 621 | 'state' => array( |
622 | - 'label' => __( 'County', 'give' ), |
|
622 | + 'label' => __('County', 'give'), |
|
623 | 623 | 'hidden' => true, |
624 | 624 | ), |
625 | 625 | ), |
626 | 626 | 'ID' => array( |
627 | 627 | 'state' => array( |
628 | - 'label' => __( 'Province', 'give' ), |
|
628 | + 'label' => __('Province', 'give'), |
|
629 | 629 | ), |
630 | 630 | ), |
631 | 631 | 'IE' => array( |
632 | 632 | 'state' => array( |
633 | - 'label' => __( 'County', 'give' ), |
|
633 | + 'label' => __('County', 'give'), |
|
634 | 634 | ), |
635 | 635 | ), |
636 | 636 | 'IS' => array( |
@@ -647,12 +647,12 @@ discard block |
||
647 | 647 | 'IT' => array( |
648 | 648 | 'state' => array( |
649 | 649 | 'required' => true, |
650 | - 'label' => __( 'Province', 'give' ), |
|
650 | + 'label' => __('Province', 'give'), |
|
651 | 651 | ), |
652 | 652 | ), |
653 | 653 | 'JP' => array( |
654 | 654 | 'state' => array( |
655 | - 'label' => __( 'Prefecture', 'give' ), |
|
655 | + 'label' => __('Prefecture', 'give'), |
|
656 | 656 | ), |
657 | 657 | ), |
658 | 658 | 'KR' => array( |
@@ -678,13 +678,13 @@ discard block |
||
678 | 678 | 'NL' => array( |
679 | 679 | 'state' => array( |
680 | 680 | 'required' => false, |
681 | - 'label' => __( 'Province', 'give' ), |
|
681 | + 'label' => __('Province', 'give'), |
|
682 | 682 | 'hidden' => true, |
683 | 683 | ), |
684 | 684 | ), |
685 | 685 | 'NZ' => array( |
686 | 686 | 'state' => array( |
687 | - 'label' => __( 'Region', 'give' ), |
|
687 | + 'label' => __('Region', 'give'), |
|
688 | 688 | ), |
689 | 689 | ), |
690 | 690 | 'NO' => array( |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | ), |
696 | 696 | 'NP' => array( |
697 | 697 | 'state' => array( |
698 | - 'label' => __( 'State / Zone', 'give' ), |
|
698 | + 'label' => __('State / Zone', 'give'), |
|
699 | 699 | ), |
700 | 700 | ), |
701 | 701 | 'PL' => array( |
@@ -739,12 +739,12 @@ discard block |
||
739 | 739 | ), |
740 | 740 | 'ES' => array( |
741 | 741 | 'state' => array( |
742 | - 'label' => __( 'Province', 'give' ), |
|
742 | + 'label' => __('Province', 'give'), |
|
743 | 743 | ), |
744 | 744 | ), |
745 | 745 | 'LI' => array( |
746 | 746 | 'state' => array( |
747 | - 'label' => __( 'Municipality', 'give' ), |
|
747 | + 'label' => __('Municipality', 'give'), |
|
748 | 748 | 'required' => false, |
749 | 749 | 'hidden' => true, |
750 | 750 | ), |
@@ -762,17 +762,17 @@ discard block |
||
762 | 762 | ), |
763 | 763 | 'TR' => array( |
764 | 764 | 'state' => array( |
765 | - 'label' => __( 'Province', 'give' ), |
|
765 | + 'label' => __('Province', 'give'), |
|
766 | 766 | ), |
767 | 767 | ), |
768 | 768 | 'US' => array( |
769 | 769 | 'state' => array( |
770 | - 'label' => __( 'State', 'give' ), |
|
770 | + 'label' => __('State', 'give'), |
|
771 | 771 | ), |
772 | 772 | ), |
773 | 773 | 'GB' => array( |
774 | 774 | 'state' => array( |
775 | - 'label' => __( 'County', 'give' ), |
|
775 | + 'label' => __('County', 'give'), |
|
776 | 776 | 'required' => false, |
777 | 777 | ), |
778 | 778 | ), |
@@ -789,10 +789,10 @@ discard block |
||
789 | 789 | ), |
790 | 790 | 'ZA' => array( |
791 | 791 | 'state' => array( |
792 | - 'label' => __( 'Province', 'give' ), |
|
792 | + 'label' => __('Province', 'give'), |
|
793 | 793 | ), |
794 | 794 | ), |
795 | - ) ); |
|
795 | + )); |
|
796 | 796 | } |
797 | 797 | |
798 | 798 | /** |
@@ -804,90 +804,90 @@ discard block |
||
804 | 804 | function give_get_turkey_states_list() { |
805 | 805 | $states = array( |
806 | 806 | '' => '', |
807 | - 'TR01' => __( 'Adana', 'give' ), |
|
808 | - 'TR02' => __( 'Adıyaman', 'give' ), |
|
809 | - 'TR03' => __( 'Afyon', 'give' ), |
|
810 | - 'TR04' => __( 'Ağrı', 'give' ), |
|
811 | - 'TR05' => __( 'Amasya', 'give' ), |
|
812 | - 'TR06' => __( 'Ankara', 'give' ), |
|
813 | - 'TR07' => __( 'Antalya', 'give' ), |
|
814 | - 'TR08' => __( 'Artvin', 'give' ), |
|
815 | - 'TR09' => __( 'Aydın', 'give' ), |
|
816 | - 'TR10' => __( 'Balıkesir', 'give' ), |
|
817 | - 'TR11' => __( 'Bilecik', 'give' ), |
|
818 | - 'TR12' => __( 'Bingöl', 'give' ), |
|
819 | - 'TR13' => __( 'Bitlis', 'give' ), |
|
820 | - 'TR14' => __( 'Bolu', 'give' ), |
|
821 | - 'TR15' => __( 'Burdur', 'give' ), |
|
822 | - 'TR16' => __( 'Bursa', 'give' ), |
|
823 | - 'TR17' => __( 'Çanakkale', 'give' ), |
|
824 | - 'TR18' => __( 'Çankırı', 'give' ), |
|
825 | - 'TR19' => __( 'Çorum', 'give' ), |
|
826 | - 'TR20' => __( 'Denizli', 'give' ), |
|
827 | - 'TR21' => __( 'Diyarbakır', 'give' ), |
|
828 | - 'TR22' => __( 'Edirne', 'give' ), |
|
829 | - 'TR23' => __( 'Elazığ', 'give' ), |
|
830 | - 'TR24' => __( 'Erzincan', 'give' ), |
|
831 | - 'TR25' => __( 'Erzurum', 'give' ), |
|
832 | - 'TR26' => __( 'Eskişehir', 'give' ), |
|
833 | - 'TR27' => __( 'Gaziantep', 'give' ), |
|
834 | - 'TR28' => __( 'Giresun', 'give' ), |
|
835 | - 'TR29' => __( 'Gümüşhane', 'give' ), |
|
836 | - 'TR30' => __( 'Hakkari', 'give' ), |
|
837 | - 'TR31' => __( 'Hatay', 'give' ), |
|
838 | - 'TR32' => __( 'Isparta', 'give' ), |
|
839 | - 'TR33' => __( 'İçel', 'give' ), |
|
840 | - 'TR34' => __( 'İstanbul', 'give' ), |
|
841 | - 'TR35' => __( 'İzmir', 'give' ), |
|
842 | - 'TR36' => __( 'Kars', 'give' ), |
|
843 | - 'TR37' => __( 'Kastamonu', 'give' ), |
|
844 | - 'TR38' => __( 'Kayseri', 'give' ), |
|
845 | - 'TR39' => __( 'Kırklareli', 'give' ), |
|
846 | - 'TR40' => __( 'Kırşehir', 'give' ), |
|
847 | - 'TR41' => __( 'Kocaeli', 'give' ), |
|
848 | - 'TR42' => __( 'Konya', 'give' ), |
|
849 | - 'TR43' => __( 'Kütahya', 'give' ), |
|
850 | - 'TR44' => __( 'Malatya', 'give' ), |
|
851 | - 'TR45' => __( 'Manisa', 'give' ), |
|
852 | - 'TR46' => __( 'Kahramanmaraş', 'give' ), |
|
853 | - 'TR47' => __( 'Mardin', 'give' ), |
|
854 | - 'TR48' => __( 'Muğla', 'give' ), |
|
855 | - 'TR49' => __( 'Muş', 'give' ), |
|
856 | - 'TR50' => __( 'Nevşehir', 'give' ), |
|
857 | - 'TR51' => __( 'Niğde', 'give' ), |
|
858 | - 'TR52' => __( 'Ordu', 'give' ), |
|
859 | - 'TR53' => __( 'Rize', 'give' ), |
|
860 | - 'TR54' => __( 'Sakarya', 'give' ), |
|
861 | - 'TR55' => __( 'Samsun', 'give' ), |
|
862 | - 'TR56' => __( 'Siirt', 'give' ), |
|
863 | - 'TR57' => __( 'Sinop', 'give' ), |
|
864 | - 'TR58' => __( 'Sivas', 'give' ), |
|
865 | - 'TR59' => __( 'Tekirdağ', 'give' ), |
|
866 | - 'TR60' => __( 'Tokat', 'give' ), |
|
867 | - 'TR61' => __( 'Trabzon', 'give' ), |
|
868 | - 'TR62' => __( 'Tunceli', 'give' ), |
|
869 | - 'TR63' => __( 'Şanlıurfa', 'give' ), |
|
870 | - 'TR64' => __( 'Uşak', 'give' ), |
|
871 | - 'TR65' => __( 'Van', 'give' ), |
|
872 | - 'TR66' => __( 'Yozgat', 'give' ), |
|
873 | - 'TR67' => __( 'Zonguldak', 'give' ), |
|
874 | - 'TR68' => __( 'Aksaray', 'give' ), |
|
875 | - 'TR69' => __( 'Bayburt', 'give' ), |
|
876 | - 'TR70' => __( 'Karaman', 'give' ), |
|
877 | - 'TR71' => __( 'Kırıkkale', 'give' ), |
|
878 | - 'TR72' => __( 'Batman', 'give' ), |
|
879 | - 'TR73' => __( 'Şırnak', 'give' ), |
|
880 | - 'TR74' => __( 'Bartın', 'give' ), |
|
881 | - 'TR75' => __( 'Ardahan', 'give' ), |
|
882 | - 'TR76' => __( 'Iğdır', 'give' ), |
|
883 | - 'TR77' => __( 'Yalova', 'give' ), |
|
884 | - 'TR78' => __( 'Karabük', 'give' ), |
|
885 | - 'TR79' => __( 'Kilis', 'give' ), |
|
886 | - 'TR80' => __( 'Osmaniye', 'give' ), |
|
887 | - 'TR81' => __( 'Düzce', 'give' ), |
|
807 | + 'TR01' => __('Adana', 'give'), |
|
808 | + 'TR02' => __('Adıyaman', 'give'), |
|
809 | + 'TR03' => __('Afyon', 'give'), |
|
810 | + 'TR04' => __('Ağrı', 'give'), |
|
811 | + 'TR05' => __('Amasya', 'give'), |
|
812 | + 'TR06' => __('Ankara', 'give'), |
|
813 | + 'TR07' => __('Antalya', 'give'), |
|
814 | + 'TR08' => __('Artvin', 'give'), |
|
815 | + 'TR09' => __('Aydın', 'give'), |
|
816 | + 'TR10' => __('Balıkesir', 'give'), |
|
817 | + 'TR11' => __('Bilecik', 'give'), |
|
818 | + 'TR12' => __('Bingöl', 'give'), |
|
819 | + 'TR13' => __('Bitlis', 'give'), |
|
820 | + 'TR14' => __('Bolu', 'give'), |
|
821 | + 'TR15' => __('Burdur', 'give'), |
|
822 | + 'TR16' => __('Bursa', 'give'), |
|
823 | + 'TR17' => __('Çanakkale', 'give'), |
|
824 | + 'TR18' => __('Çankırı', 'give'), |
|
825 | + 'TR19' => __('Çorum', 'give'), |
|
826 | + 'TR20' => __('Denizli', 'give'), |
|
827 | + 'TR21' => __('Diyarbakır', 'give'), |
|
828 | + 'TR22' => __('Edirne', 'give'), |
|
829 | + 'TR23' => __('Elazığ', 'give'), |
|
830 | + 'TR24' => __('Erzincan', 'give'), |
|
831 | + 'TR25' => __('Erzurum', 'give'), |
|
832 | + 'TR26' => __('Eskişehir', 'give'), |
|
833 | + 'TR27' => __('Gaziantep', 'give'), |
|
834 | + 'TR28' => __('Giresun', 'give'), |
|
835 | + 'TR29' => __('Gümüşhane', 'give'), |
|
836 | + 'TR30' => __('Hakkari', 'give'), |
|
837 | + 'TR31' => __('Hatay', 'give'), |
|
838 | + 'TR32' => __('Isparta', 'give'), |
|
839 | + 'TR33' => __('İçel', 'give'), |
|
840 | + 'TR34' => __('İstanbul', 'give'), |
|
841 | + 'TR35' => __('İzmir', 'give'), |
|
842 | + 'TR36' => __('Kars', 'give'), |
|
843 | + 'TR37' => __('Kastamonu', 'give'), |
|
844 | + 'TR38' => __('Kayseri', 'give'), |
|
845 | + 'TR39' => __('Kırklareli', 'give'), |
|
846 | + 'TR40' => __('Kırşehir', 'give'), |
|
847 | + 'TR41' => __('Kocaeli', 'give'), |
|
848 | + 'TR42' => __('Konya', 'give'), |
|
849 | + 'TR43' => __('Kütahya', 'give'), |
|
850 | + 'TR44' => __('Malatya', 'give'), |
|
851 | + 'TR45' => __('Manisa', 'give'), |
|
852 | + 'TR46' => __('Kahramanmaraş', 'give'), |
|
853 | + 'TR47' => __('Mardin', 'give'), |
|
854 | + 'TR48' => __('Muğla', 'give'), |
|
855 | + 'TR49' => __('Muş', 'give'), |
|
856 | + 'TR50' => __('Nevşehir', 'give'), |
|
857 | + 'TR51' => __('Niğde', 'give'), |
|
858 | + 'TR52' => __('Ordu', 'give'), |
|
859 | + 'TR53' => __('Rize', 'give'), |
|
860 | + 'TR54' => __('Sakarya', 'give'), |
|
861 | + 'TR55' => __('Samsun', 'give'), |
|
862 | + 'TR56' => __('Siirt', 'give'), |
|
863 | + 'TR57' => __('Sinop', 'give'), |
|
864 | + 'TR58' => __('Sivas', 'give'), |
|
865 | + 'TR59' => __('Tekirdağ', 'give'), |
|
866 | + 'TR60' => __('Tokat', 'give'), |
|
867 | + 'TR61' => __('Trabzon', 'give'), |
|
868 | + 'TR62' => __('Tunceli', 'give'), |
|
869 | + 'TR63' => __('Şanlıurfa', 'give'), |
|
870 | + 'TR64' => __('Uşak', 'give'), |
|
871 | + 'TR65' => __('Van', 'give'), |
|
872 | + 'TR66' => __('Yozgat', 'give'), |
|
873 | + 'TR67' => __('Zonguldak', 'give'), |
|
874 | + 'TR68' => __('Aksaray', 'give'), |
|
875 | + 'TR69' => __('Bayburt', 'give'), |
|
876 | + 'TR70' => __('Karaman', 'give'), |
|
877 | + 'TR71' => __('Kırıkkale', 'give'), |
|
878 | + 'TR72' => __('Batman', 'give'), |
|
879 | + 'TR73' => __('Şırnak', 'give'), |
|
880 | + 'TR74' => __('Bartın', 'give'), |
|
881 | + 'TR75' => __('Ardahan', 'give'), |
|
882 | + 'TR76' => __('Iğdır', 'give'), |
|
883 | + 'TR77' => __('Yalova', 'give'), |
|
884 | + 'TR78' => __('Karabük', 'give'), |
|
885 | + 'TR79' => __('Kilis', 'give'), |
|
886 | + 'TR80' => __('Osmaniye', 'give'), |
|
887 | + 'TR81' => __('Düzce', 'give'), |
|
888 | 888 | ); |
889 | 889 | |
890 | - return apply_filters( 'give_turkey_states', $states ); |
|
890 | + return apply_filters('give_turkey_states', $states); |
|
891 | 891 | } |
892 | 892 | |
893 | 893 | /** |
@@ -899,51 +899,51 @@ discard block |
||
899 | 899 | function give_get_romania_states_list() { |
900 | 900 | $states = array( |
901 | 901 | '' => '', |
902 | - 'AB' => __( 'Alba', 'give' ), |
|
903 | - 'AR' => __( 'Arad', 'give' ), |
|
904 | - 'AG' => __( 'Arges', 'give' ), |
|
905 | - 'BC' => __( 'Bacau', 'give' ), |
|
906 | - 'BH' => __( 'Bihor', 'give' ), |
|
907 | - 'BN' => __( 'Bistrita-Nasaud', 'give' ), |
|
908 | - 'BT' => __( 'Botosani', 'give' ), |
|
909 | - 'BR' => __( 'Braila', 'give' ), |
|
910 | - 'BV' => __( 'Brasov', 'give' ), |
|
911 | - 'B' => __( 'Bucuresti', 'give' ), |
|
912 | - 'BZ' => __( 'Buzau', 'give' ), |
|
913 | - 'CL' => __( 'Calarasi', 'give' ), |
|
914 | - 'CS' => __( 'Caras-Severin', 'give' ), |
|
915 | - 'CJ' => __( 'Cluj', 'give' ), |
|
916 | - 'CT' => __( 'Constanta', 'give' ), |
|
917 | - 'CV' => __( 'Covasna', 'give' ), |
|
918 | - 'DB' => __( 'Dambovita', 'give' ), |
|
919 | - 'DJ' => __( 'Dolj', 'give' ), |
|
920 | - 'GL' => __( 'Galati', 'give' ), |
|
921 | - 'GR' => __( 'Giurgiu', 'give' ), |
|
922 | - 'GJ' => __( 'Gorj', 'give' ), |
|
923 | - 'HR' => __( 'Harghita', 'give' ), |
|
924 | - 'HD' => __( 'Hunedoara', 'give' ), |
|
925 | - 'IL' => __( 'Ialomita', 'give' ), |
|
926 | - 'IS' => __( 'Iasi', 'give' ), |
|
927 | - 'IF' => __( 'Ilfov', 'give' ), |
|
928 | - 'MM' => __( 'Maramures', 'give' ), |
|
929 | - 'MH' => __( 'Mehedinti', 'give' ), |
|
930 | - 'MS' => __( 'Mures', 'give' ), |
|
931 | - 'NT' => __( 'Neamt', 'give' ), |
|
932 | - 'OT' => __( 'Olt', 'give' ), |
|
933 | - 'PH' => __( 'Prahova', 'give' ), |
|
934 | - 'SJ' => __( 'Salaj', 'give' ), |
|
935 | - 'SM' => __( 'Satu Mare', 'give' ), |
|
936 | - 'SB' => __( 'Sibiu', 'give' ), |
|
937 | - 'SV' => __( 'Suceava', 'give' ), |
|
938 | - 'TR' => __( 'Teleorman', 'give' ), |
|
939 | - 'TM' => __( 'Timis', 'give' ), |
|
940 | - 'TL' => __( 'Tulcea', 'give' ), |
|
941 | - 'VL' => __( 'Valcea', 'give' ), |
|
942 | - 'VS' => __( 'Vaslui', 'give' ), |
|
943 | - 'VN' => __( 'Vrancea', 'give' ), |
|
902 | + 'AB' => __('Alba', 'give'), |
|
903 | + 'AR' => __('Arad', 'give'), |
|
904 | + 'AG' => __('Arges', 'give'), |
|
905 | + 'BC' => __('Bacau', 'give'), |
|
906 | + 'BH' => __('Bihor', 'give'), |
|
907 | + 'BN' => __('Bistrita-Nasaud', 'give'), |
|
908 | + 'BT' => __('Botosani', 'give'), |
|
909 | + 'BR' => __('Braila', 'give'), |
|
910 | + 'BV' => __('Brasov', 'give'), |
|
911 | + 'B' => __('Bucuresti', 'give'), |
|
912 | + 'BZ' => __('Buzau', 'give'), |
|
913 | + 'CL' => __('Calarasi', 'give'), |
|
914 | + 'CS' => __('Caras-Severin', 'give'), |
|
915 | + 'CJ' => __('Cluj', 'give'), |
|
916 | + 'CT' => __('Constanta', 'give'), |
|
917 | + 'CV' => __('Covasna', 'give'), |
|
918 | + 'DB' => __('Dambovita', 'give'), |
|
919 | + 'DJ' => __('Dolj', 'give'), |
|
920 | + 'GL' => __('Galati', 'give'), |
|
921 | + 'GR' => __('Giurgiu', 'give'), |
|
922 | + 'GJ' => __('Gorj', 'give'), |
|
923 | + 'HR' => __('Harghita', 'give'), |
|
924 | + 'HD' => __('Hunedoara', 'give'), |
|
925 | + 'IL' => __('Ialomita', 'give'), |
|
926 | + 'IS' => __('Iasi', 'give'), |
|
927 | + 'IF' => __('Ilfov', 'give'), |
|
928 | + 'MM' => __('Maramures', 'give'), |
|
929 | + 'MH' => __('Mehedinti', 'give'), |
|
930 | + 'MS' => __('Mures', 'give'), |
|
931 | + 'NT' => __('Neamt', 'give'), |
|
932 | + 'OT' => __('Olt', 'give'), |
|
933 | + 'PH' => __('Prahova', 'give'), |
|
934 | + 'SJ' => __('Salaj', 'give'), |
|
935 | + 'SM' => __('Satu Mare', 'give'), |
|
936 | + 'SB' => __('Sibiu', 'give'), |
|
937 | + 'SV' => __('Suceava', 'give'), |
|
938 | + 'TR' => __('Teleorman', 'give'), |
|
939 | + 'TM' => __('Timis', 'give'), |
|
940 | + 'TL' => __('Tulcea', 'give'), |
|
941 | + 'VL' => __('Valcea', 'give'), |
|
942 | + 'VS' => __('Vaslui', 'give'), |
|
943 | + 'VN' => __('Vrancea', 'give'), |
|
944 | 944 | ); |
945 | 945 | |
946 | - return apply_filters( 'give_romania_states', $states ); |
|
946 | + return apply_filters('give_romania_states', $states); |
|
947 | 947 | } |
948 | 948 | |
949 | 949 | /** |
@@ -955,17 +955,17 @@ discard block |
||
955 | 955 | function give_get_pakistan_states_list() { |
956 | 956 | $states = array( |
957 | 957 | '' => '', |
958 | - 'JK' => __( 'Azad Kashmir', 'give' ), |
|
959 | - 'BA' => __( 'Balochistan', 'give' ), |
|
960 | - 'TA' => __( 'FATA', 'give' ), |
|
961 | - 'GB' => __( 'Gilgit Baltistan', 'give' ), |
|
962 | - 'IS' => __( 'Islamabad Capital Territory', 'give' ), |
|
963 | - 'KP' => __( 'Khyber Pakhtunkhwa', 'give' ), |
|
964 | - 'PB' => __( 'Punjab', 'give' ), |
|
965 | - 'SD' => __( 'Sindh', 'give' ), |
|
958 | + 'JK' => __('Azad Kashmir', 'give'), |
|
959 | + 'BA' => __('Balochistan', 'give'), |
|
960 | + 'TA' => __('FATA', 'give'), |
|
961 | + 'GB' => __('Gilgit Baltistan', 'give'), |
|
962 | + 'IS' => __('Islamabad Capital Territory', 'give'), |
|
963 | + 'KP' => __('Khyber Pakhtunkhwa', 'give'), |
|
964 | + 'PB' => __('Punjab', 'give'), |
|
965 | + 'SD' => __('Sindh', 'give'), |
|
966 | 966 | ); |
967 | 967 | |
968 | - return apply_filters( 'give_pakistan_states', $states ); |
|
968 | + return apply_filters('give_pakistan_states', $states); |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | /** |
@@ -977,91 +977,91 @@ discard block |
||
977 | 977 | function give_get_philippines_states_list() { |
978 | 978 | $states = array( |
979 | 979 | '' => '', |
980 | - 'ABR' => __( 'Abra', 'give' ), |
|
981 | - 'AGN' => __( 'Agusan del Norte', 'give' ), |
|
982 | - 'AGS' => __( 'Agusan del Sur', 'give' ), |
|
983 | - 'AKL' => __( 'Aklan', 'give' ), |
|
984 | - 'ALB' => __( 'Albay', 'give' ), |
|
985 | - 'ANT' => __( 'Antique', 'give' ), |
|
986 | - 'APA' => __( 'Apayao', 'give' ), |
|
987 | - 'AUR' => __( 'Aurora', 'give' ), |
|
988 | - 'BAS' => __( 'Basilan', 'give' ), |
|
989 | - 'BAN' => __( 'Bataan', 'give' ), |
|
990 | - 'BTN' => __( 'Batanes', 'give' ), |
|
991 | - 'BTG' => __( 'Batangas', 'give' ), |
|
992 | - 'BEN' => __( 'Benguet', 'give' ), |
|
993 | - 'BIL' => __( 'Biliran', 'give' ), |
|
994 | - 'BOH' => __( 'Bohol', 'give' ), |
|
995 | - 'BUK' => __( 'Bukidnon', 'give' ), |
|
996 | - 'BUL' => __( 'Bulacan', 'give' ), |
|
997 | - 'CAG' => __( 'Cagayan', 'give' ), |
|
998 | - 'CAN' => __( 'Camarines Norte', 'give' ), |
|
999 | - 'CAS' => __( 'Camarines Sur', 'give' ), |
|
1000 | - 'CAM' => __( 'Camiguin', 'give' ), |
|
1001 | - 'CAP' => __( 'Capiz', 'give' ), |
|
1002 | - 'CAT' => __( 'Catanduanes', 'give' ), |
|
1003 | - 'CAV' => __( 'Cavite', 'give' ), |
|
1004 | - 'CEB' => __( 'Cebu', 'give' ), |
|
1005 | - 'COM' => __( 'Compostela Valley', 'give' ), |
|
1006 | - 'NCO' => __( 'Cotabato', 'give' ), |
|
1007 | - 'DAV' => __( 'Davao del Norte', 'give' ), |
|
1008 | - 'DAS' => __( 'Davao del Sur', 'give' ), |
|
1009 | - 'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned |
|
1010 | - 'DAO' => __( 'Davao Oriental', 'give' ), |
|
1011 | - 'DIN' => __( 'Dinagat Islands', 'give' ), |
|
1012 | - 'EAS' => __( 'Eastern Samar', 'give' ), |
|
1013 | - 'GUI' => __( 'Guimaras', 'give' ), |
|
1014 | - 'IFU' => __( 'Ifugao', 'give' ), |
|
1015 | - 'ILN' => __( 'Ilocos Norte', 'give' ), |
|
1016 | - 'ILS' => __( 'Ilocos Sur', 'give' ), |
|
1017 | - 'ILI' => __( 'Iloilo', 'give' ), |
|
1018 | - 'ISA' => __( 'Isabela', 'give' ), |
|
1019 | - 'KAL' => __( 'Kalinga', 'give' ), |
|
1020 | - 'LUN' => __( 'La Union', 'give' ), |
|
1021 | - 'LAG' => __( 'Laguna', 'give' ), |
|
1022 | - 'LAN' => __( 'Lanao del Norte', 'give' ), |
|
1023 | - 'LAS' => __( 'Lanao del Sur', 'give' ), |
|
1024 | - 'LEY' => __( 'Leyte', 'give' ), |
|
1025 | - 'MAG' => __( 'Maguindanao', 'give' ), |
|
1026 | - 'MAD' => __( 'Marinduque', 'give' ), |
|
1027 | - 'MAS' => __( 'Masbate', 'give' ), |
|
1028 | - 'MSC' => __( 'Misamis Occidental', 'give' ), |
|
1029 | - 'MSR' => __( 'Misamis Oriental', 'give' ), |
|
1030 | - 'MOU' => __( 'Mountain Province', 'give' ), |
|
1031 | - 'NEC' => __( 'Negros Occidental', 'give' ), |
|
1032 | - 'NER' => __( 'Negros Oriental', 'give' ), |
|
1033 | - 'NSA' => __( 'Northern Samar', 'give' ), |
|
1034 | - 'NUE' => __( 'Nueva Ecija', 'give' ), |
|
1035 | - 'NUV' => __( 'Nueva Vizcaya', 'give' ), |
|
1036 | - 'MDC' => __( 'Occidental Mindoro', 'give' ), |
|
1037 | - 'MDR' => __( 'Oriental Mindoro', 'give' ), |
|
1038 | - 'PLW' => __( 'Palawan', 'give' ), |
|
1039 | - 'PAM' => __( 'Pampanga', 'give' ), |
|
1040 | - 'PAN' => __( 'Pangasinan', 'give' ), |
|
1041 | - 'QUE' => __( 'Quezon', 'give' ), |
|
1042 | - 'QUI' => __( 'Quirino', 'give' ), |
|
1043 | - 'RIZ' => __( 'Rizal', 'give' ), |
|
1044 | - 'ROM' => __( 'Romblon', 'give' ), |
|
1045 | - 'WSA' => __( 'Samar', 'give' ), |
|
1046 | - 'SAR' => __( 'Sarangani', 'give' ), |
|
1047 | - 'SIQ' => __( 'Siquijor', 'give' ), |
|
1048 | - 'SOR' => __( 'Sorsogon', 'give' ), |
|
1049 | - 'SCO' => __( 'South Cotabato', 'give' ), |
|
1050 | - 'SLE' => __( 'Southern Leyte', 'give' ), |
|
1051 | - 'SUK' => __( 'Sultan Kudarat', 'give' ), |
|
1052 | - 'SLU' => __( 'Sulu', 'give' ), |
|
1053 | - 'SUN' => __( 'Surigao del Norte', 'give' ), |
|
1054 | - 'SUR' => __( 'Surigao del Sur', 'give' ), |
|
1055 | - 'TAR' => __( 'Tarlac', 'give' ), |
|
1056 | - 'TAW' => __( 'Tawi-Tawi', 'give' ), |
|
1057 | - 'ZMB' => __( 'Zambales', 'give' ), |
|
1058 | - 'ZAN' => __( 'Zamboanga del Norte', 'give' ), |
|
1059 | - 'ZAS' => __( 'Zamboanga del Sur', 'give' ), |
|
1060 | - 'ZSI' => __( 'Zamboanga Sibugay', 'give' ), |
|
1061 | - '00' => __( 'Metro Manila', 'give' ), |
|
980 | + 'ABR' => __('Abra', 'give'), |
|
981 | + 'AGN' => __('Agusan del Norte', 'give'), |
|
982 | + 'AGS' => __('Agusan del Sur', 'give'), |
|
983 | + 'AKL' => __('Aklan', 'give'), |
|
984 | + 'ALB' => __('Albay', 'give'), |
|
985 | + 'ANT' => __('Antique', 'give'), |
|
986 | + 'APA' => __('Apayao', 'give'), |
|
987 | + 'AUR' => __('Aurora', 'give'), |
|
988 | + 'BAS' => __('Basilan', 'give'), |
|
989 | + 'BAN' => __('Bataan', 'give'), |
|
990 | + 'BTN' => __('Batanes', 'give'), |
|
991 | + 'BTG' => __('Batangas', 'give'), |
|
992 | + 'BEN' => __('Benguet', 'give'), |
|
993 | + 'BIL' => __('Biliran', 'give'), |
|
994 | + 'BOH' => __('Bohol', 'give'), |
|
995 | + 'BUK' => __('Bukidnon', 'give'), |
|
996 | + 'BUL' => __('Bulacan', 'give'), |
|
997 | + 'CAG' => __('Cagayan', 'give'), |
|
998 | + 'CAN' => __('Camarines Norte', 'give'), |
|
999 | + 'CAS' => __('Camarines Sur', 'give'), |
|
1000 | + 'CAM' => __('Camiguin', 'give'), |
|
1001 | + 'CAP' => __('Capiz', 'give'), |
|
1002 | + 'CAT' => __('Catanduanes', 'give'), |
|
1003 | + 'CAV' => __('Cavite', 'give'), |
|
1004 | + 'CEB' => __('Cebu', 'give'), |
|
1005 | + 'COM' => __('Compostela Valley', 'give'), |
|
1006 | + 'NCO' => __('Cotabato', 'give'), |
|
1007 | + 'DAV' => __('Davao del Norte', 'give'), |
|
1008 | + 'DAS' => __('Davao del Sur', 'give'), |
|
1009 | + 'DAC' => __('Davao Occidental', 'give'), // TODO: Needs to be updated when ISO code is assigned |
|
1010 | + 'DAO' => __('Davao Oriental', 'give'), |
|
1011 | + 'DIN' => __('Dinagat Islands', 'give'), |
|
1012 | + 'EAS' => __('Eastern Samar', 'give'), |
|
1013 | + 'GUI' => __('Guimaras', 'give'), |
|
1014 | + 'IFU' => __('Ifugao', 'give'), |
|
1015 | + 'ILN' => __('Ilocos Norte', 'give'), |
|
1016 | + 'ILS' => __('Ilocos Sur', 'give'), |
|
1017 | + 'ILI' => __('Iloilo', 'give'), |
|
1018 | + 'ISA' => __('Isabela', 'give'), |
|
1019 | + 'KAL' => __('Kalinga', 'give'), |
|
1020 | + 'LUN' => __('La Union', 'give'), |
|
1021 | + 'LAG' => __('Laguna', 'give'), |
|
1022 | + 'LAN' => __('Lanao del Norte', 'give'), |
|
1023 | + 'LAS' => __('Lanao del Sur', 'give'), |
|
1024 | + 'LEY' => __('Leyte', 'give'), |
|
1025 | + 'MAG' => __('Maguindanao', 'give'), |
|
1026 | + 'MAD' => __('Marinduque', 'give'), |
|
1027 | + 'MAS' => __('Masbate', 'give'), |
|
1028 | + 'MSC' => __('Misamis Occidental', 'give'), |
|
1029 | + 'MSR' => __('Misamis Oriental', 'give'), |
|
1030 | + 'MOU' => __('Mountain Province', 'give'), |
|
1031 | + 'NEC' => __('Negros Occidental', 'give'), |
|
1032 | + 'NER' => __('Negros Oriental', 'give'), |
|
1033 | + 'NSA' => __('Northern Samar', 'give'), |
|
1034 | + 'NUE' => __('Nueva Ecija', 'give'), |
|
1035 | + 'NUV' => __('Nueva Vizcaya', 'give'), |
|
1036 | + 'MDC' => __('Occidental Mindoro', 'give'), |
|
1037 | + 'MDR' => __('Oriental Mindoro', 'give'), |
|
1038 | + 'PLW' => __('Palawan', 'give'), |
|
1039 | + 'PAM' => __('Pampanga', 'give'), |
|
1040 | + 'PAN' => __('Pangasinan', 'give'), |
|
1041 | + 'QUE' => __('Quezon', 'give'), |
|
1042 | + 'QUI' => __('Quirino', 'give'), |
|
1043 | + 'RIZ' => __('Rizal', 'give'), |
|
1044 | + 'ROM' => __('Romblon', 'give'), |
|
1045 | + 'WSA' => __('Samar', 'give'), |
|
1046 | + 'SAR' => __('Sarangani', 'give'), |
|
1047 | + 'SIQ' => __('Siquijor', 'give'), |
|
1048 | + 'SOR' => __('Sorsogon', 'give'), |
|
1049 | + 'SCO' => __('South Cotabato', 'give'), |
|
1050 | + 'SLE' => __('Southern Leyte', 'give'), |
|
1051 | + 'SUK' => __('Sultan Kudarat', 'give'), |
|
1052 | + 'SLU' => __('Sulu', 'give'), |
|
1053 | + 'SUN' => __('Surigao del Norte', 'give'), |
|
1054 | + 'SUR' => __('Surigao del Sur', 'give'), |
|
1055 | + 'TAR' => __('Tarlac', 'give'), |
|
1056 | + 'TAW' => __('Tawi-Tawi', 'give'), |
|
1057 | + 'ZMB' => __('Zambales', 'give'), |
|
1058 | + 'ZAN' => __('Zamboanga del Norte', 'give'), |
|
1059 | + 'ZAS' => __('Zamboanga del Sur', 'give'), |
|
1060 | + 'ZSI' => __('Zamboanga Sibugay', 'give'), |
|
1061 | + '00' => __('Metro Manila', 'give'), |
|
1062 | 1062 | ); |
1063 | 1063 | |
1064 | - return apply_filters( 'give_philippines_states', $states ); |
|
1064 | + return apply_filters('give_philippines_states', $states); |
|
1065 | 1065 | } |
1066 | 1066 | |
1067 | 1067 | /** |
@@ -1073,35 +1073,35 @@ discard block |
||
1073 | 1073 | function give_get_peru_states_list() { |
1074 | 1074 | $states = array( |
1075 | 1075 | '' => '', |
1076 | - 'CAL' => __( 'El Callao', 'give' ), |
|
1077 | - 'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ), |
|
1078 | - 'AMA' => __( 'Amazonas', 'give' ), |
|
1079 | - 'ANC' => __( 'Ancash', 'give' ), |
|
1080 | - 'APU' => __( 'Apurímac', 'give' ), |
|
1081 | - 'ARE' => __( 'Arequipa', 'give' ), |
|
1082 | - 'AYA' => __( 'Ayacucho', 'give' ), |
|
1083 | - 'CAJ' => __( 'Cajamarca', 'give' ), |
|
1084 | - 'CUS' => __( 'Cusco', 'give' ), |
|
1085 | - 'HUV' => __( 'Huancavelica', 'give' ), |
|
1086 | - 'HUC' => __( 'Huánuco', 'give' ), |
|
1087 | - 'ICA' => __( 'Ica', 'give' ), |
|
1088 | - 'JUN' => __( 'Junín', 'give' ), |
|
1089 | - 'LAL' => __( 'La Libertad', 'give' ), |
|
1090 | - 'LAM' => __( 'Lambayeque', 'give' ), |
|
1091 | - 'LIM' => __( 'Lima', 'give' ), |
|
1092 | - 'LOR' => __( 'Loreto', 'give' ), |
|
1093 | - 'MDD' => __( 'Madre de Dios', 'give' ), |
|
1094 | - 'MOQ' => __( 'Moquegua', 'give' ), |
|
1095 | - 'PAS' => __( 'Pasco', 'give' ), |
|
1096 | - 'PIU' => __( 'Piura', 'give' ), |
|
1097 | - 'PUN' => __( 'Puno', 'give' ), |
|
1098 | - 'SAM' => __( 'San Martín', 'give' ), |
|
1099 | - 'TAC' => __( 'Tacna', 'give' ), |
|
1100 | - 'TUM' => __( 'Tumbes', 'give' ), |
|
1101 | - 'UCA' => __( 'Ucayali', 'give' ), |
|
1076 | + 'CAL' => __('El Callao', 'give'), |
|
1077 | + 'LMA' => __('Municipalidad Metropolitana de Lima', 'give'), |
|
1078 | + 'AMA' => __('Amazonas', 'give'), |
|
1079 | + 'ANC' => __('Ancash', 'give'), |
|
1080 | + 'APU' => __('Apurímac', 'give'), |
|
1081 | + 'ARE' => __('Arequipa', 'give'), |
|
1082 | + 'AYA' => __('Ayacucho', 'give'), |
|
1083 | + 'CAJ' => __('Cajamarca', 'give'), |
|
1084 | + 'CUS' => __('Cusco', 'give'), |
|
1085 | + 'HUV' => __('Huancavelica', 'give'), |
|
1086 | + 'HUC' => __('Huánuco', 'give'), |
|
1087 | + 'ICA' => __('Ica', 'give'), |
|
1088 | + 'JUN' => __('Junín', 'give'), |
|
1089 | + 'LAL' => __('La Libertad', 'give'), |
|
1090 | + 'LAM' => __('Lambayeque', 'give'), |
|
1091 | + 'LIM' => __('Lima', 'give'), |
|
1092 | + 'LOR' => __('Loreto', 'give'), |
|
1093 | + 'MDD' => __('Madre de Dios', 'give'), |
|
1094 | + 'MOQ' => __('Moquegua', 'give'), |
|
1095 | + 'PAS' => __('Pasco', 'give'), |
|
1096 | + 'PIU' => __('Piura', 'give'), |
|
1097 | + 'PUN' => __('Puno', 'give'), |
|
1098 | + 'SAM' => __('San Martín', 'give'), |
|
1099 | + 'TAC' => __('Tacna', 'give'), |
|
1100 | + 'TUM' => __('Tumbes', 'give'), |
|
1101 | + 'UCA' => __('Ucayali', 'give'), |
|
1102 | 1102 | ); |
1103 | 1103 | |
1104 | - return apply_filters( 'give_peru_states', $states ); |
|
1104 | + return apply_filters('give_peru_states', $states); |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | /** |
@@ -1113,23 +1113,23 @@ discard block |
||
1113 | 1113 | function give_get_nepal_states_list() { |
1114 | 1114 | $states = array( |
1115 | 1115 | '' => '', |
1116 | - 'BAG' => __( 'Bagmati', 'give' ), |
|
1117 | - 'BHE' => __( 'Bheri', 'give' ), |
|
1118 | - 'DHA' => __( 'Dhaulagiri', 'give' ), |
|
1119 | - 'GAN' => __( 'Gandaki', 'give' ), |
|
1120 | - 'JAN' => __( 'Janakpur', 'give' ), |
|
1121 | - 'KAR' => __( 'Karnali', 'give' ), |
|
1122 | - 'KOS' => __( 'Koshi', 'give' ), |
|
1123 | - 'LUM' => __( 'Lumbini', 'give' ), |
|
1124 | - 'MAH' => __( 'Mahakali', 'give' ), |
|
1125 | - 'MEC' => __( 'Mechi', 'give' ), |
|
1126 | - 'NAR' => __( 'Narayani', 'give' ), |
|
1127 | - 'RAP' => __( 'Rapti', 'give' ), |
|
1128 | - 'SAG' => __( 'Sagarmatha', 'give' ), |
|
1129 | - 'SET' => __( 'Seti', 'give' ), |
|
1116 | + 'BAG' => __('Bagmati', 'give'), |
|
1117 | + 'BHE' => __('Bheri', 'give'), |
|
1118 | + 'DHA' => __('Dhaulagiri', 'give'), |
|
1119 | + 'GAN' => __('Gandaki', 'give'), |
|
1120 | + 'JAN' => __('Janakpur', 'give'), |
|
1121 | + 'KAR' => __('Karnali', 'give'), |
|
1122 | + 'KOS' => __('Koshi', 'give'), |
|
1123 | + 'LUM' => __('Lumbini', 'give'), |
|
1124 | + 'MAH' => __('Mahakali', 'give'), |
|
1125 | + 'MEC' => __('Mechi', 'give'), |
|
1126 | + 'NAR' => __('Narayani', 'give'), |
|
1127 | + 'RAP' => __('Rapti', 'give'), |
|
1128 | + 'SAG' => __('Sagarmatha', 'give'), |
|
1129 | + 'SET' => __('Seti', 'give'), |
|
1130 | 1130 | ); |
1131 | 1131 | |
1132 | - return apply_filters( 'give_nepal_states', $states ); |
|
1132 | + return apply_filters('give_nepal_states', $states); |
|
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | /** |
@@ -1141,46 +1141,46 @@ discard block |
||
1141 | 1141 | function give_get_nigerian_states_list() { |
1142 | 1142 | $states = array( |
1143 | 1143 | '' => '', |
1144 | - 'AB' => __( 'Abia', 'give' ), |
|
1145 | - 'FC' => __( 'Abuja', 'give' ), |
|
1146 | - 'AD' => __( 'Adamawa', 'give' ), |
|
1147 | - 'AK' => __( 'Akwa Ibom', 'give' ), |
|
1148 | - 'AN' => __( 'Anambra', 'give' ), |
|
1149 | - 'BA' => __( 'Bauchi', 'give' ), |
|
1150 | - 'BY' => __( 'Bayelsa', 'give' ), |
|
1151 | - 'BE' => __( 'Benue', 'give' ), |
|
1152 | - 'BO' => __( 'Borno', 'give' ), |
|
1153 | - 'CR' => __( 'Cross River', 'give' ), |
|
1154 | - 'DE' => __( 'Delta', 'give' ), |
|
1155 | - 'EB' => __( 'Ebonyi', 'give' ), |
|
1156 | - 'ED' => __( 'Edo', 'give' ), |
|
1157 | - 'EK' => __( 'Ekiti', 'give' ), |
|
1158 | - 'EN' => __( 'Enugu', 'give' ), |
|
1159 | - 'GO' => __( 'Gombe', 'give' ), |
|
1160 | - 'IM' => __( 'Imo', 'give' ), |
|
1161 | - 'JI' => __( 'Jigawa', 'give' ), |
|
1162 | - 'KD' => __( 'Kaduna', 'give' ), |
|
1163 | - 'KN' => __( 'Kano', 'give' ), |
|
1164 | - 'KT' => __( 'Katsina', 'give' ), |
|
1165 | - 'KE' => __( 'Kebbi', 'give' ), |
|
1166 | - 'KO' => __( 'Kogi', 'give' ), |
|
1167 | - 'KW' => __( 'Kwara', 'give' ), |
|
1168 | - 'LA' => __( 'Lagos', 'give' ), |
|
1169 | - 'NA' => __( 'Nasarawa', 'give' ), |
|
1170 | - 'NI' => __( 'Niger', 'give' ), |
|
1171 | - 'OG' => __( 'Ogun', 'give' ), |
|
1172 | - 'ON' => __( 'Ondo', 'give' ), |
|
1173 | - 'OS' => __( 'Osun', 'give' ), |
|
1174 | - 'OY' => __( 'Oyo', 'give' ), |
|
1175 | - 'PL' => __( 'Plateau', 'give' ), |
|
1176 | - 'RI' => __( 'Rivers', 'give' ), |
|
1177 | - 'SO' => __( 'Sokoto', 'give' ), |
|
1178 | - 'TA' => __( 'Taraba', 'give' ), |
|
1179 | - 'YO' => __( 'Yobe', 'give' ), |
|
1180 | - 'ZA' => __( 'Zamfara', 'give' ), |
|
1144 | + 'AB' => __('Abia', 'give'), |
|
1145 | + 'FC' => __('Abuja', 'give'), |
|
1146 | + 'AD' => __('Adamawa', 'give'), |
|
1147 | + 'AK' => __('Akwa Ibom', 'give'), |
|
1148 | + 'AN' => __('Anambra', 'give'), |
|
1149 | + 'BA' => __('Bauchi', 'give'), |
|
1150 | + 'BY' => __('Bayelsa', 'give'), |
|
1151 | + 'BE' => __('Benue', 'give'), |
|
1152 | + 'BO' => __('Borno', 'give'), |
|
1153 | + 'CR' => __('Cross River', 'give'), |
|
1154 | + 'DE' => __('Delta', 'give'), |
|
1155 | + 'EB' => __('Ebonyi', 'give'), |
|
1156 | + 'ED' => __('Edo', 'give'), |
|
1157 | + 'EK' => __('Ekiti', 'give'), |
|
1158 | + 'EN' => __('Enugu', 'give'), |
|
1159 | + 'GO' => __('Gombe', 'give'), |
|
1160 | + 'IM' => __('Imo', 'give'), |
|
1161 | + 'JI' => __('Jigawa', 'give'), |
|
1162 | + 'KD' => __('Kaduna', 'give'), |
|
1163 | + 'KN' => __('Kano', 'give'), |
|
1164 | + 'KT' => __('Katsina', 'give'), |
|
1165 | + 'KE' => __('Kebbi', 'give'), |
|
1166 | + 'KO' => __('Kogi', 'give'), |
|
1167 | + 'KW' => __('Kwara', 'give'), |
|
1168 | + 'LA' => __('Lagos', 'give'), |
|
1169 | + 'NA' => __('Nasarawa', 'give'), |
|
1170 | + 'NI' => __('Niger', 'give'), |
|
1171 | + 'OG' => __('Ogun', 'give'), |
|
1172 | + 'ON' => __('Ondo', 'give'), |
|
1173 | + 'OS' => __('Osun', 'give'), |
|
1174 | + 'OY' => __('Oyo', 'give'), |
|
1175 | + 'PL' => __('Plateau', 'give'), |
|
1176 | + 'RI' => __('Rivers', 'give'), |
|
1177 | + 'SO' => __('Sokoto', 'give'), |
|
1178 | + 'TA' => __('Taraba', 'give'), |
|
1179 | + 'YO' => __('Yobe', 'give'), |
|
1180 | + 'ZA' => __('Zamfara', 'give'), |
|
1181 | 1181 | ); |
1182 | 1182 | |
1183 | - return apply_filters( 'give_nigerian_states', $states ); |
|
1183 | + return apply_filters('give_nigerian_states', $states); |
|
1184 | 1184 | } |
1185 | 1185 | |
1186 | 1186 | /** |
@@ -1192,41 +1192,41 @@ discard block |
||
1192 | 1192 | function give_get_mexico_states_list() { |
1193 | 1193 | $states = array( |
1194 | 1194 | '' => '', |
1195 | - 'Distrito Federal' => __( 'Distrito Federal', 'give' ), |
|
1196 | - 'Jalisco' => __( 'Jalisco', 'give' ), |
|
1197 | - 'Nuevo Leon' => __( 'Nuevo León', 'give' ), |
|
1198 | - 'Aguascalientes' => __( 'Aguascalientes', 'give' ), |
|
1199 | - 'Baja California' => __( 'Baja California', 'give' ), |
|
1200 | - 'Baja California Sur' => __( 'Baja California Sur', 'give' ), |
|
1201 | - 'Campeche' => __( 'Campeche', 'give' ), |
|
1202 | - 'Chiapas' => __( 'Chiapas', 'give' ), |
|
1203 | - 'Chihuahua' => __( 'Chihuahua', 'give' ), |
|
1204 | - 'Coahuila' => __( 'Coahuila', 'give' ), |
|
1205 | - 'Colima' => __( 'Colima', 'give' ), |
|
1206 | - 'Durango' => __( 'Durango', 'give' ), |
|
1207 | - 'Guanajuato' => __( 'Guanajuato', 'give' ), |
|
1208 | - 'Guerrero' => __( 'Guerrero', 'give' ), |
|
1209 | - 'Hidalgo' => __( 'Hidalgo', 'give' ), |
|
1210 | - 'Estado de Mexico' => __( 'Edo. de México', 'give' ), |
|
1211 | - 'Michoacan' => __( 'Michoacán', 'give' ), |
|
1212 | - 'Morelos' => __( 'Morelos', 'give' ), |
|
1213 | - 'Nayarit' => __( 'Nayarit', 'give' ), |
|
1214 | - 'Oaxaca' => __( 'Oaxaca', 'give' ), |
|
1215 | - 'Puebla' => __( 'Puebla', 'give' ), |
|
1216 | - 'Queretaro' => __( 'Querétaro', 'give' ), |
|
1217 | - 'Quintana Roo' => __( 'Quintana Roo', 'give' ), |
|
1218 | - 'San Luis Potosi' => __( 'San Luis Potosí', 'give' ), |
|
1219 | - 'Sinaloa' => __( 'Sinaloa', 'give' ), |
|
1220 | - 'Sonora' => __( 'Sonora', 'give' ), |
|
1221 | - 'Tabasco' => __( 'Tabasco', 'give' ), |
|
1222 | - 'Tamaulipas' => __( 'Tamaulipas', 'give' ), |
|
1223 | - 'Tlaxcala' => __( 'Tlaxcala', 'give' ), |
|
1224 | - 'Veracruz' => __( 'Veracruz', 'give' ), |
|
1225 | - 'Yucatan' => __( 'Yucatán', 'give' ), |
|
1226 | - 'Zacatecas' => __( 'Zacatecas', 'give' ), |
|
1195 | + 'Distrito Federal' => __('Distrito Federal', 'give'), |
|
1196 | + 'Jalisco' => __('Jalisco', 'give'), |
|
1197 | + 'Nuevo Leon' => __('Nuevo León', 'give'), |
|
1198 | + 'Aguascalientes' => __('Aguascalientes', 'give'), |
|
1199 | + 'Baja California' => __('Baja California', 'give'), |
|
1200 | + 'Baja California Sur' => __('Baja California Sur', 'give'), |
|
1201 | + 'Campeche' => __('Campeche', 'give'), |
|
1202 | + 'Chiapas' => __('Chiapas', 'give'), |
|
1203 | + 'Chihuahua' => __('Chihuahua', 'give'), |
|
1204 | + 'Coahuila' => __('Coahuila', 'give'), |
|
1205 | + 'Colima' => __('Colima', 'give'), |
|
1206 | + 'Durango' => __('Durango', 'give'), |
|
1207 | + 'Guanajuato' => __('Guanajuato', 'give'), |
|
1208 | + 'Guerrero' => __('Guerrero', 'give'), |
|
1209 | + 'Hidalgo' => __('Hidalgo', 'give'), |
|
1210 | + 'Estado de Mexico' => __('Edo. de México', 'give'), |
|
1211 | + 'Michoacan' => __('Michoacán', 'give'), |
|
1212 | + 'Morelos' => __('Morelos', 'give'), |
|
1213 | + 'Nayarit' => __('Nayarit', 'give'), |
|
1214 | + 'Oaxaca' => __('Oaxaca', 'give'), |
|
1215 | + 'Puebla' => __('Puebla', 'give'), |
|
1216 | + 'Queretaro' => __('Querétaro', 'give'), |
|
1217 | + 'Quintana Roo' => __('Quintana Roo', 'give'), |
|
1218 | + 'San Luis Potosi' => __('San Luis Potosí', 'give'), |
|
1219 | + 'Sinaloa' => __('Sinaloa', 'give'), |
|
1220 | + 'Sonora' => __('Sonora', 'give'), |
|
1221 | + 'Tabasco' => __('Tabasco', 'give'), |
|
1222 | + 'Tamaulipas' => __('Tamaulipas', 'give'), |
|
1223 | + 'Tlaxcala' => __('Tlaxcala', 'give'), |
|
1224 | + 'Veracruz' => __('Veracruz', 'give'), |
|
1225 | + 'Yucatan' => __('Yucatán', 'give'), |
|
1226 | + 'Zacatecas' => __('Zacatecas', 'give'), |
|
1227 | 1227 | ); |
1228 | 1228 | |
1229 | - return apply_filters( 'give_mexico_states', $states ); |
|
1229 | + return apply_filters('give_mexico_states', $states); |
|
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | /** |
@@ -1238,56 +1238,56 @@ discard block |
||
1238 | 1238 | function give_get_japan_states_list() { |
1239 | 1239 | $states = array( |
1240 | 1240 | '' => '', |
1241 | - 'JP01' => __( 'Hokkaido', 'give' ), |
|
1242 | - 'JP02' => __( 'Aomori', 'give' ), |
|
1243 | - 'JP03' => __( 'Iwate', 'give' ), |
|
1244 | - 'JP04' => __( 'Miyagi', 'give' ), |
|
1245 | - 'JP05' => __( 'Akita', 'give' ), |
|
1246 | - 'JP06' => __( 'Yamagata', 'give' ), |
|
1247 | - 'JP07' => __( 'Fukushima', 'give' ), |
|
1248 | - 'JP08' => __( 'Ibaraki', 'give' ), |
|
1249 | - 'JP09' => __( 'Tochigi', 'give' ), |
|
1250 | - 'JP10' => __( 'Gunma', 'give' ), |
|
1251 | - 'JP11' => __( 'Saitama', 'give' ), |
|
1252 | - 'JP12' => __( 'Chiba', 'give' ), |
|
1253 | - 'JP13' => __( 'Tokyo', 'give' ), |
|
1254 | - 'JP14' => __( 'Kanagawa', 'give' ), |
|
1255 | - 'JP15' => __( 'Niigata', 'give' ), |
|
1256 | - 'JP16' => __( 'Toyama', 'give' ), |
|
1257 | - 'JP17' => __( 'Ishikawa', 'give' ), |
|
1258 | - 'JP18' => __( 'Fukui', 'give' ), |
|
1259 | - 'JP19' => __( 'Yamanashi', 'give' ), |
|
1260 | - 'JP20' => __( 'Nagano', 'give' ), |
|
1261 | - 'JP21' => __( 'Gifu', 'give' ), |
|
1262 | - 'JP22' => __( 'Shizuoka', 'give' ), |
|
1263 | - 'JP23' => __( 'Aichi', 'give' ), |
|
1264 | - 'JP24' => __( 'Mie', 'give' ), |
|
1265 | - 'JP25' => __( 'Shiga', 'give' ), |
|
1266 | - 'JP26' => __( 'Kyoto', 'give' ), |
|
1267 | - 'JP27' => __( 'Osaka', 'give' ), |
|
1268 | - 'JP28' => __( 'Hyogo', 'give' ), |
|
1269 | - 'JP29' => __( 'Nara', 'give' ), |
|
1270 | - 'JP30' => __( 'Wakayama', 'give' ), |
|
1271 | - 'JP31' => __( 'Tottori', 'give' ), |
|
1272 | - 'JP32' => __( 'Shimane', 'give' ), |
|
1273 | - 'JP33' => __( 'Okayama', 'give' ), |
|
1274 | - 'JP34' => __( 'Hiroshima', 'give' ), |
|
1275 | - 'JP35' => __( 'Yamaguchi', 'give' ), |
|
1276 | - 'JP36' => __( 'Tokushima', 'give' ), |
|
1277 | - 'JP37' => __( 'Kagawa', 'give' ), |
|
1278 | - 'JP38' => __( 'Ehime', 'give' ), |
|
1279 | - 'JP39' => __( 'Kochi', 'give' ), |
|
1280 | - 'JP40' => __( 'Fukuoka', 'give' ), |
|
1281 | - 'JP41' => __( 'Saga', 'give' ), |
|
1282 | - 'JP42' => __( 'Nagasaki', 'give' ), |
|
1283 | - 'JP43' => __( 'Kumamoto', 'give' ), |
|
1284 | - 'JP44' => __( 'Oita', 'give' ), |
|
1285 | - 'JP45' => __( 'Miyazaki', 'give' ), |
|
1286 | - 'JP46' => __( 'Kagoshima', 'give' ), |
|
1287 | - 'JP47' => __( 'Okinawa', 'give' ), |
|
1241 | + 'JP01' => __('Hokkaido', 'give'), |
|
1242 | + 'JP02' => __('Aomori', 'give'), |
|
1243 | + 'JP03' => __('Iwate', 'give'), |
|
1244 | + 'JP04' => __('Miyagi', 'give'), |
|
1245 | + 'JP05' => __('Akita', 'give'), |
|
1246 | + 'JP06' => __('Yamagata', 'give'), |
|
1247 | + 'JP07' => __('Fukushima', 'give'), |
|
1248 | + 'JP08' => __('Ibaraki', 'give'), |
|
1249 | + 'JP09' => __('Tochigi', 'give'), |
|
1250 | + 'JP10' => __('Gunma', 'give'), |
|
1251 | + 'JP11' => __('Saitama', 'give'), |
|
1252 | + 'JP12' => __('Chiba', 'give'), |
|
1253 | + 'JP13' => __('Tokyo', 'give'), |
|
1254 | + 'JP14' => __('Kanagawa', 'give'), |
|
1255 | + 'JP15' => __('Niigata', 'give'), |
|
1256 | + 'JP16' => __('Toyama', 'give'), |
|
1257 | + 'JP17' => __('Ishikawa', 'give'), |
|
1258 | + 'JP18' => __('Fukui', 'give'), |
|
1259 | + 'JP19' => __('Yamanashi', 'give'), |
|
1260 | + 'JP20' => __('Nagano', 'give'), |
|
1261 | + 'JP21' => __('Gifu', 'give'), |
|
1262 | + 'JP22' => __('Shizuoka', 'give'), |
|
1263 | + 'JP23' => __('Aichi', 'give'), |
|
1264 | + 'JP24' => __('Mie', 'give'), |
|
1265 | + 'JP25' => __('Shiga', 'give'), |
|
1266 | + 'JP26' => __('Kyoto', 'give'), |
|
1267 | + 'JP27' => __('Osaka', 'give'), |
|
1268 | + 'JP28' => __('Hyogo', 'give'), |
|
1269 | + 'JP29' => __('Nara', 'give'), |
|
1270 | + 'JP30' => __('Wakayama', 'give'), |
|
1271 | + 'JP31' => __('Tottori', 'give'), |
|
1272 | + 'JP32' => __('Shimane', 'give'), |
|
1273 | + 'JP33' => __('Okayama', 'give'), |
|
1274 | + 'JP34' => __('Hiroshima', 'give'), |
|
1275 | + 'JP35' => __('Yamaguchi', 'give'), |
|
1276 | + 'JP36' => __('Tokushima', 'give'), |
|
1277 | + 'JP37' => __('Kagawa', 'give'), |
|
1278 | + 'JP38' => __('Ehime', 'give'), |
|
1279 | + 'JP39' => __('Kochi', 'give'), |
|
1280 | + 'JP40' => __('Fukuoka', 'give'), |
|
1281 | + 'JP41' => __('Saga', 'give'), |
|
1282 | + 'JP42' => __('Nagasaki', 'give'), |
|
1283 | + 'JP43' => __('Kumamoto', 'give'), |
|
1284 | + 'JP44' => __('Oita', 'give'), |
|
1285 | + 'JP45' => __('Miyazaki', 'give'), |
|
1286 | + 'JP46' => __('Kagoshima', 'give'), |
|
1287 | + 'JP47' => __('Okinawa', 'give'), |
|
1288 | 1288 | ); |
1289 | 1289 | |
1290 | - return apply_filters( 'give_japan_states', $states ); |
|
1290 | + return apply_filters('give_japan_states', $states); |
|
1291 | 1291 | } |
1292 | 1292 | |
1293 | 1293 | /** |
@@ -1299,119 +1299,119 @@ discard block |
||
1299 | 1299 | function give_get_italy_states_list() { |
1300 | 1300 | $states = array( |
1301 | 1301 | '' => '', |
1302 | - 'AG' => __( 'Agrigento', 'give' ), |
|
1303 | - 'AL' => __( 'Alessandria', 'give' ), |
|
1304 | - 'AN' => __( 'Ancona', 'give' ), |
|
1305 | - 'AO' => __( 'Aosta', 'give' ), |
|
1306 | - 'AR' => __( 'Arezzo', 'give' ), |
|
1307 | - 'AP' => __( 'Ascoli Piceno', 'give' ), |
|
1308 | - 'AT' => __( 'Asti', 'give' ), |
|
1309 | - 'AV' => __( 'Avellino', 'give' ), |
|
1310 | - 'BA' => __( 'Bari', 'give' ), |
|
1311 | - 'BT' => __( 'Barletta-Andria-Trani', 'give' ), |
|
1312 | - 'BL' => __( 'Belluno', 'give' ), |
|
1313 | - 'BN' => __( 'Benevento', 'give' ), |
|
1314 | - 'BG' => __( 'Bergamo', 'give' ), |
|
1315 | - 'BI' => __( 'Biella', 'give' ), |
|
1316 | - 'BO' => __( 'Bologna', 'give' ), |
|
1317 | - 'BZ' => __( 'Bolzano', 'give' ), |
|
1318 | - 'BS' => __( 'Brescia', 'give' ), |
|
1319 | - 'BR' => __( 'Brindisi', 'give' ), |
|
1320 | - 'CA' => __( 'Cagliari', 'give' ), |
|
1321 | - 'CL' => __( 'Caltanissetta', 'give' ), |
|
1322 | - 'CB' => __( 'Campobasso', 'give' ), |
|
1323 | - 'CI' => __( 'Carbonia-Iglesias', 'give' ), |
|
1324 | - 'CE' => __( 'Caserta', 'give' ), |
|
1325 | - 'CT' => __( 'Catania', 'give' ), |
|
1326 | - 'CZ' => __( 'Catanzaro', 'give' ), |
|
1327 | - 'CH' => __( 'Chieti', 'give' ), |
|
1328 | - 'CO' => __( 'Como', 'give' ), |
|
1329 | - 'CS' => __( 'Cosenza', 'give' ), |
|
1330 | - 'CR' => __( 'Cremona', 'give' ), |
|
1331 | - 'KR' => __( 'Crotone', 'give' ), |
|
1332 | - 'CN' => __( 'Cuneo', 'give' ), |
|
1333 | - 'EN' => __( 'Enna', 'give' ), |
|
1334 | - 'FM' => __( 'Fermo', 'give' ), |
|
1335 | - 'FE' => __( 'Ferrara', 'give' ), |
|
1336 | - 'FI' => __( 'Firenze', 'give' ), |
|
1337 | - 'FG' => __( 'Foggia', 'give' ), |
|
1338 | - 'FC' => __( 'Forlì-Cesena', 'give' ), |
|
1339 | - 'FR' => __( 'Frosinone', 'give' ), |
|
1340 | - 'GE' => __( 'Genova', 'give' ), |
|
1341 | - 'GO' => __( 'Gorizia', 'give' ), |
|
1342 | - 'GR' => __( 'Grosseto', 'give' ), |
|
1343 | - 'IM' => __( 'Imperia', 'give' ), |
|
1344 | - 'IS' => __( 'Isernia', 'give' ), |
|
1345 | - 'SP' => __( 'La Spezia', 'give' ), |
|
1346 | - 'AQ' => __( "L'Aquila", 'give' ), |
|
1347 | - 'LT' => __( 'Latina', 'give' ), |
|
1348 | - 'LE' => __( 'Lecce', 'give' ), |
|
1349 | - 'LC' => __( 'Lecco', 'give' ), |
|
1350 | - 'LI' => __( 'Livorno', 'give' ), |
|
1351 | - 'LO' => __( 'Lodi', 'give' ), |
|
1352 | - 'LU' => __( 'Lucca', 'give' ), |
|
1353 | - 'MC' => __( 'Macerata', 'give' ), |
|
1354 | - 'MN' => __( 'Mantova', 'give' ), |
|
1355 | - 'MS' => __( 'Massa-Carrara', 'give' ), |
|
1356 | - 'MT' => __( 'Matera', 'give' ), |
|
1357 | - 'ME' => __( 'Messina', 'give' ), |
|
1358 | - 'MI' => __( 'Milano', 'give' ), |
|
1359 | - 'MO' => __( 'Modena', 'give' ), |
|
1360 | - 'MB' => __( 'Monza e della Brianza', 'give' ), |
|
1361 | - 'NA' => __( 'Napoli', 'give' ), |
|
1362 | - 'NO' => __( 'Novara', 'give' ), |
|
1363 | - 'NU' => __( 'Nuoro', 'give' ), |
|
1364 | - 'OT' => __( 'Olbia-Tempio', 'give' ), |
|
1365 | - 'OR' => __( 'Oristano', 'give' ), |
|
1366 | - 'PD' => __( 'Padova', 'give' ), |
|
1367 | - 'PA' => __( 'Palermo', 'give' ), |
|
1368 | - 'PR' => __( 'Parma', 'give' ), |
|
1369 | - 'PV' => __( 'Pavia', 'give' ), |
|
1370 | - 'PG' => __( 'Perugia', 'give' ), |
|
1371 | - 'PU' => __( 'Pesaro e Urbino', 'give' ), |
|
1372 | - 'PE' => __( 'Pescara', 'give' ), |
|
1373 | - 'PC' => __( 'Piacenza', 'give' ), |
|
1374 | - 'PI' => __( 'Pisa', 'give' ), |
|
1375 | - 'PT' => __( 'Pistoia', 'give' ), |
|
1376 | - 'PN' => __( 'Pordenone', 'give' ), |
|
1377 | - 'PZ' => __( 'Potenza', 'give' ), |
|
1378 | - 'PO' => __( 'Prato', 'give' ), |
|
1379 | - 'RG' => __( 'Ragusa', 'give' ), |
|
1380 | - 'RA' => __( 'Ravenna', 'give' ), |
|
1381 | - 'RC' => __( 'Reggio Calabria', 'give' ), |
|
1382 | - 'RE' => __( 'Reggio Emilia', 'give' ), |
|
1383 | - 'RI' => __( 'Rieti', 'give' ), |
|
1384 | - 'RN' => __( 'Rimini', 'give' ), |
|
1385 | - 'RM' => __( 'Roma', 'give' ), |
|
1386 | - 'RO' => __( 'Rovigo', 'give' ), |
|
1387 | - 'SA' => __( 'Salerno', 'give' ), |
|
1388 | - 'VS' => __( 'Medio Campidano', 'give' ), |
|
1389 | - 'SS' => __( 'Sassari', 'give' ), |
|
1390 | - 'SV' => __( 'Savona', 'give' ), |
|
1391 | - 'SI' => __( 'Siena', 'give' ), |
|
1392 | - 'SR' => __( 'Siracusa', 'give' ), |
|
1393 | - 'SO' => __( 'Sondrio', 'give' ), |
|
1394 | - 'TA' => __( 'Taranto', 'give' ), |
|
1395 | - 'TE' => __( 'Teramo', 'give' ), |
|
1396 | - 'TR' => __( 'Terni', 'give' ), |
|
1397 | - 'TO' => __( 'Torino', 'give' ), |
|
1398 | - 'OG' => __( 'Ogliastra', 'give' ), |
|
1399 | - 'TP' => __( 'Trapani', 'give' ), |
|
1400 | - 'TN' => __( 'Trento', 'give' ), |
|
1401 | - 'TV' => __( 'Treviso', 'give' ), |
|
1402 | - 'TS' => __( 'Trieste', 'give' ), |
|
1403 | - 'UD' => __( 'Udine', 'give' ), |
|
1404 | - 'VA' => __( 'Varese', 'give' ), |
|
1405 | - 'VE' => __( 'Venezia', 'give' ), |
|
1406 | - 'VB' => __( 'Verbano-Cusio-Ossola', 'give' ), |
|
1407 | - 'VC' => __( 'Vercelli', 'give' ), |
|
1408 | - 'VR' => __( 'Verona', 'give' ), |
|
1409 | - 'VV' => __( 'Vibo Valentia', 'give' ), |
|
1410 | - 'VI' => __( 'Vicenza', 'give' ), |
|
1411 | - 'VT' => __( 'Viterbo', 'give' ), |
|
1302 | + 'AG' => __('Agrigento', 'give'), |
|
1303 | + 'AL' => __('Alessandria', 'give'), |
|
1304 | + 'AN' => __('Ancona', 'give'), |
|
1305 | + 'AO' => __('Aosta', 'give'), |
|
1306 | + 'AR' => __('Arezzo', 'give'), |
|
1307 | + 'AP' => __('Ascoli Piceno', 'give'), |
|
1308 | + 'AT' => __('Asti', 'give'), |
|
1309 | + 'AV' => __('Avellino', 'give'), |
|
1310 | + 'BA' => __('Bari', 'give'), |
|
1311 | + 'BT' => __('Barletta-Andria-Trani', 'give'), |
|
1312 | + 'BL' => __('Belluno', 'give'), |
|
1313 | + 'BN' => __('Benevento', 'give'), |
|
1314 | + 'BG' => __('Bergamo', 'give'), |
|
1315 | + 'BI' => __('Biella', 'give'), |
|
1316 | + 'BO' => __('Bologna', 'give'), |
|
1317 | + 'BZ' => __('Bolzano', 'give'), |
|
1318 | + 'BS' => __('Brescia', 'give'), |
|
1319 | + 'BR' => __('Brindisi', 'give'), |
|
1320 | + 'CA' => __('Cagliari', 'give'), |
|
1321 | + 'CL' => __('Caltanissetta', 'give'), |
|
1322 | + 'CB' => __('Campobasso', 'give'), |
|
1323 | + 'CI' => __('Carbonia-Iglesias', 'give'), |
|
1324 | + 'CE' => __('Caserta', 'give'), |
|
1325 | + 'CT' => __('Catania', 'give'), |
|
1326 | + 'CZ' => __('Catanzaro', 'give'), |
|
1327 | + 'CH' => __('Chieti', 'give'), |
|
1328 | + 'CO' => __('Como', 'give'), |
|
1329 | + 'CS' => __('Cosenza', 'give'), |
|
1330 | + 'CR' => __('Cremona', 'give'), |
|
1331 | + 'KR' => __('Crotone', 'give'), |
|
1332 | + 'CN' => __('Cuneo', 'give'), |
|
1333 | + 'EN' => __('Enna', 'give'), |
|
1334 | + 'FM' => __('Fermo', 'give'), |
|
1335 | + 'FE' => __('Ferrara', 'give'), |
|
1336 | + 'FI' => __('Firenze', 'give'), |
|
1337 | + 'FG' => __('Foggia', 'give'), |
|
1338 | + 'FC' => __('Forlì-Cesena', 'give'), |
|
1339 | + 'FR' => __('Frosinone', 'give'), |
|
1340 | + 'GE' => __('Genova', 'give'), |
|
1341 | + 'GO' => __('Gorizia', 'give'), |
|
1342 | + 'GR' => __('Grosseto', 'give'), |
|
1343 | + 'IM' => __('Imperia', 'give'), |
|
1344 | + 'IS' => __('Isernia', 'give'), |
|
1345 | + 'SP' => __('La Spezia', 'give'), |
|
1346 | + 'AQ' => __("L'Aquila", 'give'), |
|
1347 | + 'LT' => __('Latina', 'give'), |
|
1348 | + 'LE' => __('Lecce', 'give'), |
|
1349 | + 'LC' => __('Lecco', 'give'), |
|
1350 | + 'LI' => __('Livorno', 'give'), |
|
1351 | + 'LO' => __('Lodi', 'give'), |
|
1352 | + 'LU' => __('Lucca', 'give'), |
|
1353 | + 'MC' => __('Macerata', 'give'), |
|
1354 | + 'MN' => __('Mantova', 'give'), |
|
1355 | + 'MS' => __('Massa-Carrara', 'give'), |
|
1356 | + 'MT' => __('Matera', 'give'), |
|
1357 | + 'ME' => __('Messina', 'give'), |
|
1358 | + 'MI' => __('Milano', 'give'), |
|
1359 | + 'MO' => __('Modena', 'give'), |
|
1360 | + 'MB' => __('Monza e della Brianza', 'give'), |
|
1361 | + 'NA' => __('Napoli', 'give'), |
|
1362 | + 'NO' => __('Novara', 'give'), |
|
1363 | + 'NU' => __('Nuoro', 'give'), |
|
1364 | + 'OT' => __('Olbia-Tempio', 'give'), |
|
1365 | + 'OR' => __('Oristano', 'give'), |
|
1366 | + 'PD' => __('Padova', 'give'), |
|
1367 | + 'PA' => __('Palermo', 'give'), |
|
1368 | + 'PR' => __('Parma', 'give'), |
|
1369 | + 'PV' => __('Pavia', 'give'), |
|
1370 | + 'PG' => __('Perugia', 'give'), |
|
1371 | + 'PU' => __('Pesaro e Urbino', 'give'), |
|
1372 | + 'PE' => __('Pescara', 'give'), |
|
1373 | + 'PC' => __('Piacenza', 'give'), |
|
1374 | + 'PI' => __('Pisa', 'give'), |
|
1375 | + 'PT' => __('Pistoia', 'give'), |
|
1376 | + 'PN' => __('Pordenone', 'give'), |
|
1377 | + 'PZ' => __('Potenza', 'give'), |
|
1378 | + 'PO' => __('Prato', 'give'), |
|
1379 | + 'RG' => __('Ragusa', 'give'), |
|
1380 | + 'RA' => __('Ravenna', 'give'), |
|
1381 | + 'RC' => __('Reggio Calabria', 'give'), |
|
1382 | + 'RE' => __('Reggio Emilia', 'give'), |
|
1383 | + 'RI' => __('Rieti', 'give'), |
|
1384 | + 'RN' => __('Rimini', 'give'), |
|
1385 | + 'RM' => __('Roma', 'give'), |
|
1386 | + 'RO' => __('Rovigo', 'give'), |
|
1387 | + 'SA' => __('Salerno', 'give'), |
|
1388 | + 'VS' => __('Medio Campidano', 'give'), |
|
1389 | + 'SS' => __('Sassari', 'give'), |
|
1390 | + 'SV' => __('Savona', 'give'), |
|
1391 | + 'SI' => __('Siena', 'give'), |
|
1392 | + 'SR' => __('Siracusa', 'give'), |
|
1393 | + 'SO' => __('Sondrio', 'give'), |
|
1394 | + 'TA' => __('Taranto', 'give'), |
|
1395 | + 'TE' => __('Teramo', 'give'), |
|
1396 | + 'TR' => __('Terni', 'give'), |
|
1397 | + 'TO' => __('Torino', 'give'), |
|
1398 | + 'OG' => __('Ogliastra', 'give'), |
|
1399 | + 'TP' => __('Trapani', 'give'), |
|
1400 | + 'TN' => __('Trento', 'give'), |
|
1401 | + 'TV' => __('Treviso', 'give'), |
|
1402 | + 'TS' => __('Trieste', 'give'), |
|
1403 | + 'UD' => __('Udine', 'give'), |
|
1404 | + 'VA' => __('Varese', 'give'), |
|
1405 | + 'VE' => __('Venezia', 'give'), |
|
1406 | + 'VB' => __('Verbano-Cusio-Ossola', 'give'), |
|
1407 | + 'VC' => __('Vercelli', 'give'), |
|
1408 | + 'VR' => __('Verona', 'give'), |
|
1409 | + 'VV' => __('Vibo Valentia', 'give'), |
|
1410 | + 'VI' => __('Vicenza', 'give'), |
|
1411 | + 'VT' => __('Viterbo', 'give'), |
|
1412 | 1412 | ); |
1413 | 1413 | |
1414 | - return apply_filters( 'give_italy_states', $states ); |
|
1414 | + return apply_filters('give_italy_states', $states); |
|
1415 | 1415 | } |
1416 | 1416 | |
1417 | 1417 | /** |
@@ -1423,40 +1423,40 @@ discard block |
||
1423 | 1423 | function give_get_iran_states_list() { |
1424 | 1424 | $states = array( |
1425 | 1425 | '' => '', |
1426 | - 'KHZ' => __( 'Khuzestan (خوزستان)', 'give' ), |
|
1427 | - 'THR' => __( 'Tehran (تهران)', 'give' ), |
|
1428 | - 'ILM' => __( 'Ilaam (ایلام)', 'give' ), |
|
1429 | - 'BHR' => __( 'Bushehr (بوشهر)', 'give' ), |
|
1430 | - 'ADL' => __( 'Ardabil (اردبیل)', 'give' ), |
|
1431 | - 'ESF' => __( 'Isfahan (اصفهان)', 'give' ), |
|
1432 | - 'YZD' => __( 'Yazd (یزد)', 'give' ), |
|
1433 | - 'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ), |
|
1434 | - 'KRN' => __( 'Kerman (کرمان)', 'give' ), |
|
1435 | - 'HDN' => __( 'Hamadan (همدان)', 'give' ), |
|
1436 | - 'GZN' => __( 'Ghazvin (قزوین)', 'give' ), |
|
1437 | - 'ZJN' => __( 'Zanjan (زنجان)', 'give' ), |
|
1438 | - 'LRS' => __( 'Luristan (لرستان)', 'give' ), |
|
1439 | - 'ABZ' => __( 'Alborz (البرز)', 'give' ), |
|
1440 | - 'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ), |
|
1441 | - 'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ), |
|
1442 | - 'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ), |
|
1443 | - 'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ), |
|
1444 | - 'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ), |
|
1445 | - 'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ), |
|
1446 | - 'SMN' => __( 'Semnan (سمنان)', 'give' ), |
|
1447 | - 'FRS' => __( 'Fars (فارس)', 'give' ), |
|
1448 | - 'QHM' => __( 'Qom (قم)', 'give' ), |
|
1449 | - 'KRD' => __( 'Kurdistan / کردستان)', 'give' ), |
|
1450 | - 'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ), |
|
1451 | - 'GLS' => __( 'Golestan (گلستان)', 'give' ), |
|
1452 | - 'GIL' => __( 'Gilan (گیلان)', 'give' ), |
|
1453 | - 'MZN' => __( 'Mazandaran (مازندران)', 'give' ), |
|
1454 | - 'MKZ' => __( 'Markazi (مرکزی)', 'give' ), |
|
1455 | - 'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ), |
|
1456 | - 'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ), |
|
1426 | + 'KHZ' => __('Khuzestan (خوزستان)', 'give'), |
|
1427 | + 'THR' => __('Tehran (تهران)', 'give'), |
|
1428 | + 'ILM' => __('Ilaam (ایلام)', 'give'), |
|
1429 | + 'BHR' => __('Bushehr (بوشهر)', 'give'), |
|
1430 | + 'ADL' => __('Ardabil (اردبیل)', 'give'), |
|
1431 | + 'ESF' => __('Isfahan (اصفهان)', 'give'), |
|
1432 | + 'YZD' => __('Yazd (یزد)', 'give'), |
|
1433 | + 'KRH' => __('Kermanshah (کرمانشاه)', 'give'), |
|
1434 | + 'KRN' => __('Kerman (کرمان)', 'give'), |
|
1435 | + 'HDN' => __('Hamadan (همدان)', 'give'), |
|
1436 | + 'GZN' => __('Ghazvin (قزوین)', 'give'), |
|
1437 | + 'ZJN' => __('Zanjan (زنجان)', 'give'), |
|
1438 | + 'LRS' => __('Luristan (لرستان)', 'give'), |
|
1439 | + 'ABZ' => __('Alborz (البرز)', 'give'), |
|
1440 | + 'EAZ' => __('East Azarbaijan (آذربایجان شرقی)', 'give'), |
|
1441 | + 'WAZ' => __('West Azarbaijan (آذربایجان غربی)', 'give'), |
|
1442 | + 'CHB' => __('Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give'), |
|
1443 | + 'SKH' => __('South Khorasan (خراسان جنوبی)', 'give'), |
|
1444 | + 'RKH' => __('Razavi Khorasan (خراسان رضوی)', 'give'), |
|
1445 | + 'NKH' => __('North Khorasan (خراسان جنوبی)', 'give'), |
|
1446 | + 'SMN' => __('Semnan (سمنان)', 'give'), |
|
1447 | + 'FRS' => __('Fars (فارس)', 'give'), |
|
1448 | + 'QHM' => __('Qom (قم)', 'give'), |
|
1449 | + 'KRD' => __('Kurdistan / کردستان)', 'give'), |
|
1450 | + 'KBD' => __('Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give'), |
|
1451 | + 'GLS' => __('Golestan (گلستان)', 'give'), |
|
1452 | + 'GIL' => __('Gilan (گیلان)', 'give'), |
|
1453 | + 'MZN' => __('Mazandaran (مازندران)', 'give'), |
|
1454 | + 'MKZ' => __('Markazi (مرکزی)', 'give'), |
|
1455 | + 'HRZ' => __('Hormozgan (هرمزگان)', 'give'), |
|
1456 | + 'SBN' => __('Sistan and Baluchestan (سیستان و بلوچستان)', 'give'), |
|
1457 | 1457 | ); |
1458 | 1458 | |
1459 | - return apply_filters( 'give_iran_states', $states ); |
|
1459 | + return apply_filters('give_iran_states', $states); |
|
1460 | 1460 | } |
1461 | 1461 | |
1462 | 1462 | /** |
@@ -1468,35 +1468,35 @@ discard block |
||
1468 | 1468 | function give_get_ireland_states_list() { |
1469 | 1469 | $states = array( |
1470 | 1470 | '' => '', |
1471 | - 'CE' => __( 'Clare', 'give' ), |
|
1472 | - 'CK' => __( 'Cork', 'give' ), |
|
1473 | - 'CN' => __( 'Cavan', 'give' ), |
|
1474 | - 'CW' => __( 'Carlow', 'give' ), |
|
1475 | - 'DL' => __( 'Donegal', 'give' ), |
|
1476 | - 'DN' => __( 'Dublin', 'give' ), |
|
1477 | - 'GY' => __( 'Galway', 'give' ), |
|
1478 | - 'KE' => __( 'Kildare', 'give' ), |
|
1479 | - 'KK' => __( 'Kilkenny', 'give' ), |
|
1480 | - 'KY' => __( 'Kerry', 'give' ), |
|
1481 | - 'LD' => __( 'Longford', 'give' ), |
|
1482 | - 'LH' => __( 'Louth', 'give' ), |
|
1483 | - 'LK' => __( 'Limerick', 'give' ), |
|
1484 | - 'LM' => __( 'Leitrim', 'give' ), |
|
1485 | - 'LS' => __( 'Laois', 'give' ), |
|
1486 | - 'MH' => __( 'Meath', 'give' ), |
|
1487 | - 'MN' => __( 'Monaghan', 'give' ), |
|
1488 | - 'MO' => __( 'Mayo', 'give' ), |
|
1489 | - 'OY' => __( 'Offaly', 'give' ), |
|
1490 | - 'RN' => __( 'Roscommon', 'give' ), |
|
1491 | - 'SO' => __( 'Sligo', 'give' ), |
|
1492 | - 'TY' => __( 'Tipperary', 'give' ), |
|
1493 | - 'WD' => __( 'Waterford', 'give' ), |
|
1494 | - 'WH' => __( 'Westmeath', 'give' ), |
|
1495 | - 'WW' => __( 'Wicklow', 'give' ), |
|
1496 | - 'WX' => __( 'Wexford', 'give' ), |
|
1471 | + 'CE' => __('Clare', 'give'), |
|
1472 | + 'CK' => __('Cork', 'give'), |
|
1473 | + 'CN' => __('Cavan', 'give'), |
|
1474 | + 'CW' => __('Carlow', 'give'), |
|
1475 | + 'DL' => __('Donegal', 'give'), |
|
1476 | + 'DN' => __('Dublin', 'give'), |
|
1477 | + 'GY' => __('Galway', 'give'), |
|
1478 | + 'KE' => __('Kildare', 'give'), |
|
1479 | + 'KK' => __('Kilkenny', 'give'), |
|
1480 | + 'KY' => __('Kerry', 'give'), |
|
1481 | + 'LD' => __('Longford', 'give'), |
|
1482 | + 'LH' => __('Louth', 'give'), |
|
1483 | + 'LK' => __('Limerick', 'give'), |
|
1484 | + 'LM' => __('Leitrim', 'give'), |
|
1485 | + 'LS' => __('Laois', 'give'), |
|
1486 | + 'MH' => __('Meath', 'give'), |
|
1487 | + 'MN' => __('Monaghan', 'give'), |
|
1488 | + 'MO' => __('Mayo', 'give'), |
|
1489 | + 'OY' => __('Offaly', 'give'), |
|
1490 | + 'RN' => __('Roscommon', 'give'), |
|
1491 | + 'SO' => __('Sligo', 'give'), |
|
1492 | + 'TY' => __('Tipperary', 'give'), |
|
1493 | + 'WD' => __('Waterford', 'give'), |
|
1494 | + 'WH' => __('Westmeath', 'give'), |
|
1495 | + 'WW' => __('Wicklow', 'give'), |
|
1496 | + 'WX' => __('Wexford', 'give'), |
|
1497 | 1497 | ); |
1498 | 1498 | |
1499 | - return apply_filters( 'give_ireland_states', $states ); |
|
1499 | + return apply_filters('give_ireland_states', $states); |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | /** |
@@ -1508,22 +1508,22 @@ discard block |
||
1508 | 1508 | function give_get_greek_states_list() { |
1509 | 1509 | $states = array( |
1510 | 1510 | '' => '', |
1511 | - 'I' => __( 'Αττική', 'give' ), |
|
1512 | - 'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ), |
|
1513 | - 'B' => __( 'Κεντρική Μακεδονία', 'give' ), |
|
1514 | - 'C' => __( 'Δυτική Μακεδονία', 'give' ), |
|
1515 | - 'D' => __( 'Ήπειρος', 'give' ), |
|
1516 | - 'E' => __( 'Θεσσαλία', 'give' ), |
|
1517 | - 'F' => __( 'Ιόνιοι Νήσοι', 'give' ), |
|
1518 | - 'G' => __( 'Δυτική Ελλάδα', 'give' ), |
|
1519 | - 'H' => __( 'Στερεά Ελλάδα', 'give' ), |
|
1520 | - 'J' => __( 'Πελοπόννησος', 'give' ), |
|
1521 | - 'K' => __( 'Βόρειο Αιγαίο', 'give' ), |
|
1522 | - 'L' => __( 'Νότιο Αιγαίο', 'give' ), |
|
1523 | - 'M' => __( 'Κρήτη', 'give' ), |
|
1511 | + 'I' => __('Αττική', 'give'), |
|
1512 | + 'A' => __('Ανατολική Μακεδονία και Θράκη', 'give'), |
|
1513 | + 'B' => __('Κεντρική Μακεδονία', 'give'), |
|
1514 | + 'C' => __('Δυτική Μακεδονία', 'give'), |
|
1515 | + 'D' => __('Ήπειρος', 'give'), |
|
1516 | + 'E' => __('Θεσσαλία', 'give'), |
|
1517 | + 'F' => __('Ιόνιοι Νήσοι', 'give'), |
|
1518 | + 'G' => __('Δυτική Ελλάδα', 'give'), |
|
1519 | + 'H' => __('Στερεά Ελλάδα', 'give'), |
|
1520 | + 'J' => __('Πελοπόννησος', 'give'), |
|
1521 | + 'K' => __('Βόρειο Αιγαίο', 'give'), |
|
1522 | + 'L' => __('Νότιο Αιγαίο', 'give'), |
|
1523 | + 'M' => __('Κρήτη', 'give'), |
|
1524 | 1524 | ); |
1525 | 1525 | |
1526 | - return apply_filters( 'give_greek_states', $states ); |
|
1526 | + return apply_filters('give_greek_states', $states); |
|
1527 | 1527 | } |
1528 | 1528 | |
1529 | 1529 | /** |
@@ -1535,18 +1535,18 @@ discard block |
||
1535 | 1535 | function give_get_bolivian_states_list() { |
1536 | 1536 | $states = array( |
1537 | 1537 | '' => '', |
1538 | - 'B' => __( 'Chuquisaca', 'give' ), |
|
1539 | - 'H' => __( 'Beni', 'give' ), |
|
1540 | - 'C' => __( 'Cochabamba', 'give' ), |
|
1541 | - 'L' => __( 'La Paz', 'give' ), |
|
1542 | - 'O' => __( 'Oruro', 'give' ), |
|
1543 | - 'N' => __( 'Pando', 'give' ), |
|
1544 | - 'P' => __( 'Potosí', 'give' ), |
|
1545 | - 'S' => __( 'Santa Cruz', 'give' ), |
|
1546 | - 'T' => __( 'Tarija', 'give' ), |
|
1538 | + 'B' => __('Chuquisaca', 'give'), |
|
1539 | + 'H' => __('Beni', 'give'), |
|
1540 | + 'C' => __('Cochabamba', 'give'), |
|
1541 | + 'L' => __('La Paz', 'give'), |
|
1542 | + 'O' => __('Oruro', 'give'), |
|
1543 | + 'N' => __('Pando', 'give'), |
|
1544 | + 'P' => __('Potosí', 'give'), |
|
1545 | + 'S' => __('Santa Cruz', 'give'), |
|
1546 | + 'T' => __('Tarija', 'give'), |
|
1547 | 1547 | ); |
1548 | 1548 | |
1549 | - return apply_filters( 'give_bolivian_states', $states ); |
|
1549 | + return apply_filters('give_bolivian_states', $states); |
|
1550 | 1550 | } |
1551 | 1551 | |
1552 | 1552 | /** |
@@ -1558,37 +1558,37 @@ discard block |
||
1558 | 1558 | function give_get_bulgarian_states_list() { |
1559 | 1559 | $states = array( |
1560 | 1560 | '' => '', |
1561 | - 'BG-01' => __( 'Blagoevgrad', 'give' ), |
|
1562 | - 'BG-02' => __( 'Burgas', 'give' ), |
|
1563 | - 'BG-08' => __( 'Dobrich', 'give' ), |
|
1564 | - 'BG-07' => __( 'Gabrovo', 'give' ), |
|
1565 | - 'BG-26' => __( 'Haskovo', 'give' ), |
|
1566 | - 'BG-09' => __( 'Kardzhali', 'give' ), |
|
1567 | - 'BG-10' => __( 'Kyustendil', 'give' ), |
|
1568 | - 'BG-11' => __( 'Lovech', 'give' ), |
|
1569 | - 'BG-12' => __( 'Montana', 'give' ), |
|
1570 | - 'BG-13' => __( 'Pazardzhik', 'give' ), |
|
1571 | - 'BG-14' => __( 'Pernik', 'give' ), |
|
1572 | - 'BG-15' => __( 'Pleven', 'give' ), |
|
1573 | - 'BG-16' => __( 'Plovdiv', 'give' ), |
|
1574 | - 'BG-17' => __( 'Razgrad', 'give' ), |
|
1575 | - 'BG-18' => __( 'Ruse', 'give' ), |
|
1576 | - 'BG-27' => __( 'Shumen', 'give' ), |
|
1577 | - 'BG-19' => __( 'Silistra', 'give' ), |
|
1578 | - 'BG-20' => __( 'Sliven', 'give' ), |
|
1579 | - 'BG-21' => __( 'Smolyan', 'give' ), |
|
1580 | - 'BG-23' => __( 'Sofia', 'give' ), |
|
1581 | - 'BG-22' => __( 'Sofia-Grad', 'give' ), |
|
1582 | - 'BG-24' => __( 'Stara Zagora', 'give' ), |
|
1583 | - 'BG-25' => __( 'Targovishte', 'give' ), |
|
1584 | - 'BG-03' => __( 'Varna', 'give' ), |
|
1585 | - 'BG-04' => __( 'Veliko Tarnovo', 'give' ), |
|
1586 | - 'BG-05' => __( 'Vidin', 'give' ), |
|
1587 | - 'BG-06' => __( 'Vratsa', 'give' ), |
|
1588 | - 'BG-28' => __( 'Yambol', 'give' ), |
|
1561 | + 'BG-01' => __('Blagoevgrad', 'give'), |
|
1562 | + 'BG-02' => __('Burgas', 'give'), |
|
1563 | + 'BG-08' => __('Dobrich', 'give'), |
|
1564 | + 'BG-07' => __('Gabrovo', 'give'), |
|
1565 | + 'BG-26' => __('Haskovo', 'give'), |
|
1566 | + 'BG-09' => __('Kardzhali', 'give'), |
|
1567 | + 'BG-10' => __('Kyustendil', 'give'), |
|
1568 | + 'BG-11' => __('Lovech', 'give'), |
|
1569 | + 'BG-12' => __('Montana', 'give'), |
|
1570 | + 'BG-13' => __('Pazardzhik', 'give'), |
|
1571 | + 'BG-14' => __('Pernik', 'give'), |
|
1572 | + 'BG-15' => __('Pleven', 'give'), |
|
1573 | + 'BG-16' => __('Plovdiv', 'give'), |
|
1574 | + 'BG-17' => __('Razgrad', 'give'), |
|
1575 | + 'BG-18' => __('Ruse', 'give'), |
|
1576 | + 'BG-27' => __('Shumen', 'give'), |
|
1577 | + 'BG-19' => __('Silistra', 'give'), |
|
1578 | + 'BG-20' => __('Sliven', 'give'), |
|
1579 | + 'BG-21' => __('Smolyan', 'give'), |
|
1580 | + 'BG-23' => __('Sofia', 'give'), |
|
1581 | + 'BG-22' => __('Sofia-Grad', 'give'), |
|
1582 | + 'BG-24' => __('Stara Zagora', 'give'), |
|
1583 | + 'BG-25' => __('Targovishte', 'give'), |
|
1584 | + 'BG-03' => __('Varna', 'give'), |
|
1585 | + 'BG-04' => __('Veliko Tarnovo', 'give'), |
|
1586 | + 'BG-05' => __('Vidin', 'give'), |
|
1587 | + 'BG-06' => __('Vratsa', 'give'), |
|
1588 | + 'BG-28' => __('Yambol', 'give'), |
|
1589 | 1589 | ); |
1590 | 1590 | |
1591 | - return apply_filters( 'give_bulgarian_states', $states ); |
|
1591 | + return apply_filters('give_bulgarian_states', $states); |
|
1592 | 1592 | } |
1593 | 1593 | |
1594 | 1594 | /** |
@@ -1600,73 +1600,73 @@ discard block |
||
1600 | 1600 | function give_get_bangladeshi_states_list() { |
1601 | 1601 | $states = array( |
1602 | 1602 | '' => '', |
1603 | - 'BAG' => __( 'Bagerhat', 'give' ), |
|
1604 | - 'BAN' => __( 'Bandarban', 'give' ), |
|
1605 | - 'BAR' => __( 'Barguna', 'give' ), |
|
1606 | - 'BARI' => __( 'Barisal', 'give' ), |
|
1607 | - 'BHO' => __( 'Bhola', 'give' ), |
|
1608 | - 'BOG' => __( 'Bogra', 'give' ), |
|
1609 | - 'BRA' => __( 'Brahmanbaria', 'give' ), |
|
1610 | - 'CHA' => __( 'Chandpur', 'give' ), |
|
1611 | - 'CHI' => __( 'Chittagong', 'give' ), |
|
1612 | - 'CHU' => __( 'Chuadanga', 'give' ), |
|
1613 | - 'COM' => __( 'Comilla', 'give' ), |
|
1614 | - 'COX' => __( "Cox's Bazar", 'give' ), |
|
1615 | - 'DHA' => __( 'Dhaka', 'give' ), |
|
1616 | - 'DIN' => __( 'Dinajpur', 'give' ), |
|
1617 | - 'FAR' => __( 'Faridpur ', 'give' ), |
|
1618 | - 'FEN' => __( 'Feni', 'give' ), |
|
1619 | - 'GAI' => __( 'Gaibandha', 'give' ), |
|
1620 | - 'GAZI' => __( 'Gazipur', 'give' ), |
|
1621 | - 'GOP' => __( 'Gopalganj', 'give' ), |
|
1622 | - 'HAB' => __( 'Habiganj', 'give' ), |
|
1623 | - 'JAM' => __( 'Jamalpur', 'give' ), |
|
1624 | - 'JES' => __( 'Jessore', 'give' ), |
|
1625 | - 'JHA' => __( 'Jhalokati', 'give' ), |
|
1626 | - 'JHE' => __( 'Jhenaidah', 'give' ), |
|
1627 | - 'JOY' => __( 'Joypurhat', 'give' ), |
|
1628 | - 'KHA' => __( 'Khagrachhari', 'give' ), |
|
1629 | - 'KHU' => __( 'Khulna', 'give' ), |
|
1630 | - 'KIS' => __( 'Kishoreganj', 'give' ), |
|
1631 | - 'KUR' => __( 'Kurigram', 'give' ), |
|
1632 | - 'KUS' => __( 'Kushtia', 'give' ), |
|
1633 | - 'LAK' => __( 'Lakshmipur', 'give' ), |
|
1634 | - 'LAL' => __( 'Lalmonirhat', 'give' ), |
|
1635 | - 'MAD' => __( 'Madaripur', 'give' ), |
|
1636 | - 'MAG' => __( 'Magura', 'give' ), |
|
1637 | - 'MAN' => __( 'Manikganj ', 'give' ), |
|
1638 | - 'MEH' => __( 'Meherpur', 'give' ), |
|
1639 | - 'MOU' => __( 'Moulvibazar', 'give' ), |
|
1640 | - 'MUN' => __( 'Munshiganj', 'give' ), |
|
1641 | - 'MYM' => __( 'Mymensingh', 'give' ), |
|
1642 | - 'NAO' => __( 'Naogaon', 'give' ), |
|
1643 | - 'NAR' => __( 'Narail', 'give' ), |
|
1644 | - 'NARG' => __( 'Narayanganj', 'give' ), |
|
1645 | - 'NARD' => __( 'Narsingdi', 'give' ), |
|
1646 | - 'NAT' => __( 'Natore', 'give' ), |
|
1647 | - 'NAW' => __( 'Nawabganj', 'give' ), |
|
1648 | - 'NET' => __( 'Netrakona', 'give' ), |
|
1649 | - 'NIL' => __( 'Nilphamari', 'give' ), |
|
1650 | - 'NOA' => __( 'Noakhali', 'give' ), |
|
1651 | - 'PAB' => __( 'Pabna', 'give' ), |
|
1652 | - 'PAN' => __( 'Panchagarh', 'give' ), |
|
1653 | - 'PAT' => __( 'Patuakhali', 'give' ), |
|
1654 | - 'PIR' => __( 'Pirojpur', 'give' ), |
|
1655 | - 'RAJB' => __( 'Rajbari', 'give' ), |
|
1656 | - 'RAJ' => __( 'Rajshahi', 'give' ), |
|
1657 | - 'RAN' => __( 'Rangamati', 'give' ), |
|
1658 | - 'RANP' => __( 'Rangpur', 'give' ), |
|
1659 | - 'SAT' => __( 'Satkhira', 'give' ), |
|
1660 | - 'SHA' => __( 'Shariatpur', 'give' ), |
|
1661 | - 'SHE' => __( 'Sherpur', 'give' ), |
|
1662 | - 'SIR' => __( 'Sirajganj', 'give' ), |
|
1663 | - 'SUN' => __( 'Sunamganj', 'give' ), |
|
1664 | - 'SYL' => __( 'Sylhet', 'give' ), |
|
1665 | - 'TAN' => __( 'Tangail', 'give' ), |
|
1666 | - 'THA' => __( 'Thakurgaon', 'give' ), |
|
1603 | + 'BAG' => __('Bagerhat', 'give'), |
|
1604 | + 'BAN' => __('Bandarban', 'give'), |
|
1605 | + 'BAR' => __('Barguna', 'give'), |
|
1606 | + 'BARI' => __('Barisal', 'give'), |
|
1607 | + 'BHO' => __('Bhola', 'give'), |
|
1608 | + 'BOG' => __('Bogra', 'give'), |
|
1609 | + 'BRA' => __('Brahmanbaria', 'give'), |
|
1610 | + 'CHA' => __('Chandpur', 'give'), |
|
1611 | + 'CHI' => __('Chittagong', 'give'), |
|
1612 | + 'CHU' => __('Chuadanga', 'give'), |
|
1613 | + 'COM' => __('Comilla', 'give'), |
|
1614 | + 'COX' => __("Cox's Bazar", 'give'), |
|
1615 | + 'DHA' => __('Dhaka', 'give'), |
|
1616 | + 'DIN' => __('Dinajpur', 'give'), |
|
1617 | + 'FAR' => __('Faridpur ', 'give'), |
|
1618 | + 'FEN' => __('Feni', 'give'), |
|
1619 | + 'GAI' => __('Gaibandha', 'give'), |
|
1620 | + 'GAZI' => __('Gazipur', 'give'), |
|
1621 | + 'GOP' => __('Gopalganj', 'give'), |
|
1622 | + 'HAB' => __('Habiganj', 'give'), |
|
1623 | + 'JAM' => __('Jamalpur', 'give'), |
|
1624 | + 'JES' => __('Jessore', 'give'), |
|
1625 | + 'JHA' => __('Jhalokati', 'give'), |
|
1626 | + 'JHE' => __('Jhenaidah', 'give'), |
|
1627 | + 'JOY' => __('Joypurhat', 'give'), |
|
1628 | + 'KHA' => __('Khagrachhari', 'give'), |
|
1629 | + 'KHU' => __('Khulna', 'give'), |
|
1630 | + 'KIS' => __('Kishoreganj', 'give'), |
|
1631 | + 'KUR' => __('Kurigram', 'give'), |
|
1632 | + 'KUS' => __('Kushtia', 'give'), |
|
1633 | + 'LAK' => __('Lakshmipur', 'give'), |
|
1634 | + 'LAL' => __('Lalmonirhat', 'give'), |
|
1635 | + 'MAD' => __('Madaripur', 'give'), |
|
1636 | + 'MAG' => __('Magura', 'give'), |
|
1637 | + 'MAN' => __('Manikganj ', 'give'), |
|
1638 | + 'MEH' => __('Meherpur', 'give'), |
|
1639 | + 'MOU' => __('Moulvibazar', 'give'), |
|
1640 | + 'MUN' => __('Munshiganj', 'give'), |
|
1641 | + 'MYM' => __('Mymensingh', 'give'), |
|
1642 | + 'NAO' => __('Naogaon', 'give'), |
|
1643 | + 'NAR' => __('Narail', 'give'), |
|
1644 | + 'NARG' => __('Narayanganj', 'give'), |
|
1645 | + 'NARD' => __('Narsingdi', 'give'), |
|
1646 | + 'NAT' => __('Natore', 'give'), |
|
1647 | + 'NAW' => __('Nawabganj', 'give'), |
|
1648 | + 'NET' => __('Netrakona', 'give'), |
|
1649 | + 'NIL' => __('Nilphamari', 'give'), |
|
1650 | + 'NOA' => __('Noakhali', 'give'), |
|
1651 | + 'PAB' => __('Pabna', 'give'), |
|
1652 | + 'PAN' => __('Panchagarh', 'give'), |
|
1653 | + 'PAT' => __('Patuakhali', 'give'), |
|
1654 | + 'PIR' => __('Pirojpur', 'give'), |
|
1655 | + 'RAJB' => __('Rajbari', 'give'), |
|
1656 | + 'RAJ' => __('Rajshahi', 'give'), |
|
1657 | + 'RAN' => __('Rangamati', 'give'), |
|
1658 | + 'RANP' => __('Rangpur', 'give'), |
|
1659 | + 'SAT' => __('Satkhira', 'give'), |
|
1660 | + 'SHA' => __('Shariatpur', 'give'), |
|
1661 | + 'SHE' => __('Sherpur', 'give'), |
|
1662 | + 'SIR' => __('Sirajganj', 'give'), |
|
1663 | + 'SUN' => __('Sunamganj', 'give'), |
|
1664 | + 'SYL' => __('Sylhet', 'give'), |
|
1665 | + 'TAN' => __('Tangail', 'give'), |
|
1666 | + 'THA' => __('Thakurgaon', 'give'), |
|
1667 | 1667 | ); |
1668 | 1668 | |
1669 | - return apply_filters( 'give_bangladeshi_states', $states ); |
|
1669 | + return apply_filters('give_bangladeshi_states', $states); |
|
1670 | 1670 | } |
1671 | 1671 | |
1672 | 1672 | /** |
@@ -1678,33 +1678,33 @@ discard block |
||
1678 | 1678 | function give_get_argentina_states_list() { |
1679 | 1679 | $states = array( |
1680 | 1680 | '' => '', |
1681 | - 'C' => __( 'Ciudad Autónoma de Buenos Aires', 'give' ), |
|
1682 | - 'B' => __( 'Buenos Aires', 'give' ), |
|
1683 | - 'K' => __( 'Catamarca', 'give' ), |
|
1684 | - 'H' => __( 'Chaco', 'give' ), |
|
1685 | - 'U' => __( 'Chubut', 'give' ), |
|
1686 | - 'X' => __( 'Córdoba', 'give' ), |
|
1687 | - 'W' => __( 'Corrientes', 'give' ), |
|
1688 | - 'E' => __( 'Entre Ríos', 'give' ), |
|
1689 | - 'P' => __( 'Formosa', 'give' ), |
|
1690 | - 'Y' => __( 'Jujuy', 'give' ), |
|
1691 | - 'L' => __( 'La Pampa', 'give' ), |
|
1692 | - 'F' => __( 'La Rioja', 'give' ), |
|
1693 | - 'M' => __( 'Mendoza', 'give' ), |
|
1694 | - 'N' => __( 'Misiones', 'give' ), |
|
1695 | - 'Q' => __( 'Neuquén', 'give' ), |
|
1696 | - 'R' => __( 'Río Negro', 'give' ), |
|
1697 | - 'A' => __( 'Salta', 'give' ), |
|
1698 | - 'J' => __( 'San Juan', 'give' ), |
|
1699 | - 'D' => __( 'San Luis', 'give' ), |
|
1700 | - 'Z' => __( 'Santa Cruz', 'give' ), |
|
1701 | - 'S' => __( 'Santa Fe', 'give' ), |
|
1702 | - 'G' => __( 'Santiago del Estero', 'give' ), |
|
1703 | - 'V' => __( 'Tierra del Fuego', 'give' ), |
|
1704 | - 'T' => __( 'Tucumán', 'give' ), |
|
1681 | + 'C' => __('Ciudad Autónoma de Buenos Aires', 'give'), |
|
1682 | + 'B' => __('Buenos Aires', 'give'), |
|
1683 | + 'K' => __('Catamarca', 'give'), |
|
1684 | + 'H' => __('Chaco', 'give'), |
|
1685 | + 'U' => __('Chubut', 'give'), |
|
1686 | + 'X' => __('Córdoba', 'give'), |
|
1687 | + 'W' => __('Corrientes', 'give'), |
|
1688 | + 'E' => __('Entre Ríos', 'give'), |
|
1689 | + 'P' => __('Formosa', 'give'), |
|
1690 | + 'Y' => __('Jujuy', 'give'), |
|
1691 | + 'L' => __('La Pampa', 'give'), |
|
1692 | + 'F' => __('La Rioja', 'give'), |
|
1693 | + 'M' => __('Mendoza', 'give'), |
|
1694 | + 'N' => __('Misiones', 'give'), |
|
1695 | + 'Q' => __('Neuquén', 'give'), |
|
1696 | + 'R' => __('Río Negro', 'give'), |
|
1697 | + 'A' => __('Salta', 'give'), |
|
1698 | + 'J' => __('San Juan', 'give'), |
|
1699 | + 'D' => __('San Luis', 'give'), |
|
1700 | + 'Z' => __('Santa Cruz', 'give'), |
|
1701 | + 'S' => __('Santa Fe', 'give'), |
|
1702 | + 'G' => __('Santiago del Estero', 'give'), |
|
1703 | + 'V' => __('Tierra del Fuego', 'give'), |
|
1704 | + 'T' => __('Tucumán', 'give'), |
|
1705 | 1705 | ); |
1706 | 1706 | |
1707 | - return apply_filters( 'give_argentina_states', $states ); |
|
1707 | + return apply_filters('give_argentina_states', $states); |
|
1708 | 1708 | } |
1709 | 1709 | |
1710 | 1710 | /** |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | 'AP' => 'Armed Forces - Pacific', |
1786 | 1786 | ); |
1787 | 1787 | |
1788 | - return apply_filters( 'give_us_states', $states ); |
|
1788 | + return apply_filters('give_us_states', $states); |
|
1789 | 1789 | } |
1790 | 1790 | |
1791 | 1791 | /** |
@@ -1798,22 +1798,22 @@ discard block |
||
1798 | 1798 | function give_get_provinces_list() { |
1799 | 1799 | $provinces = array( |
1800 | 1800 | '' => '', |
1801 | - 'AB' => esc_html__( 'Alberta', 'give' ), |
|
1802 | - 'BC' => esc_html__( 'British Columbia', 'give' ), |
|
1803 | - 'MB' => esc_html__( 'Manitoba', 'give' ), |
|
1804 | - 'NB' => esc_html__( 'New Brunswick', 'give' ), |
|
1805 | - 'NL' => esc_html__( 'Newfoundland and Labrador', 'give' ), |
|
1806 | - 'NS' => esc_html__( 'Nova Scotia', 'give' ), |
|
1807 | - 'NT' => esc_html__( 'Northwest Territories', 'give' ), |
|
1808 | - 'NU' => esc_html__( 'Nunavut', 'give' ), |
|
1809 | - 'ON' => esc_html__( 'Ontario', 'give' ), |
|
1810 | - 'PE' => esc_html__( 'Prince Edward Island', 'give' ), |
|
1811 | - 'QC' => esc_html__( 'Quebec', 'give' ), |
|
1812 | - 'SK' => esc_html__( 'Saskatchewan', 'give' ), |
|
1813 | - 'YT' => esc_html__( 'Yukon', 'give' ), |
|
1801 | + 'AB' => esc_html__('Alberta', 'give'), |
|
1802 | + 'BC' => esc_html__('British Columbia', 'give'), |
|
1803 | + 'MB' => esc_html__('Manitoba', 'give'), |
|
1804 | + 'NB' => esc_html__('New Brunswick', 'give'), |
|
1805 | + 'NL' => esc_html__('Newfoundland and Labrador', 'give'), |
|
1806 | + 'NS' => esc_html__('Nova Scotia', 'give'), |
|
1807 | + 'NT' => esc_html__('Northwest Territories', 'give'), |
|
1808 | + 'NU' => esc_html__('Nunavut', 'give'), |
|
1809 | + 'ON' => esc_html__('Ontario', 'give'), |
|
1810 | + 'PE' => esc_html__('Prince Edward Island', 'give'), |
|
1811 | + 'QC' => esc_html__('Quebec', 'give'), |
|
1812 | + 'SK' => esc_html__('Saskatchewan', 'give'), |
|
1813 | + 'YT' => esc_html__('Yukon', 'give'), |
|
1814 | 1814 | ); |
1815 | 1815 | |
1816 | - return apply_filters( 'give_canada_provinces', $provinces ); |
|
1816 | + return apply_filters('give_canada_provinces', $provinces); |
|
1817 | 1817 | } |
1818 | 1818 | |
1819 | 1819 | /** |
@@ -1835,7 +1835,7 @@ discard block |
||
1835 | 1835 | 'WA' => 'Western Australia', |
1836 | 1836 | ); |
1837 | 1837 | |
1838 | - return apply_filters( 'give_australian_states', $states ); |
|
1838 | + return apply_filters('give_australian_states', $states); |
|
1839 | 1839 | } |
1840 | 1840 | |
1841 | 1841 | /** |
@@ -1876,7 +1876,7 @@ discard block |
||
1876 | 1876 | 'TO' => 'Tocantins', |
1877 | 1877 | ); |
1878 | 1878 | |
1879 | - return apply_filters( 'give_brazil_states', $states ); |
|
1879 | + return apply_filters('give_brazil_states', $states); |
|
1880 | 1880 | } |
1881 | 1881 | |
1882 | 1882 | /** |
@@ -1893,7 +1893,7 @@ discard block |
||
1893 | 1893 | 'NEW TERRITORIES' => 'New Territories', |
1894 | 1894 | ); |
1895 | 1895 | |
1896 | - return apply_filters( 'give_hong_kong_states', $states ); |
|
1896 | + return apply_filters('give_hong_kong_states', $states); |
|
1897 | 1897 | } |
1898 | 1898 | |
1899 | 1899 | /** |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | 'ZA' => 'Zala', |
1928 | 1928 | ); |
1929 | 1929 | |
1930 | - return apply_filters( 'give_hungary_states', $states ); |
|
1930 | + return apply_filters('give_hungary_states', $states); |
|
1931 | 1931 | } |
1932 | 1932 | |
1933 | 1933 | /** |
@@ -1973,7 +1973,7 @@ discard block |
||
1973 | 1973 | 'CN32' => 'Xinjiang / 新疆', |
1974 | 1974 | ); |
1975 | 1975 | |
1976 | - return apply_filters( 'give_chinese_states', $states ); |
|
1976 | + return apply_filters('give_chinese_states', $states); |
|
1977 | 1977 | } |
1978 | 1978 | |
1979 | 1979 | /** |
@@ -2002,7 +2002,7 @@ discard block |
||
2002 | 2002 | 'WC' => 'West Coast', |
2003 | 2003 | ); |
2004 | 2004 | |
2005 | - return apply_filters( 'give_new_zealand_states', $states ); |
|
2005 | + return apply_filters('give_new_zealand_states', $states); |
|
2006 | 2006 | } |
2007 | 2007 | |
2008 | 2008 | /** |
@@ -2050,7 +2050,7 @@ discard block |
||
2050 | 2050 | 'PB' => 'Papua Barat', |
2051 | 2051 | ); |
2052 | 2052 | |
2053 | - return apply_filters( 'give_indonesia_states', $states ); |
|
2053 | + return apply_filters('give_indonesia_states', $states); |
|
2054 | 2054 | } |
2055 | 2055 | |
2056 | 2056 | /** |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | 'PY' => 'Pondicherry (Puducherry)', |
2101 | 2101 | ); |
2102 | 2102 | |
2103 | - return apply_filters( 'give_indian_states', $states ); |
|
2103 | + return apply_filters('give_indian_states', $states); |
|
2104 | 2104 | } |
2105 | 2105 | |
2106 | 2106 | /** |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | 'PJY' => 'W.P. Putrajaya', |
2131 | 2131 | ); |
2132 | 2132 | |
2133 | - return apply_filters( 'give_malaysian_states', $states ); |
|
2133 | + return apply_filters('give_malaysian_states', $states); |
|
2134 | 2134 | } |
2135 | 2135 | |
2136 | 2136 | /** |
@@ -2153,7 +2153,7 @@ discard block |
||
2153 | 2153 | 'WC' => 'Western Cape', |
2154 | 2154 | ); |
2155 | 2155 | |
2156 | - return apply_filters( 'give_south_african_states', $states ); |
|
2156 | + return apply_filters('give_south_african_states', $states); |
|
2157 | 2157 | } |
2158 | 2158 | |
2159 | 2159 | /** |
@@ -2244,7 +2244,7 @@ discard block |
||
2244 | 2244 | 'TH-35' => 'Yasothon (ยโสธร)', |
2245 | 2245 | ); |
2246 | 2246 | |
2247 | - return apply_filters( 'give_thailand_states', $states ); |
|
2247 | + return apply_filters('give_thailand_states', $states); |
|
2248 | 2248 | } |
2249 | 2249 | |
2250 | 2250 | /** |
@@ -2256,59 +2256,59 @@ discard block |
||
2256 | 2256 | function give_get_spain_states_list() { |
2257 | 2257 | $states = array( |
2258 | 2258 | '' => '', |
2259 | - 'C' => esc_html__( 'A Coruña', 'give' ), |
|
2260 | - 'VI' => esc_html__( 'Álava', 'give' ), |
|
2261 | - 'AB' => esc_html__( 'Albacete', 'give' ), |
|
2262 | - 'A' => esc_html__( 'Alicante', 'give' ), |
|
2263 | - 'AL' => esc_html__( 'Almería', 'give' ), |
|
2264 | - 'O' => esc_html__( 'Asturias', 'give' ), |
|
2265 | - 'AV' => esc_html__( 'Ávila', 'give' ), |
|
2266 | - 'BA' => esc_html__( 'Badajoz', 'give' ), |
|
2267 | - 'PM' => esc_html__( 'Baleares', 'give' ), |
|
2268 | - 'B' => esc_html__( 'Barcelona', 'give' ), |
|
2269 | - 'BU' => esc_html__( 'Burgos', 'give' ), |
|
2270 | - 'CC' => esc_html__( 'Cáceres', 'give' ), |
|
2271 | - 'CA' => esc_html__( 'Cádiz', 'give' ), |
|
2272 | - 'S' => esc_html__( 'Cantabria', 'give' ), |
|
2273 | - 'CS' => esc_html__( 'Castellón', 'give' ), |
|
2274 | - 'CE' => esc_html__( 'Ceuta', 'give' ), |
|
2275 | - 'CR' => esc_html__( 'Ciudad Real', 'give' ), |
|
2276 | - 'CO' => esc_html__( 'Córdoba', 'give' ), |
|
2277 | - 'CU' => esc_html__( 'Cuenca', 'give' ), |
|
2278 | - 'GI' => esc_html__( 'Girona', 'give' ), |
|
2279 | - 'GR' => esc_html__( 'Granada', 'give' ), |
|
2280 | - 'GU' => esc_html__( 'Guadalajara', 'give' ), |
|
2281 | - 'SS' => esc_html__( 'Gipuzkoa', 'give' ), |
|
2282 | - 'H' => esc_html__( 'Huelva', 'give' ), |
|
2283 | - 'HU' => esc_html__( 'Huesca', 'give' ), |
|
2284 | - 'J' => esc_html__( 'Jaén', 'give' ), |
|
2285 | - 'LO' => esc_html__( 'La Rioja', 'give' ), |
|
2286 | - 'GC' => esc_html__( 'Las Palmas', 'give' ), |
|
2287 | - 'LE' => esc_html__( 'León', 'give' ), |
|
2288 | - 'L' => esc_html__( 'Lleida', 'give' ), |
|
2289 | - 'LU' => esc_html__( 'Lugo', 'give' ), |
|
2290 | - 'M' => esc_html__( 'Madrid', 'give' ), |
|
2291 | - 'MA' => esc_html__( 'Málaga', 'give' ), |
|
2292 | - 'ML' => esc_html__( 'Melilla', 'give' ), |
|
2293 | - 'MU' => esc_html__( 'Murcia', 'give' ), |
|
2294 | - 'NA' => esc_html__( 'Navarra', 'give' ), |
|
2295 | - 'OR' => esc_html__( 'Ourense', 'give' ), |
|
2296 | - 'P' => esc_html__( 'Palencia', 'give' ), |
|
2297 | - 'PO' => esc_html__( 'Pontevedra', 'give' ), |
|
2298 | - 'SA' => esc_html__( 'Salamanca', 'give' ), |
|
2299 | - 'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ), |
|
2300 | - 'SG' => esc_html__( 'Segovia', 'give' ), |
|
2301 | - 'SE' => esc_html__( 'Sevilla', 'give' ), |
|
2302 | - 'SO' => esc_html__( 'Soria', 'give' ), |
|
2303 | - 'T' => esc_html__( 'Tarragona', 'give' ), |
|
2304 | - 'TE' => esc_html__( 'Teruel', 'give' ), |
|
2305 | - 'TO' => esc_html__( 'Toledo', 'give' ), |
|
2306 | - 'V' => esc_html__( 'Valencia', 'give' ), |
|
2307 | - 'VA' => esc_html__( 'Valladolid', 'give' ), |
|
2308 | - 'BI' => esc_html__( 'Bizkaia', 'give' ), |
|
2309 | - 'ZA' => esc_html__( 'Zamora', 'give' ), |
|
2310 | - 'Z' => esc_html__( 'Zaragoza', 'give' ), |
|
2259 | + 'C' => esc_html__('A Coruña', 'give'), |
|
2260 | + 'VI' => esc_html__('Álava', 'give'), |
|
2261 | + 'AB' => esc_html__('Albacete', 'give'), |
|
2262 | + 'A' => esc_html__('Alicante', 'give'), |
|
2263 | + 'AL' => esc_html__('Almería', 'give'), |
|
2264 | + 'O' => esc_html__('Asturias', 'give'), |
|
2265 | + 'AV' => esc_html__('Ávila', 'give'), |
|
2266 | + 'BA' => esc_html__('Badajoz', 'give'), |
|
2267 | + 'PM' => esc_html__('Baleares', 'give'), |
|
2268 | + 'B' => esc_html__('Barcelona', 'give'), |
|
2269 | + 'BU' => esc_html__('Burgos', 'give'), |
|
2270 | + 'CC' => esc_html__('Cáceres', 'give'), |
|
2271 | + 'CA' => esc_html__('Cádiz', 'give'), |
|
2272 | + 'S' => esc_html__('Cantabria', 'give'), |
|
2273 | + 'CS' => esc_html__('Castellón', 'give'), |
|
2274 | + 'CE' => esc_html__('Ceuta', 'give'), |
|
2275 | + 'CR' => esc_html__('Ciudad Real', 'give'), |
|
2276 | + 'CO' => esc_html__('Córdoba', 'give'), |
|
2277 | + 'CU' => esc_html__('Cuenca', 'give'), |
|
2278 | + 'GI' => esc_html__('Girona', 'give'), |
|
2279 | + 'GR' => esc_html__('Granada', 'give'), |
|
2280 | + 'GU' => esc_html__('Guadalajara', 'give'), |
|
2281 | + 'SS' => esc_html__('Gipuzkoa', 'give'), |
|
2282 | + 'H' => esc_html__('Huelva', 'give'), |
|
2283 | + 'HU' => esc_html__('Huesca', 'give'), |
|
2284 | + 'J' => esc_html__('Jaén', 'give'), |
|
2285 | + 'LO' => esc_html__('La Rioja', 'give'), |
|
2286 | + 'GC' => esc_html__('Las Palmas', 'give'), |
|
2287 | + 'LE' => esc_html__('León', 'give'), |
|
2288 | + 'L' => esc_html__('Lleida', 'give'), |
|
2289 | + 'LU' => esc_html__('Lugo', 'give'), |
|
2290 | + 'M' => esc_html__('Madrid', 'give'), |
|
2291 | + 'MA' => esc_html__('Málaga', 'give'), |
|
2292 | + 'ML' => esc_html__('Melilla', 'give'), |
|
2293 | + 'MU' => esc_html__('Murcia', 'give'), |
|
2294 | + 'NA' => esc_html__('Navarra', 'give'), |
|
2295 | + 'OR' => esc_html__('Ourense', 'give'), |
|
2296 | + 'P' => esc_html__('Palencia', 'give'), |
|
2297 | + 'PO' => esc_html__('Pontevedra', 'give'), |
|
2298 | + 'SA' => esc_html__('Salamanca', 'give'), |
|
2299 | + 'TF' => esc_html__('Santa Cruz de Tenerife', 'give'), |
|
2300 | + 'SG' => esc_html__('Segovia', 'give'), |
|
2301 | + 'SE' => esc_html__('Sevilla', 'give'), |
|
2302 | + 'SO' => esc_html__('Soria', 'give'), |
|
2303 | + 'T' => esc_html__('Tarragona', 'give'), |
|
2304 | + 'TE' => esc_html__('Teruel', 'give'), |
|
2305 | + 'TO' => esc_html__('Toledo', 'give'), |
|
2306 | + 'V' => esc_html__('Valencia', 'give'), |
|
2307 | + 'VA' => esc_html__('Valladolid', 'give'), |
|
2308 | + 'BI' => esc_html__('Bizkaia', 'give'), |
|
2309 | + 'ZA' => esc_html__('Zamora', 'give'), |
|
2310 | + 'Z' => esc_html__('Zaragoza', 'give'), |
|
2311 | 2311 | ); |
2312 | 2312 | |
2313 | - return apply_filters( 'give_spain_states', $states ); |
|
2313 | + return apply_filters('give_spain_states', $states); |
|
2314 | 2314 | } |
@@ -521,7 +521,7 @@ |
||
521 | 521 | * |
522 | 522 | * @since 1.8.17 |
523 | 523 | * |
524 | - * @return bool |
|
524 | + * @return false|null |
|
525 | 525 | */ |
526 | 526 | function give_confirm_email_for_donation_access() { |
527 | 527 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -26,31 +26,31 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function give_test_ajax_works() { |
28 | 28 | // Handle ajax. |
29 | - if( doing_action( 'wp_ajax_nopriv_give_test_ajax' ) ) { |
|
30 | - wp_die( 0, 200 ); |
|
29 | + if (doing_action('wp_ajax_nopriv_give_test_ajax')) { |
|
30 | + wp_die(0, 200); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // Check if the Airplane Mode plugin is installed. |
34 | - if ( class_exists( 'Airplane_Mode_Core' ) ) { |
|
34 | + if (class_exists('Airplane_Mode_Core')) { |
|
35 | 35 | |
36 | 36 | $airplane = Airplane_Mode_Core::getInstance(); |
37 | 37 | |
38 | - if ( method_exists( $airplane, 'enabled' ) ) { |
|
38 | + if (method_exists($airplane, 'enabled')) { |
|
39 | 39 | |
40 | - if ( $airplane->enabled() ) { |
|
40 | + if ($airplane->enabled()) { |
|
41 | 41 | return true; |
42 | 42 | } |
43 | 43 | } else { |
44 | 44 | |
45 | - if ( 'on' === $airplane->check_status() ) { |
|
45 | + if ('on' === $airplane->check_status()) { |
|
46 | 46 | return true; |
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | - add_filter( 'block_local_requests', '__return_false' ); |
|
51 | + add_filter('block_local_requests', '__return_false'); |
|
52 | 52 | |
53 | - if ( Give_Cache::get( '_give_ajax_works', true ) ) { |
|
53 | + if (Give_Cache::get('_give_ajax_works', true)) { |
|
54 | 54 | return true; |
55 | 55 | } |
56 | 56 | |
@@ -62,41 +62,41 @@ discard block |
||
62 | 62 | ), |
63 | 63 | ); |
64 | 64 | |
65 | - $ajax = wp_remote_post( give_get_ajax_url(), $params ); |
|
65 | + $ajax = wp_remote_post(give_get_ajax_url(), $params); |
|
66 | 66 | |
67 | 67 | $works = true; |
68 | 68 | |
69 | - if ( is_wp_error( $ajax ) ) { |
|
69 | + if (is_wp_error($ajax)) { |
|
70 | 70 | |
71 | 71 | $works = false; |
72 | 72 | |
73 | 73 | } else { |
74 | 74 | |
75 | - if ( empty( $ajax['response'] ) ) { |
|
75 | + if (empty($ajax['response'])) { |
|
76 | 76 | $works = false; |
77 | 77 | } |
78 | 78 | |
79 | - if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) { |
|
79 | + if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) { |
|
80 | 80 | $works = false; |
81 | 81 | } |
82 | 82 | |
83 | - if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) { |
|
83 | + if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) { |
|
84 | 84 | $works = false; |
85 | 85 | } |
86 | 86 | |
87 | - if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) { |
|
87 | + if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) { |
|
88 | 88 | $works = false; |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - if ( $works ) { |
|
93 | - Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true ); |
|
92 | + if ($works) { |
|
93 | + Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return $works; |
97 | 97 | } |
98 | 98 | |
99 | -add_action( 'wp_ajax_nopriv_give_test_ajax', 'give_test_ajax_works' ); |
|
99 | +add_action('wp_ajax_nopriv_give_test_ajax', 'give_test_ajax_works'); |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Get AJAX URL |
@@ -107,21 +107,21 @@ discard block |
||
107 | 107 | * |
108 | 108 | * @return string |
109 | 109 | */ |
110 | -function give_get_ajax_url( $query = array() ) { |
|
111 | - $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
110 | +function give_get_ajax_url($query = array()) { |
|
111 | + $scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
112 | 112 | |
113 | 113 | $current_url = give_get_current_page_url(); |
114 | - $ajax_url = admin_url( 'admin-ajax.php', $scheme ); |
|
114 | + $ajax_url = admin_url('admin-ajax.php', $scheme); |
|
115 | 115 | |
116 | - if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) { |
|
117 | - $ajax_url = preg_replace( '/^http/', 'https', $ajax_url ); |
|
116 | + if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) { |
|
117 | + $ajax_url = preg_replace('/^http/', 'https', $ajax_url); |
|
118 | 118 | } |
119 | 119 | |
120 | - if( ! empty( $query ) ) { |
|
121 | - $ajax_url = add_query_arg( $query, $ajax_url ); |
|
120 | + if ( ! empty($query)) { |
|
121 | + $ajax_url = add_query_arg($query, $ajax_url); |
|
122 | 122 | } |
123 | 123 | |
124 | - return apply_filters( 'give_ajax_url', $ajax_url ); |
|
124 | + return apply_filters('give_ajax_url', $ajax_url); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @since 1.7 |
139 | 139 | */ |
140 | - do_action( 'give_donation_form_login_fields' ); |
|
140 | + do_action('give_donation_form_login_fields'); |
|
141 | 141 | |
142 | 142 | give_die(); |
143 | 143 | } |
144 | 144 | |
145 | -add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' ); |
|
145 | +add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields'); |
|
146 | 146 | |
147 | 147 | /** |
148 | 148 | * Load Checkout Fields |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * @return void |
153 | 153 | */ |
154 | 154 | function give_load_checkout_fields() { |
155 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : ''; |
|
155 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : ''; |
|
156 | 156 | |
157 | 157 | ob_start(); |
158 | 158 | |
@@ -161,18 +161,18 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @since 1.7 |
163 | 163 | */ |
164 | - do_action( 'give_donation_form_register_login_fields', $form_id ); |
|
164 | + do_action('give_donation_form_register_login_fields', $form_id); |
|
165 | 165 | |
166 | 166 | $fields = ob_get_clean(); |
167 | 167 | |
168 | - wp_send_json( array( |
|
169 | - 'fields' => wp_json_encode( $fields ), |
|
170 | - 'submit' => wp_json_encode( give_get_donation_form_submit_button( $form_id ) ), |
|
171 | - ) ); |
|
168 | + wp_send_json(array( |
|
169 | + 'fields' => wp_json_encode($fields), |
|
170 | + 'submit' => wp_json_encode(give_get_donation_form_submit_button($form_id)), |
|
171 | + )); |
|
172 | 172 | } |
173 | 173 | |
174 | -add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' ); |
|
175 | -add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' ); |
|
174 | +add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields'); |
|
175 | +add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields'); |
|
176 | 176 | |
177 | 177 | /** |
178 | 178 | * Get Form Title via AJAX (used only in WordPress Admin) |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | * @return void |
183 | 183 | */ |
184 | 184 | function give_ajax_get_form_title() { |
185 | - if ( isset( $_POST['form_id'] ) ) { |
|
186 | - $title = get_the_title( $_POST['form_id'] ); |
|
187 | - if ( $title ) { |
|
185 | + if (isset($_POST['form_id'])) { |
|
186 | + $title = get_the_title($_POST['form_id']); |
|
187 | + if ($title) { |
|
188 | 188 | echo $title; |
189 | 189 | } else { |
190 | 190 | echo 'fail'; |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | give_die(); |
194 | 194 | } |
195 | 195 | |
196 | -add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' ); |
|
197 | -add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' ); |
|
196 | +add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title'); |
|
197 | +add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title'); |
|
198 | 198 | |
199 | 199 | /** |
200 | 200 | * Retrieve a states drop down |
@@ -208,41 +208,41 @@ discard block |
||
208 | 208 | $show_field = true; |
209 | 209 | $states_require = true; |
210 | 210 | // Get the Country code from the $_POST. |
211 | - $country = sanitize_text_field( $_POST['country'] ); |
|
211 | + $country = sanitize_text_field($_POST['country']); |
|
212 | 212 | |
213 | 213 | // Get the field name from the $_POST. |
214 | - $field_name = sanitize_text_field( $_POST['field_name'] ); |
|
214 | + $field_name = sanitize_text_field($_POST['field_name']); |
|
215 | 215 | |
216 | - $label = __( 'State', 'give' ); |
|
216 | + $label = __('State', 'give'); |
|
217 | 217 | $states_label = give_get_states_label(); |
218 | 218 | |
219 | 219 | $default_state = ''; |
220 | - if ( $country === give_get_country() ) { |
|
220 | + if ($country === give_get_country()) { |
|
221 | 221 | $default_state = give_get_state(); |
222 | 222 | } |
223 | 223 | |
224 | 224 | // Check if $country code exists in the array key for states label. |
225 | - if ( array_key_exists( $country, $states_label ) ) { |
|
226 | - $label = $states_label[ $country ]; |
|
225 | + if (array_key_exists($country, $states_label)) { |
|
226 | + $label = $states_label[$country]; |
|
227 | 227 | } |
228 | 228 | |
229 | - if ( empty( $country ) ) { |
|
229 | + if (empty($country)) { |
|
230 | 230 | $country = give_get_country(); |
231 | 231 | } |
232 | 232 | |
233 | - $states = give_get_states( $country ); |
|
234 | - if ( ! empty( $states ) ) { |
|
235 | - $args = array( |
|
233 | + $states = give_get_states($country); |
|
234 | + if ( ! empty($states)) { |
|
235 | + $args = array( |
|
236 | 236 | 'name' => $field_name, |
237 | 237 | 'id' => $field_name, |
238 | - 'class' => $field_name . ' give-select', |
|
238 | + 'class' => $field_name.' give-select', |
|
239 | 239 | 'options' => $states, |
240 | 240 | 'show_option_all' => false, |
241 | 241 | 'show_option_none' => false, |
242 | 242 | 'placeholder' => $label, |
243 | 243 | 'selected' => $default_state, |
244 | 244 | ); |
245 | - $data = Give()->html->select( $args ); |
|
245 | + $data = Give()->html->select($args); |
|
246 | 246 | $states_found = true; |
247 | 247 | } else { |
248 | 248 | $data = 'nostates'; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $no_states_country = give_no_states_country_list(); |
252 | 252 | |
253 | 253 | // Check if $country code exists in the array key. |
254 | - if ( array_key_exists( $country, $no_states_country ) ) { |
|
254 | + if (array_key_exists($country, $no_states_country)) { |
|
255 | 255 | $show_field = false; |
256 | 256 | } |
257 | 257 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $states_not_required_country_list = give_states_not_required_country_list(); |
260 | 260 | |
261 | 261 | // Check if $country code exists in the array key. |
262 | - if ( array_key_exists( $country, $states_not_required_country_list ) ) { |
|
262 | + if (array_key_exists($country, $states_not_required_country_list)) { |
|
263 | 263 | $states_require = false; |
264 | 264 | } |
265 | 265 | } |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | 'data' => $data, |
273 | 273 | 'default_state' => $default_state, |
274 | 274 | ); |
275 | - wp_send_json( $response ); |
|
275 | + wp_send_json($response); |
|
276 | 276 | } |
277 | 277 | |
278 | -add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' ); |
|
279 | -add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' ); |
|
278 | +add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field'); |
|
279 | +add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field'); |
|
280 | 280 | |
281 | 281 | /** |
282 | 282 | * Retrieve donation forms via AJAX for chosen dropdown search field. |
@@ -288,19 +288,19 @@ discard block |
||
288 | 288 | function give_ajax_form_search() { |
289 | 289 | global $wpdb; |
290 | 290 | |
291 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
292 | - $excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() ); |
|
291 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
292 | + $excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array()); |
|
293 | 293 | |
294 | 294 | $results = array(); |
295 | - if ( current_user_can( 'edit_give_forms' ) ) { |
|
296 | - $items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" ); |
|
295 | + if (current_user_can('edit_give_forms')) { |
|
296 | + $items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50"); |
|
297 | 297 | } else { |
298 | - $items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" ); |
|
298 | + $items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50"); |
|
299 | 299 | } |
300 | 300 | |
301 | - if ( $items ) { |
|
301 | + if ($items) { |
|
302 | 302 | |
303 | - foreach ( $items as $item ) { |
|
303 | + foreach ($items as $item) { |
|
304 | 304 | |
305 | 305 | $results[] = array( |
306 | 306 | 'id' => $item->ID, |
@@ -311,18 +311,18 @@ discard block |
||
311 | 311 | |
312 | 312 | $items[] = array( |
313 | 313 | 'id' => 0, |
314 | - 'name' => __( 'No forms found.', 'give' ), |
|
314 | + 'name' => __('No forms found.', 'give'), |
|
315 | 315 | ); |
316 | 316 | |
317 | 317 | } |
318 | 318 | |
319 | - echo json_encode( $results ); |
|
319 | + echo json_encode($results); |
|
320 | 320 | |
321 | 321 | give_die(); |
322 | 322 | } |
323 | 323 | |
324 | -add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' ); |
|
325 | -add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' ); |
|
324 | +add_action('wp_ajax_give_form_search', 'give_ajax_form_search'); |
|
325 | +add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search'); |
|
326 | 326 | |
327 | 327 | /** |
328 | 328 | * Search the donors database via Ajax |
@@ -334,38 +334,38 @@ discard block |
||
334 | 334 | function give_ajax_donor_search() { |
335 | 335 | global $wpdb; |
336 | 336 | |
337 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
337 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
338 | 338 | $results = array(); |
339 | - if ( ! current_user_can( 'view_give_reports' ) ) { |
|
339 | + if ( ! current_user_can('view_give_reports')) { |
|
340 | 340 | $donors = array(); |
341 | 341 | } else { |
342 | - $donors = $wpdb->get_results( "SELECT id,name,email FROM $wpdb->donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" ); |
|
342 | + $donors = $wpdb->get_results("SELECT id,name,email FROM $wpdb->donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50"); |
|
343 | 343 | } |
344 | 344 | |
345 | - if ( $donors ) { |
|
345 | + if ($donors) { |
|
346 | 346 | |
347 | - foreach ( $donors as $donor ) { |
|
347 | + foreach ($donors as $donor) { |
|
348 | 348 | |
349 | 349 | $results[] = array( |
350 | 350 | 'id' => $donor->id, |
351 | - 'name' => $donor->name . ' (' . $donor->email . ')', |
|
351 | + 'name' => $donor->name.' ('.$donor->email.')', |
|
352 | 352 | ); |
353 | 353 | } |
354 | 354 | } else { |
355 | 355 | |
356 | 356 | $donors[] = array( |
357 | 357 | 'id' => 0, |
358 | - 'name' => __( 'No donors found.', 'give' ), |
|
358 | + 'name' => __('No donors found.', 'give'), |
|
359 | 359 | ); |
360 | 360 | |
361 | 361 | } |
362 | 362 | |
363 | - echo json_encode( $results ); |
|
363 | + echo json_encode($results); |
|
364 | 364 | |
365 | 365 | give_die(); |
366 | 366 | } |
367 | 367 | |
368 | -add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' ); |
|
368 | +add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search'); |
|
369 | 369 | |
370 | 370 | |
371 | 371 | /** |
@@ -377,39 +377,39 @@ discard block |
||
377 | 377 | */ |
378 | 378 | function give_ajax_search_users() { |
379 | 379 | |
380 | - if ( current_user_can( 'manage_give_settings' ) ) { |
|
380 | + if (current_user_can('manage_give_settings')) { |
|
381 | 381 | |
382 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
382 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
383 | 383 | |
384 | 384 | $get_users_args = array( |
385 | 385 | 'number' => 9999, |
386 | - 'search' => $search . '*', |
|
386 | + 'search' => $search.'*', |
|
387 | 387 | ); |
388 | 388 | |
389 | - $get_users_args = apply_filters( 'give_search_users_args', $get_users_args ); |
|
389 | + $get_users_args = apply_filters('give_search_users_args', $get_users_args); |
|
390 | 390 | |
391 | - $found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search ); |
|
391 | + $found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search); |
|
392 | 392 | $results = array(); |
393 | 393 | |
394 | - if ( $found_users ) { |
|
394 | + if ($found_users) { |
|
395 | 395 | |
396 | - foreach ( $found_users as $user ) { |
|
396 | + foreach ($found_users as $user) { |
|
397 | 397 | |
398 | 398 | $results[] = array( |
399 | 399 | 'id' => $user->ID, |
400 | - 'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ), |
|
400 | + 'name' => esc_html($user->user_login.' ('.$user->user_email.')'), |
|
401 | 401 | ); |
402 | 402 | } |
403 | 403 | } else { |
404 | 404 | |
405 | 405 | $results[] = array( |
406 | 406 | 'id' => 0, |
407 | - 'name' => __( 'No users found.', 'give' ), |
|
407 | + 'name' => __('No users found.', 'give'), |
|
408 | 408 | ); |
409 | 409 | |
410 | 410 | } |
411 | 411 | |
412 | - echo json_encode( $results ); |
|
412 | + echo json_encode($results); |
|
413 | 413 | |
414 | 414 | }// End if(). |
415 | 415 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | } |
419 | 419 | |
420 | -add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' ); |
|
420 | +add_action('wp_ajax_give_user_search', 'give_ajax_search_users'); |
|
421 | 421 | |
422 | 422 | |
423 | 423 | /** |
@@ -429,32 +429,32 @@ discard block |
||
429 | 429 | */ |
430 | 430 | function give_check_for_form_price_variations() { |
431 | 431 | |
432 | - if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) { |
|
433 | - die( '-1' ); |
|
432 | + if ( ! current_user_can('edit_give_forms', get_current_user_id())) { |
|
433 | + die('-1'); |
|
434 | 434 | } |
435 | 435 | |
436 | - $form_id = intval( $_POST['form_id'] ); |
|
437 | - $form = get_post( $form_id ); |
|
436 | + $form_id = intval($_POST['form_id']); |
|
437 | + $form = get_post($form_id); |
|
438 | 438 | |
439 | - if ( 'give_forms' != $form->post_type ) { |
|
440 | - die( '-2' ); |
|
439 | + if ('give_forms' != $form->post_type) { |
|
440 | + die('-2'); |
|
441 | 441 | } |
442 | 442 | |
443 | - if ( give_has_variable_prices( $form_id ) ) { |
|
444 | - $variable_prices = give_get_variable_prices( $form_id ); |
|
443 | + if (give_has_variable_prices($form_id)) { |
|
444 | + $variable_prices = give_get_variable_prices($form_id); |
|
445 | 445 | |
446 | - if ( $variable_prices ) { |
|
446 | + if ($variable_prices) { |
|
447 | 447 | $ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">'; |
448 | 448 | |
449 | - if ( isset( $_POST['all_prices'] ) ) { |
|
450 | - $ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>'; |
|
449 | + if (isset($_POST['all_prices'])) { |
|
450 | + $ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>'; |
|
451 | 451 | } |
452 | 452 | |
453 | - foreach ( $variable_prices as $key => $price ) { |
|
453 | + foreach ($variable_prices as $key => $price) { |
|
454 | 454 | |
455 | - $level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ); |
|
455 | + $level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))); |
|
456 | 456 | |
457 | - $ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>'; |
|
457 | + $ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>'; |
|
458 | 458 | } |
459 | 459 | $ajax_response .= '</select>'; |
460 | 460 | echo $ajax_response; |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | give_die(); |
465 | 465 | } |
466 | 466 | |
467 | -add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' ); |
|
467 | +add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations'); |
|
468 | 468 | |
469 | 469 | |
470 | 470 | /** |
@@ -475,28 +475,28 @@ discard block |
||
475 | 475 | * @return void |
476 | 476 | */ |
477 | 477 | function give_check_for_form_price_variations_html() { |
478 | - if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) { |
|
478 | + if ( ! current_user_can('edit_give_payments', get_current_user_id())) { |
|
479 | 479 | wp_die(); |
480 | 480 | } |
481 | 481 | |
482 | - $form_id = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : false; |
|
483 | - $payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : false; |
|
484 | - if ( empty( $form_id ) || empty( $payment_id ) ) { |
|
482 | + $form_id = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : false; |
|
483 | + $payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : false; |
|
484 | + if (empty($form_id) || empty($payment_id)) { |
|
485 | 485 | wp_die(); |
486 | 486 | } |
487 | 487 | |
488 | - $form = get_post( $form_id ); |
|
489 | - if ( ! empty( $form->post_type ) && 'give_forms' != $form->post_type ) { |
|
488 | + $form = get_post($form_id); |
|
489 | + if ( ! empty($form->post_type) && 'give_forms' != $form->post_type) { |
|
490 | 490 | wp_die(); |
491 | 491 | } |
492 | 492 | |
493 | - if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) { |
|
494 | - esc_html_e( 'n/a', 'give' ); |
|
493 | + if ( ! give_has_variable_prices($form_id) || ! $form_id) { |
|
494 | + esc_html_e('n/a', 'give'); |
|
495 | 495 | } else { |
496 | 496 | $prices_atts = array(); |
497 | - if ( $variable_prices = give_get_variable_prices( $form_id ) ) { |
|
498 | - foreach ( $variable_prices as $variable_price ) { |
|
499 | - $prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) ); |
|
497 | + if ($variable_prices = give_get_variable_prices($form_id)) { |
|
498 | + foreach ($variable_prices as $variable_price) { |
|
499 | + $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false)); |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | |
@@ -507,12 +507,12 @@ discard block |
||
507 | 507 | 'chosen' => true, |
508 | 508 | 'show_option_all' => '', |
509 | 509 | 'show_option_none' => '', |
510 | - 'select_atts' => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ), |
|
510 | + 'select_atts' => 'data-prices='.esc_attr(json_encode($prices_atts)), |
|
511 | 511 | ); |
512 | 512 | |
513 | - if ( $payment_id ) { |
|
513 | + if ($payment_id) { |
|
514 | 514 | // Payment object. |
515 | - $payment = new Give_Payment( $payment_id ); |
|
515 | + $payment = new Give_Payment($payment_id); |
|
516 | 516 | |
517 | 517 | // Payment meta. |
518 | 518 | $payment_meta = $payment->get_meta(); |
@@ -520,13 +520,13 @@ discard block |
||
520 | 520 | } |
521 | 521 | |
522 | 522 | // Render variable prices select tag html. |
523 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
523 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | give_die(); |
527 | 527 | } |
528 | 528 | |
529 | -add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' ); |
|
529 | +add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html'); |
|
530 | 530 | |
531 | 531 | /** |
532 | 532 | * Send Confirmation Email For Complete Donation History Access. |
@@ -538,24 +538,24 @@ discard block |
||
538 | 538 | function give_confirm_email_for_donation_access() { |
539 | 539 | |
540 | 540 | // Verify Security using Nonce. |
541 | - if ( ! check_ajax_referer( 'give_ajax_nonce', 'nonce' ) ) { |
|
541 | + if ( ! check_ajax_referer('give_ajax_nonce', 'nonce')) { |
|
542 | 542 | return false; |
543 | 543 | } |
544 | 544 | |
545 | 545 | // Bail Out, if email is empty. |
546 | - if ( empty( $_POST['email'] ) ) { |
|
546 | + if (empty($_POST['email'])) { |
|
547 | 547 | return false; |
548 | 548 | } |
549 | 549 | |
550 | - $donor = Give()->donors->get_donor_by( 'email', give_clean( $_POST['email'] ) ); |
|
551 | - if ( Give()->email_access->can_send_email( $donor->id ) ) { |
|
550 | + $donor = Give()->donors->get_donor_by('email', give_clean($_POST['email'])); |
|
551 | + if (Give()->email_access->can_send_email($donor->id)) { |
|
552 | 552 | $return = array(); |
553 | - $email_sent = Give()->email_access->send_email( $donor->id, $donor->email ); |
|
553 | + $email_sent = Give()->email_access->send_email($donor->id, $donor->email); |
|
554 | 554 | |
555 | - if ( ! $email_sent ) { |
|
555 | + if ( ! $email_sent) { |
|
556 | 556 | $return['status'] = 'error'; |
557 | 557 | $return['message'] = Give()->notices->print_frontend_notice( |
558 | - __( 'Unable to send email. Please try again.', 'give' ), |
|
558 | + __('Unable to send email. Please try again.', 'give'), |
|
559 | 559 | false, |
560 | 560 | 'error' |
561 | 561 | ); |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | |
564 | 564 | $return['status'] = 'success'; |
565 | 565 | $return['message'] = Give()->notices->print_frontend_notice( |
566 | - __( 'Please check your email and click on the link to access your complete donation history.', 'give' ), |
|
566 | + __('Please check your email and click on the link to access your complete donation history.', 'give'), |
|
567 | 567 | false, |
568 | 568 | 'success' |
569 | 569 | ); |
@@ -574,16 +574,16 @@ discard block |
||
574 | 574 | $return['status'] = 'error'; |
575 | 575 | $return['message'] = Give()->notices->print_frontend_notice( |
576 | 576 | sprintf( |
577 | - __( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ), |
|
578 | - sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value ) |
|
577 | + __('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'), |
|
578 | + sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value) |
|
579 | 579 | ), |
580 | 580 | false, |
581 | 581 | 'error' |
582 | 582 | ); |
583 | 583 | } |
584 | 584 | |
585 | - echo json_encode( $return ); |
|
585 | + echo json_encode($return); |
|
586 | 586 | give_die(); |
587 | 587 | } |
588 | 588 | |
589 | -add_action( 'wp_ajax_nopriv_give_confirm_email_for_donations_access', 'give_confirm_email_for_donation_access' ); |
|
590 | 589 | \ No newline at end of file |
590 | +add_action('wp_ajax_nopriv_give_confirm_email_for_donations_access', 'give_confirm_email_for_donation_access'); |
|
591 | 591 | \ No newline at end of file |
@@ -242,7 +242,7 @@ |
||
242 | 242 | * @since 1.0 |
243 | 243 | * @access public |
244 | 244 | * |
245 | - * @return bool |
|
245 | + * @return boolean|null |
|
246 | 246 | */ |
247 | 247 | public function check_for_token() { |
248 | 248 |
@@ -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 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function __construct() { |
107 | 107 | |
108 | 108 | // get it started |
109 | - add_action( 'init', array( $this, 'init' ) ); |
|
109 | + add_action('init', array($this, 'init')); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -122,28 +122,28 @@ discard block |
||
122 | 122 | public function init() { |
123 | 123 | |
124 | 124 | // Bail Out, if user is logged in. |
125 | - if ( is_user_logged_in() ) { |
|
125 | + if (is_user_logged_in()) { |
|
126 | 126 | return; |
127 | 127 | } |
128 | 128 | |
129 | 129 | // Are db columns setup? |
130 | - $column_exists = Give()->donors->does_column_exist( 'token' ); |
|
131 | - if ( ! $column_exists ) { |
|
130 | + $column_exists = Give()->donors->does_column_exist('token'); |
|
131 | + if ( ! $column_exists) { |
|
132 | 132 | $this->create_columns(); |
133 | 133 | } |
134 | 134 | |
135 | 135 | // Timeouts. |
136 | - $this->verify_throttle = apply_filters( 'give_nl_verify_throttle', 300 ); |
|
137 | - $this->limit_throttle = apply_filters( 'give_nl_limit_throttle', 3 ); |
|
138 | - $this->token_expiration = apply_filters( 'give_nl_token_expiration', 7200 ); |
|
136 | + $this->verify_throttle = apply_filters('give_nl_verify_throttle', 300); |
|
137 | + $this->limit_throttle = apply_filters('give_nl_limit_throttle', 3); |
|
138 | + $this->token_expiration = apply_filters('give_nl_token_expiration', 7200); |
|
139 | 139 | |
140 | 140 | // Setup login. |
141 | 141 | $this->check_for_token(); |
142 | 142 | |
143 | - if ( $this->token_exists ) { |
|
144 | - add_filter( 'give_can_view_receipt', '__return_true' ); |
|
145 | - add_filter( 'give_user_pending_verification', '__return_false' ); |
|
146 | - add_filter( 'give_get_users_donations_args', array( $this, 'users_donations_args' ) ); |
|
143 | + if ($this->token_exists) { |
|
144 | + add_filter('give_can_view_receipt', '__return_true'); |
|
145 | + add_filter('give_user_pending_verification', '__return_false'); |
|
146 | + add_filter('give_get_users_donations_args', array($this, 'users_donations_args')); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | } |
@@ -158,23 +158,23 @@ discard block |
||
158 | 158 | * |
159 | 159 | * @return bool |
160 | 160 | */ |
161 | - public function can_send_email( $donor_id ) { |
|
161 | + public function can_send_email($donor_id) { |
|
162 | 162 | |
163 | - $donor = Give()->donors->get_donor_by( 'id', $donor_id ); |
|
163 | + $donor = Give()->donors->get_donor_by('id', $donor_id); |
|
164 | 164 | |
165 | - if ( is_object( $donor ) && count( $donor ) > 0 ) { |
|
165 | + if (is_object($donor) && count($donor) > 0) { |
|
166 | 166 | |
167 | - $email_throttle_count = (int) give_get_meta( $donor_id, '_give_email_throttle_count', true ); |
|
167 | + $email_throttle_count = (int) give_get_meta($donor_id, '_give_email_throttle_count', true); |
|
168 | 168 | |
169 | 169 | $cache_key = "give_cache_email_throttle_limit_exhausted_{$donor_id}"; |
170 | 170 | if ( |
171 | 171 | $email_throttle_count < $this->limit_throttle && |
172 | - true !== Give_Cache::get( $cache_key ) |
|
172 | + true !== Give_Cache::get($cache_key) |
|
173 | 173 | ) { |
174 | - give_update_meta( $donor_id, '_give_email_throttle_count', $email_throttle_count + 1 ); |
|
174 | + give_update_meta($donor_id, '_give_email_throttle_count', $email_throttle_count + 1); |
|
175 | 175 | } else { |
176 | - give_update_meta( $donor_id, '_give_email_throttle_count', 0 ); |
|
177 | - Give_Cache::set( $cache_key, true, $this->verify_throttle ); |
|
176 | + give_update_meta($donor_id, '_give_email_throttle_count', 0); |
|
177 | + Give_Cache::set($cache_key, true, $this->verify_throttle); |
|
178 | 178 | return false; |
179 | 179 | } |
180 | 180 | |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | * |
195 | 195 | * @return bool |
196 | 196 | */ |
197 | - public function send_email( $donor_id, $email ) { |
|
198 | - return apply_filters( 'give_email-access_email_notification', $donor_id, $email ); |
|
197 | + public function send_email($donor_id, $email) { |
|
198 | + return apply_filters('give_email-access_email_notification', $donor_id, $email); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -208,28 +208,28 @@ discard block |
||
208 | 208 | */ |
209 | 209 | public function check_for_token() { |
210 | 210 | |
211 | - $token = isset( $_GET['give_nl'] ) ? $_GET['give_nl'] : ''; |
|
211 | + $token = isset($_GET['give_nl']) ? $_GET['give_nl'] : ''; |
|
212 | 212 | |
213 | 213 | // Check for cookie. |
214 | - if ( empty( $token ) ) { |
|
215 | - $token = isset( $_COOKIE['give_nl'] ) ? $_COOKIE['give_nl'] : ''; |
|
214 | + if (empty($token)) { |
|
215 | + $token = isset($_COOKIE['give_nl']) ? $_COOKIE['give_nl'] : ''; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | // Must have a token. |
219 | - if ( ! empty( $token ) ) { |
|
219 | + if ( ! empty($token)) { |
|
220 | 220 | |
221 | - if ( ! $this->is_valid_token( $token ) ) { |
|
222 | - if ( ! $this->is_valid_verify_key( $token ) ) { |
|
221 | + if ( ! $this->is_valid_token($token)) { |
|
222 | + if ( ! $this->is_valid_verify_key($token)) { |
|
223 | 223 | return false; |
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | 227 | // Set Receipt Access Session. |
228 | - Give()->session->set( 'receipt_access', true ); |
|
228 | + Give()->session->set('receipt_access', true); |
|
229 | 229 | $this->token_exists = true; |
230 | 230 | // Set cookie. |
231 | - $lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time(); |
|
232 | - @setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false ); |
|
231 | + $lifetime = current_time('timestamp') + Give()->session->set_expiration_time(); |
|
232 | + @setcookie('give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false); |
|
233 | 233 | |
234 | 234 | return true; |
235 | 235 | } |
@@ -245,26 +245,26 @@ discard block |
||
245 | 245 | * |
246 | 246 | * @return bool |
247 | 247 | */ |
248 | - public function is_valid_token( $token ) { |
|
248 | + public function is_valid_token($token) { |
|
249 | 249 | |
250 | 250 | global $wpdb; |
251 | 251 | |
252 | 252 | // Make sure token isn't expired. |
253 | - $expires = date( 'Y-m-d H:i:s', time() - $this->token_expiration ); |
|
253 | + $expires = date('Y-m-d H:i:s', time() - $this->token_expiration); |
|
254 | 254 | |
255 | 255 | $email = $wpdb->get_var( |
256 | - $wpdb->prepare( "SELECT email FROM {$wpdb->donors} WHERE verify_key = %s AND verify_throttle >= %s LIMIT 1", $token, $expires ) |
|
256 | + $wpdb->prepare("SELECT email FROM {$wpdb->donors} WHERE verify_key = %s AND verify_throttle >= %s LIMIT 1", $token, $expires) |
|
257 | 257 | ); |
258 | 258 | |
259 | - if ( ! empty( $email ) ) { |
|
259 | + if ( ! empty($email)) { |
|
260 | 260 | $this->token_email = $email; |
261 | 261 | $this->token = $token; |
262 | 262 | return true; |
263 | 263 | } |
264 | 264 | |
265 | 265 | // Set error only if email access form isn't being submitted. |
266 | - if ( ! isset( $_POST['give_email'] ) && ! isset( $_POST['_wpnonce'] ) ) { |
|
267 | - 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' ) ) ); |
|
266 | + if ( ! isset($_POST['give_email']) && ! isset($_POST['_wpnonce'])) { |
|
267 | + 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'))); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | return false; |
@@ -283,25 +283,25 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @return void |
285 | 285 | */ |
286 | - public function set_verify_key( $donor_id, $email, $verify_key ) { |
|
286 | + public function set_verify_key($donor_id, $email, $verify_key) { |
|
287 | 287 | global $wpdb; |
288 | 288 | |
289 | - $now = date( 'Y-m-d H:i:s' ); |
|
289 | + $now = date('Y-m-d H:i:s'); |
|
290 | 290 | |
291 | 291 | // Insert or update? |
292 | 292 | $row_id = (int) $wpdb->get_var( |
293 | - $wpdb->prepare( "SELECT id FROM {$wpdb->donors} WHERE id = %d LIMIT 1", $donor_id ) |
|
293 | + $wpdb->prepare("SELECT id FROM {$wpdb->donors} WHERE id = %d LIMIT 1", $donor_id) |
|
294 | 294 | ); |
295 | 295 | |
296 | 296 | // Update. |
297 | - if ( ! empty( $row_id ) ) { |
|
297 | + if ( ! empty($row_id)) { |
|
298 | 298 | $wpdb->query( |
299 | - $wpdb->prepare( "UPDATE {$wpdb->donors} SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id ) |
|
299 | + $wpdb->prepare("UPDATE {$wpdb->donors} SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id) |
|
300 | 300 | ); |
301 | 301 | } // Insert. |
302 | 302 | else { |
303 | 303 | $wpdb->query( |
304 | - $wpdb->prepare( "INSERT INTO {$wpdb->donors} ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now ) |
|
304 | + $wpdb->prepare("INSERT INTO {$wpdb->donors} ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now) |
|
305 | 305 | ); |
306 | 306 | } |
307 | 307 | } |
@@ -316,21 +316,21 @@ discard block |
||
316 | 316 | * |
317 | 317 | * @return bool |
318 | 318 | */ |
319 | - public function is_valid_verify_key( $token ) { |
|
319 | + public function is_valid_verify_key($token) { |
|
320 | 320 | /* @var WPDB $wpdb */ |
321 | 321 | global $wpdb; |
322 | 322 | |
323 | 323 | // See if the verify_key exists. |
324 | 324 | $row = $wpdb->get_row( |
325 | - $wpdb->prepare( "SELECT id, email FROM {$wpdb->donors} WHERE verify_key = %s LIMIT 1", $token ) |
|
325 | + $wpdb->prepare("SELECT id, email FROM {$wpdb->donors} WHERE verify_key = %s LIMIT 1", $token) |
|
326 | 326 | ); |
327 | 327 | |
328 | - $now = date( 'Y-m-d H:i:s' ); |
|
328 | + $now = date('Y-m-d H:i:s'); |
|
329 | 329 | |
330 | 330 | // Set token and remove verify key. |
331 | - if ( ! empty( $row ) ) { |
|
331 | + if ( ! empty($row)) { |
|
332 | 332 | $wpdb->query( |
333 | - $wpdb->prepare( "UPDATE {$wpdb->donors} SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id ) |
|
333 | + $wpdb->prepare("UPDATE {$wpdb->donors} SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id) |
|
334 | 334 | ); |
335 | 335 | |
336 | 336 | $this->token_email = $row->email; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | * |
355 | 355 | * @return mixed |
356 | 356 | */ |
357 | - public function users_donations_args( $args ) { |
|
357 | + public function users_donations_args($args) { |
|
358 | 358 | $args['user'] = $this->token_email; |
359 | 359 | |
360 | 360 | return $args; |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | global $wpdb; |
376 | 376 | |
377 | 377 | // Create columns in donors table. |
378 | - $wpdb->query( "ALTER TABLE {$wpdb->donors} 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`" ); |
|
378 | + $wpdb->query("ALTER TABLE {$wpdb->donors} 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`"); |
|
379 | 379 | } |
380 | 380 | |
381 | 381 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * |
156 | 156 | * Used to redirect a user back to the donation form if there are errors present. |
157 | 157 | * |
158 | - * @param array $args |
|
158 | + * @param string $args |
|
159 | 159 | * |
160 | 160 | * @access public |
161 | 161 | * @since 1.0 |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * @since 1.0 |
302 | 302 | * @since 1.8.16 Add security check |
303 | 303 | * |
304 | - * @return bool |
|
304 | + * @return false|null |
|
305 | 305 | */ |
306 | 306 | function give_listen_for_failed_payments() { |
307 | 307 | |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | * |
750 | 750 | * @param int $form_id ID number of the form to retrieve the minimum price for |
751 | 751 | * |
752 | - * @return mixed string|int Minimum price of the form |
|
752 | + * @return string string|int Minimum price of the form |
|
753 | 753 | */ |
754 | 754 | function give_get_form_minimum_price( $form_id = 0 ) { |
755 | 755 |
@@ -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,14 +23,14 @@ discard block |
||
23 | 23 | |
24 | 24 | global $typenow; |
25 | 25 | |
26 | - if ( $typenow != 'give_forms' ) { |
|
26 | + if ($typenow != 'give_forms') { |
|
27 | 27 | return true; |
28 | 28 | } |
29 | 29 | |
30 | 30 | return false; |
31 | 31 | } |
32 | 32 | |
33 | -add_filter( 'give_shortcode_button_condition', 'give_shortcode_button_condition' ); |
|
33 | +add_filter('give_shortcode_button_condition', 'give_shortcode_button_condition'); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return int|false |
42 | 42 | */ |
43 | -function get_form_id_from_args( $args ) { |
|
43 | +function get_form_id_from_args($args) { |
|
44 | 44 | |
45 | - if ( isset( $args['form_id'] ) && $args['form_id'] != 0 ) { |
|
45 | + if (isset($args['form_id']) && $args['form_id'] != 0) { |
|
46 | 46 | |
47 | - return intval( $args['form_id'] ); |
|
47 | + return intval($args['form_id']); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return false; |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return bool |
61 | 61 | */ |
62 | -function give_is_float_labels_enabled( $args ) { |
|
62 | +function give_is_float_labels_enabled($args) { |
|
63 | 63 | |
64 | 64 | $float_labels = ''; |
65 | 65 | |
66 | - if ( ! empty( $args['float_labels'] ) ) { |
|
66 | + if ( ! empty($args['float_labels'])) { |
|
67 | 67 | $float_labels = $args['float_labels']; |
68 | 68 | } |
69 | 69 | |
70 | - if ( empty( $float_labels ) ) { |
|
71 | - $float_labels = give_get_meta( $args['form_id'], '_give_form_floating_labels', true ); |
|
70 | + if (empty($float_labels)) { |
|
71 | + $float_labels = give_get_meta($args['form_id'], '_give_form_floating_labels', true); |
|
72 | 72 | } |
73 | 73 | |
74 | - if ( empty( $float_labels ) || ( 'global' === $float_labels ) ) { |
|
75 | - $float_labels = give_get_option( 'floatlabels', 'disabled' ); |
|
74 | + if (empty($float_labels) || ('global' === $float_labels)) { |
|
75 | + $float_labels = give_get_option('floatlabels', 'disabled'); |
|
76 | 76 | } |
77 | 77 | |
78 | - return give_is_setting_enabled( $float_labels ); |
|
78 | + return give_is_setting_enabled($float_labels); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $can_checkout = true; |
93 | 93 | |
94 | - return (bool) apply_filters( 'give_can_checkout', $can_checkout ); |
|
94 | + return (bool) apply_filters('give_can_checkout', $can_checkout); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | function give_get_success_page_uri() { |
106 | 106 | $give_options = give_get_settings(); |
107 | 107 | |
108 | - $success_page = isset( $give_options['success_page'] ) ? get_permalink( absint( $give_options['success_page'] ) ) : get_bloginfo( 'url' ); |
|
108 | + $success_page = isset($give_options['success_page']) ? get_permalink(absint($give_options['success_page'])) : get_bloginfo('url'); |
|
109 | 109 | |
110 | - return apply_filters( 'give_get_success_page_uri', $success_page ); |
|
110 | + return apply_filters('give_get_success_page_uri', $success_page); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function give_is_success_page() { |
121 | 121 | $give_options = give_get_settings(); |
122 | - $is_success_page = isset( $give_options['success_page'] ) ? is_page( $give_options['success_page'] ) : false; |
|
122 | + $is_success_page = isset($give_options['success_page']) ? is_page($give_options['success_page']) : false; |
|
123 | 123 | |
124 | - return apply_filters( 'give_is_success_page', $is_success_page ); |
|
124 | + return apply_filters('give_is_success_page', $is_success_page); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | * @since 1.0 |
136 | 136 | * @return void |
137 | 137 | */ |
138 | -function give_send_to_success_page( $query_string = null ) { |
|
138 | +function give_send_to_success_page($query_string = null) { |
|
139 | 139 | |
140 | 140 | $redirect = give_get_success_page_uri(); |
141 | 141 | |
142 | - if ( $query_string ) { |
|
142 | + if ($query_string) { |
|
143 | 143 | $redirect .= $query_string; |
144 | 144 | } |
145 | 145 | |
146 | - $gateway = isset( $_REQUEST['give-gateway'] ) ? $_REQUEST['give-gateway'] : ''; |
|
146 | + $gateway = isset($_REQUEST['give-gateway']) ? $_REQUEST['give-gateway'] : ''; |
|
147 | 147 | |
148 | - wp_redirect( apply_filters( 'give_success_page_redirect', $redirect, $gateway, $query_string ) ); |
|
148 | + wp_redirect(apply_filters('give_success_page_redirect', $redirect, $gateway, $query_string)); |
|
149 | 149 | give_die(); |
150 | 150 | } |
151 | 151 | |
@@ -161,19 +161,19 @@ discard block |
||
161 | 161 | * @since 1.0 |
162 | 162 | * @return Void |
163 | 163 | */ |
164 | -function give_send_back_to_checkout( $args = array() ) { |
|
164 | +function give_send_back_to_checkout($args = array()) { |
|
165 | 165 | |
166 | - $url = isset( $_POST['give-current-url'] ) ? sanitize_text_field( $_POST['give-current-url'] ) : ''; |
|
166 | + $url = isset($_POST['give-current-url']) ? sanitize_text_field($_POST['give-current-url']) : ''; |
|
167 | 167 | $form_id = 0; |
168 | 168 | |
169 | 169 | // Set the form_id. |
170 | - if ( isset( $_POST['give-form-id'] ) ) { |
|
171 | - $form_id = sanitize_text_field( $_POST['give-form-id'] ); |
|
170 | + if (isset($_POST['give-form-id'])) { |
|
171 | + $form_id = sanitize_text_field($_POST['give-form-id']); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | // Need a URL to continue. If none, redirect back to single form. |
175 | - if ( empty( $url ) ) { |
|
176 | - wp_safe_redirect( get_permalink( $form_id ) ); |
|
175 | + if (empty($url)) { |
|
176 | + wp_safe_redirect(get_permalink($form_id)); |
|
177 | 177 | give_die(); |
178 | 178 | } |
179 | 179 | |
@@ -182,41 +182,41 @@ discard block |
||
182 | 182 | ); |
183 | 183 | |
184 | 184 | // Set the $level_id. |
185 | - if ( isset( $_POST['give-price-id'] ) ) { |
|
186 | - $defaults['level-id'] = sanitize_text_field( $_POST['give-price-id'] ); |
|
185 | + if (isset($_POST['give-price-id'])) { |
|
186 | + $defaults['level-id'] = sanitize_text_field($_POST['give-price-id']); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // Check for backward compatibility. |
190 | - if ( is_string( $args ) ) { |
|
191 | - $args = str_replace( '?', '', $args ); |
|
190 | + if (is_string($args)) { |
|
191 | + $args = str_replace('?', '', $args); |
|
192 | 192 | } |
193 | 193 | |
194 | - $args = wp_parse_args( $args, $defaults ); |
|
194 | + $args = wp_parse_args($args, $defaults); |
|
195 | 195 | |
196 | 196 | // Merge URL query with $args to maintain third-party URL parameters after redirect. |
197 | - $url_data = wp_parse_url( $url ); |
|
197 | + $url_data = wp_parse_url($url); |
|
198 | 198 | |
199 | 199 | // Check if an array to prevent notices before parsing. |
200 | - if ( isset( $url_data['query'] ) && ! empty( $url_data['query'] ) ) { |
|
201 | - parse_str( $url_data['query'], $query ); |
|
200 | + if (isset($url_data['query']) && ! empty($url_data['query'])) { |
|
201 | + parse_str($url_data['query'], $query); |
|
202 | 202 | |
203 | 203 | // Precaution: don't allow any CC info. |
204 | - unset( $query['card_number'] ); |
|
205 | - unset( $query['card_cvc'] ); |
|
204 | + unset($query['card_number']); |
|
205 | + unset($query['card_cvc']); |
|
206 | 206 | |
207 | 207 | } else { |
208 | 208 | // No $url_data so pass empty array. |
209 | 209 | $query = array(); |
210 | 210 | } |
211 | 211 | |
212 | - $new_query = array_merge( $args, $query ); |
|
213 | - $new_query_string = http_build_query( $new_query ); |
|
212 | + $new_query = array_merge($args, $query); |
|
213 | + $new_query_string = http_build_query($new_query); |
|
214 | 214 | |
215 | 215 | // Assemble URL parts. |
216 | - $redirect = home_url( '/' . $url_data['path'] . '?' . $new_query_string . '#give-form-' . $form_id . '-wrap' ); |
|
216 | + $redirect = home_url('/'.$url_data['path'].'?'.$new_query_string.'#give-form-'.$form_id.'-wrap'); |
|
217 | 217 | |
218 | 218 | // Redirect them. |
219 | - wp_safe_redirect( apply_filters( 'give_send_back_to_checkout', $redirect, $args ) ); |
|
219 | + wp_safe_redirect(apply_filters('give_send_back_to_checkout', $redirect, $args)); |
|
220 | 220 | give_die(); |
221 | 221 | |
222 | 222 | } |
@@ -232,16 +232,16 @@ discard block |
||
232 | 232 | * @since 1.0 |
233 | 233 | * @return string |
234 | 234 | */ |
235 | -function give_get_success_page_url( $query_string = null ) { |
|
235 | +function give_get_success_page_url($query_string = null) { |
|
236 | 236 | |
237 | - $success_page = give_get_option( 'success_page', 0 ); |
|
238 | - $success_page = get_permalink( $success_page ); |
|
237 | + $success_page = give_get_option('success_page', 0); |
|
238 | + $success_page = get_permalink($success_page); |
|
239 | 239 | |
240 | - if ( $query_string ) { |
|
240 | + if ($query_string) { |
|
241 | 241 | $success_page .= $query_string; |
242 | 242 | } |
243 | 243 | |
244 | - return apply_filters( 'give_success_page_url', $success_page ); |
|
244 | + return apply_filters('give_success_page_url', $success_page); |
|
245 | 245 | |
246 | 246 | } |
247 | 247 | |
@@ -254,32 +254,31 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @return mixed Full URL to the Failed Donation Page, if present, home page if it doesn't exist. |
256 | 256 | */ |
257 | -function give_get_failed_transaction_uri( $extras = false ) { |
|
257 | +function give_get_failed_transaction_uri($extras = false) { |
|
258 | 258 | $give_options = give_get_settings(); |
259 | 259 | |
260 | 260 | // Remove question mark. |
261 | - if ( 0 === strpos( $extras, '?' ) ) { |
|
262 | - $extras = substr( $extras, 1 ); |
|
261 | + if (0 === strpos($extras, '?')) { |
|
262 | + $extras = substr($extras, 1); |
|
263 | 263 | } |
264 | 264 | |
265 | - $extras_args = wp_parse_args( $extras ); |
|
265 | + $extras_args = wp_parse_args($extras); |
|
266 | 266 | |
267 | 267 | // Set nonce if payment id exist in extra params. |
268 | - if ( array_key_exists( 'payment-id', $extras_args ) ) { |
|
269 | - $extras_args['_wpnonce'] = wp_create_nonce( "give-failed-donation-{$extras_args['payment-id']}" ); |
|
270 | - $extras = http_build_query( $extras_args ); |
|
268 | + if (array_key_exists('payment-id', $extras_args)) { |
|
269 | + $extras_args['_wpnonce'] = wp_create_nonce("give-failed-donation-{$extras_args['payment-id']}"); |
|
270 | + $extras = http_build_query($extras_args); |
|
271 | 271 | } |
272 | 272 | |
273 | - $uri = ! empty( $give_options['failure_page'] ) ? |
|
274 | - trailingslashit( get_permalink( $give_options['failure_page'] ) ) : |
|
275 | - home_url(); |
|
273 | + $uri = ! empty($give_options['failure_page']) ? |
|
274 | + trailingslashit(get_permalink($give_options['failure_page'])) : home_url(); |
|
276 | 275 | |
277 | 276 | |
278 | - if ( $extras ) { |
|
277 | + if ($extras) { |
|
279 | 278 | $uri .= "?{$extras}"; |
280 | 279 | } |
281 | 280 | |
282 | - return apply_filters( 'give_get_failed_transaction_uri', $uri ); |
|
281 | + return apply_filters('give_get_failed_transaction_uri', $uri); |
|
283 | 282 | } |
284 | 283 | |
285 | 284 | /** |
@@ -290,9 +289,9 @@ discard block |
||
290 | 289 | */ |
291 | 290 | function give_is_failed_transaction_page() { |
292 | 291 | $give_options = give_get_settings(); |
293 | - $ret = isset( $give_options['failure_page'] ) ? is_page( $give_options['failure_page'] ) : false; |
|
292 | + $ret = isset($give_options['failure_page']) ? is_page($give_options['failure_page']) : false; |
|
294 | 293 | |
295 | - return apply_filters( 'give_is_failure_page', $ret ); |
|
294 | + return apply_filters('give_is_failure_page', $ret); |
|
296 | 295 | } |
297 | 296 | |
298 | 297 | /** |
@@ -305,25 +304,25 @@ discard block |
||
305 | 304 | */ |
306 | 305 | function give_listen_for_failed_payments() { |
307 | 306 | |
308 | - $failed_page = give_get_option( 'failure_page', 0 ); |
|
309 | - $payment_id = ! empty( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : 0; |
|
310 | - $nonce = ! empty( $_GET['_wpnonce'] ) ? give_clean( $_GET['_wpnonce'] ) : false; |
|
307 | + $failed_page = give_get_option('failure_page', 0); |
|
308 | + $payment_id = ! empty($_GET['payment-id']) ? absint($_GET['payment-id']) : 0; |
|
309 | + $nonce = ! empty($_GET['_wpnonce']) ? give_clean($_GET['_wpnonce']) : false; |
|
311 | 310 | |
312 | 311 | // Bailout. |
313 | - if ( ! $failed_page || ! is_page( $failed_page ) || ! $payment_id || ! $nonce ) { |
|
312 | + if ( ! $failed_page || ! is_page($failed_page) || ! $payment_id || ! $nonce) { |
|
314 | 313 | return false; |
315 | 314 | } |
316 | 315 | |
317 | 316 | // Security check. |
318 | - if ( ! wp_verify_nonce( $nonce, "give-failed-donation-{$payment_id}" ) ) { |
|
319 | - wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ) ); |
|
317 | + if ( ! wp_verify_nonce($nonce, "give-failed-donation-{$payment_id}")) { |
|
318 | + wp_die(__('Nonce verification failed.', 'give'), __('Error', 'give')); |
|
320 | 319 | } |
321 | 320 | |
322 | 321 | // Set payment status to failure |
323 | - give_update_payment_status( $payment_id, 'failed' ); |
|
322 | + give_update_payment_status($payment_id, 'failed'); |
|
324 | 323 | } |
325 | 324 | |
326 | -add_action( 'template_redirect', 'give_listen_for_failed_payments' ); |
|
325 | +add_action('template_redirect', 'give_listen_for_failed_payments'); |
|
327 | 326 | |
328 | 327 | /** |
329 | 328 | * Retrieve the Donation History page URI |
@@ -336,9 +335,9 @@ discard block |
||
336 | 335 | function give_get_history_page_uri() { |
337 | 336 | $give_options = give_get_settings(); |
338 | 337 | |
339 | - $history_page = isset( $give_options['history_page'] ) ? get_permalink( absint( $give_options['history_page'] ) ) : get_bloginfo( 'url' ); |
|
338 | + $history_page = isset($give_options['history_page']) ? get_permalink(absint($give_options['history_page'])) : get_bloginfo('url'); |
|
340 | 339 | |
341 | - return apply_filters( 'give_get_history_page_uri', $history_page ); |
|
340 | + return apply_filters('give_get_history_page_uri', $history_page); |
|
342 | 341 | } |
343 | 342 | |
344 | 343 | /** |
@@ -351,11 +350,11 @@ discard block |
||
351 | 350 | * @since 1.0 |
352 | 351 | * @return bool |
353 | 352 | */ |
354 | -function give_field_is_required( $field = '', $form_id ) { |
|
353 | +function give_field_is_required($field = '', $form_id) { |
|
355 | 354 | |
356 | - $required_fields = give_get_required_fields( $form_id ); |
|
355 | + $required_fields = give_get_required_fields($form_id); |
|
357 | 356 | |
358 | - return array_key_exists( $field, $required_fields ); |
|
357 | + return array_key_exists($field, $required_fields); |
|
359 | 358 | } |
360 | 359 | |
361 | 360 | /** |
@@ -372,12 +371,12 @@ discard block |
||
372 | 371 | * |
373 | 372 | * @return void |
374 | 373 | */ |
375 | -function give_record_donation_in_log( $give_form_id = 0, $payment_id, $price_id = false, $donation_date = null ) { |
|
374 | +function give_record_donation_in_log($give_form_id = 0, $payment_id, $price_id = false, $donation_date = null) { |
|
376 | 375 | $log_data = array( |
377 | 376 | 'log_parent' => $payment_id, |
378 | 377 | 'log_type' => 'sale', |
379 | - 'log_date' => isset( $donation_date ) ? $donation_date : null, |
|
380 | - 'log_date_gmt' => isset( $donation_date ) ? $donation_date : null, |
|
378 | + 'log_date' => isset($donation_date) ? $donation_date : null, |
|
379 | + 'log_date_gmt' => isset($donation_date) ? $donation_date : null, |
|
381 | 380 | ); |
382 | 381 | |
383 | 382 | $log_meta = array( |
@@ -385,7 +384,7 @@ discard block |
||
385 | 384 | 'price_id' => (int) $price_id, |
386 | 385 | ); |
387 | 386 | |
388 | - Give()->logs->insert_log( $log_data, $log_meta ); |
|
387 | + Give()->logs->insert_log($log_data, $log_meta); |
|
389 | 388 | } |
390 | 389 | |
391 | 390 | |
@@ -399,11 +398,11 @@ discard block |
||
399 | 398 | * |
400 | 399 | * @return bool|int |
401 | 400 | */ |
402 | -function give_increase_donation_count( $form_id = 0, $quantity = 1 ) { |
|
401 | +function give_increase_donation_count($form_id = 0, $quantity = 1) { |
|
403 | 402 | $quantity = (int) $quantity; |
404 | - $form = new Give_Donate_Form( $form_id ); |
|
403 | + $form = new Give_Donate_Form($form_id); |
|
405 | 404 | |
406 | - return $form->increase_sales( $quantity ); |
|
405 | + return $form->increase_sales($quantity); |
|
407 | 406 | } |
408 | 407 | |
409 | 408 | /** |
@@ -416,11 +415,11 @@ discard block |
||
416 | 415 | * |
417 | 416 | * @return bool|int |
418 | 417 | */ |
419 | -function give_decrease_donation_count( $form_id = 0, $quantity = 1 ) { |
|
418 | +function give_decrease_donation_count($form_id = 0, $quantity = 1) { |
|
420 | 419 | $quantity = (int) $quantity; |
421 | - $form = new Give_Donate_Form( $form_id ); |
|
420 | + $form = new Give_Donate_Form($form_id); |
|
422 | 421 | |
423 | - return $form->decrease_sales( $quantity ); |
|
422 | + return $form->decrease_sales($quantity); |
|
424 | 423 | } |
425 | 424 | |
426 | 425 | /** |
@@ -433,10 +432,10 @@ discard block |
||
433 | 432 | * |
434 | 433 | * @return bool|int |
435 | 434 | */ |
436 | -function give_increase_earnings( $give_form_id = 0, $amount ) { |
|
437 | - $form = new Give_Donate_Form( $give_form_id ); |
|
435 | +function give_increase_earnings($give_form_id = 0, $amount) { |
|
436 | + $form = new Give_Donate_Form($give_form_id); |
|
438 | 437 | |
439 | - return $form->increase_earnings( $amount ); |
|
438 | + return $form->increase_earnings($amount); |
|
440 | 439 | } |
441 | 440 | |
442 | 441 | /** |
@@ -451,11 +450,11 @@ discard block |
||
451 | 450 | * |
452 | 451 | * @return bool|int |
453 | 452 | */ |
454 | -function give_decrease_form_earnings( $form_id = 0, $amount ) { |
|
453 | +function give_decrease_form_earnings($form_id = 0, $amount) { |
|
455 | 454 | |
456 | - $form = new Give_Donate_Form( $form_id ); |
|
455 | + $form = new Give_Donate_Form($form_id); |
|
457 | 456 | |
458 | - return $form->decrease_earnings( $amount ); |
|
457 | + return $form->decrease_earnings($amount); |
|
459 | 458 | } |
460 | 459 | |
461 | 460 | |
@@ -468,15 +467,15 @@ discard block |
||
468 | 467 | * |
469 | 468 | * @return int $earnings Earnings for a certain form |
470 | 469 | */ |
471 | -function give_get_form_earnings_stats( $form_id = 0 ) { |
|
472 | - $give_form = new Give_Donate_Form( $form_id ); |
|
470 | +function give_get_form_earnings_stats($form_id = 0) { |
|
471 | + $give_form = new Give_Donate_Form($form_id); |
|
473 | 472 | |
474 | 473 | /** |
475 | 474 | * Filter the form earnings |
476 | 475 | * |
477 | 476 | * @since 1.8.17 |
478 | 477 | */ |
479 | - return apply_filters( 'give_get_form_earnings_stats', $give_form->earnings, $form_id, $give_form ); |
|
478 | + return apply_filters('give_get_form_earnings_stats', $give_form->earnings, $form_id, $give_form); |
|
480 | 479 | } |
481 | 480 | |
482 | 481 | |
@@ -489,8 +488,8 @@ discard block |
||
489 | 488 | * |
490 | 489 | * @return int $sales Amount of sales for a certain form |
491 | 490 | */ |
492 | -function give_get_form_sales_stats( $give_form_id = 0 ) { |
|
493 | - $give_form = new Give_Donate_Form( $give_form_id ); |
|
491 | +function give_get_form_sales_stats($give_form_id = 0) { |
|
492 | + $give_form = new Give_Donate_Form($give_form_id); |
|
494 | 493 | |
495 | 494 | return $give_form->sales; |
496 | 495 | } |
@@ -505,16 +504,16 @@ discard block |
||
505 | 504 | * |
506 | 505 | * @return float $sales Average monthly sales |
507 | 506 | */ |
508 | -function give_get_average_monthly_form_sales( $form_id = 0 ) { |
|
509 | - $sales = give_get_form_sales_stats( $form_id ); |
|
510 | - $release_date = get_post_field( 'post_date', $form_id ); |
|
507 | +function give_get_average_monthly_form_sales($form_id = 0) { |
|
508 | + $sales = give_get_form_sales_stats($form_id); |
|
509 | + $release_date = get_post_field('post_date', $form_id); |
|
511 | 510 | |
512 | - $diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) ); |
|
511 | + $diff = abs(current_time('timestamp') - strtotime($release_date)); |
|
513 | 512 | |
514 | - $months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication |
|
513 | + $months = floor($diff / (30 * 60 * 60 * 24)); // Number of months since publication |
|
515 | 514 | |
516 | - if ( $months > 0 ) { |
|
517 | - $sales = ( $sales / $months ); |
|
515 | + if ($months > 0) { |
|
516 | + $sales = ($sales / $months); |
|
518 | 517 | } |
519 | 518 | |
520 | 519 | return $sales; |
@@ -530,16 +529,16 @@ discard block |
||
530 | 529 | * |
531 | 530 | * @return float $earnings Average monthly earnings |
532 | 531 | */ |
533 | -function give_get_average_monthly_form_earnings( $form_id = 0 ) { |
|
534 | - $earnings = give_get_form_earnings_stats( $form_id ); |
|
535 | - $release_date = get_post_field( 'post_date', $form_id ); |
|
532 | +function give_get_average_monthly_form_earnings($form_id = 0) { |
|
533 | + $earnings = give_get_form_earnings_stats($form_id); |
|
534 | + $release_date = get_post_field('post_date', $form_id); |
|
536 | 535 | |
537 | - $diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) ); |
|
536 | + $diff = abs(current_time('timestamp') - strtotime($release_date)); |
|
538 | 537 | |
539 | - $months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication |
|
538 | + $months = floor($diff / (30 * 60 * 60 * 24)); // Number of months since publication |
|
540 | 539 | |
541 | - if ( $months > 0 ) { |
|
542 | - $earnings = ( $earnings / $months ); |
|
540 | + if ($months > 0) { |
|
541 | + $earnings = ($earnings / $months); |
|
543 | 542 | } |
544 | 543 | |
545 | 544 | return $earnings < 0 ? 0 : $earnings; |
@@ -560,34 +559,34 @@ discard block |
||
560 | 559 | * |
561 | 560 | * @return string $price_name Name of the price option |
562 | 561 | */ |
563 | -function give_get_price_option_name( $form_id = 0, $price_id = 0, $payment_id = 0, $use_fallback = true ) { |
|
562 | +function give_get_price_option_name($form_id = 0, $price_id = 0, $payment_id = 0, $use_fallback = true) { |
|
564 | 563 | |
565 | - $prices = give_get_variable_prices( $form_id ); |
|
564 | + $prices = give_get_variable_prices($form_id); |
|
566 | 565 | $price_name = ''; |
567 | 566 | |
568 | - if ( false === $prices ) { |
|
567 | + if (false === $prices) { |
|
569 | 568 | return $price_name; |
570 | 569 | } |
571 | 570 | |
572 | - foreach ( $prices as $price ) { |
|
571 | + foreach ($prices as $price) { |
|
573 | 572 | |
574 | - if ( intval( $price['_give_id']['level_id'] ) === intval( $price_id ) ) { |
|
573 | + if (intval($price['_give_id']['level_id']) === intval($price_id)) { |
|
575 | 574 | |
576 | - $price_text = isset( $price['_give_text'] ) ? $price['_give_text'] : ''; |
|
575 | + $price_text = isset($price['_give_text']) ? $price['_give_text'] : ''; |
|
577 | 576 | $price_fallback = $use_fallback ? |
578 | 577 | give_currency_filter( |
579 | 578 | give_format_amount( |
580 | 579 | $price['_give_amount'], |
581 | - array( 'sanitize' => false ) |
|
580 | + array('sanitize' => false) |
|
582 | 581 | ), |
583 | - array( 'decode_currency' => true ) |
|
582 | + array('decode_currency' => true) |
|
584 | 583 | ) : ''; |
585 | - $price_name = ! empty( $price_text ) ? $price_text : $price_fallback; |
|
584 | + $price_name = ! empty($price_text) ? $price_text : $price_fallback; |
|
586 | 585 | |
587 | 586 | } |
588 | 587 | } |
589 | 588 | |
590 | - return apply_filters( 'give_get_price_option_name', $price_name, $form_id, $payment_id, $price_id ); |
|
589 | + return apply_filters('give_get_price_option_name', $price_name, $form_id, $payment_id, $price_id); |
|
591 | 590 | } |
592 | 591 | |
593 | 592 | |
@@ -601,25 +600,25 @@ discard block |
||
601 | 600 | * |
602 | 601 | * @return string $range A fully formatted price range |
603 | 602 | */ |
604 | -function give_price_range( $form_id = 0, $formatted = true ) { |
|
605 | - $low = give_get_lowest_price_option( $form_id ); |
|
606 | - $high = give_get_highest_price_option( $form_id ); |
|
607 | - $order_type = ! empty( $_REQUEST['order'] ) ? $_REQUEST['order'] : 'asc'; |
|
603 | +function give_price_range($form_id = 0, $formatted = true) { |
|
604 | + $low = give_get_lowest_price_option($form_id); |
|
605 | + $high = give_get_highest_price_option($form_id); |
|
606 | + $order_type = ! empty($_REQUEST['order']) ? $_REQUEST['order'] : 'asc'; |
|
608 | 607 | |
609 | 608 | $range = sprintf( |
610 | 609 | '<span class="give_price_range_%1$s">%2$s</span><span class="give_price_range_sep"> – </span><span class="give_price_range_%3$s">%4$s</span>', |
611 | 610 | 'asc' === $order_type ? 'low' : 'high', |
612 | - 'asc' === $order_type ? give_currency_filter( give_format_amount( $low, array( 'sanitize' => false ) ) ) : give_currency_filter( give_format_amount( $high, array( 'sanitize' => false ) ) ), |
|
611 | + 'asc' === $order_type ? give_currency_filter(give_format_amount($low, array('sanitize' => false))) : give_currency_filter(give_format_amount($high, array('sanitize' => false))), |
|
613 | 612 | 'asc' === $order_type ? 'high' : 'low', |
614 | - 'asc' === $order_type ? give_currency_filter( give_format_amount( $high, array( 'sanitize' => false ) ) ) : give_currency_filter( give_format_amount( $low, array( 'sanitize' => false ) ) ) |
|
613 | + 'asc' === $order_type ? give_currency_filter(give_format_amount($high, array('sanitize' => false))) : give_currency_filter(give_format_amount($low, array('sanitize' => false))) |
|
615 | 614 | |
616 | 615 | ); |
617 | 616 | |
618 | - if ( ! $formatted ) { |
|
619 | - $range = wp_strip_all_tags( $range ); |
|
617 | + if ( ! $formatted) { |
|
618 | + $range = wp_strip_all_tags($range); |
|
620 | 619 | } |
621 | 620 | |
622 | - return apply_filters( 'give_price_range', $range, $form_id, $low, $high ); |
|
621 | + return apply_filters('give_price_range', $range, $form_id, $low, $high); |
|
623 | 622 | } |
624 | 623 | |
625 | 624 | |
@@ -634,35 +633,35 @@ discard block |
||
634 | 633 | * |
635 | 634 | * @return int ID of the lowest price |
636 | 635 | */ |
637 | -function give_get_lowest_price_id( $form_id = 0 ) { |
|
636 | +function give_get_lowest_price_id($form_id = 0) { |
|
638 | 637 | |
639 | - if ( empty( $form_id ) ) { |
|
638 | + if (empty($form_id)) { |
|
640 | 639 | $form_id = get_the_ID(); |
641 | 640 | } |
642 | 641 | |
643 | - if ( ! give_has_variable_prices( $form_id ) ) { |
|
644 | - return give_get_form_price( $form_id ); |
|
642 | + if ( ! give_has_variable_prices($form_id)) { |
|
643 | + return give_get_form_price($form_id); |
|
645 | 644 | } |
646 | 645 | |
647 | - $prices = give_get_variable_prices( $form_id ); |
|
646 | + $prices = give_get_variable_prices($form_id); |
|
648 | 647 | |
649 | 648 | $min = $min_id = 0; |
650 | 649 | |
651 | - if ( ! empty( $prices ) ) { |
|
650 | + if ( ! empty($prices)) { |
|
652 | 651 | |
653 | - foreach ( $prices as $key => $price ) { |
|
652 | + foreach ($prices as $key => $price) { |
|
654 | 653 | |
655 | - if ( empty( $price['_give_amount'] ) ) { |
|
654 | + if (empty($price['_give_amount'])) { |
|
656 | 655 | continue; |
657 | 656 | } |
658 | 657 | |
659 | - if ( ! isset( $min ) ) { |
|
658 | + if ( ! isset($min)) { |
|
660 | 659 | $min = $price['_give_amount']; |
661 | 660 | } else { |
662 | - $min = min( $min, $price['_give_amount'] ); |
|
661 | + $min = min($min, $price['_give_amount']); |
|
663 | 662 | } |
664 | 663 | |
665 | - if ( $price['_give_amount'] == $min ) { |
|
664 | + if ($price['_give_amount'] == $min) { |
|
666 | 665 | $min_id = $price['_give_id']['level_id']; |
667 | 666 | } |
668 | 667 | } |
@@ -680,22 +679,22 @@ discard block |
||
680 | 679 | * |
681 | 680 | * @return float Amount of the lowest price |
682 | 681 | */ |
683 | -function give_get_lowest_price_option( $form_id = 0 ) { |
|
684 | - if ( empty( $form_id ) ) { |
|
682 | +function give_get_lowest_price_option($form_id = 0) { |
|
683 | + if (empty($form_id)) { |
|
685 | 684 | $form_id = get_the_ID(); |
686 | 685 | } |
687 | 686 | |
688 | - if ( ! give_has_variable_prices( $form_id ) ) { |
|
689 | - return give_get_form_price( $form_id ); |
|
687 | + if ( ! give_has_variable_prices($form_id)) { |
|
688 | + return give_get_form_price($form_id); |
|
690 | 689 | } |
691 | 690 | |
692 | - if ( ! ( $low = get_post_meta( $form_id, '_give_levels_minimum_amount', true ) ) ) { |
|
691 | + if ( ! ($low = get_post_meta($form_id, '_give_levels_minimum_amount', true))) { |
|
693 | 692 | // Backward compatibility. |
694 | - $prices = wp_list_pluck( give_get_variable_prices( $form_id ), '_give_amount' ); |
|
695 | - $low = ! empty( $prices ) ? min( $prices ) : 0; |
|
693 | + $prices = wp_list_pluck(give_get_variable_prices($form_id), '_give_amount'); |
|
694 | + $low = ! empty($prices) ? min($prices) : 0; |
|
696 | 695 | } |
697 | 696 | |
698 | - return give_maybe_sanitize_amount( $low ); |
|
697 | + return give_maybe_sanitize_amount($low); |
|
699 | 698 | } |
700 | 699 | |
701 | 700 | /** |
@@ -707,23 +706,23 @@ discard block |
||
707 | 706 | * |
708 | 707 | * @return float Amount of the highest price |
709 | 708 | */ |
710 | -function give_get_highest_price_option( $form_id = 0 ) { |
|
709 | +function give_get_highest_price_option($form_id = 0) { |
|
711 | 710 | |
712 | - if ( empty( $form_id ) ) { |
|
711 | + if (empty($form_id)) { |
|
713 | 712 | $form_id = get_the_ID(); |
714 | 713 | } |
715 | 714 | |
716 | - if ( ! give_has_variable_prices( $form_id ) ) { |
|
717 | - return give_get_form_price( $form_id ); |
|
715 | + if ( ! give_has_variable_prices($form_id)) { |
|
716 | + return give_get_form_price($form_id); |
|
718 | 717 | } |
719 | 718 | |
720 | - if ( ! ( $high = get_post_meta( $form_id, '_give_levels_maximum_amount', true ) ) ) { |
|
719 | + if ( ! ($high = get_post_meta($form_id, '_give_levels_maximum_amount', true))) { |
|
721 | 720 | // Backward compatibility. |
722 | - $prices = wp_list_pluck( give_get_variable_prices( $form_id ), '_give_amount' ); |
|
723 | - $high = ! empty( $prices ) ? max( $prices ) : 0; |
|
721 | + $prices = wp_list_pluck(give_get_variable_prices($form_id), '_give_amount'); |
|
722 | + $high = ! empty($prices) ? max($prices) : 0; |
|
724 | 723 | } |
725 | 724 | |
726 | - return give_maybe_sanitize_amount( $high ); |
|
725 | + return give_maybe_sanitize_amount($high); |
|
727 | 726 | } |
728 | 727 | |
729 | 728 | /** |
@@ -735,15 +734,15 @@ discard block |
||
735 | 734 | * |
736 | 735 | * @return mixed string|int Price of the form |
737 | 736 | */ |
738 | -function give_get_form_price( $form_id = 0 ) { |
|
737 | +function give_get_form_price($form_id = 0) { |
|
739 | 738 | |
740 | - if ( empty( $form_id ) ) { |
|
739 | + if (empty($form_id)) { |
|
741 | 740 | return false; |
742 | 741 | } |
743 | 742 | |
744 | - $form = new Give_Donate_Form( $form_id ); |
|
743 | + $form = new Give_Donate_Form($form_id); |
|
745 | 744 | |
746 | - return $form->__get( 'price' ); |
|
745 | + return $form->__get('price'); |
|
747 | 746 | } |
748 | 747 | |
749 | 748 | /** |
@@ -755,13 +754,13 @@ discard block |
||
755 | 754 | * |
756 | 755 | * @return mixed string|int Minimum price of the form |
757 | 756 | */ |
758 | -function give_get_form_minimum_price( $form_id = 0 ) { |
|
757 | +function give_get_form_minimum_price($form_id = 0) { |
|
759 | 758 | |
760 | - if ( empty( $form_id ) ) { |
|
759 | + if (empty($form_id)) { |
|
761 | 760 | return false; |
762 | 761 | } |
763 | 762 | |
764 | - $form = new Give_Donate_Form( $form_id ); |
|
763 | + $form = new Give_Donate_Form($form_id); |
|
765 | 764 | |
766 | 765 | return $form->get_minimum_price(); |
767 | 766 | |
@@ -778,48 +777,48 @@ discard block |
||
778 | 777 | * |
779 | 778 | * @return int $formatted_price |
780 | 779 | */ |
781 | -function give_price( $form_id = 0, $echo = true, $price_id = false ) { |
|
780 | +function give_price($form_id = 0, $echo = true, $price_id = false) { |
|
782 | 781 | $price = 0; |
783 | 782 | |
784 | - if ( empty( $form_id ) ) { |
|
783 | + if (empty($form_id)) { |
|
785 | 784 | $form_id = get_the_ID(); |
786 | 785 | } |
787 | 786 | |
788 | - if ( give_has_variable_prices( $form_id ) ) { |
|
787 | + if (give_has_variable_prices($form_id)) { |
|
789 | 788 | |
790 | - $prices = give_get_variable_prices( $form_id ); |
|
789 | + $prices = give_get_variable_prices($form_id); |
|
791 | 790 | |
792 | - if ( false !== $price_id ) { |
|
791 | + if (false !== $price_id) { |
|
793 | 792 | |
794 | 793 | // loop through multi-prices to see which is default |
795 | - foreach ( $prices as $price ) { |
|
794 | + foreach ($prices as $price) { |
|
796 | 795 | // this is the default price |
797 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
796 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
798 | 797 | $price = (float) $price['_give_amount']; |
799 | 798 | }; |
800 | 799 | } |
801 | 800 | } else { |
802 | 801 | |
803 | - $price = give_get_lowest_price_option( $form_id ); |
|
802 | + $price = give_get_lowest_price_option($form_id); |
|
804 | 803 | } |
805 | 804 | } else { |
806 | 805 | |
807 | - $price = give_get_form_price( $form_id ); |
|
806 | + $price = give_get_form_price($form_id); |
|
808 | 807 | } |
809 | 808 | |
810 | - $price = apply_filters( 'give_form_price', give_maybe_sanitize_amount( $price ), $form_id ); |
|
811 | - $formatted_price = '<span class="give_price" id="give_price_' . $form_id . '">' . $price . '</span>'; |
|
812 | - $formatted_price = apply_filters( 'give_form_price_after_html', $formatted_price, $form_id, $price ); |
|
809 | + $price = apply_filters('give_form_price', give_maybe_sanitize_amount($price), $form_id); |
|
810 | + $formatted_price = '<span class="give_price" id="give_price_'.$form_id.'">'.$price.'</span>'; |
|
811 | + $formatted_price = apply_filters('give_form_price_after_html', $formatted_price, $form_id, $price); |
|
813 | 812 | |
814 | - if ( $echo ) { |
|
813 | + if ($echo) { |
|
815 | 814 | echo $formatted_price; |
816 | 815 | } else { |
817 | 816 | return $formatted_price; |
818 | 817 | } |
819 | 818 | } |
820 | 819 | |
821 | -add_filter( 'give_form_price', 'give_format_amount', 10 ); |
|
822 | -add_filter( 'give_form_price', 'give_currency_filter', 20 ); |
|
820 | +add_filter('give_form_price', 'give_format_amount', 10); |
|
821 | +add_filter('give_form_price', 'give_currency_filter', 20); |
|
823 | 822 | |
824 | 823 | |
825 | 824 | /** |
@@ -832,19 +831,19 @@ discard block |
||
832 | 831 | * |
833 | 832 | * @return float $amount Amount of the price option |
834 | 833 | */ |
835 | -function give_get_price_option_amount( $form_id = 0, $price_id = 0 ) { |
|
836 | - $prices = give_get_variable_prices( $form_id ); |
|
834 | +function give_get_price_option_amount($form_id = 0, $price_id = 0) { |
|
835 | + $prices = give_get_variable_prices($form_id); |
|
837 | 836 | |
838 | 837 | $amount = 0.00; |
839 | 838 | |
840 | - foreach ( $prices as $price ) { |
|
841 | - if ( isset( $price['_give_id']['level_id'] ) && $price['_give_id']['level_id'] == $price_id ) { |
|
842 | - $amount = isset( $price['_give_amount'] ) ? $price['_give_amount'] : 0.00; |
|
839 | + foreach ($prices as $price) { |
|
840 | + if (isset($price['_give_id']['level_id']) && $price['_give_id']['level_id'] == $price_id) { |
|
841 | + $amount = isset($price['_give_amount']) ? $price['_give_amount'] : 0.00; |
|
843 | 842 | break; |
844 | 843 | }; |
845 | 844 | } |
846 | 845 | |
847 | - return apply_filters( 'give_get_price_option_amount', give_maybe_sanitize_amount( $amount ), $form_id, $price_id ); |
|
846 | + return apply_filters('give_get_price_option_amount', give_maybe_sanitize_amount($amount), $form_id, $price_id); |
|
848 | 847 | } |
849 | 848 | |
850 | 849 | /** |
@@ -856,13 +855,13 @@ discard block |
||
856 | 855 | * |
857 | 856 | * @return mixed string|int Goal of the form |
858 | 857 | */ |
859 | -function give_get_form_goal( $form_id = 0 ) { |
|
858 | +function give_get_form_goal($form_id = 0) { |
|
860 | 859 | |
861 | - if ( empty( $form_id ) ) { |
|
860 | + if (empty($form_id)) { |
|
862 | 861 | return false; |
863 | 862 | } |
864 | 863 | |
865 | - $form = new Give_Donate_Form( $form_id ); |
|
864 | + $form = new Give_Donate_Form($form_id); |
|
866 | 865 | |
867 | 866 | return $form->goal; |
868 | 867 | |
@@ -877,13 +876,13 @@ discard block |
||
877 | 876 | * |
878 | 877 | * @return mixed string|int Goal of the form |
879 | 878 | */ |
880 | -function give_get_form_goal_format( $form_id = 0 ) { |
|
879 | +function give_get_form_goal_format($form_id = 0) { |
|
881 | 880 | |
882 | - if ( empty( $form_id ) ) { |
|
881 | + if (empty($form_id)) { |
|
883 | 882 | return false; |
884 | 883 | } |
885 | 884 | |
886 | - return give_get_meta( $form_id, '_give_goal_format', true ); |
|
885 | + return give_get_meta($form_id, '_give_goal_format', true); |
|
887 | 886 | |
888 | 887 | } |
889 | 888 | |
@@ -897,19 +896,19 @@ discard block |
||
897 | 896 | * |
898 | 897 | * @return string $formatted_goal |
899 | 898 | */ |
900 | -function give_goal( $form_id = 0, $echo = true ) { |
|
899 | +function give_goal($form_id = 0, $echo = true) { |
|
901 | 900 | |
902 | - if ( empty( $form_id ) ) { |
|
901 | + if (empty($form_id)) { |
|
903 | 902 | $form_id = get_the_ID(); |
904 | 903 | } |
905 | 904 | |
906 | - $goal = give_get_form_goal( $form_id ); |
|
905 | + $goal = give_get_form_goal($form_id); |
|
907 | 906 | $goal_format = give_get_form_goal_format($form_id); |
908 | 907 | |
909 | - if ( 'donation' === $goal_format ) { |
|
908 | + if ('donation' === $goal_format) { |
|
910 | 909 | $goal = "{$goal} donations"; |
911 | 910 | } else { |
912 | - $goal = apply_filters( 'give_form_goal', give_maybe_sanitize_amount( $goal ), $form_id ); |
|
911 | + $goal = apply_filters('give_form_goal', give_maybe_sanitize_amount($goal), $form_id); |
|
913 | 912 | } |
914 | 913 | |
915 | 914 | $formatted_goal = sprintf( |
@@ -917,17 +916,17 @@ discard block |
||
917 | 916 | $form_id, |
918 | 917 | $goal |
919 | 918 | ); |
920 | - $formatted_goal = apply_filters( 'give_form_price_after_html', $formatted_goal, $form_id, $goal ); |
|
919 | + $formatted_goal = apply_filters('give_form_price_after_html', $formatted_goal, $form_id, $goal); |
|
921 | 920 | |
922 | - if ( $echo ) { |
|
921 | + if ($echo) { |
|
923 | 922 | echo $formatted_goal; |
924 | 923 | } else { |
925 | 924 | return $formatted_goal; |
926 | 925 | } |
927 | 926 | } |
928 | 927 | |
929 | -add_filter( 'give_form_goal', 'give_format_amount', 10 ); |
|
930 | -add_filter( 'give_form_goal', 'give_currency_filter', 20 ); |
|
928 | +add_filter('give_form_goal', 'give_format_amount', 10); |
|
929 | +add_filter('give_form_goal', 'give_currency_filter', 20); |
|
931 | 930 | |
932 | 931 | |
933 | 932 | /** |
@@ -939,15 +938,15 @@ discard block |
||
939 | 938 | * |
940 | 939 | * @return bool $ret Whether or not the logged_in_only setting is set |
941 | 940 | */ |
942 | -function give_logged_in_only( $form_id ) { |
|
941 | +function give_logged_in_only($form_id) { |
|
943 | 942 | // If _give_logged_in_only is set to enable then guest can donate from that specific form. |
944 | 943 | // Otherwise it is member only donation form. |
945 | - $val = give_get_meta( $form_id, '_give_logged_in_only', true ); |
|
946 | - $val = ! empty( $val ) ? $val : 'enabled'; |
|
944 | + $val = give_get_meta($form_id, '_give_logged_in_only', true); |
|
945 | + $val = ! empty($val) ? $val : 'enabled'; |
|
947 | 946 | |
948 | - $ret = ! give_is_setting_enabled( $val ); |
|
947 | + $ret = ! give_is_setting_enabled($val); |
|
949 | 948 | |
950 | - return (bool) apply_filters( 'give_logged_in_only', $ret, $form_id ); |
|
949 | + return (bool) apply_filters('give_logged_in_only', $ret, $form_id); |
|
951 | 950 | } |
952 | 951 | |
953 | 952 | |
@@ -960,11 +959,11 @@ discard block |
||
960 | 959 | * |
961 | 960 | * @return string |
962 | 961 | */ |
963 | -function give_show_login_register_option( $form_id ) { |
|
962 | +function give_show_login_register_option($form_id) { |
|
964 | 963 | |
965 | - $show_register_form = give_get_meta( $form_id, '_give_show_register_form', true ); |
|
964 | + $show_register_form = give_get_meta($form_id, '_give_show_register_form', true); |
|
966 | 965 | |
967 | - return apply_filters( 'give_show_register_form', $show_register_form, $form_id ); |
|
966 | + return apply_filters('give_show_register_form', $show_register_form, $form_id); |
|
968 | 967 | |
969 | 968 | } |
970 | 969 | |
@@ -980,12 +979,12 @@ discard block |
||
980 | 979 | * |
981 | 980 | * @return array |
982 | 981 | */ |
983 | -function _give_get_prefill_form_field_values( $form_id ) { |
|
982 | +function _give_get_prefill_form_field_values($form_id) { |
|
984 | 983 | $logged_in_donor_info = array(); |
985 | 984 | |
986 | - if ( is_user_logged_in() ) : |
|
987 | - $donor_data = get_userdata( get_current_user_id() ); |
|
988 | - $donor_address = give_get_donor_address( get_current_user_id() ); |
|
985 | + if (is_user_logged_in()) : |
|
986 | + $donor_data = get_userdata(get_current_user_id()); |
|
987 | + $donor_address = give_get_donor_address(get_current_user_id()); |
|
989 | 988 | |
990 | 989 | $logged_in_donor_info = array( |
991 | 990 | // First name. |
@@ -1019,21 +1018,21 @@ discard block |
||
1019 | 1018 | |
1020 | 1019 | // Bailout: Auto fill form field values only form form which donor is donating. |
1021 | 1020 | if ( |
1022 | - empty( $_GET['form-id'] ) |
|
1021 | + empty($_GET['form-id']) |
|
1023 | 1022 | || ! $form_id |
1024 | - || ( $form_id !== absint( $_GET['form-id'] ) ) |
|
1023 | + || ($form_id !== absint($_GET['form-id'])) |
|
1025 | 1024 | ) { |
1026 | 1025 | return $logged_in_donor_info; |
1027 | 1026 | } |
1028 | 1027 | |
1029 | 1028 | // Get purchase data. |
1030 | - $give_purchase_data = Give()->session->get( 'give_purchase' ); |
|
1029 | + $give_purchase_data = Give()->session->get('give_purchase'); |
|
1031 | 1030 | |
1032 | 1031 | // Get donor info from form data. |
1033 | - $give_donor_info_in_session = empty( $give_purchase_data['post_data'] ) |
|
1032 | + $give_donor_info_in_session = empty($give_purchase_data['post_data']) |
|
1034 | 1033 | ? array() |
1035 | 1034 | : $give_purchase_data['post_data']; |
1036 | 1035 | |
1037 | 1036 | // Output. |
1038 | - return wp_parse_args( $give_donor_info_in_session, $logged_in_donor_info ); |
|
1037 | + return wp_parse_args($give_donor_info_in_session, $logged_in_donor_info); |
|
1039 | 1038 | } |