@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_System_Info' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_System_Info')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_System_Info. |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'system-info'; |
46 | - $this->label = esc_html__( 'System Info', 'give' ); |
|
46 | + $this->label = esc_html__('System Info', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
48 | + add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-tools_settings_{$this->id}_page", array($this, 'output')); |
|
50 | 50 | |
51 | 51 | // Do not use main form for this tab. |
52 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
53 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
54 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
52 | + if (give_get_current_setting_tab() === $this->id) { |
|
53 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
54 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array |
66 | 66 | */ |
67 | - public function add_settings_page( $pages ) { |
|
68 | - $pages[ $this->id ] = $this->label; |
|
67 | + public function add_settings_page($pages) { |
|
68 | + $pages[$this->id] = $this->label; |
|
69 | 69 | |
70 | 70 | return $pages; |
71 | 71 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function output() { |
80 | 80 | $GLOBALS['give_hide_save_button'] = true; |
81 | - include_once( 'views/html-admin-page-system-info.php' ); |
|
81 | + include_once('views/html-admin-page-system-info.php'); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 |
@@ -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 | |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_donors_page() { |
26 | 26 | $default_views = give_donor_views(); |
27 | - $requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors'; |
|
28 | - if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) { |
|
29 | - give_render_donor_view( $requested_view, $default_views ); |
|
27 | + $requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors'; |
|
28 | + if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) { |
|
29 | + give_render_donor_view($requested_view, $default_views); |
|
30 | 30 | } else { |
31 | 31 | give_donors_list(); |
32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $views = array(); |
44 | 44 | |
45 | - return apply_filters( 'give_donor_views', $views ); |
|
45 | + return apply_filters('give_donor_views', $views); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $tabs = array(); |
58 | 58 | |
59 | - return apply_filters( 'give_donor_tabs', $tabs ); |
|
59 | + return apply_filters('give_donor_tabs', $tabs); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | function give_donors_list() { |
70 | - include dirname( __FILE__ ) . '/class-donor-table.php'; |
|
70 | + include dirname(__FILE__).'/class-donor-table.php'; |
|
71 | 71 | |
72 | 72 | $donors_table = new Give_Donor_List_Table(); |
73 | 73 | $donors_table->prepare_items(); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @since 1.0 |
82 | 82 | */ |
83 | - do_action( 'give_donors_table_top' ); |
|
83 | + do_action('give_donors_table_top'); |
|
84 | 84 | ?> |
85 | - <form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
85 | + <form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
86 | 86 | <?php |
87 | - $donors_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' ); |
|
87 | + $donors_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors'); |
|
88 | 88 | $donors_table->display(); |
89 | 89 | ?> |
90 | 90 | <input type="hidden" name="post_type" value="give_forms" /> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 1.0 |
99 | 99 | */ |
100 | - do_action( 'give_donors_table_bottom' ); |
|
100 | + do_action('give_donors_table_bottom'); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return void |
115 | 115 | */ |
116 | -function give_render_donor_view( $view, $callbacks ) { |
|
116 | +function give_render_donor_view($view, $callbacks) { |
|
117 | 117 | |
118 | 118 | $render = true; |
119 | 119 | |
120 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
120 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
121 | 121 | |
122 | - if ( ! current_user_can( $donor_view_role ) ) { |
|
123 | - give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) ); |
|
122 | + if ( ! current_user_can($donor_view_role)) { |
|
123 | + give_set_error('give-no-access', __('You are not permitted to view this data.', 'give')); |
|
124 | 124 | $render = false; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
128 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
129 | 129 | $render = false; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $donor_id = (int) $_GET['id']; |
133 | - $donor = new Give_Donor( $donor_id ); |
|
133 | + $donor = new Give_Donor($donor_id); |
|
134 | 134 | |
135 | - if ( empty( $donor->id ) ) { |
|
136 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
135 | + if (empty($donor->id)) { |
|
136 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class='wrap'> |
144 | 144 | |
145 | - <?php if ( give_get_errors() ) : ?> |
|
145 | + <?php if (give_get_errors()) : ?> |
|
146 | 146 | <div class="error settings-error"> |
147 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
147 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | 150 | |
151 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Donor', 'give' ); ?></h1> |
|
151 | + <h1 class="screen-reader-text"><?php esc_html_e('Donor', 'give'); ?></h1> |
|
152 | 152 | |
153 | - <?php if ( $donor && $render ) : ?> |
|
153 | + <?php if ($donor && $render) : ?> |
|
154 | 154 | |
155 | 155 | <h2 class="nav-tab-wrapper"> |
156 | 156 | <?php |
157 | - foreach ( $donor_tabs as $key => $tab ) : |
|
157 | + foreach ($donor_tabs as $key => $tab) : |
|
158 | 158 | $active = $key === $view ? true : false; |
159 | 159 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
160 | 160 | printf( |
161 | - '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n", |
|
162 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ), |
|
163 | - esc_attr( $class ), |
|
164 | - sanitize_html_class( $tab['dashicon'] ), |
|
165 | - esc_html( $tab['title'] ) |
|
161 | + '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
|
162 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)), |
|
163 | + esc_attr($class), |
|
164 | + sanitize_html_class($tab['dashicon']), |
|
165 | + esc_html($tab['title']) |
|
166 | 166 | ); |
167 | 167 | endforeach; |
168 | 168 | ?> |
169 | 169 | </h2> |
170 | 170 | |
171 | 171 | <div id="give-donor-card-wrapper"> |
172 | - <?php $callbacks[ $view ]( $donor ) ?> |
|
172 | + <?php $callbacks[$view]($donor) ?> |
|
173 | 173 | </div> |
174 | 174 | |
175 | 175 | <?php endif; ?> |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return void |
191 | 191 | */ |
192 | -function give_donor_view( $donor ) { |
|
192 | +function give_donor_view($donor) { |
|
193 | 193 | |
194 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
194 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Fires in donor profile screen, above the donor card. |
@@ -200,32 +200,32 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @param object $donor The donor object being displayed. |
202 | 202 | */ |
203 | - do_action( 'give_donor_card_top', $donor ); |
|
203 | + do_action('give_donor_card_top', $donor); |
|
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <div id="donor-summary" class="info-wrapper donor-section postbox"> |
207 | 207 | |
208 | - <form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>"> |
|
208 | + <form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>"> |
|
209 | 209 | |
210 | 210 | <div class="donor-info"> |
211 | 211 | |
212 | 212 | <div class="donor-bio-header clearfix"> |
213 | 213 | |
214 | 214 | <div class="avatar-wrap left" id="donor-avatar"> |
215 | - <?php echo get_avatar( $donor->email ); ?> |
|
215 | + <?php echo get_avatar($donor->email); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div id="donor-name-wrap" class="left"> |
219 | 219 | <span class="donor-id">#<?php echo $donor->id; ?></span> |
220 | - <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
220 | + <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
221 | 221 | <span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span> |
222 | 222 | </div> |
223 | 223 | <p class="donor-since info-item"> |
224 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
225 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
224 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
225 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
226 | 226 | </p> |
227 | - <?php if ( current_user_can( $donor_edit_role ) ) : ?> |
|
228 | - <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
227 | + <?php if (current_user_can($donor_edit_role)) : ?> |
|
228 | + <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
229 | 229 | <?php endif; ?> |
230 | 230 | </div> |
231 | 231 | <!-- /donor-bio-header --> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <table class="widefat"> |
236 | 236 | <tbody> |
237 | 237 | <tr class="alternate"> |
238 | - <th scope="col"><label for="tablecell"><?php esc_html_e( 'User:', 'give' ); ?></label></th> |
|
238 | + <th scope="col"><label for="tablecell"><?php esc_html_e('User:', 'give'); ?></label></th> |
|
239 | 239 | <td> |
240 | 240 | <span class="donor-user-id info-item edit-item"> |
241 | 241 | <?php |
@@ -252,37 +252,37 @@ discard block |
||
252 | 252 | 'data' => $data_atts, |
253 | 253 | ); |
254 | 254 | |
255 | - if ( ! empty( $user_id ) ) { |
|
256 | - $userdata = get_userdata( $user_id ); |
|
255 | + if ( ! empty($user_id)) { |
|
256 | + $userdata = get_userdata($user_id); |
|
257 | 257 | $user_args['selected'] = $user_id; |
258 | 258 | } |
259 | 259 | |
260 | - echo Give()->html->ajax_user_search( $user_args ); |
|
260 | + echo Give()->html->ajax_user_search($user_args); |
|
261 | 261 | ?> |
262 | 262 | </span> |
263 | 263 | |
264 | 264 | <span class="donor-user-id info-item editable"> |
265 | - <?php if ( ! empty( $userdata ) ) { ?> |
|
266 | - <span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span> |
|
265 | + <?php if ( ! empty($userdata)) { ?> |
|
266 | + <span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span> |
|
267 | 267 | <?php } else { ?> |
268 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
268 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
269 | 269 | <?php } ?> |
270 | - <?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?> |
|
271 | - <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
270 | + <?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?> |
|
271 | + <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e('Disconnects the current user ID from this donor record.', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
272 | 272 | <?php } ?> |
273 | 273 | </span> |
274 | 274 | </td> |
275 | 275 | </tr> |
276 | - <?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?> |
|
276 | + <?php if (isset($donor->user_id) && $donor->user_id > 0) : ?> |
|
277 | 277 | |
278 | 278 | <tr> |
279 | - <th scope="col"><?php esc_html_e( 'Address:', 'give' ); ?></th> |
|
279 | + <th scope="col"><?php esc_html_e('Address:', 'give'); ?></th> |
|
280 | 280 | <td class="row-title"> |
281 | 281 | |
282 | 282 | <div class="donor-address-wrapper"> |
283 | 283 | |
284 | 284 | <?php |
285 | - $address = get_user_meta( $donor->user_id, '_give_user_address', true ); |
|
285 | + $address = get_user_meta($donor->user_id, '_give_user_address', true); |
|
286 | 286 | $defaults = array( |
287 | 287 | 'line1' => '', |
288 | 288 | 'line2' => '', |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | 'zip' => '', |
293 | 293 | ); |
294 | 294 | |
295 | - $address = wp_parse_args( $address, $defaults ); |
|
295 | + $address = wp_parse_args($address, $defaults); |
|
296 | 296 | ?> |
297 | 297 | |
298 | - <?php if ( ! empty( $address ) ) { ?> |
|
298 | + <?php if ( ! empty($address)) { ?> |
|
299 | 299 | <span class="donor-address info-item editable"> |
300 | 300 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
301 | 301 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -306,43 +306,43 @@ discard block |
||
306 | 306 | </span> |
307 | 307 | <?php } ?> |
308 | 308 | <span class="donor-address info-item edit-item"> |
309 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
309 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
312 | 312 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
313 | 313 | <?php |
314 | 314 | |
315 | 315 | $selected_country = $address['country']; |
316 | 316 | |
317 | 317 | $countries = give_get_country_list(); |
318 | - foreach ( $countries as $country_code => $country ) { |
|
319 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
318 | + foreach ($countries as $country_code => $country) { |
|
319 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
323 | 323 | <?php |
324 | 324 | $selected_state = give_get_state(); |
325 | - $states = give_get_states( $selected_country ); |
|
325 | + $states = give_get_states($selected_country); |
|
326 | 326 | |
327 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
327 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
328 | 328 | |
329 | - if ( ! empty( $states ) ) { |
|
329 | + if ( ! empty($states)) { |
|
330 | 330 | ?> |
331 | 331 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
332 | 332 | <?php |
333 | - foreach ( $states as $state_code => $state ) { |
|
334 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
333 | + foreach ($states as $state_code => $state) { |
|
334 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
335 | 335 | } |
336 | 336 | ?> |
337 | 337 | </select> |
338 | 338 | <?php |
339 | 339 | } else { |
340 | 340 | ?> |
341 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province / County', 'give' ); ?>" /> |
|
341 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province / County', 'give'); ?>" /> |
|
342 | 342 | <?php |
343 | 343 | } |
344 | 344 | ?> |
345 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
345 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
346 | 346 | </span> |
347 | 347 | |
348 | 348 | </div> |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | |
359 | 359 | <span id="donor-edit-actions" class="edit-item"> |
360 | 360 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" /> |
361 | - <?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?> |
|
361 | + <?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?> |
|
362 | 362 | <input type="hidden" name="give_action" value="edit-donor" /> |
363 | - <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
364 | - <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
363 | + <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
364 | + <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
365 | 365 | </span> |
366 | 366 | |
367 | 367 | </form> |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @param object $donor The donor object being displayed. |
378 | 378 | */ |
379 | - do_action( 'give_donor_before_stats', $donor ); |
|
379 | + do_action('give_donor_before_stats', $donor); |
|
380 | 380 | ?> |
381 | 381 | |
382 | 382 | <div id="donor-stats-wrapper" class="donor-section postbox clear"> |
383 | 383 | <ul> |
384 | 384 | <li> |
385 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $donor->email ) ); ?>"> |
|
385 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($donor->email)); ?>"> |
|
386 | 386 | <span class="dashicons dashicons-heart"></span> |
387 | 387 | <?php |
388 | 388 | // Completed Donations |
389 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count ); |
|
390 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor ); |
|
389 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count); |
|
390 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor); |
|
391 | 391 | ?> |
392 | 392 | </a> |
393 | 393 | </li> |
394 | 394 | <li> |
395 | 395 | <span class="dashicons dashicons-chart-area"></span> |
396 | - <?php echo give_currency_filter( give_format_amount( $donor->purchase_value ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
396 | + <?php echo give_currency_filter(give_format_amount($donor->purchase_value)); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
397 | 397 | </li> |
398 | 398 | <?php |
399 | 399 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @param object $donor The donor object being displayed. |
407 | 407 | */ |
408 | - do_action( 'give_donor_stats_list', $donor ); |
|
408 | + do_action('give_donor_stats_list', $donor); |
|
409 | 409 | ?> |
410 | 410 | </ul> |
411 | 411 | </div> |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param object $donor The donor object being displayed. |
420 | 420 | */ |
421 | - do_action( 'give_donor_before_tables_wrapper', $donor ); |
|
421 | + do_action('give_donor_before_tables_wrapper', $donor); |
|
422 | 422 | ?> |
423 | 423 | |
424 | 424 | <div id="donor-tables-wrapper" class="donor-section"> |
@@ -431,46 +431,46 @@ discard block |
||
431 | 431 | * |
432 | 432 | * @param object $donor The donor object being displayed. |
433 | 433 | */ |
434 | - do_action( 'give_donor_before_tables', $donor ); |
|
434 | + do_action('give_donor_before_tables', $donor); |
|
435 | 435 | ?> |
436 | 436 | |
437 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
437 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
438 | 438 | |
439 | 439 | <table class="wp-list-table widefat striped emails"> |
440 | 440 | <thead> |
441 | 441 | <tr> |
442 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
443 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
442 | + <th><?php _e('Email', 'give'); ?></th> |
|
443 | + <th><?php _e('Actions', 'give'); ?></th> |
|
444 | 444 | </tr> |
445 | 445 | </thead> |
446 | 446 | |
447 | 447 | <tbody> |
448 | - <?php if ( ! empty( $donor->emails ) ) { ?> |
|
448 | + <?php if ( ! empty($donor->emails)) { ?> |
|
449 | 449 | |
450 | - <?php foreach ( $donor->emails as $key => $email ) : ?> |
|
450 | + <?php foreach ($donor->emails as $key => $email) : ?> |
|
451 | 451 | <tr data-key="<?php echo $key; ?>"> |
452 | 452 | <td> |
453 | 453 | <?php echo $email; ?> |
454 | - <?php if ( 'primary' === $key ) : ?> |
|
454 | + <?php if ('primary' === $key) : ?> |
|
455 | 455 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
456 | 456 | <?php endif; ?> |
457 | 457 | </td> |
458 | 458 | <td> |
459 | - <?php if ( 'primary' !== $key ) : ?> |
|
459 | + <?php if ('primary' !== $key) : ?> |
|
460 | 460 | <?php |
461 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); |
|
462 | - $promote_url = wp_nonce_url( add_query_arg( array( |
|
463 | - 'email' => rawurlencode( $email ), |
|
461 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); |
|
462 | + $promote_url = wp_nonce_url(add_query_arg(array( |
|
463 | + 'email' => rawurlencode($email), |
|
464 | 464 | 'give_action' => 'set_donor_primary_email', |
465 | - ), $base_url ), 'give-set-donor-primary-email' ); |
|
466 | - $remove_url = wp_nonce_url( add_query_arg( array( |
|
467 | - 'email' => rawurlencode( $email ), |
|
465 | + ), $base_url), 'give-set-donor-primary-email'); |
|
466 | + $remove_url = wp_nonce_url(add_query_arg(array( |
|
467 | + 'email' => rawurlencode($email), |
|
468 | 468 | 'give_action' => 'remove_donor_email', |
469 | - ), $base_url ), 'give-remove-donor-email' ); |
|
469 | + ), $base_url), 'give-remove-donor-email'); |
|
470 | 470 | ?> |
471 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
471 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
472 | 472 | | |
473 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
473 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
474 | 474 | <?php endif; ?> |
475 | 475 | </td> |
476 | 476 | </tr> |
@@ -480,59 +480,59 @@ discard block |
||
480 | 480 | <td colspan="2" class="add-donor-email-td"> |
481 | 481 | <div class="add-donor-email-wrapper"> |
482 | 482 | <input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" /> |
483 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
484 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
485 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
486 | - <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
483 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
484 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
485 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
486 | + <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button> |
|
487 | 487 | <span class="spinner"></span> |
488 | 488 | </div> |
489 | 489 | <div class="notice-wrap"></div> |
490 | 490 | </td> |
491 | 491 | </tr> |
492 | 492 | <?php } else { ?> |
493 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr> |
|
493 | + <tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr> |
|
494 | 494 | <?php }// End if(). |
495 | 495 | ?> |
496 | 496 | </tbody> |
497 | 497 | </table> |
498 | 498 | |
499 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
499 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
500 | 500 | <?php |
501 | - $payment_ids = explode( ',', $donor->payment_ids ); |
|
502 | - $payments = give_get_payments( array( |
|
501 | + $payment_ids = explode(',', $donor->payment_ids); |
|
502 | + $payments = give_get_payments(array( |
|
503 | 503 | 'post__in' => $payment_ids, |
504 | - ) ); |
|
505 | - $payments = array_slice( $payments, 0, 10 ); |
|
504 | + )); |
|
505 | + $payments = array_slice($payments, 0, 10); |
|
506 | 506 | ?> |
507 | 507 | <table class="wp-list-table widefat striped payments"> |
508 | 508 | <thead> |
509 | 509 | <tr> |
510 | - <th scope="col"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
511 | - <th scope="col"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
512 | - <th scope="col"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
513 | - <th scope="col"><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
514 | - <th scope="col"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
510 | + <th scope="col"><?php esc_html_e('ID', 'give'); ?></th> |
|
511 | + <th scope="col"><?php esc_html_e('Amount', 'give'); ?></th> |
|
512 | + <th scope="col"><?php esc_html_e('Date', 'give'); ?></th> |
|
513 | + <th scope="col"><?php esc_html_e('Status', 'give'); ?></th> |
|
514 | + <th scope="col"><?php esc_html_e('Actions', 'give'); ?></th> |
|
515 | 515 | </tr> |
516 | 516 | </thead> |
517 | 517 | <tbody> |
518 | - <?php if ( ! empty( $payments ) ) { ?> |
|
519 | - <?php foreach ( $payments as $payment ) : ?> |
|
518 | + <?php if ( ! empty($payments)) { ?> |
|
519 | + <?php foreach ($payments as $payment) : ?> |
|
520 | 520 | <tr> |
521 | 521 | <td><?php echo $payment->ID; ?></td> |
522 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
523 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
524 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
522 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
523 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
524 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
525 | 525 | <td> |
526 | 526 | <?php |
527 | 527 | printf( |
528 | 528 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
529 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ), |
|
529 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID), |
|
530 | 530 | sprintf( |
531 | 531 | /* translators: %s: Donation ID */ |
532 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
532 | + esc_attr__('View Donation %s.', 'give'), |
|
533 | 533 | $payment->ID |
534 | 534 | ), |
535 | - esc_html__( 'View Donation', 'give' ) |
|
535 | + esc_html__('View Donation', 'give') |
|
536 | 536 | ); |
537 | 537 | ?> |
538 | 538 | |
@@ -547,47 +547,47 @@ discard block |
||
547 | 547 | * @param object $donor The donor object being displayed. |
548 | 548 | * @param object $payment The payment object being displayed. |
549 | 549 | */ |
550 | - do_action( 'give_donor_recent_purchases_actions', $donor, $payment ); |
|
550 | + do_action('give_donor_recent_purchases_actions', $donor, $payment); |
|
551 | 551 | ?> |
552 | 552 | </td> |
553 | 553 | </tr> |
554 | 554 | <?php endforeach; ?> |
555 | 555 | <?php } else { ?> |
556 | 556 | <tr> |
557 | - <td colspan="5"><?php esc_html_e( 'No donations found.', 'give' ); ?></td> |
|
557 | + <td colspan="5"><?php esc_html_e('No donations found.', 'give'); ?></td> |
|
558 | 558 | </tr> |
559 | 559 | <?php }// End if(). |
560 | 560 | ?> |
561 | 561 | </tbody> |
562 | 562 | </table> |
563 | 563 | |
564 | - <h3><?php esc_html_e( 'Completed Forms', 'give' ); ?></h3> |
|
564 | + <h3><?php esc_html_e('Completed Forms', 'give'); ?></h3> |
|
565 | 565 | <?php |
566 | - $donations = give_get_users_completed_donations( $donor->email ); |
|
566 | + $donations = give_get_users_completed_donations($donor->email); |
|
567 | 567 | ?> |
568 | 568 | <table class="wp-list-table widefat striped donations"> |
569 | 569 | <thead> |
570 | 570 | <tr> |
571 | - <th scope="col"><?php esc_html_e( 'Form', 'give' ); ?></th> |
|
572 | - <th scope="col" width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
571 | + <th scope="col"><?php esc_html_e('Form', 'give'); ?></th> |
|
572 | + <th scope="col" width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
573 | 573 | </tr> |
574 | 574 | </thead> |
575 | 575 | <tbody> |
576 | - <?php if ( ! empty( $donations ) ) { ?> |
|
577 | - <?php foreach ( $donations as $donation ) : ?> |
|
576 | + <?php if ( ! empty($donations)) { ?> |
|
577 | + <?php foreach ($donations as $donation) : ?> |
|
578 | 578 | <tr> |
579 | 579 | <td><?php echo $donation->post_title; ?></td> |
580 | 580 | <td> |
581 | 581 | <?php |
582 | 582 | printf( |
583 | 583 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
584 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
584 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
585 | 585 | sprintf( |
586 | 586 | /* translators: %s: form name */ |
587 | - esc_attr__( 'View Form %s.', 'give' ), |
|
587 | + esc_attr__('View Form %s.', 'give'), |
|
588 | 588 | $donation->post_title |
589 | 589 | ), |
590 | - esc_html__( 'View Form', 'give' ) |
|
590 | + esc_html__('View Form', 'give') |
|
591 | 591 | ); |
592 | 592 | ?> |
593 | 593 | </td> |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | <?php endforeach; ?> |
596 | 596 | <?php } else { ?> |
597 | 597 | <tr> |
598 | - <td colspan="2"><?php esc_html_e( 'No completed donations found.', 'give' ); ?></td> |
|
598 | + <td colspan="2"><?php esc_html_e('No completed donations found.', 'give'); ?></td> |
|
599 | 599 | </tr> |
600 | 600 | <?php } ?> |
601 | 601 | </tbody> |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | * |
610 | 610 | * @param object $donor The donor object being displayed. |
611 | 611 | */ |
612 | - do_action( 'give_donor_after_tables', $donor ); |
|
612 | + do_action('give_donor_after_tables', $donor); |
|
613 | 613 | ?> |
614 | 614 | |
615 | 615 | </div> |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @param object $donor The donor object being displayed. |
624 | 624 | */ |
625 | - do_action( 'give_donor_card_bottom', $donor ); |
|
625 | + do_action('give_donor_card_bottom', $donor); |
|
626 | 626 | |
627 | 627 | } |
628 | 628 | |
@@ -635,30 +635,30 @@ discard block |
||
635 | 635 | * |
636 | 636 | * @return void |
637 | 637 | */ |
638 | -function give_donor_notes_view( $donor ) { |
|
638 | +function give_donor_notes_view($donor) { |
|
639 | 639 | |
640 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
641 | - $paged = absint( $paged ); |
|
640 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
641 | + $paged = absint($paged); |
|
642 | 642 | $note_count = $donor->get_notes_count(); |
643 | - $per_page = apply_filters( 'give_donor_notes_per_page', 20 ); |
|
644 | - $total_pages = ceil( $note_count / $per_page ); |
|
645 | - $donor_notes = $donor->get_notes( $per_page, $paged ); |
|
643 | + $per_page = apply_filters('give_donor_notes_per_page', 20); |
|
644 | + $total_pages = ceil($note_count / $per_page); |
|
645 | + $donor_notes = $donor->get_notes($per_page, $paged); |
|
646 | 646 | ?> |
647 | 647 | |
648 | 648 | <div id="donor-notes-wrapper"> |
649 | 649 | <div class="donor-notes-header"> |
650 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
650 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
651 | 651 | </div> |
652 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
652 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
653 | 653 | |
654 | - <?php if ( 1 == $paged ) : ?> |
|
654 | + <?php if (1 == $paged) : ?> |
|
655 | 655 | <div style="display: block; margin-bottom: 55px;"> |
656 | - <form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>"> |
|
656 | + <form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>"> |
|
657 | 657 | <textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea> |
658 | 658 | <br /> |
659 | 659 | <input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" /> |
660 | 660 | <input type="hidden" name="give_action" value="add-donor-note" /> |
661 | - <?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?> |
|
661 | + <?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?> |
|
662 | 662 | <input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" /> |
663 | 663 | </form> |
664 | 664 | </div> |
@@ -673,26 +673,26 @@ discard block |
||
673 | 673 | 'show_all' => true, |
674 | 674 | ); |
675 | 675 | |
676 | - echo paginate_links( $pagination_args ); |
|
676 | + echo paginate_links($pagination_args); |
|
677 | 677 | ?> |
678 | 678 | |
679 | 679 | <div id="give-donor-notes" class="postbox"> |
680 | - <?php if ( count( $donor_notes ) > 0 ) { ?> |
|
681 | - <?php foreach ( $donor_notes as $key => $note ) : ?> |
|
680 | + <?php if (count($donor_notes) > 0) { ?> |
|
681 | + <?php foreach ($donor_notes as $key => $note) : ?> |
|
682 | 682 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
683 | 683 | <span class="note-content-wrap"> |
684 | - <?php echo stripslashes( $note ); ?> |
|
684 | + <?php echo stripslashes($note); ?> |
|
685 | 685 | </span> |
686 | 686 | </div> |
687 | 687 | <?php endforeach; ?> |
688 | 688 | <?php } else { ?> |
689 | 689 | <div class="give-no-donor-notes"> |
690 | - <?php esc_html_e( 'No donor notes found.', 'give' ); ?> |
|
690 | + <?php esc_html_e('No donor notes found.', 'give'); ?> |
|
691 | 691 | </div> |
692 | 692 | <?php } ?> |
693 | 693 | </div> |
694 | 694 | |
695 | - <?php echo paginate_links( $pagination_args ); ?> |
|
695 | + <?php echo paginate_links($pagination_args); ?> |
|
696 | 696 | |
697 | 697 | </div> |
698 | 698 | |
@@ -708,9 +708,9 @@ discard block |
||
708 | 708 | * |
709 | 709 | * @return void |
710 | 710 | */ |
711 | -function give_donor_delete_view( $donor ) { |
|
711 | +function give_donor_delete_view($donor) { |
|
712 | 712 | |
713 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
713 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
714 | 714 | |
715 | 715 | /** |
716 | 716 | * Fires in donor delete screen, above the content. |
@@ -719,15 +719,15 @@ discard block |
||
719 | 719 | * |
720 | 720 | * @param object $donor The donor object being displayed. |
721 | 721 | */ |
722 | - do_action( 'give_donor_delete_top', $donor ); |
|
722 | + do_action('give_donor_delete_top', $donor); |
|
723 | 723 | ?> |
724 | 724 | |
725 | 725 | <div class="info-wrapper donor-section"> |
726 | 726 | |
727 | - <form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>"> |
|
727 | + <form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>"> |
|
728 | 728 | |
729 | 729 | <div class="donor-notes-header"> |
730 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
730 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
731 | 731 | </div> |
732 | 732 | |
733 | 733 | |
@@ -735,20 +735,20 @@ discard block |
||
735 | 735 | |
736 | 736 | <span class="delete-donor-options"> |
737 | 737 | <p> |
738 | - <?php echo Give()->html->checkbox( array( |
|
738 | + <?php echo Give()->html->checkbox(array( |
|
739 | 739 | 'name' => 'give-donor-delete-confirm', |
740 | - ) ); ?> |
|
741 | - <label for="give-donor-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
740 | + )); ?> |
|
741 | + <label for="give-donor-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
742 | 742 | </p> |
743 | 743 | |
744 | 744 | <p> |
745 | - <?php echo Give()->html->checkbox( array( |
|
745 | + <?php echo Give()->html->checkbox(array( |
|
746 | 746 | 'name' => 'give-donor-delete-records', |
747 | 747 | 'options' => array( |
748 | 748 | 'disabled' => true, |
749 | 749 | ), |
750 | - ) ); ?> |
|
751 | - <label for="give-donor-delete-records"><?php esc_html_e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
750 | + )); ?> |
|
751 | + <label for="give-donor-delete-records"><?php esc_html_e('Delete all associated donations and records?', 'give'); ?></label> |
|
752 | 752 | </p> |
753 | 753 | |
754 | 754 | <?php |
@@ -761,16 +761,16 @@ discard block |
||
761 | 761 | * |
762 | 762 | * @param object $donor The donor object being displayed. |
763 | 763 | */ |
764 | - do_action( 'give_donor_delete_inputs', $donor ); |
|
764 | + do_action('give_donor_delete_inputs', $donor); |
|
765 | 765 | ?> |
766 | 766 | </span> |
767 | 767 | |
768 | 768 | <span id="donor-edit-actions"> |
769 | 769 | <input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" /> |
770 | - <?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?> |
|
770 | + <?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?> |
|
771 | 771 | <input type="hidden" name="give_action" value="delete-donor" /> |
772 | - <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
773 | - <a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
772 | + <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
773 | + <a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
774 | 774 | </span> |
775 | 775 | |
776 | 776 | </div> |
@@ -786,5 +786,5 @@ discard block |
||
786 | 786 | * |
787 | 787 | * @param object $donor The donor object being displayed. |
788 | 788 | */ |
789 | - do_action( 'give_donor_delete_bottom', $donor ); |
|
789 | + do_action('give_donor_delete_bottom', $donor); |
|
790 | 790 | } |
@@ -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,26 +26,26 @@ discard block |
||
26 | 26 | function give_test_ajax_works() { |
27 | 27 | |
28 | 28 | // Check if the Airplane Mode plugin is installed. |
29 | - if ( class_exists( 'Airplane_Mode_Core' ) ) { |
|
29 | + if (class_exists('Airplane_Mode_Core')) { |
|
30 | 30 | |
31 | 31 | $airplane = Airplane_Mode_Core::getInstance(); |
32 | 32 | |
33 | - if ( method_exists( $airplane, 'enabled' ) ) { |
|
33 | + if (method_exists($airplane, 'enabled')) { |
|
34 | 34 | |
35 | - if ( $airplane->enabled() ) { |
|
35 | + if ($airplane->enabled()) { |
|
36 | 36 | return true; |
37 | 37 | } |
38 | 38 | } else { |
39 | 39 | |
40 | - if ( 'on' === $airplane->check_status() ) { |
|
40 | + if ('on' === $airplane->check_status()) { |
|
41 | 41 | return true; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | - add_filter( 'block_local_requests', '__return_false' ); |
|
46 | + add_filter('block_local_requests', '__return_false'); |
|
47 | 47 | |
48 | - if ( Give_Cache::get( '_give_ajax_works', true ) ) { |
|
48 | + if (Give_Cache::get('_give_ajax_works', true)) { |
|
49 | 49 | return true; |
50 | 50 | } |
51 | 51 | |
@@ -57,35 +57,35 @@ discard block |
||
57 | 57 | ), |
58 | 58 | ); |
59 | 59 | |
60 | - $ajax = wp_remote_post( give_get_ajax_url(), $params ); |
|
60 | + $ajax = wp_remote_post(give_get_ajax_url(), $params); |
|
61 | 61 | |
62 | 62 | $works = true; |
63 | 63 | |
64 | - if ( is_wp_error( $ajax ) ) { |
|
64 | + if (is_wp_error($ajax)) { |
|
65 | 65 | |
66 | 66 | $works = false; |
67 | 67 | |
68 | 68 | } else { |
69 | 69 | |
70 | - if ( empty( $ajax['response'] ) ) { |
|
70 | + if (empty($ajax['response'])) { |
|
71 | 71 | $works = false; |
72 | 72 | } |
73 | 73 | |
74 | - if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) { |
|
74 | + if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) { |
|
75 | 75 | $works = false; |
76 | 76 | } |
77 | 77 | |
78 | - if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) { |
|
78 | + if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) { |
|
79 | 79 | $works = false; |
80 | 80 | } |
81 | 81 | |
82 | - if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) { |
|
82 | + if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) { |
|
83 | 83 | $works = false; |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | - if ( $works ) { |
|
88 | - Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true ); |
|
87 | + if ($works) { |
|
88 | + Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | return $works; |
@@ -100,16 +100,16 @@ discard block |
||
100 | 100 | * @return string |
101 | 101 | */ |
102 | 102 | function give_get_ajax_url() { |
103 | - $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
103 | + $scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
104 | 104 | |
105 | 105 | $current_url = give_get_current_page_url(); |
106 | - $ajax_url = admin_url( 'admin-ajax.php', $scheme ); |
|
106 | + $ajax_url = admin_url('admin-ajax.php', $scheme); |
|
107 | 107 | |
108 | - if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) { |
|
109 | - $ajax_url = preg_replace( '/^http/', 'https', $ajax_url ); |
|
108 | + if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) { |
|
109 | + $ajax_url = preg_replace('/^http/', 'https', $ajax_url); |
|
110 | 110 | } |
111 | 111 | |
112 | - return apply_filters( 'give_ajax_url', $ajax_url ); |
|
112 | + return apply_filters('give_ajax_url', $ajax_url); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @since 1.7 |
127 | 127 | */ |
128 | - do_action( 'give_donation_form_login_fields' ); |
|
128 | + do_action('give_donation_form_login_fields'); |
|
129 | 129 | |
130 | 130 | give_die(); |
131 | 131 | } |
132 | 132 | |
133 | -add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' ); |
|
133 | +add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields'); |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * Load Checkout Fields |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @return void |
141 | 141 | */ |
142 | 142 | function give_load_checkout_fields() { |
143 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : ''; |
|
143 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : ''; |
|
144 | 144 | |
145 | 145 | ob_start(); |
146 | 146 | |
@@ -149,18 +149,18 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @since 1.7 |
151 | 151 | */ |
152 | - do_action( 'give_donation_form_register_login_fields', $form_id ); |
|
152 | + do_action('give_donation_form_register_login_fields', $form_id); |
|
153 | 153 | |
154 | 154 | $fields = ob_get_clean(); |
155 | 155 | |
156 | - wp_send_json( array( |
|
157 | - 'fields' => wp_json_encode( $fields ), |
|
158 | - 'submit' => wp_json_encode( give_get_donation_form_submit_button( $form_id ) ), |
|
159 | - ) ); |
|
156 | + wp_send_json(array( |
|
157 | + 'fields' => wp_json_encode($fields), |
|
158 | + 'submit' => wp_json_encode(give_get_donation_form_submit_button($form_id)), |
|
159 | + )); |
|
160 | 160 | } |
161 | 161 | |
162 | -add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' ); |
|
163 | -add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' ); |
|
162 | +add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields'); |
|
163 | +add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields'); |
|
164 | 164 | |
165 | 165 | /** |
166 | 166 | * Get Form Title via AJAX (used only in WordPress Admin) |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | * @return void |
171 | 171 | */ |
172 | 172 | function give_ajax_get_form_title() { |
173 | - if ( isset( $_POST['form_id'] ) ) { |
|
174 | - $title = get_the_title( $_POST['form_id'] ); |
|
175 | - if ( $title ) { |
|
173 | + if (isset($_POST['form_id'])) { |
|
174 | + $title = get_the_title($_POST['form_id']); |
|
175 | + if ($title) { |
|
176 | 176 | echo $title; |
177 | 177 | } else { |
178 | 178 | echo 'fail'; |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | give_die(); |
182 | 182 | } |
183 | 183 | |
184 | -add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' ); |
|
185 | -add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' ); |
|
184 | +add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title'); |
|
185 | +add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title'); |
|
186 | 186 | |
187 | 187 | /** |
188 | 188 | * Retrieve a states drop down |
@@ -195,26 +195,26 @@ discard block |
||
195 | 195 | $states_found = false; |
196 | 196 | $show_field = true; |
197 | 197 | // Get the Country code from the $_POST. |
198 | - $country = sanitize_text_field( $_POST['country'] ); |
|
198 | + $country = sanitize_text_field($_POST['country']); |
|
199 | 199 | |
200 | 200 | // Get the field name from the $_POST. |
201 | - $field_name = sanitize_text_field( $_POST['field_name'] ); |
|
201 | + $field_name = sanitize_text_field($_POST['field_name']); |
|
202 | 202 | |
203 | - if ( empty( $country ) ) { |
|
203 | + if (empty($country)) { |
|
204 | 204 | $country = give_get_country(); |
205 | 205 | } |
206 | 206 | |
207 | - $states = give_get_states( $country ); |
|
208 | - if ( ! empty( $states ) ) { |
|
207 | + $states = give_get_states($country); |
|
208 | + if ( ! empty($states)) { |
|
209 | 209 | $args = array( |
210 | 210 | 'name' => $field_name, |
211 | 211 | 'id' => $field_name, |
212 | - 'class' => $field_name . ' give-select', |
|
212 | + 'class' => $field_name.' give-select', |
|
213 | 213 | 'options' => $states, |
214 | 214 | 'show_option_all' => false, |
215 | 215 | 'show_option_none' => false, |
216 | 216 | ); |
217 | - $data = Give()->html->select( $args ); |
|
217 | + $data = Give()->html->select($args); |
|
218 | 218 | $states_found = true; |
219 | 219 | } else { |
220 | 220 | $data = 'nostates'; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $no_states_country = give_no_states_country_list(); |
224 | 224 | |
225 | 225 | // Check if $country code exists in the array key. |
226 | - if ( array_key_exists( $country, $no_states_country ) ) { |
|
226 | + if (array_key_exists($country, $no_states_country)) { |
|
227 | 227 | $show_field = false; |
228 | 228 | } |
229 | 229 | } |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | 'show_field' => $show_field, |
234 | 234 | 'data' => $data, |
235 | 235 | ); |
236 | - wp_send_json( $response ); |
|
236 | + wp_send_json($response); |
|
237 | 237 | } |
238 | -add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' ); |
|
239 | -add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' ); |
|
238 | +add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field'); |
|
239 | +add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field'); |
|
240 | 240 | |
241 | 241 | /** |
242 | 242 | * Retrieve donation forms via AJAX for chosen dropdown search field. |
@@ -248,19 +248,19 @@ discard block |
||
248 | 248 | function give_ajax_form_search() { |
249 | 249 | global $wpdb; |
250 | 250 | |
251 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
252 | - $excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() ); |
|
251 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
252 | + $excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array()); |
|
253 | 253 | |
254 | 254 | $results = array(); |
255 | - if ( current_user_can( 'edit_give_forms' ) ) { |
|
256 | - $items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" ); |
|
255 | + if (current_user_can('edit_give_forms')) { |
|
256 | + $items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50"); |
|
257 | 257 | } else { |
258 | - $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" ); |
|
258 | + $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"); |
|
259 | 259 | } |
260 | 260 | |
261 | - if ( $items ) { |
|
261 | + if ($items) { |
|
262 | 262 | |
263 | - foreach ( $items as $item ) { |
|
263 | + foreach ($items as $item) { |
|
264 | 264 | |
265 | 265 | $results[] = array( |
266 | 266 | 'id' => $item->ID, |
@@ -271,18 +271,18 @@ discard block |
||
271 | 271 | |
272 | 272 | $items[] = array( |
273 | 273 | 'id' => 0, |
274 | - 'name' => __( 'No forms found.', 'give' ), |
|
274 | + 'name' => __('No forms found.', 'give'), |
|
275 | 275 | ); |
276 | 276 | |
277 | 277 | } |
278 | 278 | |
279 | - echo json_encode( $results ); |
|
279 | + echo json_encode($results); |
|
280 | 280 | |
281 | 281 | give_die(); |
282 | 282 | } |
283 | 283 | |
284 | -add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' ); |
|
285 | -add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' ); |
|
284 | +add_action('wp_ajax_give_form_search', 'give_ajax_form_search'); |
|
285 | +add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search'); |
|
286 | 286 | |
287 | 287 | /** |
288 | 288 | * Search the donors database via Ajax |
@@ -294,38 +294,38 @@ discard block |
||
294 | 294 | function give_ajax_donor_search() { |
295 | 295 | global $wpdb; |
296 | 296 | |
297 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
297 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
298 | 298 | $results = array(); |
299 | - if ( ! current_user_can( 'view_give_reports' ) ) { |
|
299 | + if ( ! current_user_can('view_give_reports')) { |
|
300 | 300 | $donors = array(); |
301 | 301 | } else { |
302 | - $donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" ); |
|
302 | + $donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50"); |
|
303 | 303 | } |
304 | 304 | |
305 | - if ( $donors ) { |
|
305 | + if ($donors) { |
|
306 | 306 | |
307 | - foreach ( $donors as $donor ) { |
|
307 | + foreach ($donors as $donor) { |
|
308 | 308 | |
309 | 309 | $results[] = array( |
310 | 310 | 'id' => $donor->id, |
311 | - 'name' => $donor->name . ' (' . $donor->email . ')', |
|
311 | + 'name' => $donor->name.' ('.$donor->email.')', |
|
312 | 312 | ); |
313 | 313 | } |
314 | 314 | } else { |
315 | 315 | |
316 | 316 | $donors[] = array( |
317 | 317 | 'id' => 0, |
318 | - 'name' => __( 'No donors found.', 'give' ), |
|
318 | + 'name' => __('No donors found.', 'give'), |
|
319 | 319 | ); |
320 | 320 | |
321 | 321 | } |
322 | 322 | |
323 | - echo json_encode( $results ); |
|
323 | + echo json_encode($results); |
|
324 | 324 | |
325 | 325 | give_die(); |
326 | 326 | } |
327 | 327 | |
328 | -add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' ); |
|
328 | +add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search'); |
|
329 | 329 | |
330 | 330 | |
331 | 331 | /** |
@@ -337,39 +337,39 @@ discard block |
||
337 | 337 | */ |
338 | 338 | function give_ajax_search_users() { |
339 | 339 | |
340 | - if ( current_user_can( 'manage_give_settings' ) ) { |
|
340 | + if (current_user_can('manage_give_settings')) { |
|
341 | 341 | |
342 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
342 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
343 | 343 | |
344 | 344 | $get_users_args = array( |
345 | 345 | 'number' => 9999, |
346 | - 'search' => $search . '*', |
|
346 | + 'search' => $search.'*', |
|
347 | 347 | ); |
348 | 348 | |
349 | - $get_users_args = apply_filters( 'give_search_users_args', $get_users_args ); |
|
349 | + $get_users_args = apply_filters('give_search_users_args', $get_users_args); |
|
350 | 350 | |
351 | - $found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search ); |
|
351 | + $found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search); |
|
352 | 352 | $results = array(); |
353 | 353 | |
354 | - if ( $found_users ) { |
|
354 | + if ($found_users) { |
|
355 | 355 | |
356 | - foreach ( $found_users as $user ) { |
|
356 | + foreach ($found_users as $user) { |
|
357 | 357 | |
358 | 358 | $results[] = array( |
359 | 359 | 'id' => $user->ID, |
360 | - 'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ), |
|
360 | + 'name' => esc_html($user->user_login.' ('.$user->user_email.')'), |
|
361 | 361 | ); |
362 | 362 | } |
363 | 363 | } else { |
364 | 364 | |
365 | 365 | $results[] = array( |
366 | 366 | 'id' => 0, |
367 | - 'name' => __( 'No users found.', 'give' ), |
|
367 | + 'name' => __('No users found.', 'give'), |
|
368 | 368 | ); |
369 | 369 | |
370 | 370 | } |
371 | 371 | |
372 | - echo json_encode( $results ); |
|
372 | + echo json_encode($results); |
|
373 | 373 | |
374 | 374 | }// End if(). |
375 | 375 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | |
378 | 378 | } |
379 | 379 | |
380 | -add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' ); |
|
380 | +add_action('wp_ajax_give_user_search', 'give_ajax_search_users'); |
|
381 | 381 | |
382 | 382 | |
383 | 383 | /** |
@@ -389,32 +389,32 @@ discard block |
||
389 | 389 | */ |
390 | 390 | function give_check_for_form_price_variations() { |
391 | 391 | |
392 | - if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) { |
|
393 | - die( '-1' ); |
|
392 | + if ( ! current_user_can('edit_give_forms', get_current_user_id())) { |
|
393 | + die('-1'); |
|
394 | 394 | } |
395 | 395 | |
396 | - $form_id = intval( $_POST['form_id'] ); |
|
397 | - $form = get_post( $form_id ); |
|
396 | + $form_id = intval($_POST['form_id']); |
|
397 | + $form = get_post($form_id); |
|
398 | 398 | |
399 | - if ( 'give_forms' != $form->post_type ) { |
|
400 | - die( '-2' ); |
|
399 | + if ('give_forms' != $form->post_type) { |
|
400 | + die('-2'); |
|
401 | 401 | } |
402 | 402 | |
403 | - if ( give_has_variable_prices( $form_id ) ) { |
|
404 | - $variable_prices = give_get_variable_prices( $form_id ); |
|
403 | + if (give_has_variable_prices($form_id)) { |
|
404 | + $variable_prices = give_get_variable_prices($form_id); |
|
405 | 405 | |
406 | - if ( $variable_prices ) { |
|
406 | + if ($variable_prices) { |
|
407 | 407 | $ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">'; |
408 | 408 | |
409 | - if ( isset( $_POST['all_prices'] ) ) { |
|
410 | - $ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>'; |
|
409 | + if (isset($_POST['all_prices'])) { |
|
410 | + $ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>'; |
|
411 | 411 | } |
412 | 412 | |
413 | - foreach ( $variable_prices as $key => $price ) { |
|
413 | + foreach ($variable_prices as $key => $price) { |
|
414 | 414 | |
415 | - $level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) ); |
|
415 | + $level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'])); |
|
416 | 416 | |
417 | - $ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>'; |
|
417 | + $ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>'; |
|
418 | 418 | } |
419 | 419 | $ajax_response .= '</select>'; |
420 | 420 | echo $ajax_response; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | give_die(); |
425 | 425 | } |
426 | 426 | |
427 | -add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' ); |
|
427 | +add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations'); |
|
428 | 428 | |
429 | 429 | |
430 | 430 | /** |
@@ -435,25 +435,25 @@ discard block |
||
435 | 435 | * @return void |
436 | 436 | */ |
437 | 437 | function give_check_for_form_price_variations_html() { |
438 | - if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) { |
|
438 | + if ( ! current_user_can('edit_give_payments', get_current_user_id())) { |
|
439 | 439 | wp_die(); |
440 | 440 | } |
441 | 441 | |
442 | - $form_id = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : 0; |
|
443 | - $payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : 0; |
|
444 | - $form = get_post( $form_id ); |
|
442 | + $form_id = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : 0; |
|
443 | + $payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : 0; |
|
444 | + $form = get_post($form_id); |
|
445 | 445 | |
446 | - if ( 'give_forms' != $form->post_type ) { |
|
446 | + if ('give_forms' != $form->post_type) { |
|
447 | 447 | wp_die(); |
448 | 448 | } |
449 | 449 | |
450 | - if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) { |
|
451 | - esc_html_e( 'n/a', 'give' ); |
|
450 | + if ( ! give_has_variable_prices($form_id) || ! $form_id) { |
|
451 | + esc_html_e('n/a', 'give'); |
|
452 | 452 | } else { |
453 | 453 | $prices_atts = ''; |
454 | - if ( $variable_prices = give_get_variable_prices( $form_id ) ) { |
|
455 | - foreach ( $variable_prices as $variable_price ) { |
|
456 | - $prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'] ); |
|
454 | + if ($variable_prices = give_get_variable_prices($form_id)) { |
|
455 | + foreach ($variable_prices as $variable_price) { |
|
456 | + $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']); |
|
457 | 457 | } |
458 | 458 | } |
459 | 459 | |
@@ -464,12 +464,12 @@ discard block |
||
464 | 464 | 'chosen' => true, |
465 | 465 | 'show_option_all' => '', |
466 | 466 | 'show_option_none' => '', |
467 | - 'select_atts' => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ), |
|
467 | + 'select_atts' => 'data-prices='.esc_attr(json_encode($prices_atts)), |
|
468 | 468 | ); |
469 | 469 | |
470 | - if ( $payment_id ) { |
|
470 | + if ($payment_id) { |
|
471 | 471 | // Payment object. |
472 | - $payment = new Give_Payment( $payment_id ); |
|
472 | + $payment = new Give_Payment($payment_id); |
|
473 | 473 | |
474 | 474 | // Payment meta. |
475 | 475 | $payment_meta = $payment->get_meta(); |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | } |
478 | 478 | |
479 | 479 | // Render variable prices select tag html. |
480 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
480 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | give_die(); |
484 | 484 | } |
485 | 485 | |
486 | -add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' ); |
|
486 | +add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html'); |
@@ -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|void A list of states for the shop'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__( 'Phillipines', '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__('Phillipines', '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 | /** |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * |
384 | 384 | * @param array $states Contain the list of states in array key format where key of the array is there respected country code. |
385 | 385 | */ |
386 | - return (array) apply_filters( 'give_states_list', $states ); |
|
386 | + return (array) apply_filters('give_states_list', $states); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
@@ -397,21 +397,21 @@ discard block |
||
397 | 397 | */ |
398 | 398 | function give_no_states_country_list() { |
399 | 399 | $country = array( |
400 | - 'AT' => esc_html__( 'Austria', 'give' ), |
|
401 | - 'BE' => esc_html__( 'Belgium', 'give' ), |
|
402 | - 'CZ' => esc_html__( 'Czech Republic', 'give' ), |
|
403 | - 'DE' => esc_html__( 'Germany', 'give' ), |
|
404 | - 'EE' => esc_html__( 'Estonia', 'give' ), |
|
405 | - 'FI' => esc_html__( 'Finland', 'give' ), |
|
406 | - 'DK' => esc_html__( 'Denmark', 'give' ), |
|
407 | - 'FR' => esc_html__( 'France', 'give' ), |
|
408 | - 'IS' => esc_html__( 'Iceland', 'give' ), |
|
409 | - 'NL' => esc_html__( 'Netherlands', 'give' ), |
|
410 | - 'PL' => esc_html__( 'Poland', 'give' ), |
|
411 | - 'PT' => esc_html__( 'Portugal', 'give' ), |
|
412 | - 'SK' => esc_html__( 'Slovak Republic', 'give' ), |
|
413 | - 'SI' => esc_html__( 'Slovenia', 'give' ), |
|
414 | - 'VN' => esc_html__( 'Vietnam', 'give' ), |
|
400 | + 'AT' => esc_html__('Austria', 'give'), |
|
401 | + 'BE' => esc_html__('Belgium', 'give'), |
|
402 | + 'CZ' => esc_html__('Czech Republic', 'give'), |
|
403 | + 'DE' => esc_html__('Germany', 'give'), |
|
404 | + 'EE' => esc_html__('Estonia', 'give'), |
|
405 | + 'FI' => esc_html__('Finland', 'give'), |
|
406 | + 'DK' => esc_html__('Denmark', 'give'), |
|
407 | + 'FR' => esc_html__('France', 'give'), |
|
408 | + 'IS' => esc_html__('Iceland', 'give'), |
|
409 | + 'NL' => esc_html__('Netherlands', 'give'), |
|
410 | + 'PL' => esc_html__('Poland', 'give'), |
|
411 | + 'PT' => esc_html__('Portugal', 'give'), |
|
412 | + 'SK' => esc_html__('Slovak Republic', 'give'), |
|
413 | + 'SI' => esc_html__('Slovenia', 'give'), |
|
414 | + 'VN' => esc_html__('Vietnam', 'give'), |
|
415 | 415 | ); |
416 | 416 | |
417 | 417 | /** |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | * |
422 | 422 | * @param array $country Contain key as there country code & value as there country name. |
423 | 423 | */ |
424 | - return (array) apply_filters( 'give_no_states_country_list', $country ); |
|
424 | + return (array) apply_filters('give_no_states_country_list', $country); |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | /** |
@@ -433,89 +433,89 @@ discard block |
||
433 | 433 | function give_get_turkey_states_list() { |
434 | 434 | $states = array( |
435 | 435 | '' => '', |
436 | - 'TR01' => __( 'Adana', 'give' ), |
|
437 | - 'TR02' => __( 'Adıyaman', 'give' ), |
|
438 | - 'TR03' => __( 'Afyon', 'give' ), |
|
439 | - 'TR04' => __( 'Ağrı', 'give' ), |
|
440 | - 'TR05' => __( 'Amasya', 'give' ), |
|
441 | - 'TR06' => __( 'Ankara', 'give' ), |
|
442 | - 'TR07' => __( 'Antalya', 'give' ), |
|
443 | - 'TR08' => __( 'Artvin', 'give' ), |
|
444 | - 'TR09' => __( 'Aydın', 'give' ), |
|
445 | - 'TR10' => __( 'Balıkesir', 'give' ), |
|
446 | - 'TR11' => __( 'Bilecik', 'give' ), |
|
447 | - 'TR12' => __( 'Bingöl', 'give' ), |
|
448 | - 'TR13' => __( 'Bitlis', 'give' ), |
|
449 | - 'TR14' => __( 'Bolu', 'give' ), |
|
450 | - 'TR15' => __( 'Burdur', 'give' ), |
|
451 | - 'TR16' => __( 'Bursa', 'give' ), |
|
452 | - 'TR17' => __( 'Çanakkale', 'give' ), |
|
453 | - 'TR18' => __( 'Çankırı', 'give' ), |
|
454 | - 'TR19' => __( 'Çorum', 'give' ), |
|
455 | - 'TR20' => __( 'Denizli', 'give' ), |
|
456 | - 'TR21' => __( 'Diyarbakır', 'give' ), |
|
457 | - 'TR22' => __( 'Edirne', 'give' ), |
|
458 | - 'TR23' => __( 'Elazığ', 'give' ), |
|
459 | - 'TR24' => __( 'Erzincan', 'give' ), |
|
460 | - 'TR25' => __( 'Erzurum', 'give' ), |
|
461 | - 'TR26' => __( 'Eskişehir', 'give' ), |
|
462 | - 'TR27' => __( 'Gaziantep', 'give' ), |
|
463 | - 'TR28' => __( 'Giresun', 'give' ), |
|
464 | - 'TR29' => __( 'Gümüşhane', 'give' ), |
|
465 | - 'TR30' => __( 'Hakkari', 'give' ), |
|
466 | - 'TR31' => __( 'Hatay', 'give' ), |
|
467 | - 'TR32' => __( 'Isparta', 'give' ), |
|
468 | - 'TR33' => __( 'İçel', 'give' ), |
|
469 | - 'TR34' => __( 'İstanbul', 'give' ), |
|
470 | - 'TR35' => __( 'İzmir', 'give' ), |
|
471 | - 'TR36' => __( 'Kars', 'give' ), |
|
472 | - 'TR37' => __( 'Kastamonu', 'give' ), |
|
473 | - 'TR38' => __( 'Kayseri', 'give' ), |
|
474 | - 'TR39' => __( 'Kırklareli', 'give' ), |
|
475 | - 'TR40' => __( 'Kırşehir', 'give' ), |
|
476 | - 'TR41' => __( 'Kocaeli', 'give' ), |
|
477 | - 'TR42' => __( 'Konya', 'give' ), |
|
478 | - 'TR43' => __( 'Kütahya', 'give' ), |
|
479 | - 'TR44' => __( 'Malatya', 'give' ), |
|
480 | - 'TR45' => __( 'Manisa', 'give' ), |
|
481 | - 'TR46' => __( 'Kahramanmaraş', 'give' ), |
|
482 | - 'TR47' => __( 'Mardin', 'give' ), |
|
483 | - 'TR48' => __( 'Muğla', 'give' ), |
|
484 | - 'TR49' => __( 'Muş', 'give' ), |
|
485 | - 'TR50' => __( 'Nevşehir', 'give' ), |
|
486 | - 'TR51' => __( 'Niğde', 'give' ), |
|
487 | - 'TR52' => __( 'Ordu', 'give' ), |
|
488 | - 'TR53' => __( 'Rize', 'give' ), |
|
489 | - 'TR54' => __( 'Sakarya', 'give' ), |
|
490 | - 'TR55' => __( 'Samsun', 'give' ), |
|
491 | - 'TR56' => __( 'Siirt', 'give' ), |
|
492 | - 'TR57' => __( 'Sinop', 'give' ), |
|
493 | - 'TR58' => __( 'Sivas', 'give' ), |
|
494 | - 'TR59' => __( 'Tekirdağ', 'give' ), |
|
495 | - 'TR60' => __( 'Tokat', 'give' ), |
|
496 | - 'TR61' => __( 'Trabzon', 'give' ), |
|
497 | - 'TR62' => __( 'Tunceli', 'give' ), |
|
498 | - 'TR63' => __( 'Şanlıurfa', 'give' ), |
|
499 | - 'TR64' => __( 'Uşak', 'give' ), |
|
500 | - 'TR65' => __( 'Van', 'give' ), |
|
501 | - 'TR66' => __( 'Yozgat', 'give' ), |
|
502 | - 'TR67' => __( 'Zonguldak', 'give' ), |
|
503 | - 'TR68' => __( 'Aksaray', 'give' ), |
|
504 | - 'TR69' => __( 'Bayburt', 'give' ), |
|
505 | - 'TR70' => __( 'Karaman', 'give' ), |
|
506 | - 'TR71' => __( 'Kırıkkale', 'give' ), |
|
507 | - 'TR72' => __( 'Batman', 'give' ), |
|
508 | - 'TR73' => __( 'Şırnak', 'give' ), |
|
509 | - 'TR74' => __( 'Bartın', 'give' ), |
|
510 | - 'TR75' => __( 'Ardahan', 'give' ), |
|
511 | - 'TR76' => __( 'Iğdır', 'give' ), |
|
512 | - 'TR77' => __( 'Yalova', 'give' ), |
|
513 | - 'TR78' => __( 'Karabük', 'give' ), |
|
514 | - 'TR79' => __( 'Kilis', 'give' ), |
|
515 | - 'TR80' => __( 'Osmaniye', 'give' ), |
|
516 | - 'TR81' => __( 'Düzce', 'give' ), |
|
436 | + 'TR01' => __('Adana', 'give'), |
|
437 | + 'TR02' => __('Adıyaman', 'give'), |
|
438 | + 'TR03' => __('Afyon', 'give'), |
|
439 | + 'TR04' => __('Ağrı', 'give'), |
|
440 | + 'TR05' => __('Amasya', 'give'), |
|
441 | + 'TR06' => __('Ankara', 'give'), |
|
442 | + 'TR07' => __('Antalya', 'give'), |
|
443 | + 'TR08' => __('Artvin', 'give'), |
|
444 | + 'TR09' => __('Aydın', 'give'), |
|
445 | + 'TR10' => __('Balıkesir', 'give'), |
|
446 | + 'TR11' => __('Bilecik', 'give'), |
|
447 | + 'TR12' => __('Bingöl', 'give'), |
|
448 | + 'TR13' => __('Bitlis', 'give'), |
|
449 | + 'TR14' => __('Bolu', 'give'), |
|
450 | + 'TR15' => __('Burdur', 'give'), |
|
451 | + 'TR16' => __('Bursa', 'give'), |
|
452 | + 'TR17' => __('Çanakkale', 'give'), |
|
453 | + 'TR18' => __('Çankırı', 'give'), |
|
454 | + 'TR19' => __('Çorum', 'give'), |
|
455 | + 'TR20' => __('Denizli', 'give'), |
|
456 | + 'TR21' => __('Diyarbakır', 'give'), |
|
457 | + 'TR22' => __('Edirne', 'give'), |
|
458 | + 'TR23' => __('Elazığ', 'give'), |
|
459 | + 'TR24' => __('Erzincan', 'give'), |
|
460 | + 'TR25' => __('Erzurum', 'give'), |
|
461 | + 'TR26' => __('Eskişehir', 'give'), |
|
462 | + 'TR27' => __('Gaziantep', 'give'), |
|
463 | + 'TR28' => __('Giresun', 'give'), |
|
464 | + 'TR29' => __('Gümüşhane', 'give'), |
|
465 | + 'TR30' => __('Hakkari', 'give'), |
|
466 | + 'TR31' => __('Hatay', 'give'), |
|
467 | + 'TR32' => __('Isparta', 'give'), |
|
468 | + 'TR33' => __('İçel', 'give'), |
|
469 | + 'TR34' => __('İstanbul', 'give'), |
|
470 | + 'TR35' => __('İzmir', 'give'), |
|
471 | + 'TR36' => __('Kars', 'give'), |
|
472 | + 'TR37' => __('Kastamonu', 'give'), |
|
473 | + 'TR38' => __('Kayseri', 'give'), |
|
474 | + 'TR39' => __('Kırklareli', 'give'), |
|
475 | + 'TR40' => __('Kırşehir', 'give'), |
|
476 | + 'TR41' => __('Kocaeli', 'give'), |
|
477 | + 'TR42' => __('Konya', 'give'), |
|
478 | + 'TR43' => __('Kütahya', 'give'), |
|
479 | + 'TR44' => __('Malatya', 'give'), |
|
480 | + 'TR45' => __('Manisa', 'give'), |
|
481 | + 'TR46' => __('Kahramanmaraş', 'give'), |
|
482 | + 'TR47' => __('Mardin', 'give'), |
|
483 | + 'TR48' => __('Muğla', 'give'), |
|
484 | + 'TR49' => __('Muş', 'give'), |
|
485 | + 'TR50' => __('Nevşehir', 'give'), |
|
486 | + 'TR51' => __('Niğde', 'give'), |
|
487 | + 'TR52' => __('Ordu', 'give'), |
|
488 | + 'TR53' => __('Rize', 'give'), |
|
489 | + 'TR54' => __('Sakarya', 'give'), |
|
490 | + 'TR55' => __('Samsun', 'give'), |
|
491 | + 'TR56' => __('Siirt', 'give'), |
|
492 | + 'TR57' => __('Sinop', 'give'), |
|
493 | + 'TR58' => __('Sivas', 'give'), |
|
494 | + 'TR59' => __('Tekirdağ', 'give'), |
|
495 | + 'TR60' => __('Tokat', 'give'), |
|
496 | + 'TR61' => __('Trabzon', 'give'), |
|
497 | + 'TR62' => __('Tunceli', 'give'), |
|
498 | + 'TR63' => __('Şanlıurfa', 'give'), |
|
499 | + 'TR64' => __('Uşak', 'give'), |
|
500 | + 'TR65' => __('Van', 'give'), |
|
501 | + 'TR66' => __('Yozgat', 'give'), |
|
502 | + 'TR67' => __('Zonguldak', 'give'), |
|
503 | + 'TR68' => __('Aksaray', 'give'), |
|
504 | + 'TR69' => __('Bayburt', 'give'), |
|
505 | + 'TR70' => __('Karaman', 'give'), |
|
506 | + 'TR71' => __('Kırıkkale', 'give'), |
|
507 | + 'TR72' => __('Batman', 'give'), |
|
508 | + 'TR73' => __('Şırnak', 'give'), |
|
509 | + 'TR74' => __('Bartın', 'give'), |
|
510 | + 'TR75' => __('Ardahan', 'give'), |
|
511 | + 'TR76' => __('Iğdır', 'give'), |
|
512 | + 'TR77' => __('Yalova', 'give'), |
|
513 | + 'TR78' => __('Karabük', 'give'), |
|
514 | + 'TR79' => __('Kilis', 'give'), |
|
515 | + 'TR80' => __('Osmaniye', 'give'), |
|
516 | + 'TR81' => __('Düzce', 'give'), |
|
517 | 517 | ); |
518 | - return apply_filters( 'give_turkey_states', $states ); |
|
518 | + return apply_filters('give_turkey_states', $states); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | /** |
@@ -525,52 +525,52 @@ discard block |
||
525 | 525 | * @return array $states A list of states |
526 | 526 | */ |
527 | 527 | function give_get_romania_states_list() { |
528 | - $states = array ( |
|
528 | + $states = array( |
|
529 | 529 | '' => '', |
530 | - 'AB' => __( 'Alba' , 'give' ), |
|
531 | - 'AR' => __( 'Arad' , 'give' ), |
|
532 | - 'AG' => __( 'Arges' , 'give' ), |
|
533 | - 'BC' => __( 'Bacau' , 'give' ), |
|
534 | - 'BH' => __( 'Bihor' , 'give' ), |
|
535 | - 'BN' => __( 'Bistrita-Nasaud' , 'give' ), |
|
536 | - 'BT' => __( 'Botosani' , 'give' ), |
|
537 | - 'BR' => __( 'Braila' , 'give' ), |
|
538 | - 'BV' => __( 'Brasov' , 'give' ), |
|
539 | - 'B' => __( 'Bucuresti' , 'give' ), |
|
540 | - 'BZ' => __( 'Buzau' , 'give' ), |
|
541 | - 'CL' => __( 'Calarasi' , 'give' ), |
|
542 | - 'CS' => __( 'Caras-Severin' , 'give' ), |
|
543 | - 'CJ' => __( 'Cluj' , 'give' ), |
|
544 | - 'CT' => __( 'Constanta' , 'give' ), |
|
545 | - 'CV' => __( 'Covasna' , 'give' ), |
|
546 | - 'DB' => __( 'Dambovita' , 'give' ), |
|
547 | - 'DJ' => __( 'Dolj' , 'give' ), |
|
548 | - 'GL' => __( 'Galati' , 'give' ), |
|
549 | - 'GR' => __( 'Giurgiu' , 'give' ), |
|
550 | - 'GJ' => __( 'Gorj' , 'give' ), |
|
551 | - 'HR' => __( 'Harghita' , 'give' ), |
|
552 | - 'HD' => __( 'Hunedoara' , 'give' ), |
|
553 | - 'IL' => __( 'Ialomita' , 'give' ), |
|
554 | - 'IS' => __( 'Iasi' , 'give' ), |
|
555 | - 'IF' => __( 'Ilfov' , 'give' ), |
|
556 | - 'MM' => __( 'Maramures' , 'give' ), |
|
557 | - 'MH' => __( 'Mehedinti' , 'give' ), |
|
558 | - 'MS' => __( 'Mures' , 'give' ), |
|
559 | - 'NT' => __( 'Neamt' , 'give' ), |
|
560 | - 'OT' => __( 'Olt' , 'give' ), |
|
561 | - 'PH' => __( 'Prahova' , 'give' ), |
|
562 | - 'SJ' => __( 'Salaj' , 'give' ), |
|
563 | - 'SM' => __( 'Satu Mare' , 'give' ), |
|
564 | - 'SB' => __( 'Sibiu' , 'give' ), |
|
565 | - 'SV' => __( 'Suceava' , 'give' ), |
|
566 | - 'TR' => __( 'Teleorman' , 'give' ), |
|
567 | - 'TM' => __( 'Timis' , 'give' ), |
|
568 | - 'TL' => __( 'Tulcea' , 'give' ), |
|
569 | - 'VL' => __( 'Valcea' , 'give' ), |
|
570 | - 'VS' => __( 'Vaslui' , 'give' ), |
|
571 | - 'VN' => __( 'Vrancea' , 'give' ), |
|
530 | + 'AB' => __('Alba', 'give'), |
|
531 | + 'AR' => __('Arad', 'give'), |
|
532 | + 'AG' => __('Arges', 'give'), |
|
533 | + 'BC' => __('Bacau', 'give'), |
|
534 | + 'BH' => __('Bihor', 'give'), |
|
535 | + 'BN' => __('Bistrita-Nasaud', 'give'), |
|
536 | + 'BT' => __('Botosani', 'give'), |
|
537 | + 'BR' => __('Braila', 'give'), |
|
538 | + 'BV' => __('Brasov', 'give'), |
|
539 | + 'B' => __('Bucuresti', 'give'), |
|
540 | + 'BZ' => __('Buzau', 'give'), |
|
541 | + 'CL' => __('Calarasi', 'give'), |
|
542 | + 'CS' => __('Caras-Severin', 'give'), |
|
543 | + 'CJ' => __('Cluj', 'give'), |
|
544 | + 'CT' => __('Constanta', 'give'), |
|
545 | + 'CV' => __('Covasna', 'give'), |
|
546 | + 'DB' => __('Dambovita', 'give'), |
|
547 | + 'DJ' => __('Dolj', 'give'), |
|
548 | + 'GL' => __('Galati', 'give'), |
|
549 | + 'GR' => __('Giurgiu', 'give'), |
|
550 | + 'GJ' => __('Gorj', 'give'), |
|
551 | + 'HR' => __('Harghita', 'give'), |
|
552 | + 'HD' => __('Hunedoara', 'give'), |
|
553 | + 'IL' => __('Ialomita', 'give'), |
|
554 | + 'IS' => __('Iasi', 'give'), |
|
555 | + 'IF' => __('Ilfov', 'give'), |
|
556 | + 'MM' => __('Maramures', 'give'), |
|
557 | + 'MH' => __('Mehedinti', 'give'), |
|
558 | + 'MS' => __('Mures', 'give'), |
|
559 | + 'NT' => __('Neamt', 'give'), |
|
560 | + 'OT' => __('Olt', 'give'), |
|
561 | + 'PH' => __('Prahova', 'give'), |
|
562 | + 'SJ' => __('Salaj', 'give'), |
|
563 | + 'SM' => __('Satu Mare', 'give'), |
|
564 | + 'SB' => __('Sibiu', 'give'), |
|
565 | + 'SV' => __('Suceava', 'give'), |
|
566 | + 'TR' => __('Teleorman', 'give'), |
|
567 | + 'TM' => __('Timis', 'give'), |
|
568 | + 'TL' => __('Tulcea', 'give'), |
|
569 | + 'VL' => __('Valcea', 'give'), |
|
570 | + 'VS' => __('Vaslui', 'give'), |
|
571 | + 'VN' => __('Vrancea', 'give'), |
|
572 | 572 | ); |
573 | - return apply_filters( 'give_romania_states', $states ); |
|
573 | + return apply_filters('give_romania_states', $states); |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
@@ -582,16 +582,16 @@ discard block |
||
582 | 582 | function give_get_pakistan_states_list() { |
583 | 583 | $states = array( |
584 | 584 | '' => '', |
585 | - 'JK' => __( 'Azad Kashmir', 'give' ), |
|
586 | - 'BA' => __( 'Balochistan', 'give' ), |
|
587 | - 'TA' => __( 'FATA', 'give' ), |
|
588 | - 'GB' => __( 'Gilgit Baltistan', 'give' ), |
|
589 | - 'IS' => __( 'Islamabad Capital Territory', 'give' ), |
|
590 | - 'KP' => __( 'Khyber Pakhtunkhwa', 'give' ), |
|
591 | - 'PB' => __( 'Punjab', 'give' ), |
|
592 | - 'SD' => __( 'Sindh', 'give' ), |
|
585 | + 'JK' => __('Azad Kashmir', 'give'), |
|
586 | + 'BA' => __('Balochistan', 'give'), |
|
587 | + 'TA' => __('FATA', 'give'), |
|
588 | + 'GB' => __('Gilgit Baltistan', 'give'), |
|
589 | + 'IS' => __('Islamabad Capital Territory', 'give'), |
|
590 | + 'KP' => __('Khyber Pakhtunkhwa', 'give'), |
|
591 | + 'PB' => __('Punjab', 'give'), |
|
592 | + 'SD' => __('Sindh', 'give'), |
|
593 | 593 | ); |
594 | - return apply_filters( 'give_pakistan_states', $states ); |
|
594 | + return apply_filters('give_pakistan_states', $states); |
|
595 | 595 | } |
596 | 596 | |
597 | 597 | /** |
@@ -603,90 +603,90 @@ discard block |
||
603 | 603 | function give_get_philippines_states_list() { |
604 | 604 | $states = array( |
605 | 605 | '' => '', |
606 | - 'ABR' => __( 'Abra', 'give' ), |
|
607 | - 'AGN' => __( 'Agusan del Norte', 'give' ), |
|
608 | - 'AGS' => __( 'Agusan del Sur', 'give' ), |
|
609 | - 'AKL' => __( 'Aklan', 'give' ), |
|
610 | - 'ALB' => __( 'Albay', 'give' ), |
|
611 | - 'ANT' => __( 'Antique', 'give' ), |
|
612 | - 'APA' => __( 'Apayao', 'give' ), |
|
613 | - 'AUR' => __( 'Aurora', 'give' ), |
|
614 | - 'BAS' => __( 'Basilan', 'give' ), |
|
615 | - 'BAN' => __( 'Bataan', 'give' ), |
|
616 | - 'BTN' => __( 'Batanes', 'give' ), |
|
617 | - 'BTG' => __( 'Batangas', 'give' ), |
|
618 | - 'BEN' => __( 'Benguet', 'give' ), |
|
619 | - 'BIL' => __( 'Biliran', 'give' ), |
|
620 | - 'BOH' => __( 'Bohol', 'give' ), |
|
621 | - 'BUK' => __( 'Bukidnon', 'give' ), |
|
622 | - 'BUL' => __( 'Bulacan', 'give' ), |
|
623 | - 'CAG' => __( 'Cagayan', 'give' ), |
|
624 | - 'CAN' => __( 'Camarines Norte', 'give' ), |
|
625 | - 'CAS' => __( 'Camarines Sur', 'give' ), |
|
626 | - 'CAM' => __( 'Camiguin', 'give' ), |
|
627 | - 'CAP' => __( 'Capiz', 'give' ), |
|
628 | - 'CAT' => __( 'Catanduanes', 'give' ), |
|
629 | - 'CAV' => __( 'Cavite', 'give' ), |
|
630 | - 'CEB' => __( 'Cebu', 'give' ), |
|
631 | - 'COM' => __( 'Compostela Valley', 'give' ), |
|
632 | - 'NCO' => __( 'Cotabato', 'give' ), |
|
633 | - 'DAV' => __( 'Davao del Norte', 'give' ), |
|
634 | - 'DAS' => __( 'Davao del Sur', 'give' ), |
|
635 | - 'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned |
|
636 | - 'DAO' => __( 'Davao Oriental', 'give' ), |
|
637 | - 'DIN' => __( 'Dinagat Islands', 'give' ), |
|
638 | - 'EAS' => __( 'Eastern Samar', 'give' ), |
|
639 | - 'GUI' => __( 'Guimaras', 'give' ), |
|
640 | - 'IFU' => __( 'Ifugao', 'give' ), |
|
641 | - 'ILN' => __( 'Ilocos Norte', 'give' ), |
|
642 | - 'ILS' => __( 'Ilocos Sur', 'give' ), |
|
643 | - 'ILI' => __( 'Iloilo', 'give' ), |
|
644 | - 'ISA' => __( 'Isabela', 'give' ), |
|
645 | - 'KAL' => __( 'Kalinga', 'give' ), |
|
646 | - 'LUN' => __( 'La Union', 'give' ), |
|
647 | - 'LAG' => __( 'Laguna', 'give' ), |
|
648 | - 'LAN' => __( 'Lanao del Norte', 'give' ), |
|
649 | - 'LAS' => __( 'Lanao del Sur', 'give' ), |
|
650 | - 'LEY' => __( 'Leyte', 'give' ), |
|
651 | - 'MAG' => __( 'Maguindanao', 'give' ), |
|
652 | - 'MAD' => __( 'Marinduque', 'give' ), |
|
653 | - 'MAS' => __( 'Masbate', 'give' ), |
|
654 | - 'MSC' => __( 'Misamis Occidental', 'give' ), |
|
655 | - 'MSR' => __( 'Misamis Oriental', 'give' ), |
|
656 | - 'MOU' => __( 'Mountain Province', 'give' ), |
|
657 | - 'NEC' => __( 'Negros Occidental', 'give' ), |
|
658 | - 'NER' => __( 'Negros Oriental', 'give' ), |
|
659 | - 'NSA' => __( 'Northern Samar', 'give' ), |
|
660 | - 'NUE' => __( 'Nueva Ecija', 'give' ), |
|
661 | - 'NUV' => __( 'Nueva Vizcaya', 'give' ), |
|
662 | - 'MDC' => __( 'Occidental Mindoro', 'give' ), |
|
663 | - 'MDR' => __( 'Oriental Mindoro', 'give' ), |
|
664 | - 'PLW' => __( 'Palawan', 'give' ), |
|
665 | - 'PAM' => __( 'Pampanga', 'give' ), |
|
666 | - 'PAN' => __( 'Pangasinan', 'give' ), |
|
667 | - 'QUE' => __( 'Quezon', 'give' ), |
|
668 | - 'QUI' => __( 'Quirino', 'give' ), |
|
669 | - 'RIZ' => __( 'Rizal', 'give' ), |
|
670 | - 'ROM' => __( 'Romblon', 'give' ), |
|
671 | - 'WSA' => __( 'Samar', 'give' ), |
|
672 | - 'SAR' => __( 'Sarangani', 'give' ), |
|
673 | - 'SIQ' => __( 'Siquijor', 'give' ), |
|
674 | - 'SOR' => __( 'Sorsogon', 'give' ), |
|
675 | - 'SCO' => __( 'South Cotabato', 'give' ), |
|
676 | - 'SLE' => __( 'Southern Leyte', 'give' ), |
|
677 | - 'SUK' => __( 'Sultan Kudarat', 'give' ), |
|
678 | - 'SLU' => __( 'Sulu', 'give' ), |
|
679 | - 'SUN' => __( 'Surigao del Norte', 'give' ), |
|
680 | - 'SUR' => __( 'Surigao del Sur', 'give' ), |
|
681 | - 'TAR' => __( 'Tarlac', 'give' ), |
|
682 | - 'TAW' => __( 'Tawi-Tawi', 'give' ), |
|
683 | - 'ZMB' => __( 'Zambales', 'give' ), |
|
684 | - 'ZAN' => __( 'Zamboanga del Norte', 'give' ), |
|
685 | - 'ZAS' => __( 'Zamboanga del Sur', 'give' ), |
|
686 | - 'ZSI' => __( 'Zamboanga Sibugay', 'give' ), |
|
687 | - '00' => __( 'Metro Manila', 'give' ), |
|
606 | + 'ABR' => __('Abra', 'give'), |
|
607 | + 'AGN' => __('Agusan del Norte', 'give'), |
|
608 | + 'AGS' => __('Agusan del Sur', 'give'), |
|
609 | + 'AKL' => __('Aklan', 'give'), |
|
610 | + 'ALB' => __('Albay', 'give'), |
|
611 | + 'ANT' => __('Antique', 'give'), |
|
612 | + 'APA' => __('Apayao', 'give'), |
|
613 | + 'AUR' => __('Aurora', 'give'), |
|
614 | + 'BAS' => __('Basilan', 'give'), |
|
615 | + 'BAN' => __('Bataan', 'give'), |
|
616 | + 'BTN' => __('Batanes', 'give'), |
|
617 | + 'BTG' => __('Batangas', 'give'), |
|
618 | + 'BEN' => __('Benguet', 'give'), |
|
619 | + 'BIL' => __('Biliran', 'give'), |
|
620 | + 'BOH' => __('Bohol', 'give'), |
|
621 | + 'BUK' => __('Bukidnon', 'give'), |
|
622 | + 'BUL' => __('Bulacan', 'give'), |
|
623 | + 'CAG' => __('Cagayan', 'give'), |
|
624 | + 'CAN' => __('Camarines Norte', 'give'), |
|
625 | + 'CAS' => __('Camarines Sur', 'give'), |
|
626 | + 'CAM' => __('Camiguin', 'give'), |
|
627 | + 'CAP' => __('Capiz', 'give'), |
|
628 | + 'CAT' => __('Catanduanes', 'give'), |
|
629 | + 'CAV' => __('Cavite', 'give'), |
|
630 | + 'CEB' => __('Cebu', 'give'), |
|
631 | + 'COM' => __('Compostela Valley', 'give'), |
|
632 | + 'NCO' => __('Cotabato', 'give'), |
|
633 | + 'DAV' => __('Davao del Norte', 'give'), |
|
634 | + 'DAS' => __('Davao del Sur', 'give'), |
|
635 | + 'DAC' => __('Davao Occidental', 'give'), // TODO: Needs to be updated when ISO code is assigned |
|
636 | + 'DAO' => __('Davao Oriental', 'give'), |
|
637 | + 'DIN' => __('Dinagat Islands', 'give'), |
|
638 | + 'EAS' => __('Eastern Samar', 'give'), |
|
639 | + 'GUI' => __('Guimaras', 'give'), |
|
640 | + 'IFU' => __('Ifugao', 'give'), |
|
641 | + 'ILN' => __('Ilocos Norte', 'give'), |
|
642 | + 'ILS' => __('Ilocos Sur', 'give'), |
|
643 | + 'ILI' => __('Iloilo', 'give'), |
|
644 | + 'ISA' => __('Isabela', 'give'), |
|
645 | + 'KAL' => __('Kalinga', 'give'), |
|
646 | + 'LUN' => __('La Union', 'give'), |
|
647 | + 'LAG' => __('Laguna', 'give'), |
|
648 | + 'LAN' => __('Lanao del Norte', 'give'), |
|
649 | + 'LAS' => __('Lanao del Sur', 'give'), |
|
650 | + 'LEY' => __('Leyte', 'give'), |
|
651 | + 'MAG' => __('Maguindanao', 'give'), |
|
652 | + 'MAD' => __('Marinduque', 'give'), |
|
653 | + 'MAS' => __('Masbate', 'give'), |
|
654 | + 'MSC' => __('Misamis Occidental', 'give'), |
|
655 | + 'MSR' => __('Misamis Oriental', 'give'), |
|
656 | + 'MOU' => __('Mountain Province', 'give'), |
|
657 | + 'NEC' => __('Negros Occidental', 'give'), |
|
658 | + 'NER' => __('Negros Oriental', 'give'), |
|
659 | + 'NSA' => __('Northern Samar', 'give'), |
|
660 | + 'NUE' => __('Nueva Ecija', 'give'), |
|
661 | + 'NUV' => __('Nueva Vizcaya', 'give'), |
|
662 | + 'MDC' => __('Occidental Mindoro', 'give'), |
|
663 | + 'MDR' => __('Oriental Mindoro', 'give'), |
|
664 | + 'PLW' => __('Palawan', 'give'), |
|
665 | + 'PAM' => __('Pampanga', 'give'), |
|
666 | + 'PAN' => __('Pangasinan', 'give'), |
|
667 | + 'QUE' => __('Quezon', 'give'), |
|
668 | + 'QUI' => __('Quirino', 'give'), |
|
669 | + 'RIZ' => __('Rizal', 'give'), |
|
670 | + 'ROM' => __('Romblon', 'give'), |
|
671 | + 'WSA' => __('Samar', 'give'), |
|
672 | + 'SAR' => __('Sarangani', 'give'), |
|
673 | + 'SIQ' => __('Siquijor', 'give'), |
|
674 | + 'SOR' => __('Sorsogon', 'give'), |
|
675 | + 'SCO' => __('South Cotabato', 'give'), |
|
676 | + 'SLE' => __('Southern Leyte', 'give'), |
|
677 | + 'SUK' => __('Sultan Kudarat', 'give'), |
|
678 | + 'SLU' => __('Sulu', 'give'), |
|
679 | + 'SUN' => __('Surigao del Norte', 'give'), |
|
680 | + 'SUR' => __('Surigao del Sur', 'give'), |
|
681 | + 'TAR' => __('Tarlac', 'give'), |
|
682 | + 'TAW' => __('Tawi-Tawi', 'give'), |
|
683 | + 'ZMB' => __('Zambales', 'give'), |
|
684 | + 'ZAN' => __('Zamboanga del Norte', 'give'), |
|
685 | + 'ZAS' => __('Zamboanga del Sur', 'give'), |
|
686 | + 'ZSI' => __('Zamboanga Sibugay', 'give'), |
|
687 | + '00' => __('Metro Manila', 'give'), |
|
688 | 688 | ); |
689 | - return apply_filters( 'give_philippines_states', $states ); |
|
689 | + return apply_filters('give_philippines_states', $states); |
|
690 | 690 | } |
691 | 691 | |
692 | 692 | /** |
@@ -698,34 +698,34 @@ discard block |
||
698 | 698 | function give_get_peru_states_list() { |
699 | 699 | $states = array( |
700 | 700 | '' => '', |
701 | - 'CAL' => __( 'El Callao', 'give' ), |
|
702 | - 'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ), |
|
703 | - 'AMA' => __( 'Amazonas', 'give' ), |
|
704 | - 'ANC' => __( 'Ancash', 'give' ), |
|
705 | - 'APU' => __( 'Apurímac', 'give' ), |
|
706 | - 'ARE' => __( 'Arequipa', 'give' ), |
|
707 | - 'AYA' => __( 'Ayacucho', 'give' ), |
|
708 | - 'CAJ' => __( 'Cajamarca', 'give' ), |
|
709 | - 'CUS' => __( 'Cusco', 'give' ), |
|
710 | - 'HUV' => __( 'Huancavelica', 'give' ), |
|
711 | - 'HUC' => __( 'Huánuco', 'give' ), |
|
712 | - 'ICA' => __( 'Ica', 'give' ), |
|
713 | - 'JUN' => __( 'Junín', 'give' ), |
|
714 | - 'LAL' => __( 'La Libertad', 'give' ), |
|
715 | - 'LAM' => __( 'Lambayeque', 'give' ), |
|
716 | - 'LIM' => __( 'Lima', 'give' ), |
|
717 | - 'LOR' => __( 'Loreto', 'give' ), |
|
718 | - 'MDD' => __( 'Madre de Dios', 'give' ), |
|
719 | - 'MOQ' => __( 'Moquegua', 'give' ), |
|
720 | - 'PAS' => __( 'Pasco', 'give' ), |
|
721 | - 'PIU' => __( 'Piura', 'give' ), |
|
722 | - 'PUN' => __( 'Puno', 'give' ), |
|
723 | - 'SAM' => __( 'San Martín', 'give' ), |
|
724 | - 'TAC' => __( 'Tacna', 'give' ), |
|
725 | - 'TUM' => __( 'Tumbes', 'give' ), |
|
726 | - 'UCA' => __( 'Ucayali', 'give' ), |
|
701 | + 'CAL' => __('El Callao', 'give'), |
|
702 | + 'LMA' => __('Municipalidad Metropolitana de Lima', 'give'), |
|
703 | + 'AMA' => __('Amazonas', 'give'), |
|
704 | + 'ANC' => __('Ancash', 'give'), |
|
705 | + 'APU' => __('Apurímac', 'give'), |
|
706 | + 'ARE' => __('Arequipa', 'give'), |
|
707 | + 'AYA' => __('Ayacucho', 'give'), |
|
708 | + 'CAJ' => __('Cajamarca', 'give'), |
|
709 | + 'CUS' => __('Cusco', 'give'), |
|
710 | + 'HUV' => __('Huancavelica', 'give'), |
|
711 | + 'HUC' => __('Huánuco', 'give'), |
|
712 | + 'ICA' => __('Ica', 'give'), |
|
713 | + 'JUN' => __('Junín', 'give'), |
|
714 | + 'LAL' => __('La Libertad', 'give'), |
|
715 | + 'LAM' => __('Lambayeque', 'give'), |
|
716 | + 'LIM' => __('Lima', 'give'), |
|
717 | + 'LOR' => __('Loreto', 'give'), |
|
718 | + 'MDD' => __('Madre de Dios', 'give'), |
|
719 | + 'MOQ' => __('Moquegua', 'give'), |
|
720 | + 'PAS' => __('Pasco', 'give'), |
|
721 | + 'PIU' => __('Piura', 'give'), |
|
722 | + 'PUN' => __('Puno', 'give'), |
|
723 | + 'SAM' => __('San Martín', 'give'), |
|
724 | + 'TAC' => __('Tacna', 'give'), |
|
725 | + 'TUM' => __('Tumbes', 'give'), |
|
726 | + 'UCA' => __('Ucayali', 'give'), |
|
727 | 727 | ); |
728 | - return apply_filters( 'give_peru_states', $states ); |
|
728 | + return apply_filters('give_peru_states', $states); |
|
729 | 729 | } |
730 | 730 | |
731 | 731 | /** |
@@ -737,22 +737,22 @@ discard block |
||
737 | 737 | function give_get_nepal_states_list() { |
738 | 738 | $states = array( |
739 | 739 | '' => '', |
740 | - 'BAG' => __( 'Bagmati', 'give' ), |
|
741 | - 'BHE' => __( 'Bheri', 'give' ), |
|
742 | - 'DHA' => __( 'Dhaulagiri', 'give' ), |
|
743 | - 'GAN' => __( 'Gandaki', 'give' ), |
|
744 | - 'JAN' => __( 'Janakpur', 'give' ), |
|
745 | - 'KAR' => __( 'Karnali', 'give' ), |
|
746 | - 'KOS' => __( 'Koshi', 'give' ), |
|
747 | - 'LUM' => __( 'Lumbini', 'give' ), |
|
748 | - 'MAH' => __( 'Mahakali', 'give' ), |
|
749 | - 'MEC' => __( 'Mechi', 'give' ), |
|
750 | - 'NAR' => __( 'Narayani', 'give' ), |
|
751 | - 'RAP' => __( 'Rapti', 'give' ), |
|
752 | - 'SAG' => __( 'Sagarmatha', 'give' ), |
|
753 | - 'SET' => __( 'Seti', 'give' ), |
|
740 | + 'BAG' => __('Bagmati', 'give'), |
|
741 | + 'BHE' => __('Bheri', 'give'), |
|
742 | + 'DHA' => __('Dhaulagiri', 'give'), |
|
743 | + 'GAN' => __('Gandaki', 'give'), |
|
744 | + 'JAN' => __('Janakpur', 'give'), |
|
745 | + 'KAR' => __('Karnali', 'give'), |
|
746 | + 'KOS' => __('Koshi', 'give'), |
|
747 | + 'LUM' => __('Lumbini', 'give'), |
|
748 | + 'MAH' => __('Mahakali', 'give'), |
|
749 | + 'MEC' => __('Mechi', 'give'), |
|
750 | + 'NAR' => __('Narayani', 'give'), |
|
751 | + 'RAP' => __('Rapti', 'give'), |
|
752 | + 'SAG' => __('Sagarmatha', 'give'), |
|
753 | + 'SET' => __('Seti', 'give'), |
|
754 | 754 | ); |
755 | - return apply_filters( 'give_nepal_states', $states ); |
|
755 | + return apply_filters('give_nepal_states', $states); |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | /** |
@@ -764,45 +764,45 @@ discard block |
||
764 | 764 | function give_get_nigerian_states_list() { |
765 | 765 | $states = array( |
766 | 766 | '' => '', |
767 | - 'AB' => __( 'Abia', 'give' ), |
|
768 | - 'FC' => __( 'Abuja', 'give' ), |
|
769 | - 'AD' => __( 'Adamawa', 'give' ), |
|
770 | - 'AK' => __( 'Akwa Ibom', 'give' ), |
|
771 | - 'AN' => __( 'Anambra', 'give' ), |
|
772 | - 'BA' => __( 'Bauchi', 'give' ), |
|
773 | - 'BY' => __( 'Bayelsa', 'give' ), |
|
774 | - 'BE' => __( 'Benue', 'give' ), |
|
775 | - 'BO' => __( 'Borno', 'give' ), |
|
776 | - 'CR' => __( 'Cross River', 'give' ), |
|
777 | - 'DE' => __( 'Delta', 'give' ), |
|
778 | - 'EB' => __( 'Ebonyi', 'give' ), |
|
779 | - 'ED' => __( 'Edo', 'give' ), |
|
780 | - 'EK' => __( 'Ekiti', 'give' ), |
|
781 | - 'EN' => __( 'Enugu', 'give' ), |
|
782 | - 'GO' => __( 'Gombe', 'give' ), |
|
783 | - 'IM' => __( 'Imo', 'give' ), |
|
784 | - 'JI' => __( 'Jigawa', 'give' ), |
|
785 | - 'KD' => __( 'Kaduna', 'give' ), |
|
786 | - 'KN' => __( 'Kano', 'give' ), |
|
787 | - 'KT' => __( 'Katsina', 'give' ), |
|
788 | - 'KE' => __( 'Kebbi', 'give' ), |
|
789 | - 'KO' => __( 'Kogi', 'give' ), |
|
790 | - 'KW' => __( 'Kwara', 'give' ), |
|
791 | - 'LA' => __( 'Lagos', 'give' ), |
|
792 | - 'NA' => __( 'Nasarawa', 'give' ), |
|
793 | - 'NI' => __( 'Niger', 'give' ), |
|
794 | - 'OG' => __( 'Ogun', 'give' ), |
|
795 | - 'ON' => __( 'Ondo', 'give' ), |
|
796 | - 'OS' => __( 'Osun', 'give' ), |
|
797 | - 'OY' => __( 'Oyo', 'give' ), |
|
798 | - 'PL' => __( 'Plateau', 'give' ), |
|
799 | - 'RI' => __( 'Rivers', 'give' ), |
|
800 | - 'SO' => __( 'Sokoto', 'give' ), |
|
801 | - 'TA' => __( 'Taraba', 'give' ), |
|
802 | - 'YO' => __( 'Yobe', 'give' ), |
|
803 | - 'ZA' => __( 'Zamfara', 'give' ), |
|
767 | + 'AB' => __('Abia', 'give'), |
|
768 | + 'FC' => __('Abuja', 'give'), |
|
769 | + 'AD' => __('Adamawa', 'give'), |
|
770 | + 'AK' => __('Akwa Ibom', 'give'), |
|
771 | + 'AN' => __('Anambra', 'give'), |
|
772 | + 'BA' => __('Bauchi', 'give'), |
|
773 | + 'BY' => __('Bayelsa', 'give'), |
|
774 | + 'BE' => __('Benue', 'give'), |
|
775 | + 'BO' => __('Borno', 'give'), |
|
776 | + 'CR' => __('Cross River', 'give'), |
|
777 | + 'DE' => __('Delta', 'give'), |
|
778 | + 'EB' => __('Ebonyi', 'give'), |
|
779 | + 'ED' => __('Edo', 'give'), |
|
780 | + 'EK' => __('Ekiti', 'give'), |
|
781 | + 'EN' => __('Enugu', 'give'), |
|
782 | + 'GO' => __('Gombe', 'give'), |
|
783 | + 'IM' => __('Imo', 'give'), |
|
784 | + 'JI' => __('Jigawa', 'give'), |
|
785 | + 'KD' => __('Kaduna', 'give'), |
|
786 | + 'KN' => __('Kano', 'give'), |
|
787 | + 'KT' => __('Katsina', 'give'), |
|
788 | + 'KE' => __('Kebbi', 'give'), |
|
789 | + 'KO' => __('Kogi', 'give'), |
|
790 | + 'KW' => __('Kwara', 'give'), |
|
791 | + 'LA' => __('Lagos', 'give'), |
|
792 | + 'NA' => __('Nasarawa', 'give'), |
|
793 | + 'NI' => __('Niger', 'give'), |
|
794 | + 'OG' => __('Ogun', 'give'), |
|
795 | + 'ON' => __('Ondo', 'give'), |
|
796 | + 'OS' => __('Osun', 'give'), |
|
797 | + 'OY' => __('Oyo', 'give'), |
|
798 | + 'PL' => __('Plateau', 'give'), |
|
799 | + 'RI' => __('Rivers', 'give'), |
|
800 | + 'SO' => __('Sokoto', 'give'), |
|
801 | + 'TA' => __('Taraba', 'give'), |
|
802 | + 'YO' => __('Yobe', 'give'), |
|
803 | + 'ZA' => __('Zamfara', 'give'), |
|
804 | 804 | ); |
805 | - return apply_filters( 'give_nigerian_states', $states ); |
|
805 | + return apply_filters('give_nigerian_states', $states); |
|
806 | 806 | } |
807 | 807 | |
808 | 808 | /** |
@@ -814,40 +814,40 @@ discard block |
||
814 | 814 | function give_get_mexico_states_list() { |
815 | 815 | $states = array( |
816 | 816 | '' => '', |
817 | - 'Distrito Federal' => __( 'Distrito Federal', 'give' ), |
|
818 | - 'Jalisco' => __( 'Jalisco', 'give' ), |
|
819 | - 'Nuevo Leon' => __( 'Nuevo León', 'give' ), |
|
820 | - 'Aguascalientes' => __( 'Aguascalientes', 'give' ), |
|
821 | - 'Baja California' => __( 'Baja California', 'give' ), |
|
822 | - 'Baja California Sur' => __( 'Baja California Sur', 'give' ), |
|
823 | - 'Campeche' => __( 'Campeche', 'give' ), |
|
824 | - 'Chiapas' => __( 'Chiapas', 'give' ), |
|
825 | - 'Chihuahua' => __( 'Chihuahua', 'give' ), |
|
826 | - 'Coahuila' => __( 'Coahuila', 'give' ), |
|
827 | - 'Colima' => __( 'Colima', 'give' ), |
|
828 | - 'Durango' => __( 'Durango', 'give' ), |
|
829 | - 'Guanajuato' => __( 'Guanajuato', 'give' ), |
|
830 | - 'Guerrero' => __( 'Guerrero', 'give' ), |
|
831 | - 'Hidalgo' => __( 'Hidalgo', 'give' ), |
|
832 | - 'Estado de Mexico' => __( 'Edo. de México', 'give' ), |
|
833 | - 'Michoacan' => __( 'Michoacán', 'give' ), |
|
834 | - 'Morelos' => __( 'Morelos', 'give' ), |
|
835 | - 'Nayarit' => __( 'Nayarit', 'give' ), |
|
836 | - 'Oaxaca' => __( 'Oaxaca', 'give' ), |
|
837 | - 'Puebla' => __( 'Puebla', 'give' ), |
|
838 | - 'Queretaro' => __( 'Querétaro', 'give' ), |
|
839 | - 'Quintana Roo' => __( 'Quintana Roo', 'give' ), |
|
840 | - 'San Luis Potosi' => __( 'San Luis Potosí', 'give' ), |
|
841 | - 'Sinaloa' => __( 'Sinaloa', 'give' ), |
|
842 | - 'Sonora' => __( 'Sonora', 'give' ), |
|
843 | - 'Tabasco' => __( 'Tabasco', 'give' ), |
|
844 | - 'Tamaulipas' => __( 'Tamaulipas', 'give' ), |
|
845 | - 'Tlaxcala' => __( 'Tlaxcala', 'give' ), |
|
846 | - 'Veracruz' => __( 'Veracruz', 'give' ), |
|
847 | - 'Yucatan' => __( 'Yucatán', 'give' ), |
|
848 | - 'Zacatecas' => __( 'Zacatecas', 'give' ), |
|
817 | + 'Distrito Federal' => __('Distrito Federal', 'give'), |
|
818 | + 'Jalisco' => __('Jalisco', 'give'), |
|
819 | + 'Nuevo Leon' => __('Nuevo León', 'give'), |
|
820 | + 'Aguascalientes' => __('Aguascalientes', 'give'), |
|
821 | + 'Baja California' => __('Baja California', 'give'), |
|
822 | + 'Baja California Sur' => __('Baja California Sur', 'give'), |
|
823 | + 'Campeche' => __('Campeche', 'give'), |
|
824 | + 'Chiapas' => __('Chiapas', 'give'), |
|
825 | + 'Chihuahua' => __('Chihuahua', 'give'), |
|
826 | + 'Coahuila' => __('Coahuila', 'give'), |
|
827 | + 'Colima' => __('Colima', 'give'), |
|
828 | + 'Durango' => __('Durango', 'give'), |
|
829 | + 'Guanajuato' => __('Guanajuato', 'give'), |
|
830 | + 'Guerrero' => __('Guerrero', 'give'), |
|
831 | + 'Hidalgo' => __('Hidalgo', 'give'), |
|
832 | + 'Estado de Mexico' => __('Edo. de México', 'give'), |
|
833 | + 'Michoacan' => __('Michoacán', 'give'), |
|
834 | + 'Morelos' => __('Morelos', 'give'), |
|
835 | + 'Nayarit' => __('Nayarit', 'give'), |
|
836 | + 'Oaxaca' => __('Oaxaca', 'give'), |
|
837 | + 'Puebla' => __('Puebla', 'give'), |
|
838 | + 'Queretaro' => __('Querétaro', 'give'), |
|
839 | + 'Quintana Roo' => __('Quintana Roo', 'give'), |
|
840 | + 'San Luis Potosi' => __('San Luis Potosí', 'give'), |
|
841 | + 'Sinaloa' => __('Sinaloa', 'give'), |
|
842 | + 'Sonora' => __('Sonora', 'give'), |
|
843 | + 'Tabasco' => __('Tabasco', 'give'), |
|
844 | + 'Tamaulipas' => __('Tamaulipas', 'give'), |
|
845 | + 'Tlaxcala' => __('Tlaxcala', 'give'), |
|
846 | + 'Veracruz' => __('Veracruz', 'give'), |
|
847 | + 'Yucatan' => __('Yucatán', 'give'), |
|
848 | + 'Zacatecas' => __('Zacatecas', 'give'), |
|
849 | 849 | ); |
850 | - return apply_filters( 'give_mexico_states', $states ); |
|
850 | + return apply_filters('give_mexico_states', $states); |
|
851 | 851 | } |
852 | 852 | |
853 | 853 | /** |
@@ -859,55 +859,55 @@ discard block |
||
859 | 859 | function give_get_japan_states_list() { |
860 | 860 | $states = array( |
861 | 861 | '' => '', |
862 | - 'JP01' => __( 'Hokkaido', 'give' ), |
|
863 | - 'JP02' => __( 'Aomori', 'give' ), |
|
864 | - 'JP03' => __( 'Iwate', 'give' ), |
|
865 | - 'JP04' => __( 'Miyagi', 'give' ), |
|
866 | - 'JP05' => __( 'Akita', 'give' ), |
|
867 | - 'JP06' => __( 'Yamagata', 'give' ), |
|
868 | - 'JP07' => __( 'Fukushima', 'give' ), |
|
869 | - 'JP08' => __( 'Ibaraki', 'give' ), |
|
870 | - 'JP09' => __( 'Tochigi', 'give' ), |
|
871 | - 'JP10' => __( 'Gunma', 'give' ), |
|
872 | - 'JP11' => __( 'Saitama', 'give' ), |
|
873 | - 'JP12' => __( 'Chiba', 'give' ), |
|
874 | - 'JP13' => __( 'Tokyo', 'give' ), |
|
875 | - 'JP14' => __( 'Kanagawa', 'give' ), |
|
876 | - 'JP15' => __( 'Niigata', 'give' ), |
|
877 | - 'JP16' => __( 'Toyama', 'give' ), |
|
878 | - 'JP17' => __( 'Ishikawa', 'give' ), |
|
879 | - 'JP18' => __( 'Fukui', 'give' ), |
|
880 | - 'JP19' => __( 'Yamanashi', 'give' ), |
|
881 | - 'JP20' => __( 'Nagano', 'give' ), |
|
882 | - 'JP21' => __( 'Gifu', 'give' ), |
|
883 | - 'JP22' => __( 'Shizuoka', 'give' ), |
|
884 | - 'JP23' => __( 'Aichi', 'give' ), |
|
885 | - 'JP24' => __( 'Mie', 'give' ), |
|
886 | - 'JP25' => __( 'Shiga', 'give' ), |
|
887 | - 'JP26' => __( 'Kyoto', 'give' ), |
|
888 | - 'JP27' => __( 'Osaka', 'give' ), |
|
889 | - 'JP28' => __( 'Hyogo', 'give' ), |
|
890 | - 'JP29' => __( 'Nara', 'give' ), |
|
891 | - 'JP30' => __( 'Wakayama', 'give' ), |
|
892 | - 'JP31' => __( 'Tottori', 'give' ), |
|
893 | - 'JP32' => __( 'Shimane', 'give' ), |
|
894 | - 'JP33' => __( 'Okayama', 'give' ), |
|
895 | - 'JP34' => __( 'Hiroshima', 'give' ), |
|
896 | - 'JP35' => __( 'Yamaguchi', 'give' ), |
|
897 | - 'JP36' => __( 'Tokushima', 'give' ), |
|
898 | - 'JP37' => __( 'Kagawa', 'give' ), |
|
899 | - 'JP38' => __( 'Ehime', 'give' ), |
|
900 | - 'JP39' => __( 'Kochi', 'give' ), |
|
901 | - 'JP40' => __( 'Fukuoka', 'give' ), |
|
902 | - 'JP41' => __( 'Saga', 'give' ), |
|
903 | - 'JP42' => __( 'Nagasaki', 'give' ), |
|
904 | - 'JP43' => __( 'Kumamoto', 'give' ), |
|
905 | - 'JP44' => __( 'Oita', 'give' ), |
|
906 | - 'JP45' => __( 'Miyazaki', 'give' ), |
|
907 | - 'JP46' => __( 'Kagoshima', 'give' ), |
|
908 | - 'JP47' => __( 'Okinawa', 'give' ), |
|
862 | + 'JP01' => __('Hokkaido', 'give'), |
|
863 | + 'JP02' => __('Aomori', 'give'), |
|
864 | + 'JP03' => __('Iwate', 'give'), |
|
865 | + 'JP04' => __('Miyagi', 'give'), |
|
866 | + 'JP05' => __('Akita', 'give'), |
|
867 | + 'JP06' => __('Yamagata', 'give'), |
|
868 | + 'JP07' => __('Fukushima', 'give'), |
|
869 | + 'JP08' => __('Ibaraki', 'give'), |
|
870 | + 'JP09' => __('Tochigi', 'give'), |
|
871 | + 'JP10' => __('Gunma', 'give'), |
|
872 | + 'JP11' => __('Saitama', 'give'), |
|
873 | + 'JP12' => __('Chiba', 'give'), |
|
874 | + 'JP13' => __('Tokyo', 'give'), |
|
875 | + 'JP14' => __('Kanagawa', 'give'), |
|
876 | + 'JP15' => __('Niigata', 'give'), |
|
877 | + 'JP16' => __('Toyama', 'give'), |
|
878 | + 'JP17' => __('Ishikawa', 'give'), |
|
879 | + 'JP18' => __('Fukui', 'give'), |
|
880 | + 'JP19' => __('Yamanashi', 'give'), |
|
881 | + 'JP20' => __('Nagano', 'give'), |
|
882 | + 'JP21' => __('Gifu', 'give'), |
|
883 | + 'JP22' => __('Shizuoka', 'give'), |
|
884 | + 'JP23' => __('Aichi', 'give'), |
|
885 | + 'JP24' => __('Mie', 'give'), |
|
886 | + 'JP25' => __('Shiga', 'give'), |
|
887 | + 'JP26' => __('Kyoto', 'give'), |
|
888 | + 'JP27' => __('Osaka', 'give'), |
|
889 | + 'JP28' => __('Hyogo', 'give'), |
|
890 | + 'JP29' => __('Nara', 'give'), |
|
891 | + 'JP30' => __('Wakayama', 'give'), |
|
892 | + 'JP31' => __('Tottori', 'give'), |
|
893 | + 'JP32' => __('Shimane', 'give'), |
|
894 | + 'JP33' => __('Okayama', 'give'), |
|
895 | + 'JP34' => __('Hiroshima', 'give'), |
|
896 | + 'JP35' => __('Yamaguchi', 'give'), |
|
897 | + 'JP36' => __('Tokushima', 'give'), |
|
898 | + 'JP37' => __('Kagawa', 'give'), |
|
899 | + 'JP38' => __('Ehime', 'give'), |
|
900 | + 'JP39' => __('Kochi', 'give'), |
|
901 | + 'JP40' => __('Fukuoka', 'give'), |
|
902 | + 'JP41' => __('Saga', 'give'), |
|
903 | + 'JP42' => __('Nagasaki', 'give'), |
|
904 | + 'JP43' => __('Kumamoto', 'give'), |
|
905 | + 'JP44' => __('Oita', 'give'), |
|
906 | + 'JP45' => __('Miyazaki', 'give'), |
|
907 | + 'JP46' => __('Kagoshima', 'give'), |
|
908 | + 'JP47' => __('Okinawa', 'give'), |
|
909 | 909 | ); |
910 | - return apply_filters( 'give_japan_states', $states ); |
|
910 | + return apply_filters('give_japan_states', $states); |
|
911 | 911 | } |
912 | 912 | |
913 | 913 | /** |
@@ -919,118 +919,118 @@ discard block |
||
919 | 919 | function give_get_italy_states_list() { |
920 | 920 | $states = array( |
921 | 921 | '' => '', |
922 | - 'AG' => __( 'Agrigento', 'give' ), |
|
923 | - 'AL' => __( 'Alessandria', 'give' ), |
|
924 | - 'AN' => __( 'Ancona', 'give' ), |
|
925 | - 'AO' => __( 'Aosta', 'give' ), |
|
926 | - 'AR' => __( 'Arezzo', 'give' ), |
|
927 | - 'AP' => __( 'Ascoli Piceno', 'give' ), |
|
928 | - 'AT' => __( 'Asti', 'give' ), |
|
929 | - 'AV' => __( 'Avellino', 'give' ), |
|
930 | - 'BA' => __( 'Bari', 'give' ), |
|
931 | - 'BT' => __( 'Barletta-Andria-Trani', 'give' ), |
|
932 | - 'BL' => __( 'Belluno', 'give' ), |
|
933 | - 'BN' => __( 'Benevento', 'give' ), |
|
934 | - 'BG' => __( 'Bergamo', 'give' ), |
|
935 | - 'BI' => __( 'Biella', 'give' ), |
|
936 | - 'BO' => __( 'Bologna', 'give' ), |
|
937 | - 'BZ' => __( 'Bolzano', 'give' ), |
|
938 | - 'BS' => __( 'Brescia', 'give' ), |
|
939 | - 'BR' => __( 'Brindisi', 'give' ), |
|
940 | - 'CA' => __( 'Cagliari', 'give' ), |
|
941 | - 'CL' => __( 'Caltanissetta', 'give' ), |
|
942 | - 'CB' => __( 'Campobasso', 'give' ), |
|
943 | - 'CI' => __( 'Carbonia-Iglesias', 'give' ), |
|
944 | - 'CE' => __( 'Caserta', 'give' ), |
|
945 | - 'CT' => __( 'Catania', 'give' ), |
|
946 | - 'CZ' => __( 'Catanzaro', 'give' ), |
|
947 | - 'CH' => __( 'Chieti', 'give' ), |
|
948 | - 'CO' => __( 'Como', 'give' ), |
|
949 | - 'CS' => __( 'Cosenza', 'give' ), |
|
950 | - 'CR' => __( 'Cremona', 'give' ), |
|
951 | - 'KR' => __( 'Crotone', 'give' ), |
|
952 | - 'CN' => __( 'Cuneo', 'give' ), |
|
953 | - 'EN' => __( 'Enna', 'give' ), |
|
954 | - 'FM' => __( 'Fermo', 'give' ), |
|
955 | - 'FE' => __( 'Ferrara', 'give' ), |
|
956 | - 'FI' => __( 'Firenze', 'give' ), |
|
957 | - 'FG' => __( 'Foggia', 'give' ), |
|
958 | - 'FC' => __( 'Forlì-Cesena', 'give' ), |
|
959 | - 'FR' => __( 'Frosinone', 'give' ), |
|
960 | - 'GE' => __( 'Genova', 'give' ), |
|
961 | - 'GO' => __( 'Gorizia', 'give' ), |
|
962 | - 'GR' => __( 'Grosseto', 'give' ), |
|
963 | - 'IM' => __( 'Imperia', 'give' ), |
|
964 | - 'IS' => __( 'Isernia', 'give' ), |
|
965 | - 'SP' => __( 'La Spezia', 'give' ), |
|
966 | - 'AQ' => __( "L'Aquila", 'give' ), |
|
967 | - 'LT' => __( 'Latina', 'give' ), |
|
968 | - 'LE' => __( 'Lecce', 'give' ), |
|
969 | - 'LC' => __( 'Lecco', 'give' ), |
|
970 | - 'LI' => __( 'Livorno', 'give' ), |
|
971 | - 'LO' => __( 'Lodi', 'give' ), |
|
972 | - 'LU' => __( 'Lucca', 'give' ), |
|
973 | - 'MC' => __( 'Macerata', 'give' ), |
|
974 | - 'MN' => __( 'Mantova', 'give' ), |
|
975 | - 'MS' => __( 'Massa-Carrara', 'give' ), |
|
976 | - 'MT' => __( 'Matera', 'give' ), |
|
977 | - 'ME' => __( 'Messina', 'give' ), |
|
978 | - 'MI' => __( 'Milano', 'give' ), |
|
979 | - 'MO' => __( 'Modena', 'give' ), |
|
980 | - 'MB' => __( 'Monza e della Brianza', 'give' ), |
|
981 | - 'NA' => __( 'Napoli', 'give' ), |
|
982 | - 'NO' => __( 'Novara', 'give' ), |
|
983 | - 'NU' => __( 'Nuoro', 'give' ), |
|
984 | - 'OT' => __( 'Olbia-Tempio', 'give' ), |
|
985 | - 'OR' => __( 'Oristano', 'give' ), |
|
986 | - 'PD' => __( 'Padova', 'give' ), |
|
987 | - 'PA' => __( 'Palermo', 'give' ), |
|
988 | - 'PR' => __( 'Parma', 'give' ), |
|
989 | - 'PV' => __( 'Pavia', 'give' ), |
|
990 | - 'PG' => __( 'Perugia', 'give' ), |
|
991 | - 'PU' => __( 'Pesaro e Urbino', 'give' ), |
|
992 | - 'PE' => __( 'Pescara', 'give' ), |
|
993 | - 'PC' => __( 'Piacenza', 'give' ), |
|
994 | - 'PI' => __( 'Pisa', 'give' ), |
|
995 | - 'PT' => __( 'Pistoia', 'give' ), |
|
996 | - 'PN' => __( 'Pordenone', 'give' ), |
|
997 | - 'PZ' => __( 'Potenza', 'give' ), |
|
998 | - 'PO' => __( 'Prato', 'give' ), |
|
999 | - 'RG' => __( 'Ragusa', 'give' ), |
|
1000 | - 'RA' => __( 'Ravenna', 'give' ), |
|
1001 | - 'RC' => __( 'Reggio Calabria', 'give' ), |
|
1002 | - 'RE' => __( 'Reggio Emilia', 'give' ), |
|
1003 | - 'RI' => __( 'Rieti', 'give' ), |
|
1004 | - 'RN' => __( 'Rimini', 'give' ), |
|
1005 | - 'RM' => __( 'Roma', 'give' ), |
|
1006 | - 'RO' => __( 'Rovigo', 'give' ), |
|
1007 | - 'SA' => __( 'Salerno', 'give' ), |
|
1008 | - 'VS' => __( 'Medio Campidano', 'give' ), |
|
1009 | - 'SS' => __( 'Sassari', 'give' ), |
|
1010 | - 'SV' => __( 'Savona', 'give' ), |
|
1011 | - 'SI' => __( 'Siena', 'give' ), |
|
1012 | - 'SR' => __( 'Siracusa', 'give' ), |
|
1013 | - 'SO' => __( 'Sondrio', 'give' ), |
|
1014 | - 'TA' => __( 'Taranto', 'give' ), |
|
1015 | - 'TE' => __( 'Teramo', 'give' ), |
|
1016 | - 'TR' => __( 'Terni', 'give' ), |
|
1017 | - 'TO' => __( 'Torino', 'give' ), |
|
1018 | - 'OG' => __( 'Ogliastra', 'give' ), |
|
1019 | - 'TP' => __( 'Trapani', 'give' ), |
|
1020 | - 'TN' => __( 'Trento', 'give' ), |
|
1021 | - 'TV' => __( 'Treviso', 'give' ), |
|
1022 | - 'TS' => __( 'Trieste', 'give' ), |
|
1023 | - 'UD' => __( 'Udine', 'give' ), |
|
1024 | - 'VA' => __( 'Varese', 'give' ), |
|
1025 | - 'VE' => __( 'Venezia', 'give' ), |
|
1026 | - 'VB' => __( 'Verbano-Cusio-Ossola', 'give' ), |
|
1027 | - 'VC' => __( 'Vercelli', 'give' ), |
|
1028 | - 'VR' => __( 'Verona', 'give' ), |
|
1029 | - 'VV' => __( 'Vibo Valentia', 'give' ), |
|
1030 | - 'VI' => __( 'Vicenza', 'give' ), |
|
1031 | - 'VT' => __( 'Viterbo', 'give' ), |
|
922 | + 'AG' => __('Agrigento', 'give'), |
|
923 | + 'AL' => __('Alessandria', 'give'), |
|
924 | + 'AN' => __('Ancona', 'give'), |
|
925 | + 'AO' => __('Aosta', 'give'), |
|
926 | + 'AR' => __('Arezzo', 'give'), |
|
927 | + 'AP' => __('Ascoli Piceno', 'give'), |
|
928 | + 'AT' => __('Asti', 'give'), |
|
929 | + 'AV' => __('Avellino', 'give'), |
|
930 | + 'BA' => __('Bari', 'give'), |
|
931 | + 'BT' => __('Barletta-Andria-Trani', 'give'), |
|
932 | + 'BL' => __('Belluno', 'give'), |
|
933 | + 'BN' => __('Benevento', 'give'), |
|
934 | + 'BG' => __('Bergamo', 'give'), |
|
935 | + 'BI' => __('Biella', 'give'), |
|
936 | + 'BO' => __('Bologna', 'give'), |
|
937 | + 'BZ' => __('Bolzano', 'give'), |
|
938 | + 'BS' => __('Brescia', 'give'), |
|
939 | + 'BR' => __('Brindisi', 'give'), |
|
940 | + 'CA' => __('Cagliari', 'give'), |
|
941 | + 'CL' => __('Caltanissetta', 'give'), |
|
942 | + 'CB' => __('Campobasso', 'give'), |
|
943 | + 'CI' => __('Carbonia-Iglesias', 'give'), |
|
944 | + 'CE' => __('Caserta', 'give'), |
|
945 | + 'CT' => __('Catania', 'give'), |
|
946 | + 'CZ' => __('Catanzaro', 'give'), |
|
947 | + 'CH' => __('Chieti', 'give'), |
|
948 | + 'CO' => __('Como', 'give'), |
|
949 | + 'CS' => __('Cosenza', 'give'), |
|
950 | + 'CR' => __('Cremona', 'give'), |
|
951 | + 'KR' => __('Crotone', 'give'), |
|
952 | + 'CN' => __('Cuneo', 'give'), |
|
953 | + 'EN' => __('Enna', 'give'), |
|
954 | + 'FM' => __('Fermo', 'give'), |
|
955 | + 'FE' => __('Ferrara', 'give'), |
|
956 | + 'FI' => __('Firenze', 'give'), |
|
957 | + 'FG' => __('Foggia', 'give'), |
|
958 | + 'FC' => __('Forlì-Cesena', 'give'), |
|
959 | + 'FR' => __('Frosinone', 'give'), |
|
960 | + 'GE' => __('Genova', 'give'), |
|
961 | + 'GO' => __('Gorizia', 'give'), |
|
962 | + 'GR' => __('Grosseto', 'give'), |
|
963 | + 'IM' => __('Imperia', 'give'), |
|
964 | + 'IS' => __('Isernia', 'give'), |
|
965 | + 'SP' => __('La Spezia', 'give'), |
|
966 | + 'AQ' => __("L'Aquila", 'give'), |
|
967 | + 'LT' => __('Latina', 'give'), |
|
968 | + 'LE' => __('Lecce', 'give'), |
|
969 | + 'LC' => __('Lecco', 'give'), |
|
970 | + 'LI' => __('Livorno', 'give'), |
|
971 | + 'LO' => __('Lodi', 'give'), |
|
972 | + 'LU' => __('Lucca', 'give'), |
|
973 | + 'MC' => __('Macerata', 'give'), |
|
974 | + 'MN' => __('Mantova', 'give'), |
|
975 | + 'MS' => __('Massa-Carrara', 'give'), |
|
976 | + 'MT' => __('Matera', 'give'), |
|
977 | + 'ME' => __('Messina', 'give'), |
|
978 | + 'MI' => __('Milano', 'give'), |
|
979 | + 'MO' => __('Modena', 'give'), |
|
980 | + 'MB' => __('Monza e della Brianza', 'give'), |
|
981 | + 'NA' => __('Napoli', 'give'), |
|
982 | + 'NO' => __('Novara', 'give'), |
|
983 | + 'NU' => __('Nuoro', 'give'), |
|
984 | + 'OT' => __('Olbia-Tempio', 'give'), |
|
985 | + 'OR' => __('Oristano', 'give'), |
|
986 | + 'PD' => __('Padova', 'give'), |
|
987 | + 'PA' => __('Palermo', 'give'), |
|
988 | + 'PR' => __('Parma', 'give'), |
|
989 | + 'PV' => __('Pavia', 'give'), |
|
990 | + 'PG' => __('Perugia', 'give'), |
|
991 | + 'PU' => __('Pesaro e Urbino', 'give'), |
|
992 | + 'PE' => __('Pescara', 'give'), |
|
993 | + 'PC' => __('Piacenza', 'give'), |
|
994 | + 'PI' => __('Pisa', 'give'), |
|
995 | + 'PT' => __('Pistoia', 'give'), |
|
996 | + 'PN' => __('Pordenone', 'give'), |
|
997 | + 'PZ' => __('Potenza', 'give'), |
|
998 | + 'PO' => __('Prato', 'give'), |
|
999 | + 'RG' => __('Ragusa', 'give'), |
|
1000 | + 'RA' => __('Ravenna', 'give'), |
|
1001 | + 'RC' => __('Reggio Calabria', 'give'), |
|
1002 | + 'RE' => __('Reggio Emilia', 'give'), |
|
1003 | + 'RI' => __('Rieti', 'give'), |
|
1004 | + 'RN' => __('Rimini', 'give'), |
|
1005 | + 'RM' => __('Roma', 'give'), |
|
1006 | + 'RO' => __('Rovigo', 'give'), |
|
1007 | + 'SA' => __('Salerno', 'give'), |
|
1008 | + 'VS' => __('Medio Campidano', 'give'), |
|
1009 | + 'SS' => __('Sassari', 'give'), |
|
1010 | + 'SV' => __('Savona', 'give'), |
|
1011 | + 'SI' => __('Siena', 'give'), |
|
1012 | + 'SR' => __('Siracusa', 'give'), |
|
1013 | + 'SO' => __('Sondrio', 'give'), |
|
1014 | + 'TA' => __('Taranto', 'give'), |
|
1015 | + 'TE' => __('Teramo', 'give'), |
|
1016 | + 'TR' => __('Terni', 'give'), |
|
1017 | + 'TO' => __('Torino', 'give'), |
|
1018 | + 'OG' => __('Ogliastra', 'give'), |
|
1019 | + 'TP' => __('Trapani', 'give'), |
|
1020 | + 'TN' => __('Trento', 'give'), |
|
1021 | + 'TV' => __('Treviso', 'give'), |
|
1022 | + 'TS' => __('Trieste', 'give'), |
|
1023 | + 'UD' => __('Udine', 'give'), |
|
1024 | + 'VA' => __('Varese', 'give'), |
|
1025 | + 'VE' => __('Venezia', 'give'), |
|
1026 | + 'VB' => __('Verbano-Cusio-Ossola', 'give'), |
|
1027 | + 'VC' => __('Vercelli', 'give'), |
|
1028 | + 'VR' => __('Verona', 'give'), |
|
1029 | + 'VV' => __('Vibo Valentia', 'give'), |
|
1030 | + 'VI' => __('Vicenza', 'give'), |
|
1031 | + 'VT' => __('Viterbo', 'give'), |
|
1032 | 1032 | ); |
1033 | - return apply_filters( 'give_italy_states', $states ); |
|
1033 | + return apply_filters('give_italy_states', $states); |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | /** |
@@ -1042,39 +1042,39 @@ discard block |
||
1042 | 1042 | function give_get_iran_states_list() { |
1043 | 1043 | $states = array( |
1044 | 1044 | '' => '', |
1045 | - 'KHZ' => __( 'Khuzestan (خوزستان)', 'give' ), |
|
1046 | - 'THR' => __( 'Tehran (تهران)', 'give' ), |
|
1047 | - 'ILM' => __( 'Ilaam (ایلام)', 'give' ), |
|
1048 | - 'BHR' => __( 'Bushehr (بوشهر)', 'give' ), |
|
1049 | - 'ADL' => __( 'Ardabil (اردبیل)', 'give' ), |
|
1050 | - 'ESF' => __( 'Isfahan (اصفهان)', 'give' ), |
|
1051 | - 'YZD' => __( 'Yazd (یزد)', 'give' ), |
|
1052 | - 'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ), |
|
1053 | - 'KRN' => __( 'Kerman (کرمان)', 'give' ), |
|
1054 | - 'HDN' => __( 'Hamadan (همدان)', 'give' ), |
|
1055 | - 'GZN' => __( 'Ghazvin (قزوین)', 'give' ), |
|
1056 | - 'ZJN' => __( 'Zanjan (زنجان)', 'give' ), |
|
1057 | - 'LRS' => __( 'Luristan (لرستان)', 'give' ), |
|
1058 | - 'ABZ' => __( 'Alborz (البرز)', 'give' ), |
|
1059 | - 'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ), |
|
1060 | - 'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ), |
|
1061 | - 'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ), |
|
1062 | - 'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ), |
|
1063 | - 'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ), |
|
1064 | - 'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ), |
|
1065 | - 'SMN' => __( 'Semnan (سمنان)', 'give' ), |
|
1066 | - 'FRS' => __( 'Fars (فارس)', 'give' ), |
|
1067 | - 'QHM' => __( 'Qom (قم)', 'give' ), |
|
1068 | - 'KRD' => __( 'Kurdistan / کردستان)', 'give' ), |
|
1069 | - 'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ), |
|
1070 | - 'GLS' => __( 'Golestan (گلستان)', 'give' ), |
|
1071 | - 'GIL' => __( 'Gilan (گیلان)', 'give' ), |
|
1072 | - 'MZN' => __( 'Mazandaran (مازندران)', 'give' ), |
|
1073 | - 'MKZ' => __( 'Markazi (مرکزی)', 'give' ), |
|
1074 | - 'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ), |
|
1075 | - 'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ), |
|
1045 | + 'KHZ' => __('Khuzestan (خوزستان)', 'give'), |
|
1046 | + 'THR' => __('Tehran (تهران)', 'give'), |
|
1047 | + 'ILM' => __('Ilaam (ایلام)', 'give'), |
|
1048 | + 'BHR' => __('Bushehr (بوشهر)', 'give'), |
|
1049 | + 'ADL' => __('Ardabil (اردبیل)', 'give'), |
|
1050 | + 'ESF' => __('Isfahan (اصفهان)', 'give'), |
|
1051 | + 'YZD' => __('Yazd (یزد)', 'give'), |
|
1052 | + 'KRH' => __('Kermanshah (کرمانشاه)', 'give'), |
|
1053 | + 'KRN' => __('Kerman (کرمان)', 'give'), |
|
1054 | + 'HDN' => __('Hamadan (همدان)', 'give'), |
|
1055 | + 'GZN' => __('Ghazvin (قزوین)', 'give'), |
|
1056 | + 'ZJN' => __('Zanjan (زنجان)', 'give'), |
|
1057 | + 'LRS' => __('Luristan (لرستان)', 'give'), |
|
1058 | + 'ABZ' => __('Alborz (البرز)', 'give'), |
|
1059 | + 'EAZ' => __('East Azarbaijan (آذربایجان شرقی)', 'give'), |
|
1060 | + 'WAZ' => __('West Azarbaijan (آذربایجان غربی)', 'give'), |
|
1061 | + 'CHB' => __('Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give'), |
|
1062 | + 'SKH' => __('South Khorasan (خراسان جنوبی)', 'give'), |
|
1063 | + 'RKH' => __('Razavi Khorasan (خراسان رضوی)', 'give'), |
|
1064 | + 'NKH' => __('North Khorasan (خراسان جنوبی)', 'give'), |
|
1065 | + 'SMN' => __('Semnan (سمنان)', 'give'), |
|
1066 | + 'FRS' => __('Fars (فارس)', 'give'), |
|
1067 | + 'QHM' => __('Qom (قم)', 'give'), |
|
1068 | + 'KRD' => __('Kurdistan / کردستان)', 'give'), |
|
1069 | + 'KBD' => __('Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give'), |
|
1070 | + 'GLS' => __('Golestan (گلستان)', 'give'), |
|
1071 | + 'GIL' => __('Gilan (گیلان)', 'give'), |
|
1072 | + 'MZN' => __('Mazandaran (مازندران)', 'give'), |
|
1073 | + 'MKZ' => __('Markazi (مرکزی)', 'give'), |
|
1074 | + 'HRZ' => __('Hormozgan (هرمزگان)', 'give'), |
|
1075 | + 'SBN' => __('Sistan and Baluchestan (سیستان و بلوچستان)', 'give'), |
|
1076 | 1076 | ); |
1077 | - return apply_filters( 'give_iran_states', $states ); |
|
1077 | + return apply_filters('give_iran_states', $states); |
|
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | /** |
@@ -1086,34 +1086,34 @@ discard block |
||
1086 | 1086 | function give_get_ireland_states_list() { |
1087 | 1087 | $states = array( |
1088 | 1088 | '' => '', |
1089 | - 'CE' => __( 'Clare', 'give' ), |
|
1090 | - 'CK' => __( 'Cork', 'give' ), |
|
1091 | - 'CN' => __( 'Cavan', 'give' ), |
|
1092 | - 'CW' => __( 'Carlow', 'give' ), |
|
1093 | - 'DL' => __( 'Donegal', 'give' ), |
|
1094 | - 'DN' => __( 'Dublin', 'give' ), |
|
1095 | - 'GY' => __( 'Galway', 'give' ), |
|
1096 | - 'KE' => __( 'Kildare', 'give' ), |
|
1097 | - 'KK' => __( 'Kilkenny', 'give' ), |
|
1098 | - 'KY' => __( 'Kerry', 'give' ), |
|
1099 | - 'LD' => __( 'Longford', 'give' ), |
|
1100 | - 'LH' => __( 'Louth', 'give' ), |
|
1101 | - 'LK' => __( 'Limerick', 'give' ), |
|
1102 | - 'LM' => __( 'Leitrim', 'give' ), |
|
1103 | - 'LS' => __( 'Laois', 'give' ), |
|
1104 | - 'MH' => __( 'Meath', 'give' ), |
|
1105 | - 'MN' => __( 'Monaghan', 'give' ), |
|
1106 | - 'MO' => __( 'Mayo', 'give' ), |
|
1107 | - 'OY' => __( 'Offaly', 'give' ), |
|
1108 | - 'RN' => __( 'Roscommon', 'give' ), |
|
1109 | - 'SO' => __( 'Sligo', 'give' ), |
|
1110 | - 'TY' => __( 'Tipperary', 'give' ), |
|
1111 | - 'WD' => __( 'Waterford', 'give' ), |
|
1112 | - 'WH' => __( 'Westmeath', 'give' ), |
|
1113 | - 'WW' => __( 'Wicklow', 'give' ), |
|
1114 | - 'WX' => __( 'Wexford', 'give' ), |
|
1089 | + 'CE' => __('Clare', 'give'), |
|
1090 | + 'CK' => __('Cork', 'give'), |
|
1091 | + 'CN' => __('Cavan', 'give'), |
|
1092 | + 'CW' => __('Carlow', 'give'), |
|
1093 | + 'DL' => __('Donegal', 'give'), |
|
1094 | + 'DN' => __('Dublin', 'give'), |
|
1095 | + 'GY' => __('Galway', 'give'), |
|
1096 | + 'KE' => __('Kildare', 'give'), |
|
1097 | + 'KK' => __('Kilkenny', 'give'), |
|
1098 | + 'KY' => __('Kerry', 'give'), |
|
1099 | + 'LD' => __('Longford', 'give'), |
|
1100 | + 'LH' => __('Louth', 'give'), |
|
1101 | + 'LK' => __('Limerick', 'give'), |
|
1102 | + 'LM' => __('Leitrim', 'give'), |
|
1103 | + 'LS' => __('Laois', 'give'), |
|
1104 | + 'MH' => __('Meath', 'give'), |
|
1105 | + 'MN' => __('Monaghan', 'give'), |
|
1106 | + 'MO' => __('Mayo', 'give'), |
|
1107 | + 'OY' => __('Offaly', 'give'), |
|
1108 | + 'RN' => __('Roscommon', 'give'), |
|
1109 | + 'SO' => __('Sligo', 'give'), |
|
1110 | + 'TY' => __('Tipperary', 'give'), |
|
1111 | + 'WD' => __('Waterford', 'give'), |
|
1112 | + 'WH' => __('Westmeath', 'give'), |
|
1113 | + 'WW' => __('Wicklow', 'give'), |
|
1114 | + 'WX' => __('Wexford', 'give'), |
|
1115 | 1115 | ); |
1116 | - return apply_filters( 'give_ireland_states', $states ); |
|
1116 | + return apply_filters('give_ireland_states', $states); |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | 1119 | /** |
@@ -1125,21 +1125,21 @@ discard block |
||
1125 | 1125 | function give_get_greek_states_list() { |
1126 | 1126 | $states = array( |
1127 | 1127 | '' => '', |
1128 | - 'I' => __( 'Αττική', 'give' ), |
|
1129 | - 'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ), |
|
1130 | - 'B' => __( 'Κεντρική Μακεδονία', 'give' ), |
|
1131 | - 'C' => __( 'Δυτική Μακεδονία', 'give' ), |
|
1132 | - 'D' => __( 'Ήπειρος', 'give' ), |
|
1133 | - 'E' => __( 'Θεσσαλία', 'give' ), |
|
1134 | - 'F' => __( 'Ιόνιοι Νήσοι', 'give' ), |
|
1135 | - 'G' => __( 'Δυτική Ελλάδα', 'give' ), |
|
1136 | - 'H' => __( 'Στερεά Ελλάδα', 'give' ), |
|
1137 | - 'J' => __( 'Πελοπόννησος', 'give' ), |
|
1138 | - 'K' => __( 'Βόρειο Αιγαίο', 'give' ), |
|
1139 | - 'L' => __( 'Νότιο Αιγαίο', 'give' ), |
|
1140 | - 'M' => __( 'Κρήτη', 'give' ), |
|
1128 | + 'I' => __('Αττική', 'give'), |
|
1129 | + 'A' => __('Ανατολική Μακεδονία και Θράκη', 'give'), |
|
1130 | + 'B' => __('Κεντρική Μακεδονία', 'give'), |
|
1131 | + 'C' => __('Δυτική Μακεδονία', 'give'), |
|
1132 | + 'D' => __('Ήπειρος', 'give'), |
|
1133 | + 'E' => __('Θεσσαλία', 'give'), |
|
1134 | + 'F' => __('Ιόνιοι Νήσοι', 'give'), |
|
1135 | + 'G' => __('Δυτική Ελλάδα', 'give'), |
|
1136 | + 'H' => __('Στερεά Ελλάδα', 'give'), |
|
1137 | + 'J' => __('Πελοπόννησος', 'give'), |
|
1138 | + 'K' => __('Βόρειο Αιγαίο', 'give'), |
|
1139 | + 'L' => __('Νότιο Αιγαίο', 'give'), |
|
1140 | + 'M' => __('Κρήτη', 'give'), |
|
1141 | 1141 | ); |
1142 | - return apply_filters( 'give_greek_states', $states ); |
|
1142 | + return apply_filters('give_greek_states', $states); |
|
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | /** |
@@ -1151,17 +1151,17 @@ discard block |
||
1151 | 1151 | function give_get_bolivian_states_list() { |
1152 | 1152 | $states = array( |
1153 | 1153 | '' => '', |
1154 | - 'B' => __( 'Chuquisaca', 'give' ), |
|
1155 | - 'H' => __( 'Beni', 'give' ), |
|
1156 | - 'C' => __( 'Cochabamba', 'give' ), |
|
1157 | - 'L' => __( 'La Paz', 'give' ), |
|
1158 | - 'O' => __( 'Oruro', 'give' ), |
|
1159 | - 'N' => __( 'Pando', 'give' ), |
|
1160 | - 'P' => __( 'Potosí', 'give' ), |
|
1161 | - 'S' => __( 'Santa Cruz', 'give' ), |
|
1162 | - 'T' => __( 'Tarija', 'give' ), |
|
1154 | + 'B' => __('Chuquisaca', 'give'), |
|
1155 | + 'H' => __('Beni', 'give'), |
|
1156 | + 'C' => __('Cochabamba', 'give'), |
|
1157 | + 'L' => __('La Paz', 'give'), |
|
1158 | + 'O' => __('Oruro', 'give'), |
|
1159 | + 'N' => __('Pando', 'give'), |
|
1160 | + 'P' => __('Potosí', 'give'), |
|
1161 | + 'S' => __('Santa Cruz', 'give'), |
|
1162 | + 'T' => __('Tarija', 'give'), |
|
1163 | 1163 | ); |
1164 | - return apply_filters( 'give_bolivian_states', $states ); |
|
1164 | + return apply_filters('give_bolivian_states', $states); |
|
1165 | 1165 | } |
1166 | 1166 | |
1167 | 1167 | /** |
@@ -1173,36 +1173,36 @@ discard block |
||
1173 | 1173 | function give_get_bulgarian_states_list() { |
1174 | 1174 | $states = array( |
1175 | 1175 | '' => '', |
1176 | - 'BG-01' => __( 'Blagoevgrad', 'give' ), |
|
1177 | - 'BG-02' => __( 'Burgas', 'give' ), |
|
1178 | - 'BG-08' => __( 'Dobrich', 'give' ), |
|
1179 | - 'BG-07' => __( 'Gabrovo', 'give' ), |
|
1180 | - 'BG-26' => __( 'Haskovo', 'give' ), |
|
1181 | - 'BG-09' => __( 'Kardzhali', 'give' ), |
|
1182 | - 'BG-10' => __( 'Kyustendil', 'give' ), |
|
1183 | - 'BG-11' => __( 'Lovech', 'give' ), |
|
1184 | - 'BG-12' => __( 'Montana', 'give' ), |
|
1185 | - 'BG-13' => __( 'Pazardzhik', 'give' ), |
|
1186 | - 'BG-14' => __( 'Pernik', 'give' ), |
|
1187 | - 'BG-15' => __( 'Pleven', 'give' ), |
|
1188 | - 'BG-16' => __( 'Plovdiv', 'give' ), |
|
1189 | - 'BG-17' => __( 'Razgrad', 'give' ), |
|
1190 | - 'BG-18' => __( 'Ruse', 'give' ), |
|
1191 | - 'BG-27' => __( 'Shumen', 'give' ), |
|
1192 | - 'BG-19' => __( 'Silistra', 'give' ), |
|
1193 | - 'BG-20' => __( 'Sliven', 'give' ), |
|
1194 | - 'BG-21' => __( 'Smolyan', 'give' ), |
|
1195 | - 'BG-23' => __( 'Sofia', 'give' ), |
|
1196 | - 'BG-22' => __( 'Sofia-Grad', 'give' ), |
|
1197 | - 'BG-24' => __( 'Stara Zagora', 'give' ), |
|
1198 | - 'BG-25' => __( 'Targovishte', 'give' ), |
|
1199 | - 'BG-03' => __( 'Varna', 'give' ), |
|
1200 | - 'BG-04' => __( 'Veliko Tarnovo', 'give' ), |
|
1201 | - 'BG-05' => __( 'Vidin', 'give' ), |
|
1202 | - 'BG-06' => __( 'Vratsa', 'give' ), |
|
1203 | - 'BG-28' => __( 'Yambol', 'give' ), |
|
1176 | + 'BG-01' => __('Blagoevgrad', 'give'), |
|
1177 | + 'BG-02' => __('Burgas', 'give'), |
|
1178 | + 'BG-08' => __('Dobrich', 'give'), |
|
1179 | + 'BG-07' => __('Gabrovo', 'give'), |
|
1180 | + 'BG-26' => __('Haskovo', 'give'), |
|
1181 | + 'BG-09' => __('Kardzhali', 'give'), |
|
1182 | + 'BG-10' => __('Kyustendil', 'give'), |
|
1183 | + 'BG-11' => __('Lovech', 'give'), |
|
1184 | + 'BG-12' => __('Montana', 'give'), |
|
1185 | + 'BG-13' => __('Pazardzhik', 'give'), |
|
1186 | + 'BG-14' => __('Pernik', 'give'), |
|
1187 | + 'BG-15' => __('Pleven', 'give'), |
|
1188 | + 'BG-16' => __('Plovdiv', 'give'), |
|
1189 | + 'BG-17' => __('Razgrad', 'give'), |
|
1190 | + 'BG-18' => __('Ruse', 'give'), |
|
1191 | + 'BG-27' => __('Shumen', 'give'), |
|
1192 | + 'BG-19' => __('Silistra', 'give'), |
|
1193 | + 'BG-20' => __('Sliven', 'give'), |
|
1194 | + 'BG-21' => __('Smolyan', 'give'), |
|
1195 | + 'BG-23' => __('Sofia', 'give'), |
|
1196 | + 'BG-22' => __('Sofia-Grad', 'give'), |
|
1197 | + 'BG-24' => __('Stara Zagora', 'give'), |
|
1198 | + 'BG-25' => __('Targovishte', 'give'), |
|
1199 | + 'BG-03' => __('Varna', 'give'), |
|
1200 | + 'BG-04' => __('Veliko Tarnovo', 'give'), |
|
1201 | + 'BG-05' => __('Vidin', 'give'), |
|
1202 | + 'BG-06' => __('Vratsa', 'give'), |
|
1203 | + 'BG-28' => __('Yambol', 'give'), |
|
1204 | 1204 | ); |
1205 | - return apply_filters( 'give_bulgarian_states', $states ); |
|
1205 | + return apply_filters('give_bulgarian_states', $states); |
|
1206 | 1206 | } |
1207 | 1207 | |
1208 | 1208 | /** |
@@ -1214,72 +1214,72 @@ discard block |
||
1214 | 1214 | function give_get_bangladeshi_states_list() { |
1215 | 1215 | $states = array( |
1216 | 1216 | '' => '', |
1217 | - 'BAG' => __( 'Bagerhat', 'give' ), |
|
1218 | - 'BAN' => __( 'Bandarban', 'give' ), |
|
1219 | - 'BAR' => __( 'Barguna', 'give' ), |
|
1220 | - 'BARI' => __( 'Barisal', 'give' ), |
|
1221 | - 'BHO' => __( 'Bhola', 'give' ), |
|
1222 | - 'BOG' => __( 'Bogra', 'give' ), |
|
1223 | - 'BRA' => __( 'Brahmanbaria', 'give' ), |
|
1224 | - 'CHA' => __( 'Chandpur', 'give' ), |
|
1225 | - 'CHI' => __( 'Chittagong', 'give' ), |
|
1226 | - 'CHU' => __( 'Chuadanga', 'give' ), |
|
1227 | - 'COM' => __( 'Comilla', 'give' ), |
|
1228 | - 'COX' => __( "Cox's Bazar", 'give' ), |
|
1229 | - 'DHA' => __( 'Dhaka', 'give' ), |
|
1230 | - 'DIN' => __( 'Dinajpur', 'give' ), |
|
1231 | - 'FAR' => __( 'Faridpur ', 'give' ), |
|
1232 | - 'FEN' => __( 'Feni', 'give' ), |
|
1233 | - 'GAI' => __( 'Gaibandha', 'give' ), |
|
1234 | - 'GAZI' => __( 'Gazipur', 'give' ), |
|
1235 | - 'GOP' => __( 'Gopalganj', 'give' ), |
|
1236 | - 'HAB' => __( 'Habiganj', 'give' ), |
|
1237 | - 'JAM' => __( 'Jamalpur', 'give' ), |
|
1238 | - 'JES' => __( 'Jessore', 'give' ), |
|
1239 | - 'JHA' => __( 'Jhalokati', 'give' ), |
|
1240 | - 'JHE' => __( 'Jhenaidah', 'give' ), |
|
1241 | - 'JOY' => __( 'Joypurhat', 'give' ), |
|
1242 | - 'KHA' => __( 'Khagrachhari', 'give' ), |
|
1243 | - 'KHU' => __( 'Khulna', 'give' ), |
|
1244 | - 'KIS' => __( 'Kishoreganj', 'give' ), |
|
1245 | - 'KUR' => __( 'Kurigram', 'give' ), |
|
1246 | - 'KUS' => __( 'Kushtia', 'give' ), |
|
1247 | - 'LAK' => __( 'Lakshmipur', 'give' ), |
|
1248 | - 'LAL' => __( 'Lalmonirhat', 'give' ), |
|
1249 | - 'MAD' => __( 'Madaripur', 'give' ), |
|
1250 | - 'MAG' => __( 'Magura', 'give' ), |
|
1251 | - 'MAN' => __( 'Manikganj ', 'give' ), |
|
1252 | - 'MEH' => __( 'Meherpur', 'give' ), |
|
1253 | - 'MOU' => __( 'Moulvibazar', 'give' ), |
|
1254 | - 'MUN' => __( 'Munshiganj', 'give' ), |
|
1255 | - 'MYM' => __( 'Mymensingh', 'give' ), |
|
1256 | - 'NAO' => __( 'Naogaon', 'give' ), |
|
1257 | - 'NAR' => __( 'Narail', 'give' ), |
|
1258 | - 'NARG' => __( 'Narayanganj', 'give' ), |
|
1259 | - 'NARD' => __( 'Narsingdi', 'give' ), |
|
1260 | - 'NAT' => __( 'Natore', 'give' ), |
|
1261 | - 'NAW' => __( 'Nawabganj', 'give' ), |
|
1262 | - 'NET' => __( 'Netrakona', 'give' ), |
|
1263 | - 'NIL' => __( 'Nilphamari', 'give' ), |
|
1264 | - 'NOA' => __( 'Noakhali', 'give' ), |
|
1265 | - 'PAB' => __( 'Pabna', 'give' ), |
|
1266 | - 'PAN' => __( 'Panchagarh', 'give' ), |
|
1267 | - 'PAT' => __( 'Patuakhali', 'give' ), |
|
1268 | - 'PIR' => __( 'Pirojpur', 'give' ), |
|
1269 | - 'RAJB' => __( 'Rajbari', 'give' ), |
|
1270 | - 'RAJ' => __( 'Rajshahi', 'give' ), |
|
1271 | - 'RAN' => __( 'Rangamati', 'give' ), |
|
1272 | - 'RANP' => __( 'Rangpur', 'give' ), |
|
1273 | - 'SAT' => __( 'Satkhira', 'give' ), |
|
1274 | - 'SHA' => __( 'Shariatpur', 'give' ), |
|
1275 | - 'SHE' => __( 'Sherpur', 'give' ), |
|
1276 | - 'SIR' => __( 'Sirajganj', 'give' ), |
|
1277 | - 'SUN' => __( 'Sunamganj', 'give' ), |
|
1278 | - 'SYL' => __( 'Sylhet', 'give' ), |
|
1279 | - 'TAN' => __( 'Tangail', 'give' ), |
|
1280 | - 'THA' => __( 'Thakurgaon', 'give' ), |
|
1217 | + 'BAG' => __('Bagerhat', 'give'), |
|
1218 | + 'BAN' => __('Bandarban', 'give'), |
|
1219 | + 'BAR' => __('Barguna', 'give'), |
|
1220 | + 'BARI' => __('Barisal', 'give'), |
|
1221 | + 'BHO' => __('Bhola', 'give'), |
|
1222 | + 'BOG' => __('Bogra', 'give'), |
|
1223 | + 'BRA' => __('Brahmanbaria', 'give'), |
|
1224 | + 'CHA' => __('Chandpur', 'give'), |
|
1225 | + 'CHI' => __('Chittagong', 'give'), |
|
1226 | + 'CHU' => __('Chuadanga', 'give'), |
|
1227 | + 'COM' => __('Comilla', 'give'), |
|
1228 | + 'COX' => __("Cox's Bazar", 'give'), |
|
1229 | + 'DHA' => __('Dhaka', 'give'), |
|
1230 | + 'DIN' => __('Dinajpur', 'give'), |
|
1231 | + 'FAR' => __('Faridpur ', 'give'), |
|
1232 | + 'FEN' => __('Feni', 'give'), |
|
1233 | + 'GAI' => __('Gaibandha', 'give'), |
|
1234 | + 'GAZI' => __('Gazipur', 'give'), |
|
1235 | + 'GOP' => __('Gopalganj', 'give'), |
|
1236 | + 'HAB' => __('Habiganj', 'give'), |
|
1237 | + 'JAM' => __('Jamalpur', 'give'), |
|
1238 | + 'JES' => __('Jessore', 'give'), |
|
1239 | + 'JHA' => __('Jhalokati', 'give'), |
|
1240 | + 'JHE' => __('Jhenaidah', 'give'), |
|
1241 | + 'JOY' => __('Joypurhat', 'give'), |
|
1242 | + 'KHA' => __('Khagrachhari', 'give'), |
|
1243 | + 'KHU' => __('Khulna', 'give'), |
|
1244 | + 'KIS' => __('Kishoreganj', 'give'), |
|
1245 | + 'KUR' => __('Kurigram', 'give'), |
|
1246 | + 'KUS' => __('Kushtia', 'give'), |
|
1247 | + 'LAK' => __('Lakshmipur', 'give'), |
|
1248 | + 'LAL' => __('Lalmonirhat', 'give'), |
|
1249 | + 'MAD' => __('Madaripur', 'give'), |
|
1250 | + 'MAG' => __('Magura', 'give'), |
|
1251 | + 'MAN' => __('Manikganj ', 'give'), |
|
1252 | + 'MEH' => __('Meherpur', 'give'), |
|
1253 | + 'MOU' => __('Moulvibazar', 'give'), |
|
1254 | + 'MUN' => __('Munshiganj', 'give'), |
|
1255 | + 'MYM' => __('Mymensingh', 'give'), |
|
1256 | + 'NAO' => __('Naogaon', 'give'), |
|
1257 | + 'NAR' => __('Narail', 'give'), |
|
1258 | + 'NARG' => __('Narayanganj', 'give'), |
|
1259 | + 'NARD' => __('Narsingdi', 'give'), |
|
1260 | + 'NAT' => __('Natore', 'give'), |
|
1261 | + 'NAW' => __('Nawabganj', 'give'), |
|
1262 | + 'NET' => __('Netrakona', 'give'), |
|
1263 | + 'NIL' => __('Nilphamari', 'give'), |
|
1264 | + 'NOA' => __('Noakhali', 'give'), |
|
1265 | + 'PAB' => __('Pabna', 'give'), |
|
1266 | + 'PAN' => __('Panchagarh', 'give'), |
|
1267 | + 'PAT' => __('Patuakhali', 'give'), |
|
1268 | + 'PIR' => __('Pirojpur', 'give'), |
|
1269 | + 'RAJB' => __('Rajbari', 'give'), |
|
1270 | + 'RAJ' => __('Rajshahi', 'give'), |
|
1271 | + 'RAN' => __('Rangamati', 'give'), |
|
1272 | + 'RANP' => __('Rangpur', 'give'), |
|
1273 | + 'SAT' => __('Satkhira', 'give'), |
|
1274 | + 'SHA' => __('Shariatpur', 'give'), |
|
1275 | + 'SHE' => __('Sherpur', 'give'), |
|
1276 | + 'SIR' => __('Sirajganj', 'give'), |
|
1277 | + 'SUN' => __('Sunamganj', 'give'), |
|
1278 | + 'SYL' => __('Sylhet', 'give'), |
|
1279 | + 'TAN' => __('Tangail', 'give'), |
|
1280 | + 'THA' => __('Thakurgaon', 'give'), |
|
1281 | 1281 | ); |
1282 | - return apply_filters( 'give_bangladeshi_states', $states ); |
|
1282 | + return apply_filters('give_bangladeshi_states', $states); |
|
1283 | 1283 | } |
1284 | 1284 | |
1285 | 1285 | /** |
@@ -1291,32 +1291,32 @@ discard block |
||
1291 | 1291 | function give_get_argentina_states_list() { |
1292 | 1292 | $states = array( |
1293 | 1293 | '' => '', |
1294 | - 'C' => __( 'Ciudad Autónoma de Buenos Aires', 'give' ), |
|
1295 | - 'B' => __( 'Buenos Aires', 'give' ), |
|
1296 | - 'K' => __( 'Catamarca', 'give' ), |
|
1297 | - 'H' => __( 'Chaco', 'give' ), |
|
1298 | - 'U' => __( 'Chubut', 'give' ), |
|
1299 | - 'X' => __( 'Córdoba', 'give' ), |
|
1300 | - 'W' => __( 'Corrientes', 'give' ), |
|
1301 | - 'E' => __( 'Entre Ríos', 'give' ), |
|
1302 | - 'P' => __( 'Formosa', 'give' ), |
|
1303 | - 'Y' => __( 'Jujuy', 'give' ), |
|
1304 | - 'L' => __( 'La Pampa', 'give' ), |
|
1305 | - 'F' => __( 'La Rioja', 'give' ), |
|
1306 | - 'M' => __( 'Mendoza', 'give' ), |
|
1307 | - 'N' => __( 'Misiones', 'give' ), |
|
1308 | - 'Q' => __( 'Neuquén', 'give' ), |
|
1309 | - 'R' => __( 'Río Negro', 'give' ), |
|
1310 | - 'A' => __( 'Salta', 'give' ), |
|
1311 | - 'J' => __( 'San Juan', 'give' ), |
|
1312 | - 'D' => __( 'San Luis', 'give' ), |
|
1313 | - 'Z' => __( 'Santa Cruz', 'give' ), |
|
1314 | - 'S' => __( 'Santa Fe', 'give' ), |
|
1315 | - 'G' => __( 'Santiago del Estero', 'give' ), |
|
1316 | - 'V' => __( 'Tierra del Fuego', 'give' ), |
|
1317 | - 'T' => __( 'Tucumán', 'give' ), |
|
1294 | + 'C' => __('Ciudad Autónoma de Buenos Aires', 'give'), |
|
1295 | + 'B' => __('Buenos Aires', 'give'), |
|
1296 | + 'K' => __('Catamarca', 'give'), |
|
1297 | + 'H' => __('Chaco', 'give'), |
|
1298 | + 'U' => __('Chubut', 'give'), |
|
1299 | + 'X' => __('Córdoba', 'give'), |
|
1300 | + 'W' => __('Corrientes', 'give'), |
|
1301 | + 'E' => __('Entre Ríos', 'give'), |
|
1302 | + 'P' => __('Formosa', 'give'), |
|
1303 | + 'Y' => __('Jujuy', 'give'), |
|
1304 | + 'L' => __('La Pampa', 'give'), |
|
1305 | + 'F' => __('La Rioja', 'give'), |
|
1306 | + 'M' => __('Mendoza', 'give'), |
|
1307 | + 'N' => __('Misiones', 'give'), |
|
1308 | + 'Q' => __('Neuquén', 'give'), |
|
1309 | + 'R' => __('Río Negro', 'give'), |
|
1310 | + 'A' => __('Salta', 'give'), |
|
1311 | + 'J' => __('San Juan', 'give'), |
|
1312 | + 'D' => __('San Luis', 'give'), |
|
1313 | + 'Z' => __('Santa Cruz', 'give'), |
|
1314 | + 'S' => __('Santa Fe', 'give'), |
|
1315 | + 'G' => __('Santiago del Estero', 'give'), |
|
1316 | + 'V' => __('Tierra del Fuego', 'give'), |
|
1317 | + 'T' => __('Tucumán', 'give'), |
|
1318 | 1318 | ); |
1319 | - return apply_filters( 'give_argentina_states', $states ); |
|
1319 | + return apply_filters('give_argentina_states', $states); |
|
1320 | 1320 | } |
1321 | 1321 | |
1322 | 1322 | /** |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | 'AP' => 'Armed Forces - Pacific' |
1398 | 1398 | ); |
1399 | 1399 | |
1400 | - return apply_filters( 'give_us_states', $states ); |
|
1400 | + return apply_filters('give_us_states', $states); |
|
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | /** |
@@ -1410,22 +1410,22 @@ discard block |
||
1410 | 1410 | function give_get_provinces_list() { |
1411 | 1411 | $provinces = array( |
1412 | 1412 | '' => '', |
1413 | - 'AB' => esc_html__('Alberta', 'give' ), |
|
1414 | - 'BC' => esc_html__('British Columbia', 'give' ), |
|
1415 | - 'MB' => esc_html__('Manitoba', 'give' ), |
|
1416 | - 'NB' => esc_html__('New Brunswick', 'give' ), |
|
1417 | - 'NL' => esc_html__('Newfoundland and Labrador', 'give' ), |
|
1418 | - 'NS' => esc_html__('Nova Scotia', 'give' ), |
|
1419 | - 'NT' => esc_html__('Northwest Territories', 'give' ), |
|
1420 | - 'NU' => esc_html__('Nunavut', 'give' ), |
|
1421 | - 'ON' => esc_html__('Ontario', 'give' ), |
|
1422 | - 'PE' => esc_html__('Prince Edward Island', 'give' ), |
|
1423 | - 'QC' => esc_html__('Quebec', 'give' ), |
|
1424 | - 'SK' => esc_html__('Saskatchewan', 'give' ), |
|
1425 | - 'YT' => esc_html__('Yukon', 'give' ) |
|
1413 | + 'AB' => esc_html__('Alberta', 'give'), |
|
1414 | + 'BC' => esc_html__('British Columbia', 'give'), |
|
1415 | + 'MB' => esc_html__('Manitoba', 'give'), |
|
1416 | + 'NB' => esc_html__('New Brunswick', 'give'), |
|
1417 | + 'NL' => esc_html__('Newfoundland and Labrador', 'give'), |
|
1418 | + 'NS' => esc_html__('Nova Scotia', 'give'), |
|
1419 | + 'NT' => esc_html__('Northwest Territories', 'give'), |
|
1420 | + 'NU' => esc_html__('Nunavut', 'give'), |
|
1421 | + 'ON' => esc_html__('Ontario', 'give'), |
|
1422 | + 'PE' => esc_html__('Prince Edward Island', 'give'), |
|
1423 | + 'QC' => esc_html__('Quebec', 'give'), |
|
1424 | + 'SK' => esc_html__('Saskatchewan', 'give'), |
|
1425 | + 'YT' => esc_html__('Yukon', 'give') |
|
1426 | 1426 | ); |
1427 | 1427 | |
1428 | - return apply_filters( 'give_canada_provinces', $provinces ); |
|
1428 | + return apply_filters('give_canada_provinces', $provinces); |
|
1429 | 1429 | } |
1430 | 1430 | |
1431 | 1431 | /** |
@@ -1447,7 +1447,7 @@ discard block |
||
1447 | 1447 | 'WA' => 'Western Australia' |
1448 | 1448 | ); |
1449 | 1449 | |
1450 | - return apply_filters( 'give_australian_states', $states ); |
|
1450 | + return apply_filters('give_australian_states', $states); |
|
1451 | 1451 | } |
1452 | 1452 | |
1453 | 1453 | /** |
@@ -1488,7 +1488,7 @@ discard block |
||
1488 | 1488 | 'TO' => 'Tocantins' |
1489 | 1489 | ); |
1490 | 1490 | |
1491 | - return apply_filters( 'give_brazil_states', $states ); |
|
1491 | + return apply_filters('give_brazil_states', $states); |
|
1492 | 1492 | } |
1493 | 1493 | |
1494 | 1494 | /** |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | 'NEW TERRITORIES' => 'New Territories' |
1506 | 1506 | ); |
1507 | 1507 | |
1508 | - return apply_filters( 'give_hong_kong_states', $states ); |
|
1508 | + return apply_filters('give_hong_kong_states', $states); |
|
1509 | 1509 | } |
1510 | 1510 | |
1511 | 1511 | /** |
@@ -1539,7 +1539,7 @@ discard block |
||
1539 | 1539 | 'ZA' => 'Zala' |
1540 | 1540 | ); |
1541 | 1541 | |
1542 | - return apply_filters( 'give_hungary_states', $states ); |
|
1542 | + return apply_filters('give_hungary_states', $states); |
|
1543 | 1543 | } |
1544 | 1544 | |
1545 | 1545 | /** |
@@ -1585,7 +1585,7 @@ discard block |
||
1585 | 1585 | 'CN32' => 'Xinjiang / 新疆' |
1586 | 1586 | ); |
1587 | 1587 | |
1588 | - return apply_filters( 'give_chinese_states', $states ); |
|
1588 | + return apply_filters('give_chinese_states', $states); |
|
1589 | 1589 | } |
1590 | 1590 | |
1591 | 1591 | /** |
@@ -1614,7 +1614,7 @@ discard block |
||
1614 | 1614 | 'WC' => 'West Coast' |
1615 | 1615 | ); |
1616 | 1616 | |
1617 | - return apply_filters( 'give_new_zealand_states', $states ); |
|
1617 | + return apply_filters('give_new_zealand_states', $states); |
|
1618 | 1618 | } |
1619 | 1619 | |
1620 | 1620 | /** |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | 'PB' => 'Papua Barat' |
1663 | 1663 | ); |
1664 | 1664 | |
1665 | - return apply_filters( 'give_indonesia_states', $states ); |
|
1665 | + return apply_filters('give_indonesia_states', $states); |
|
1666 | 1666 | } |
1667 | 1667 | |
1668 | 1668 | /** |
@@ -1712,7 +1712,7 @@ discard block |
||
1712 | 1712 | 'PY' => 'Pondicherry (Puducherry)' |
1713 | 1713 | ); |
1714 | 1714 | |
1715 | - return apply_filters( 'give_indian_states', $states ); |
|
1715 | + return apply_filters('give_indian_states', $states); |
|
1716 | 1716 | } |
1717 | 1717 | |
1718 | 1718 | /** |
@@ -1742,7 +1742,7 @@ discard block |
||
1742 | 1742 | 'PJY' => 'W.P. Putrajaya' |
1743 | 1743 | ); |
1744 | 1744 | |
1745 | - return apply_filters( 'give_malaysian_states', $states ); |
|
1745 | + return apply_filters('give_malaysian_states', $states); |
|
1746 | 1746 | } |
1747 | 1747 | |
1748 | 1748 | /** |
@@ -1765,7 +1765,7 @@ discard block |
||
1765 | 1765 | 'WC' => 'Western Cape' |
1766 | 1766 | ); |
1767 | 1767 | |
1768 | - return apply_filters( 'give_south_african_states', $states ); |
|
1768 | + return apply_filters('give_south_african_states', $states); |
|
1769 | 1769 | } |
1770 | 1770 | |
1771 | 1771 | /** |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | 'TH-35' => 'Yasothon (ยโสธร)' |
1857 | 1857 | ); |
1858 | 1858 | |
1859 | - return apply_filters( 'give_thailand_states', $states ); |
|
1859 | + return apply_filters('give_thailand_states', $states); |
|
1860 | 1860 | } |
1861 | 1861 | |
1862 | 1862 | /** |
@@ -1868,59 +1868,59 @@ discard block |
||
1868 | 1868 | function give_get_spain_states_list() { |
1869 | 1869 | $states = array( |
1870 | 1870 | '' => '', |
1871 | - 'C' => esc_html__( 'A Coruña', 'give' ), |
|
1872 | - 'VI' => esc_html__( 'Álava', 'give' ), |
|
1873 | - 'AB' => esc_html__( 'Albacete', 'give' ), |
|
1874 | - 'A' => esc_html__( 'Alicante', 'give' ), |
|
1875 | - 'AL' => esc_html__( 'Almería', 'give' ), |
|
1876 | - 'O' => esc_html__( 'Asturias', 'give' ), |
|
1877 | - 'AV' => esc_html__( 'Ávila', 'give' ), |
|
1878 | - 'BA' => esc_html__( 'Badajoz', 'give' ), |
|
1879 | - 'PM' => esc_html__( 'Baleares', 'give' ), |
|
1880 | - 'B' => esc_html__( 'Barcelona', 'give' ), |
|
1881 | - 'BU' => esc_html__( 'Burgos', 'give' ), |
|
1882 | - 'CC' => esc_html__( 'Cáceres', 'give' ), |
|
1883 | - 'CA' => esc_html__( 'Cádiz', 'give' ), |
|
1884 | - 'S' => esc_html__( 'Cantabria', 'give' ), |
|
1885 | - 'CS' => esc_html__( 'Castellón', 'give' ), |
|
1886 | - 'CE' => esc_html__( 'Ceuta', 'give' ), |
|
1887 | - 'CR' => esc_html__( 'Ciudad Real', 'give' ), |
|
1888 | - 'CO' => esc_html__( 'Córdoba', 'give' ), |
|
1889 | - 'CU' => esc_html__( 'Cuenca', 'give' ), |
|
1890 | - 'GI' => esc_html__( 'Girona', 'give' ), |
|
1891 | - 'GR' => esc_html__( 'Granada', 'give' ), |
|
1892 | - 'GU' => esc_html__( 'Guadalajara', 'give' ), |
|
1893 | - 'SS' => esc_html__( 'Gipuzkoa', 'give' ), |
|
1894 | - 'H' => esc_html__( 'Huelva', 'give' ), |
|
1895 | - 'HU' => esc_html__( 'Huesca', 'give' ), |
|
1896 | - 'J' => esc_html__( 'Jaén', 'give' ), |
|
1897 | - 'LO' => esc_html__( 'La Rioja', 'give' ), |
|
1898 | - 'GC' => esc_html__( 'Las Palmas', 'give' ), |
|
1899 | - 'LE' => esc_html__( 'León', 'give' ), |
|
1900 | - 'L' => esc_html__( 'Lleida', 'give' ), |
|
1901 | - 'LU' => esc_html__( 'Lugo', 'give' ), |
|
1902 | - 'M' => esc_html__( 'Madrid', 'give' ), |
|
1903 | - 'MA' => esc_html__( 'Málaga', 'give' ), |
|
1904 | - 'ML' => esc_html__( 'Melilla', 'give' ), |
|
1905 | - 'MU' => esc_html__( 'Murcia', 'give' ), |
|
1906 | - 'NA' => esc_html__( 'Navarra', 'give' ), |
|
1907 | - 'OR' => esc_html__( 'Ourense', 'give' ), |
|
1908 | - 'P' => esc_html__( 'Palencia', 'give' ), |
|
1909 | - 'PO' => esc_html__( 'Pontevedra', 'give' ), |
|
1910 | - 'SA' => esc_html__( 'Salamanca', 'give' ), |
|
1911 | - 'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ), |
|
1912 | - 'SG' => esc_html__( 'Segovia', 'give' ), |
|
1913 | - 'SE' => esc_html__( 'Sevilla', 'give' ), |
|
1914 | - 'SO' => esc_html__( 'Soria', 'give' ), |
|
1915 | - 'T' => esc_html__( 'Tarragona', 'give' ), |
|
1916 | - 'TE' => esc_html__( 'Teruel', 'give' ), |
|
1917 | - 'TO' => esc_html__( 'Toledo', 'give' ), |
|
1918 | - 'V' => esc_html__( 'Valencia', 'give' ), |
|
1919 | - 'VA' => esc_html__( 'Valladolid', 'give' ), |
|
1920 | - 'BI' => esc_html__( 'Bizkaia', 'give' ), |
|
1921 | - 'ZA' => esc_html__( 'Zamora', 'give' ), |
|
1922 | - 'Z' => esc_html__( 'Zaragoza', 'give' ) |
|
1871 | + 'C' => esc_html__('A Coruña', 'give'), |
|
1872 | + 'VI' => esc_html__('Álava', 'give'), |
|
1873 | + 'AB' => esc_html__('Albacete', 'give'), |
|
1874 | + 'A' => esc_html__('Alicante', 'give'), |
|
1875 | + 'AL' => esc_html__('Almería', 'give'), |
|
1876 | + 'O' => esc_html__('Asturias', 'give'), |
|
1877 | + 'AV' => esc_html__('Ávila', 'give'), |
|
1878 | + 'BA' => esc_html__('Badajoz', 'give'), |
|
1879 | + 'PM' => esc_html__('Baleares', 'give'), |
|
1880 | + 'B' => esc_html__('Barcelona', 'give'), |
|
1881 | + 'BU' => esc_html__('Burgos', 'give'), |
|
1882 | + 'CC' => esc_html__('Cáceres', 'give'), |
|
1883 | + 'CA' => esc_html__('Cádiz', 'give'), |
|
1884 | + 'S' => esc_html__('Cantabria', 'give'), |
|
1885 | + 'CS' => esc_html__('Castellón', 'give'), |
|
1886 | + 'CE' => esc_html__('Ceuta', 'give'), |
|
1887 | + 'CR' => esc_html__('Ciudad Real', 'give'), |
|
1888 | + 'CO' => esc_html__('Córdoba', 'give'), |
|
1889 | + 'CU' => esc_html__('Cuenca', 'give'), |
|
1890 | + 'GI' => esc_html__('Girona', 'give'), |
|
1891 | + 'GR' => esc_html__('Granada', 'give'), |
|
1892 | + 'GU' => esc_html__('Guadalajara', 'give'), |
|
1893 | + 'SS' => esc_html__('Gipuzkoa', 'give'), |
|
1894 | + 'H' => esc_html__('Huelva', 'give'), |
|
1895 | + 'HU' => esc_html__('Huesca', 'give'), |
|
1896 | + 'J' => esc_html__('Jaén', 'give'), |
|
1897 | + 'LO' => esc_html__('La Rioja', 'give'), |
|
1898 | + 'GC' => esc_html__('Las Palmas', 'give'), |
|
1899 | + 'LE' => esc_html__('León', 'give'), |
|
1900 | + 'L' => esc_html__('Lleida', 'give'), |
|
1901 | + 'LU' => esc_html__('Lugo', 'give'), |
|
1902 | + 'M' => esc_html__('Madrid', 'give'), |
|
1903 | + 'MA' => esc_html__('Málaga', 'give'), |
|
1904 | + 'ML' => esc_html__('Melilla', 'give'), |
|
1905 | + 'MU' => esc_html__('Murcia', 'give'), |
|
1906 | + 'NA' => esc_html__('Navarra', 'give'), |
|
1907 | + 'OR' => esc_html__('Ourense', 'give'), |
|
1908 | + 'P' => esc_html__('Palencia', 'give'), |
|
1909 | + 'PO' => esc_html__('Pontevedra', 'give'), |
|
1910 | + 'SA' => esc_html__('Salamanca', 'give'), |
|
1911 | + 'TF' => esc_html__('Santa Cruz de Tenerife', 'give'), |
|
1912 | + 'SG' => esc_html__('Segovia', 'give'), |
|
1913 | + 'SE' => esc_html__('Sevilla', 'give'), |
|
1914 | + 'SO' => esc_html__('Soria', 'give'), |
|
1915 | + 'T' => esc_html__('Tarragona', 'give'), |
|
1916 | + 'TE' => esc_html__('Teruel', 'give'), |
|
1917 | + 'TO' => esc_html__('Toledo', 'give'), |
|
1918 | + 'V' => esc_html__('Valencia', 'give'), |
|
1919 | + 'VA' => esc_html__('Valladolid', 'give'), |
|
1920 | + 'BI' => esc_html__('Bizkaia', 'give'), |
|
1921 | + 'ZA' => esc_html__('Zamora', 'give'), |
|
1922 | + 'Z' => esc_html__('Zaragoza', 'give') |
|
1923 | 1923 | ); |
1924 | 1924 | |
1925 | - return apply_filters( 'give_spain_states', $states ); |
|
1925 | + return apply_filters('give_spain_states', $states); |
|
1926 | 1926 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -25,25 +25,25 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_load_scripts() { |
27 | 27 | |
28 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/frontend/'; |
|
29 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
30 | - $scripts_footer = ( give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ) ? true : false; |
|
28 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/frontend/'; |
|
29 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
30 | + $scripts_footer = (give_is_setting_enabled(give_get_option('scripts_footer'))) ? true : false; |
|
31 | 31 | |
32 | 32 | // Use minified libraries if SCRIPT_DEBUG is turned off. |
33 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
33 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
34 | 34 | |
35 | 35 | // Localize / PHP to AJAX vars. |
36 | - $localize_give_vars = apply_filters( 'give_global_script_vars', array( |
|
36 | + $localize_give_vars = apply_filters('give_global_script_vars', array( |
|
37 | 37 | 'ajaxurl' => give_get_ajax_url(), |
38 | - 'checkout_nonce' => wp_create_nonce( 'give_checkout_nonce' ), |
|
39 | - 'currency_sign' => give_currency_filter( '' ), |
|
38 | + 'checkout_nonce' => wp_create_nonce('give_checkout_nonce'), |
|
39 | + 'currency_sign' => give_currency_filter(''), |
|
40 | 40 | 'currency_pos' => give_get_currency_position(), |
41 | 41 | 'thousands_separator' => give_get_price_thousand_separator(), |
42 | 42 | 'decimal_separator' => give_get_price_decimal_separator(), |
43 | - 'no_gateway' => __( 'Please select a payment method.', 'give' ), |
|
44 | - 'bad_minimum' => __( 'The minimum custom donation amount for this form is', 'give' ), |
|
45 | - 'general_loading' => __( 'Loading...', 'give' ), |
|
46 | - 'purchase_loading' => __( 'Please Wait...', 'give' ), |
|
43 | + 'no_gateway' => __('Please select a payment method.', 'give'), |
|
44 | + 'bad_minimum' => __('The minimum custom donation amount for this form is', 'give'), |
|
45 | + 'general_loading' => __('Loading...', 'give'), |
|
46 | + 'purchase_loading' => __('Please Wait...', 'give'), |
|
47 | 47 | 'number_decimals' => give_get_price_decimals(), |
48 | 48 | 'give_version' => GIVE_VERSION, |
49 | 49 | 'magnific_options' => apply_filters( |
@@ -57,81 +57,81 @@ discard block |
||
57 | 57 | 'give_form_translation_js', |
58 | 58 | array( |
59 | 59 | // Field name Validation message. |
60 | - 'payment-mode' => __( 'Please select payment mode.', 'give' ), |
|
61 | - 'give_first' => __( 'Please enter your first name.', 'give' ), |
|
62 | - 'give_email' => __( 'Please enter a valid email address.', 'give' ), |
|
63 | - 'give_user_login' => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ), |
|
64 | - 'give_user_pass' => __( 'Enter a password.', 'give' ), |
|
65 | - 'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ), |
|
66 | - 'give_agree_to_terms' => __( 'You must agree to the terms and conditions.', 'give' ), |
|
60 | + 'payment-mode' => __('Please select payment mode.', 'give'), |
|
61 | + 'give_first' => __('Please enter your first name.', 'give'), |
|
62 | + 'give_email' => __('Please enter a valid email address.', 'give'), |
|
63 | + 'give_user_login' => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'), |
|
64 | + 'give_user_pass' => __('Enter a password.', 'give'), |
|
65 | + 'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'), |
|
66 | + 'give_agree_to_terms' => __('You must agree to the terms and conditions.', 'give'), |
|
67 | 67 | ) |
68 | 68 | ), |
69 | - ) ); |
|
69 | + )); |
|
70 | 70 | |
71 | - $localize_give_ajax = apply_filters( 'give_global_ajax_vars', array( |
|
71 | + $localize_give_ajax = apply_filters('give_global_ajax_vars', array( |
|
72 | 72 | 'ajaxurl' => give_get_ajax_url(), |
73 | - 'loading' => __( 'Loading', 'give' ), |
|
73 | + 'loading' => __('Loading', 'give'), |
|
74 | 74 | // General loading message. |
75 | - 'select_option' => __( 'Please select an option', 'give' ), |
|
75 | + 'select_option' => __('Please select an option', 'give'), |
|
76 | 76 | // Variable pricing error with multi-donation option enabled. |
77 | - 'default_gateway' => give_get_default_gateway( null ), |
|
78 | - 'permalinks' => get_option( 'permalink_structure' ) ? '1' : '0', |
|
77 | + 'default_gateway' => give_get_default_gateway(null), |
|
78 | + 'permalinks' => get_option('permalink_structure') ? '1' : '0', |
|
79 | 79 | 'number_decimals' => give_get_price_decimals(), |
80 | - ) ); |
|
80 | + )); |
|
81 | 81 | |
82 | 82 | // DEBUG is On. |
83 | - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { |
|
83 | + if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { |
|
84 | 84 | |
85 | - if ( give_is_cc_verify_enabled() ) { |
|
86 | - wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
87 | - wp_enqueue_script( 'give-cc-validator' ); |
|
85 | + if (give_is_cc_verify_enabled()) { |
|
86 | + wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
87 | + wp_enqueue_script('give-cc-validator'); |
|
88 | 88 | } |
89 | 89 | |
90 | - wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
91 | - wp_enqueue_script( 'give-float-labels' ); |
|
90 | + wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
91 | + wp_enqueue_script('give-float-labels'); |
|
92 | 92 | |
93 | - wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
94 | - wp_enqueue_script( 'give-blockui' ); |
|
93 | + wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
94 | + wp_enqueue_script('give-blockui'); |
|
95 | 95 | |
96 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
97 | - wp_enqueue_script( 'give-qtip' ); |
|
96 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
97 | + wp_enqueue_script('give-qtip'); |
|
98 | 98 | |
99 | - wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
100 | - wp_enqueue_script( 'give-accounting' ); |
|
99 | + wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
100 | + wp_enqueue_script('give-accounting'); |
|
101 | 101 | |
102 | - wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
103 | - wp_enqueue_script( 'give-magnific' ); |
|
102 | + wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
103 | + wp_enqueue_script('give-magnific'); |
|
104 | 104 | |
105 | - wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
106 | - wp_enqueue_script( 'give-checkout-global' ); |
|
105 | + wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
106 | + wp_enqueue_script('give-checkout-global'); |
|
107 | 107 | |
108 | 108 | // General scripts. |
109 | - wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
110 | - wp_enqueue_script( 'give-scripts' ); |
|
109 | + wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
110 | + wp_enqueue_script('give-scripts'); |
|
111 | 111 | |
112 | 112 | // Load AJAX scripts, if enabled. |
113 | - wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
114 | - wp_enqueue_script( 'give-ajax' ); |
|
113 | + wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
114 | + wp_enqueue_script('give-ajax'); |
|
115 | 115 | |
116 | 116 | // Localize / Pass AJAX vars from PHP, |
117 | - wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_vars ); |
|
118 | - wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax ); |
|
117 | + wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_vars); |
|
118 | + wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax); |
|
119 | 119 | |
120 | 120 | } else { |
121 | 121 | |
122 | 122 | // DEBUG is OFF (one JS file to rule them all!). |
123 | - wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
124 | - wp_enqueue_script( 'give' ); |
|
123 | + wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
124 | + wp_enqueue_script('give'); |
|
125 | 125 | |
126 | 126 | // Localize / Pass AJAX vars from PHP. |
127 | - wp_localize_script( 'give', 'give_global_vars', $localize_give_vars ); |
|
128 | - wp_localize_script( 'give', 'give_scripts', $localize_give_ajax ); |
|
127 | + wp_localize_script('give', 'give_global_vars', $localize_give_vars); |
|
128 | + wp_localize_script('give', 'give_scripts', $localize_give_ajax); |
|
129 | 129 | |
130 | 130 | } |
131 | 131 | |
132 | 132 | } |
133 | 133 | |
134 | -add_action( 'wp_enqueue_scripts', 'give_load_scripts' ); |
|
134 | +add_action('wp_enqueue_scripts', 'give_load_scripts'); |
|
135 | 135 | |
136 | 136 | /** |
137 | 137 | * Register styles. |
@@ -144,16 +144,16 @@ discard block |
||
144 | 144 | */ |
145 | 145 | function give_register_styles() { |
146 | 146 | |
147 | - if ( ! give_is_setting_enabled( give_get_option( 'css' ) ) ) { |
|
147 | + if ( ! give_is_setting_enabled(give_get_option('css'))) { |
|
148 | 148 | return; |
149 | 149 | } |
150 | 150 | |
151 | - wp_register_style( 'give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all' ); |
|
152 | - wp_enqueue_style( 'give-styles' ); |
|
151 | + wp_register_style('give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all'); |
|
152 | + wp_enqueue_style('give-styles'); |
|
153 | 153 | |
154 | 154 | } |
155 | 155 | |
156 | -add_action( 'wp_enqueue_scripts', 'give_register_styles' ); |
|
156 | +add_action('wp_enqueue_scripts', 'give_register_styles'); |
|
157 | 157 | |
158 | 158 | |
159 | 159 | /** |
@@ -166,19 +166,19 @@ discard block |
||
166 | 166 | function give_get_stylesheet_uri() { |
167 | 167 | |
168 | 168 | // Use minified libraries if SCRIPT_DEBUG is turned off. |
169 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
169 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
170 | 170 | |
171 | 171 | // LTR or RTL files. |
172 | - $direction = ( is_rtl() ) ? '-rtl' : ''; |
|
172 | + $direction = (is_rtl()) ? '-rtl' : ''; |
|
173 | 173 | |
174 | - $file = 'give' . $direction . $suffix . '.css'; |
|
174 | + $file = 'give'.$direction.$suffix.'.css'; |
|
175 | 175 | $templates_dir = give_get_theme_template_dir_name(); |
176 | 176 | |
177 | - $child_theme_style_sheet = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file; |
|
178 | - $child_theme_style_sheet_2 = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $direction . '.css'; |
|
179 | - $parent_theme_style_sheet = trailingslashit( get_template_directory() ) . $templates_dir . $file; |
|
180 | - $parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $direction . '.css'; |
|
181 | - $give_plugin_style_sheet = trailingslashit( give_get_templates_dir() ) . $file; |
|
177 | + $child_theme_style_sheet = trailingslashit(get_stylesheet_directory()).$templates_dir.$file; |
|
178 | + $child_theme_style_sheet_2 = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$direction.'.css'; |
|
179 | + $parent_theme_style_sheet = trailingslashit(get_template_directory()).$templates_dir.$file; |
|
180 | + $parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$direction.'.css'; |
|
181 | + $give_plugin_style_sheet = trailingslashit(give_get_templates_dir()).$file; |
|
182 | 182 | |
183 | 183 | $uri = false; |
184 | 184 | |
@@ -188,23 +188,23 @@ discard block |
||
188 | 188 | * followed by non minified version, even if SCRIPT_DEBUG is not enabled. |
189 | 189 | * This allows users to copy just give.css to their theme. |
190 | 190 | */ |
191 | - if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) { |
|
192 | - if ( ! empty( $nonmin ) ) { |
|
193 | - $uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $direction . '.css'; |
|
191 | + if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) { |
|
192 | + if ( ! empty($nonmin)) { |
|
193 | + $uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$direction.'.css'; |
|
194 | 194 | } else { |
195 | - $uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file; |
|
195 | + $uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file; |
|
196 | 196 | } |
197 | - } elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) { |
|
198 | - if ( ! empty( $nonmin ) ) { |
|
199 | - $uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $direction . '.css'; |
|
197 | + } elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) { |
|
198 | + if ( ! empty($nonmin)) { |
|
199 | + $uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$direction.'.css'; |
|
200 | 200 | } else { |
201 | - $uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file; |
|
201 | + $uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file; |
|
202 | 202 | } |
203 | - } elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) { |
|
204 | - $uri = trailingslashit( give_get_templates_url() ) . $file; |
|
203 | + } elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) { |
|
204 | + $uri = trailingslashit(give_get_templates_url()).$file; |
|
205 | 205 | } |
206 | 206 | |
207 | - return apply_filters( 'give_get_stylesheet_uri', $uri ); |
|
207 | + return apply_filters('give_get_stylesheet_uri', $uri); |
|
208 | 208 | |
209 | 209 | } |
210 | 210 | |
@@ -221,79 +221,79 @@ discard block |
||
221 | 221 | * |
222 | 222 | * @return void |
223 | 223 | */ |
224 | -function give_load_admin_scripts( $hook ) { |
|
224 | +function give_load_admin_scripts($hook) { |
|
225 | 225 | |
226 | 226 | global $post, $post_type; |
227 | 227 | |
228 | 228 | $give_options = give_get_settings(); |
229 | 229 | |
230 | 230 | // Directories of assets. |
231 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/admin/'; |
|
232 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
233 | - $css_dir = GIVE_PLUGIN_URL . 'assets/css/'; |
|
231 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/admin/'; |
|
232 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
233 | + $css_dir = GIVE_PLUGIN_URL.'assets/css/'; |
|
234 | 234 | |
235 | 235 | // Use minified libraries if SCRIPT_DEBUG is turned off. |
236 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
236 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
237 | 237 | |
238 | 238 | // LTR or RTL files. |
239 | - $direction = ( is_rtl() ) ? '-rtl' : ''; |
|
239 | + $direction = (is_rtl()) ? '-rtl' : ''; |
|
240 | 240 | |
241 | 241 | // Global Admin. |
242 | - wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' ); |
|
243 | - wp_enqueue_style( 'give-admin-bar-notification' ); |
|
242 | + wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css'); |
|
243 | + wp_enqueue_style('give-admin-bar-notification'); |
|
244 | 244 | |
245 | 245 | // Give Admin Only. |
246 | - if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) { |
|
246 | + if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) { |
|
247 | 247 | return; |
248 | 248 | } |
249 | 249 | |
250 | 250 | // CSS. |
251 | - wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' ); |
|
252 | - wp_enqueue_style( 'jquery-ui-css' ); |
|
253 | - wp_register_style( 'give-admin', $css_dir . 'give-admin' . $direction . $suffix . '.css', array(), GIVE_VERSION ); |
|
254 | - wp_enqueue_style( 'give-admin' ); |
|
255 | - wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION ); |
|
256 | - wp_enqueue_style( 'jquery-chosen' ); |
|
257 | - wp_enqueue_style( 'thickbox' ); |
|
258 | - wp_enqueue_style( 'wp-color-picker' ); |
|
251 | + wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css'); |
|
252 | + wp_enqueue_style('jquery-ui-css'); |
|
253 | + wp_register_style('give-admin', $css_dir.'give-admin'.$direction.$suffix.'.css', array(), GIVE_VERSION); |
|
254 | + wp_enqueue_style('give-admin'); |
|
255 | + wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION); |
|
256 | + wp_enqueue_style('jquery-chosen'); |
|
257 | + wp_enqueue_style('thickbox'); |
|
258 | + wp_enqueue_style('wp-color-picker'); |
|
259 | 259 | |
260 | 260 | |
261 | 261 | // JS. |
262 | - wp_register_script( 'give-selector-cache', $js_plugins . 'selector-cache' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
263 | - wp_enqueue_script( 'give-selector-cache' ); |
|
262 | + wp_register_script('give-selector-cache', $js_plugins.'selector-cache'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
263 | + wp_enqueue_script('give-selector-cache'); |
|
264 | 264 | |
265 | - wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION ); |
|
266 | - wp_enqueue_script( 'jquery-chosen' ); |
|
265 | + wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION); |
|
266 | + wp_enqueue_script('jquery-chosen'); |
|
267 | 267 | |
268 | - wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
269 | - wp_enqueue_script( 'give-accounting' ); |
|
268 | + wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
269 | + wp_enqueue_script('give-accounting'); |
|
270 | 270 | |
271 | - wp_enqueue_script( 'wp-color-picker' ); |
|
272 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
273 | - wp_enqueue_script( 'thickbox' ); |
|
271 | + wp_enqueue_script('wp-color-picker'); |
|
272 | + wp_enqueue_script('jquery-ui-datepicker'); |
|
273 | + wp_enqueue_script('thickbox'); |
|
274 | 274 | |
275 | - wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker' ), GIVE_VERSION, false ); |
|
276 | - wp_enqueue_script( 'give-admin-scripts' ); |
|
275 | + wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker', 'wp-color-picker'), GIVE_VERSION, false); |
|
276 | + wp_enqueue_script('give-admin-scripts'); |
|
277 | 277 | |
278 | - wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' ); |
|
279 | - wp_enqueue_script( 'jquery-flot' ); |
|
278 | + wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js'); |
|
279 | + wp_enqueue_script('jquery-flot'); |
|
280 | 280 | |
281 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
282 | - wp_enqueue_script( 'give-qtip' ); |
|
281 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
282 | + wp_enqueue_script('give-qtip'); |
|
283 | 283 | |
284 | - wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
285 | - wp_enqueue_script( 'give-repeatable-fields' ); |
|
284 | + wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
285 | + wp_enqueue_script('give-repeatable-fields'); |
|
286 | 286 | |
287 | 287 | // Forms CPT Script. |
288 | - if ( $post_type === 'give_forms' ) { |
|
289 | - wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
290 | - wp_enqueue_script( 'give-admin-forms-scripts' ); |
|
288 | + if ($post_type === 'give_forms') { |
|
289 | + wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
290 | + wp_enqueue_script('give-admin-forms-scripts'); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | // Settings Scripts. |
294 | - if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) { |
|
295 | - wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
296 | - wp_enqueue_script( 'give-admin-settings-scripts' ); |
|
294 | + if (isset($_GET['page']) && $_GET['page'] == 'give-settings') { |
|
295 | + wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
296 | + wp_enqueue_script('give-admin-settings-scripts'); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | // Price Separators. |
@@ -301,75 +301,75 @@ discard block |
||
301 | 301 | $decimal_separator = give_get_price_decimal_separator(); |
302 | 302 | |
303 | 303 | // Localize strings & variables for JS. |
304 | - wp_localize_script( 'give-admin-scripts', 'give_vars', array( |
|
305 | - 'post_id' => isset( $post->ID ) ? $post->ID : null, |
|
304 | + wp_localize_script('give-admin-scripts', 'give_vars', array( |
|
305 | + 'post_id' => isset($post->ID) ? $post->ID : null, |
|
306 | 306 | 'give_version' => GIVE_VERSION, |
307 | 307 | 'thousands_separator' => $thousand_separator, |
308 | 308 | 'decimal_separator' => $decimal_separator, |
309 | - 'quick_edit_warning' => __( 'Not available for variable priced forms.', 'give' ), |
|
310 | - 'delete_payment' => __( 'Are you sure you want to delete this payment?', 'give' ), |
|
311 | - 'delete_payment_note' => __( 'Are you sure you want to delete this note?', 'give' ), |
|
312 | - 'revoke_api_key' => __( 'Are you sure you want to revoke this API key?', 'give' ), |
|
313 | - 'regenerate_api_key' => __( 'Are you sure you want to regenerate this API key?', 'give' ), |
|
314 | - 'resend_receipt' => __( 'Are you sure you want to resend the donation receipt?', 'give' ), |
|
315 | - 'disconnect_user' => __( 'Are you sure you want to disconnect the user from this donor?', 'give' ), |
|
316 | - 'one_option' => __( 'Choose a form', 'give' ), |
|
317 | - 'one_or_more_option' => __( 'Choose one or more forms', 'give' ), |
|
318 | - 'currency_sign' => give_currency_filter( '' ), |
|
319 | - 'currency_pos' => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before', |
|
320 | - 'currency_decimals' => give_currency_decimal_filter( give_get_price_decimals() ), |
|
321 | - 'batch_export_no_class' => __( 'You must choose a method.', 'give' ), |
|
322 | - 'batch_export_no_reqs' => __( 'Required fields not completed.', 'give' ), |
|
323 | - 'reset_stats_warn' => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ), |
|
324 | - 'price_format_guide' => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ), |
|
309 | + 'quick_edit_warning' => __('Not available for variable priced forms.', 'give'), |
|
310 | + 'delete_payment' => __('Are you sure you want to delete this payment?', 'give'), |
|
311 | + 'delete_payment_note' => __('Are you sure you want to delete this note?', 'give'), |
|
312 | + 'revoke_api_key' => __('Are you sure you want to revoke this API key?', 'give'), |
|
313 | + 'regenerate_api_key' => __('Are you sure you want to regenerate this API key?', 'give'), |
|
314 | + 'resend_receipt' => __('Are you sure you want to resend the donation receipt?', 'give'), |
|
315 | + 'disconnect_user' => __('Are you sure you want to disconnect the user from this donor?', 'give'), |
|
316 | + 'one_option' => __('Choose a form', 'give'), |
|
317 | + 'one_or_more_option' => __('Choose one or more forms', 'give'), |
|
318 | + 'currency_sign' => give_currency_filter(''), |
|
319 | + 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', |
|
320 | + 'currency_decimals' => give_currency_decimal_filter(give_get_price_decimals()), |
|
321 | + 'batch_export_no_class' => __('You must choose a method.', 'give'), |
|
322 | + 'batch_export_no_reqs' => __('Required fields not completed.', 'give'), |
|
323 | + 'reset_stats_warn' => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'), |
|
324 | + 'price_format_guide' => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator), |
|
325 | 325 | /* translators : %s: Donation form options metabox */ |
326 | - 'confirm_before_remove_row_text' => __( 'Do you want to delete this level?', 'give' ), |
|
327 | - 'matched_success_failure_page' => __( 'You cannot set the success and failed pages to the same page', 'give' ), |
|
328 | - 'dismiss_notice_text' => __( 'Dismiss this notice.', 'give' ), |
|
329 | - 'search_placeholder' => __( 'Type to search all forms', 'give' ), |
|
330 | - 'search_placeholder_donor' => __( 'Type to search all donors', 'give' ), |
|
331 | - 'search_placeholder_country' => __( 'Type to search all countries', 'give' ), |
|
332 | - 'search_placeholder_state' => __( 'Type to search all states/provinces', 'give' ), |
|
326 | + 'confirm_before_remove_row_text' => __('Do you want to delete this level?', 'give'), |
|
327 | + 'matched_success_failure_page' => __('You cannot set the success and failed pages to the same page', 'give'), |
|
328 | + 'dismiss_notice_text' => __('Dismiss this notice.', 'give'), |
|
329 | + 'search_placeholder' => __('Type to search all forms', 'give'), |
|
330 | + 'search_placeholder_donor' => __('Type to search all donors', 'give'), |
|
331 | + 'search_placeholder_country' => __('Type to search all countries', 'give'), |
|
332 | + 'search_placeholder_state' => __('Type to search all states/provinces', 'give'), |
|
333 | 333 | 'bulk_action' => array( |
334 | 334 | 'delete' => array( |
335 | - 'zero' => __( 'You must choose at least one or more payments to delete.', 'give' ), |
|
336 | - 'single' => __( 'Are you sure you want to permanently delete this donation?', 'give' ), |
|
337 | - 'multiple' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ), |
|
335 | + 'zero' => __('You must choose at least one or more payments to delete.', 'give'), |
|
336 | + 'single' => __('Are you sure you want to permanently delete this donation?', 'give'), |
|
337 | + 'multiple' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'), |
|
338 | 338 | ), |
339 | 339 | 'resend-receipt' => array( |
340 | - 'zero' => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ), |
|
341 | - 'single' => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ), |
|
342 | - 'multiple' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ), |
|
340 | + 'zero' => __('You must choose at least one or more recipients to resend the email receipt.', 'give'), |
|
341 | + 'single' => __('Are you sure you want to resend the email receipt to this recipient?', 'give'), |
|
342 | + 'multiple' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'), |
|
343 | 343 | ), |
344 | 344 | 'set-to-status' => array( |
345 | - 'zero' => __( 'You must choose at least one or more donations to set status to {status}.', 'give' ), |
|
346 | - 'single' => __( 'Are you sure you want to set status of this donation to {status}?', 'give' ), |
|
347 | - 'multiple' => __( 'Are you sure you want to set status of {payment_count} donations to {status}?', 'give' ), |
|
345 | + 'zero' => __('You must choose at least one or more donations to set status to {status}.', 'give'), |
|
346 | + 'single' => __('Are you sure you want to set status of this donation to {status}?', 'give'), |
|
347 | + 'multiple' => __('Are you sure you want to set status of {payment_count} donations to {status}?', 'give'), |
|
348 | 348 | ), |
349 | 349 | ), |
350 | 350 | 'metabox_fields' => array( |
351 | 351 | 'media' => array( |
352 | - 'button_title' => __( 'Choose Image', 'give' ), |
|
352 | + 'button_title' => __('Choose Image', 'give'), |
|
353 | 353 | ), |
354 | 354 | 'file' => array( |
355 | - 'button_title' => __( 'Choose File', 'give' ), |
|
355 | + 'button_title' => __('Choose File', 'give'), |
|
356 | 356 | ) |
357 | 357 | ), |
358 | 358 | 'chosen' => array( |
359 | - 'no_results_msg' => __( 'No results match {search_term}', 'give' ), |
|
360 | - 'ajax_search_msg' => __( 'Searching results for match {search_term}', 'give' ), |
|
359 | + 'no_results_msg' => __('No results match {search_term}', 'give'), |
|
360 | + 'ajax_search_msg' => __('Searching results for match {search_term}', 'give'), |
|
361 | 361 | ), |
362 | - 'db_update_confirmation_msg' => __( 'Did you already take backup of database before processing updates?', 'give' ) |
|
363 | - ) ); |
|
362 | + 'db_update_confirmation_msg' => __('Did you already take backup of database before processing updates?', 'give') |
|
363 | + )); |
|
364 | 364 | |
365 | - if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) { |
|
365 | + if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) { |
|
366 | 366 | // call for new media manager. |
367 | 367 | wp_enqueue_media(); |
368 | 368 | } |
369 | 369 | |
370 | 370 | } |
371 | 371 | |
372 | -add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 ); |
|
372 | +add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100); |
|
373 | 373 | |
374 | 374 | /** |
375 | 375 | * Admin Give Icon |
@@ -384,13 +384,13 @@ discard block |
||
384 | 384 | ?> |
385 | 385 | <style type="text/css" media="screen"> |
386 | 386 | |
387 | - <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?> |
|
387 | + <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?> |
|
388 | 388 | @font-face { |
389 | 389 | font-family: 'give-icomoon'; |
390 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?ngjl88'; ?>'); |
|
391 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'), |
|
392 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'), |
|
393 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg'); |
|
390 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?ngjl88'; ?>'); |
|
391 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'), |
|
392 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'), |
|
393 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg'); |
|
394 | 394 | font-weight: normal; |
395 | 395 | font-style: normal; |
396 | 396 | } |
@@ -409,4 +409,4 @@ discard block |
||
409 | 409 | <?php |
410 | 410 | } |
411 | 411 | |
412 | -add_action( 'admin_head', 'give_admin_icon' ); |
|
412 | +add_action('admin_head', 'give_admin_icon'); |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @since 1.0 |
32 | 32 | */ |
33 | - do_action( 'give_pre_process_donation' ); |
|
33 | + do_action('give_pre_process_donation'); |
|
34 | 34 | |
35 | 35 | // Validate the form $_POST data |
36 | 36 | $valid_data = give_donation_form_validate_fields(); |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | * @param bool|array $valid_data Validate fields. |
46 | 46 | * @param array $_POST Array of variables passed via the HTTP POST. |
47 | 47 | */ |
48 | - do_action( 'give_checkout_error_checks', $valid_data, $_POST ); |
|
48 | + do_action('give_checkout_error_checks', $valid_data, $_POST); |
|
49 | 49 | |
50 | - $is_ajax = isset( $_POST['give_ajax'] ); |
|
50 | + $is_ajax = isset($_POST['give_ajax']); |
|
51 | 51 | |
52 | 52 | // Process the login form |
53 | - if ( isset( $_POST['give_login_submit'] ) ) { |
|
53 | + if (isset($_POST['give_login_submit'])) { |
|
54 | 54 | give_process_form_login(); |
55 | 55 | } |
56 | 56 | |
57 | 57 | // Validate the user |
58 | - $user = give_get_donation_form_user( $valid_data ); |
|
58 | + $user = give_get_donation_form_user($valid_data); |
|
59 | 59 | |
60 | - if ( false === $valid_data || give_get_errors() || ! $user ) { |
|
61 | - if ( $is_ajax ) { |
|
60 | + if (false === $valid_data || give_get_errors() || ! $user) { |
|
61 | + if ($is_ajax) { |
|
62 | 62 | /** |
63 | 63 | * Fires when AJAX sends back errors from the donation form. |
64 | 64 | * |
65 | 65 | * @since 1.0 |
66 | 66 | */ |
67 | - do_action( 'give_ajax_donation_errors' ); |
|
67 | + do_action('give_ajax_donation_errors'); |
|
68 | 68 | give_die(); |
69 | 69 | } else { |
70 | 70 | return false; |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | // If AJAX send back success to proceed with form submission |
75 | - if ( $is_ajax ) { |
|
75 | + if ($is_ajax) { |
|
76 | 76 | echo 'success'; |
77 | 77 | give_die(); |
78 | 78 | } |
79 | 79 | |
80 | 80 | // After AJAX: Setup session if not using php_sessions |
81 | - if ( ! Give()->session->use_php_sessions() ) { |
|
81 | + if ( ! Give()->session->use_php_sessions()) { |
|
82 | 82 | // Double-check that set_cookie is publicly accessible; |
83 | 83 | // we're using a slightly modified class-wp-sessions.php |
84 | - $session_reflection = new ReflectionMethod( 'WP_Session', 'set_cookie' ); |
|
85 | - if ( $session_reflection->isPublic() ) { |
|
84 | + $session_reflection = new ReflectionMethod('WP_Session', 'set_cookie'); |
|
85 | + if ($session_reflection->isPublic()) { |
|
86 | 86 | // Manually set the cookie. |
87 | 87 | Give()->session->init()->set_cookie(); |
88 | 88 | } |
@@ -97,18 +97,18 @@ discard block |
||
97 | 97 | 'address' => $user['address'], |
98 | 98 | ); |
99 | 99 | |
100 | - $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : ''; |
|
100 | + $auth_key = defined('AUTH_KEY') ? AUTH_KEY : ''; |
|
101 | 101 | |
102 | - $price = isset( $_POST['give-amount'] ) ? (float) apply_filters( 'give_donation_total', give_sanitize_amount( give_format_amount( $_POST['give-amount'] ) ) ) : '0.00'; |
|
103 | - $purchase_key = strtolower( md5( $user['user_email'] . date( 'Y-m-d H:i:s' ) . $auth_key . uniqid( 'give', true ) ) ); |
|
102 | + $price = isset($_POST['give-amount']) ? (float) apply_filters('give_donation_total', give_sanitize_amount(give_format_amount($_POST['give-amount']))) : '0.00'; |
|
103 | + $purchase_key = strtolower(md5($user['user_email'].date('Y-m-d H:i:s').$auth_key.uniqid('give', true))); |
|
104 | 104 | |
105 | 105 | // Setup donation information |
106 | 106 | $donation_data = array( |
107 | 107 | 'price' => $price, |
108 | 108 | 'purchase_key' => $purchase_key, |
109 | 109 | 'user_email' => $user['user_email'], |
110 | - 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ), |
|
111 | - 'user_info' => stripslashes_deep( $user_info ), |
|
110 | + 'date' => date('Y-m-d H:i:s', current_time('timestamp')), |
|
111 | + 'user_info' => stripslashes_deep($user_info), |
|
112 | 112 | 'post_data' => $_POST, |
113 | 113 | 'gateway' => $valid_data['gateway'], |
114 | 114 | 'card_info' => $valid_data['cc_info'], |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | * @param array $user_info Array containing basic user information. |
129 | 129 | * @param bool|array $valid_data Validate fields. |
130 | 130 | */ |
131 | - do_action( 'give_checkout_before_gateway', $_POST, $user_info, $valid_data ); |
|
131 | + do_action('give_checkout_before_gateway', $_POST, $user_info, $valid_data); |
|
132 | 132 | |
133 | 133 | // Sanity check for price |
134 | - if ( ! $donation_data['price'] ) { |
|
134 | + if ( ! $donation_data['price']) { |
|
135 | 135 | // Revert to manual |
136 | 136 | $donation_data['gateway'] = 'manual'; |
137 | 137 | $_POST['give-gateway'] = 'manual'; |
@@ -142,27 +142,27 @@ discard block |
||
142 | 142 | * |
143 | 143 | * @since 1.7 |
144 | 144 | */ |
145 | - $donation_data = apply_filters( 'give_donation_data_before_gateway', $donation_data, $valid_data ); |
|
145 | + $donation_data = apply_filters('give_donation_data_before_gateway', $donation_data, $valid_data); |
|
146 | 146 | |
147 | 147 | // Setup the data we're storing in the donation session |
148 | 148 | $session_data = $donation_data; |
149 | 149 | |
150 | 150 | // Make sure credit card numbers are never stored in sessions |
151 | - unset( $session_data['card_info']['card_number'] ); |
|
152 | - unset( $session_data['post_data']['card_number'] ); |
|
151 | + unset($session_data['card_info']['card_number']); |
|
152 | + unset($session_data['post_data']['card_number']); |
|
153 | 153 | |
154 | 154 | // Used for showing data to non logged-in users after donation, and for other plugins needing donation data. |
155 | - give_set_purchase_session( $session_data ); |
|
155 | + give_set_purchase_session($session_data); |
|
156 | 156 | |
157 | 157 | // Send info to the gateway for payment processing |
158 | - give_send_to_gateway( $donation_data['gateway'], $donation_data ); |
|
158 | + give_send_to_gateway($donation_data['gateway'], $donation_data); |
|
159 | 159 | give_die(); |
160 | 160 | |
161 | 161 | } |
162 | 162 | |
163 | -add_action( 'give_purchase', 'give_process_donation_form' ); |
|
164 | -add_action( 'wp_ajax_give_process_donation', 'give_process_donation_form' ); |
|
165 | -add_action( 'wp_ajax_nopriv_give_process_donation', 'give_process_donation_form' ); |
|
163 | +add_action('give_purchase', 'give_process_donation_form'); |
|
164 | +add_action('wp_ajax_give_process_donation', 'give_process_donation_form'); |
|
165 | +add_action('wp_ajax_nopriv_give_process_donation', 'give_process_donation_form'); |
|
166 | 166 | |
167 | 167 | |
168 | 168 | /** |
@@ -175,29 +175,29 @@ discard block |
||
175 | 175 | * |
176 | 176 | * @return void |
177 | 177 | */ |
178 | -function give_check_logged_in_user_for_existing_email( $valid_data, $post ) { |
|
178 | +function give_check_logged_in_user_for_existing_email($valid_data, $post) { |
|
179 | 179 | |
180 | 180 | // Verify that the email address belongs to this customer. |
181 | - if ( is_user_logged_in() ) { |
|
181 | + if (is_user_logged_in()) { |
|
182 | 182 | |
183 | - $submitted_email = $valid_data['logged_in_user']['user_email']; |
|
184 | - $customer = new Give_Donor( get_current_user_id(), true ); |
|
183 | + $submitted_email = $valid_data['logged_in_user']['user_email']; |
|
184 | + $customer = new Give_Donor(get_current_user_id(), true); |
|
185 | 185 | |
186 | 186 | // If this email address is not registered with this customer, see if it belongs to any other customer |
187 | 187 | if ( |
188 | 188 | $submitted_email !== $customer->email |
189 | - && ( is_array( $customer->emails ) && ! in_array( $submitted_email, $customer->emails ) ) |
|
189 | + && (is_array($customer->emails) && ! in_array($submitted_email, $customer->emails)) |
|
190 | 190 | ) { |
191 | - $found_customer = new Give_Donor( $submitted_email ); |
|
191 | + $found_customer = new Give_Donor($submitted_email); |
|
192 | 192 | |
193 | - if ( $found_customer->id > 0 ) { |
|
194 | - give_set_error( 'give-customer-email-exists', sprintf( __( 'You are logged in as %1$s, and are submitting a donation as %2$s, which is an existing donor. To ensure that the email address is tied to the correct donor, please submit this donation from a logged-out browser, or choose another email address.' ,'give' ), $customer->email, $submitted_email ) ); |
|
193 | + if ($found_customer->id > 0) { |
|
194 | + give_set_error('give-customer-email-exists', sprintf(__('You are logged in as %1$s, and are submitting a donation as %2$s, which is an existing donor. To ensure that the email address is tied to the correct donor, please submit this donation from a logged-out browser, or choose another email address.', 'give'), $customer->email, $submitted_email)); |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | -add_action( 'give_checkout_error_checks', 'give_check_logged_in_user_for_existing_email', 10, 2 ); |
|
200 | +add_action('give_checkout_error_checks', 'give_check_logged_in_user_for_existing_email', 10, 2); |
|
201 | 201 | |
202 | 202 | /** |
203 | 203 | * Process the checkout login form |
@@ -207,49 +207,49 @@ discard block |
||
207 | 207 | * @return void |
208 | 208 | */ |
209 | 209 | function give_process_form_login() { |
210 | - $is_ajax = isset( $_POST['give_ajax'] ); |
|
210 | + $is_ajax = isset($_POST['give_ajax']); |
|
211 | 211 | |
212 | 212 | $user_data = give_donation_form_validate_user_login(); |
213 | 213 | |
214 | - if ( give_get_errors() || $user_data['user_id'] < 1 ) { |
|
215 | - if ( $is_ajax ) { |
|
214 | + if (give_get_errors() || $user_data['user_id'] < 1) { |
|
215 | + if ($is_ajax) { |
|
216 | 216 | /** |
217 | 217 | * Fires when AJAX sends back errors from the donation form. |
218 | 218 | * |
219 | 219 | * @since 1.0 |
220 | 220 | */ |
221 | 221 | ob_start(); |
222 | - do_action( 'give_ajax_donation_errors' ); |
|
222 | + do_action('give_ajax_donation_errors'); |
|
223 | 223 | $message = ob_get_contents(); |
224 | 224 | ob_end_clean(); |
225 | - wp_send_json_error( $message ); |
|
225 | + wp_send_json_error($message); |
|
226 | 226 | } else { |
227 | - wp_redirect( $_SERVER['HTTP_REFERER'] ); |
|
227 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
228 | 228 | exit; |
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | - give_log_user_in( $user_data['user_id'], $user_data['user_login'], $user_data['user_pass'] ); |
|
232 | + give_log_user_in($user_data['user_id'], $user_data['user_login'], $user_data['user_pass']); |
|
233 | 233 | |
234 | - if ( $is_ajax ) { |
|
234 | + if ($is_ajax) { |
|
235 | 235 | $message = Give()->notices->print_frontend_notice( |
236 | 236 | sprintf( |
237 | 237 | /* translators: %s: user first name */ |
238 | - esc_html__( 'Welcome %s! You have successfully logged into your account.', 'give' ), |
|
239 | - ( ! empty( $user_data['user_first'] ) ) ? $user_data['user_first'] : $user_data['user_login'] |
|
238 | + esc_html__('Welcome %s! You have successfully logged into your account.', 'give'), |
|
239 | + ( ! empty($user_data['user_first'])) ? $user_data['user_first'] : $user_data['user_login'] |
|
240 | 240 | ), |
241 | 241 | false, |
242 | 242 | 'success' |
243 | 243 | ); |
244 | 244 | |
245 | - wp_send_json_success( $message ); |
|
245 | + wp_send_json_success($message); |
|
246 | 246 | } else { |
247 | - wp_redirect( $_SERVER['HTTP_REFERER'] ); |
|
247 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
251 | -add_action( 'wp_ajax_give_process_donation_login', 'give_process_form_login' ); |
|
252 | -add_action( 'wp_ajax_nopriv_give_process_donation_login', 'give_process_form_login' ); |
|
251 | +add_action('wp_ajax_give_process_donation_login', 'give_process_form_login'); |
|
252 | +add_action('wp_ajax_nopriv_give_process_donation_login', 'give_process_form_login'); |
|
253 | 253 | |
254 | 254 | /** |
255 | 255 | * Donation Form Validate Fields. |
@@ -261,55 +261,55 @@ discard block |
||
261 | 261 | function give_donation_form_validate_fields() { |
262 | 262 | |
263 | 263 | // Check if there is $_POST |
264 | - if ( empty( $_POST ) ) { |
|
264 | + if (empty($_POST)) { |
|
265 | 265 | return false; |
266 | 266 | } |
267 | 267 | |
268 | - $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : ''; |
|
268 | + $form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : ''; |
|
269 | 269 | |
270 | 270 | // Start an array to collect valid data |
271 | 271 | $valid_data = array( |
272 | 272 | 'gateway' => give_donation_form_validate_gateway(), // Gateway fallback (amount is validated here) |
273 | - 'need_new_user' => false, // New user flag |
|
274 | - 'need_user_login' => false, // Login user flag |
|
275 | - 'logged_user_data' => array(), // Logged user collected data |
|
276 | - 'new_user_data' => array(), // New user collected data |
|
277 | - 'login_user_data' => array(), // Login user collected data |
|
278 | - 'guest_user_data' => array(), // Guest user collected data |
|
279 | - 'cc_info' => give_donation_form_validate_cc(),// Credit card info |
|
273 | + 'need_new_user' => false, // New user flag |
|
274 | + 'need_user_login' => false, // Login user flag |
|
275 | + 'logged_user_data' => array(), // Logged user collected data |
|
276 | + 'new_user_data' => array(), // New user collected data |
|
277 | + 'login_user_data' => array(), // Login user collected data |
|
278 | + 'guest_user_data' => array(), // Guest user collected data |
|
279 | + 'cc_info' => give_donation_form_validate_cc(), // Credit card info |
|
280 | 280 | ); |
281 | 281 | |
282 | 282 | // Validate Honeypot First |
283 | - if ( ! empty( $_POST['give-honeypot'] ) ) { |
|
284 | - give_set_error( 'invalid_honeypot', esc_html__( 'Honeypot field detected. Go away bad bot!', 'give' ) ); |
|
283 | + if ( ! empty($_POST['give-honeypot'])) { |
|
284 | + give_set_error('invalid_honeypot', esc_html__('Honeypot field detected. Go away bad bot!', 'give')); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | // Validate agree to terms |
288 | - if ( give_is_terms_enabled( $form_id ) ) { |
|
288 | + if (give_is_terms_enabled($form_id)) { |
|
289 | 289 | give_donation_form_validate_agree_to_terms(); |
290 | 290 | } |
291 | 291 | |
292 | 292 | // Stop processing donor registration, if donor registration is optional and donor can do guest checkout. |
293 | 293 | // If registration form username field is empty that means donor do not want to registration instead want guest checkout. |
294 | 294 | if ( |
295 | - ! give_logged_in_only( $form_id ) |
|
296 | - && isset( $_POST['give-purchase-var'] ) |
|
295 | + ! give_logged_in_only($form_id) |
|
296 | + && isset($_POST['give-purchase-var']) |
|
297 | 297 | && $_POST['give-purchase-var'] == 'needs-to-register' |
298 | - && empty( $_POST['give_user_login'] ) |
|
298 | + && empty($_POST['give_user_login']) |
|
299 | 299 | ) { |
300 | - unset( $_POST['give-purchase-var'] ); |
|
300 | + unset($_POST['give-purchase-var']); |
|
301 | 301 | } |
302 | 302 | |
303 | - if ( is_user_logged_in() ) { |
|
303 | + if (is_user_logged_in()) { |
|
304 | 304 | // Collect logged in user data. |
305 | 305 | $valid_data['logged_in_user'] = give_donation_form_validate_logged_in_user(); |
306 | - } elseif ( isset( $_POST['give-purchase-var'] ) && $_POST['give-purchase-var'] == 'needs-to-register' ) { |
|
306 | + } elseif (isset($_POST['give-purchase-var']) && $_POST['give-purchase-var'] == 'needs-to-register') { |
|
307 | 307 | // Set new user registration as required. |
308 | 308 | $valid_data['need_new_user'] = true; |
309 | 309 | // Validate new user data. |
310 | 310 | $valid_data['new_user_data'] = give_donation_form_validate_new_user(); |
311 | 311 | // Check if login validation is needed. |
312 | - } elseif ( isset( $_POST['give-purchase-var'] ) && $_POST['give-purchase-var'] == 'needs-to-login' ) { |
|
312 | + } elseif (isset($_POST['give-purchase-var']) && $_POST['give-purchase-var'] == 'needs-to-login') { |
|
313 | 313 | // Set user login as required. |
314 | 314 | $valid_data['need_user_login'] = true; |
315 | 315 | // Validate users login info. |
@@ -334,41 +334,41 @@ discard block |
||
334 | 334 | */ |
335 | 335 | function give_donation_form_validate_gateway() { |
336 | 336 | |
337 | - $form_id = isset( $_REQUEST['give-form-id'] ) ? $_REQUEST['give-form-id'] : 0; |
|
338 | - $amount = isset( $_REQUEST['give-amount'] ) ? give_sanitize_amount( $_REQUEST['give-amount'] ) : 0; |
|
339 | - $gateway = give_get_default_gateway( $form_id ); |
|
337 | + $form_id = isset($_REQUEST['give-form-id']) ? $_REQUEST['give-form-id'] : 0; |
|
338 | + $amount = isset($_REQUEST['give-amount']) ? give_sanitize_amount($_REQUEST['give-amount']) : 0; |
|
339 | + $gateway = give_get_default_gateway($form_id); |
|
340 | 340 | |
341 | 341 | // Check if a gateway value is present. |
342 | - if ( ! empty( $_REQUEST['give-gateway'] ) ) { |
|
342 | + if ( ! empty($_REQUEST['give-gateway'])) { |
|
343 | 343 | |
344 | - $gateway = sanitize_text_field( $_REQUEST['give-gateway'] ); |
|
344 | + $gateway = sanitize_text_field($_REQUEST['give-gateway']); |
|
345 | 345 | |
346 | 346 | // Is amount being donated in LIVE mode 0.00? If so, error: |
347 | - if ( $amount == 0 && ! give_is_test_mode() ) { |
|
347 | + if ($amount == 0 && ! give_is_test_mode()) { |
|
348 | 348 | |
349 | - give_set_error( 'invalid_donation_amount', __( 'Please insert a valid donation amount.', 'give' ) ); |
|
349 | + give_set_error('invalid_donation_amount', __('Please insert a valid donation amount.', 'give')); |
|
350 | 350 | |
351 | 351 | } // End if(). |
352 | - elseif ( ! give_verify_minimum_price() ) { |
|
352 | + elseif ( ! give_verify_minimum_price()) { |
|
353 | 353 | // translators: %s: minimum donation amount. |
354 | 354 | give_set_error( |
355 | 355 | 'invalid_donation_minimum', |
356 | 356 | sprintf( |
357 | 357 | /* translators: %s: minimum donation amount */ |
358 | - __( 'This form has a minimum donation amount of %s.', 'give' ), |
|
359 | - give_currency_filter( give_format_amount( give_get_form_minimum_price( $form_id ) ) ) |
|
358 | + __('This form has a minimum donation amount of %s.', 'give'), |
|
359 | + give_currency_filter(give_format_amount(give_get_form_minimum_price($form_id))) |
|
360 | 360 | ) |
361 | 361 | ); |
362 | 362 | |
363 | 363 | } //Is this test mode zero donation? Let it through but set to manual gateway. |
364 | - elseif ( $amount == 0 && give_is_test_mode() ) { |
|
364 | + elseif ($amount == 0 && give_is_test_mode()) { |
|
365 | 365 | |
366 | 366 | $gateway = 'manual'; |
367 | 367 | |
368 | 368 | } //Check if this gateway is active. |
369 | - elseif ( ! give_is_gateway_active( $gateway ) ) { |
|
369 | + elseif ( ! give_is_gateway_active($gateway)) { |
|
370 | 370 | |
371 | - give_set_error( 'invalid_gateway', __( 'The selected payment gateway is not enabled.', 'give' ) ); |
|
371 | + give_set_error('invalid_gateway', __('The selected payment gateway is not enabled.', 'give')); |
|
372 | 372 | |
373 | 373 | } |
374 | 374 | } |
@@ -386,21 +386,21 @@ discard block |
||
386 | 386 | */ |
387 | 387 | function give_verify_minimum_price() { |
388 | 388 | |
389 | - $amount = give_sanitize_amount( $_REQUEST['give-amount'] ); |
|
390 | - $form_id = isset( $_REQUEST['give-form-id'] ) ? $_REQUEST['give-form-id'] : 0; |
|
391 | - $price_id = isset( $_REQUEST['give-price-id'] ) ? $_REQUEST['give-price-id'] : null; |
|
392 | - $variable_prices = give_has_variable_prices( $form_id ); |
|
389 | + $amount = give_sanitize_amount($_REQUEST['give-amount']); |
|
390 | + $form_id = isset($_REQUEST['give-form-id']) ? $_REQUEST['give-form-id'] : 0; |
|
391 | + $price_id = isset($_REQUEST['give-price-id']) ? $_REQUEST['give-price-id'] : null; |
|
392 | + $variable_prices = give_has_variable_prices($form_id); |
|
393 | 393 | |
394 | - if ( $variable_prices && in_array( $price_id, give_get_variable_price_ids( $form_id ) ) ) { |
|
394 | + if ($variable_prices && in_array($price_id, give_get_variable_price_ids($form_id))) { |
|
395 | 395 | |
396 | - $price_level_amount = give_get_price_option_amount( $form_id, $price_id ); |
|
396 | + $price_level_amount = give_get_price_option_amount($form_id, $price_id); |
|
397 | 397 | |
398 | - if ( $price_level_amount == $amount ) { |
|
398 | + if ($price_level_amount == $amount) { |
|
399 | 399 | return true; |
400 | 400 | } |
401 | 401 | } |
402 | 402 | |
403 | - if ( give_get_form_minimum_price( $form_id ) > $amount ) { |
|
403 | + if (give_get_form_minimum_price($form_id) > $amount) { |
|
404 | 404 | return false; |
405 | 405 | } |
406 | 406 | |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | */ |
417 | 417 | function give_donation_form_validate_agree_to_terms() { |
418 | 418 | // Validate agree to terms. |
419 | - if ( ! isset( $_POST['give_agree_to_terms'] ) || $_POST['give_agree_to_terms'] != 1 ) { |
|
419 | + if ( ! isset($_POST['give_agree_to_terms']) || $_POST['give_agree_to_terms'] != 1) { |
|
420 | 420 | // User did not agree. |
421 | - give_set_error( 'agree_to_terms', apply_filters( 'give_agree_to_terms_text', __( 'You must agree to the terms and conditions.', 'give' ) ) ); |
|
421 | + give_set_error('agree_to_terms', apply_filters('give_agree_to_terms_text', __('You must agree to the terms and conditions.', 'give'))); |
|
422 | 422 | } |
423 | 423 | } |
424 | 424 | |
@@ -432,59 +432,59 @@ discard block |
||
432 | 432 | * |
433 | 433 | * @return array |
434 | 434 | */ |
435 | -function give_get_required_fields( $form_id ) { |
|
435 | +function give_get_required_fields($form_id) { |
|
436 | 436 | |
437 | - $payment_mode = give_get_chosen_gateway( $form_id ); |
|
437 | + $payment_mode = give_get_chosen_gateway($form_id); |
|
438 | 438 | |
439 | 439 | $required_fields = array( |
440 | 440 | 'give_email' => array( |
441 | 441 | 'error_id' => 'invalid_email', |
442 | - 'error_message' => __( 'Please enter a valid email address.', 'give' ), |
|
442 | + 'error_message' => __('Please enter a valid email address.', 'give'), |
|
443 | 443 | ), |
444 | 444 | 'give_first' => array( |
445 | 445 | 'error_id' => 'invalid_first_name', |
446 | - 'error_message' => __( 'Please enter your first name.', 'give' ), |
|
446 | + 'error_message' => __('Please enter your first name.', 'give'), |
|
447 | 447 | ), |
448 | 448 | ); |
449 | 449 | |
450 | - $require_address = give_require_billing_address( $payment_mode ); |
|
450 | + $require_address = give_require_billing_address($payment_mode); |
|
451 | 451 | |
452 | - if ( $require_address ) { |
|
453 | - $required_fields['card_address'] = array( |
|
452 | + if ($require_address) { |
|
453 | + $required_fields['card_address'] = array( |
|
454 | 454 | 'error_id' => 'invalid_card_address', |
455 | - 'error_message' => __( 'Please enter your primary billing address.', 'give' ), |
|
455 | + 'error_message' => __('Please enter your primary billing address.', 'give'), |
|
456 | 456 | ); |
457 | - $required_fields['card_zip'] = array( |
|
457 | + $required_fields['card_zip'] = array( |
|
458 | 458 | 'error_id' => 'invalid_zip_code', |
459 | - 'error_message' => __( 'Please enter your zip / postal code.', 'give' ), |
|
459 | + 'error_message' => __('Please enter your zip / postal code.', 'give'), |
|
460 | 460 | ); |
461 | - $required_fields['card_city'] = array( |
|
461 | + $required_fields['card_city'] = array( |
|
462 | 462 | 'error_id' => 'invalid_city', |
463 | - 'error_message' => __( 'Please enter your billing city.', 'give' ), |
|
463 | + 'error_message' => __('Please enter your billing city.', 'give'), |
|
464 | 464 | ); |
465 | 465 | $required_fields['billing_country'] = array( |
466 | 466 | 'error_id' => 'invalid_country', |
467 | - 'error_message' => __( 'Please select your billing country.', 'give' ), |
|
467 | + 'error_message' => __('Please select your billing country.', 'give'), |
|
468 | 468 | ); |
469 | 469 | |
470 | 470 | |
471 | - $required_fields['card_state'] = array( |
|
471 | + $required_fields['card_state'] = array( |
|
472 | 472 | 'error_id' => 'invalid_state', |
473 | - 'error_message' => __( 'Please enter billing state / province / County.', 'give' ), |
|
473 | + 'error_message' => __('Please enter billing state / province / County.', 'give'), |
|
474 | 474 | ); |
475 | 475 | |
476 | 476 | // Check if billing country alredy exists. |
477 | - if ( ! empty( $_POST['billing_country'] ) ) { |
|
477 | + if ( ! empty($_POST['billing_country'])) { |
|
478 | 478 | // Get the value from $_POST. |
479 | - $country = sanitize_text_field( $_POST['billing_country'] ); |
|
479 | + $country = sanitize_text_field($_POST['billing_country']); |
|
480 | 480 | |
481 | 481 | // Get the country list that does not have any states init. |
482 | 482 | $no_states_country = give_no_states_country_list(); |
483 | 483 | |
484 | 484 | // Check if states is empty or not. |
485 | - if ( array_key_exists( $country, $no_states_country ) ) { |
|
485 | + if (array_key_exists($country, $no_states_country)) { |
|
486 | 486 | // If states is empty remove the required feilds of state in billing cart. |
487 | - unset( $required_fields['card_state'] ); |
|
487 | + unset($required_fields['card_state']); |
|
488 | 488 | } |
489 | 489 | } |
490 | 490 | } |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | * |
495 | 495 | * @since 1.7 |
496 | 496 | */ |
497 | - $required_fields = apply_filters( 'give_donation_form_required_fields', $required_fields, $form_id ); |
|
497 | + $required_fields = apply_filters('give_donation_form_required_fields', $required_fields, $form_id); |
|
498 | 498 | |
499 | 499 | return $required_fields; |
500 | 500 | |
@@ -509,16 +509,16 @@ discard block |
||
509 | 509 | * |
510 | 510 | * @return bool |
511 | 511 | */ |
512 | -function give_require_billing_address( $payment_mode ) { |
|
512 | +function give_require_billing_address($payment_mode) { |
|
513 | 513 | |
514 | 514 | $return = false; |
515 | 515 | |
516 | - if ( isset( $_POST['billing_country'] ) || did_action( "give_{$payment_mode}_cc_form" ) || did_action( 'give_cc_form' ) ) { |
|
516 | + if (isset($_POST['billing_country']) || did_action("give_{$payment_mode}_cc_form") || did_action('give_cc_form')) { |
|
517 | 517 | $return = true; |
518 | 518 | } |
519 | 519 | |
520 | 520 | // Let payment gateways and other extensions determine if address fields should be required. |
521 | - return apply_filters( 'give_require_billing_address', $return ); |
|
521 | + return apply_filters('give_require_billing_address', $return); |
|
522 | 522 | |
523 | 523 | } |
524 | 524 | |
@@ -532,42 +532,42 @@ discard block |
||
532 | 532 | function give_donation_form_validate_logged_in_user() { |
533 | 533 | global $user_ID; |
534 | 534 | |
535 | - $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : ''; |
|
535 | + $form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : ''; |
|
536 | 536 | |
537 | 537 | // Start empty array to collect valid user data. |
538 | 538 | $valid_user_data = array( |
539 | 539 | // Assume there will be errors. |
540 | - 'user_id' => - 1, |
|
540 | + 'user_id' => -1, |
|
541 | 541 | ); |
542 | 542 | |
543 | 543 | // Verify there is a user_ID. |
544 | - if ( $user_ID > 0 ) { |
|
544 | + if ($user_ID > 0) { |
|
545 | 545 | // Get the logged in user data. |
546 | - $user_data = get_userdata( $user_ID ); |
|
546 | + $user_data = get_userdata($user_ID); |
|
547 | 547 | |
548 | 548 | // Loop through required fields and show error messages. |
549 | - foreach ( give_get_required_fields( $form_id ) as $field_name => $value ) { |
|
550 | - if ( in_array( $value, give_get_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) { |
|
551 | - give_set_error( $value['error_id'], $value['error_message'] ); |
|
549 | + foreach (give_get_required_fields($form_id) as $field_name => $value) { |
|
550 | + if (in_array($value, give_get_required_fields($form_id)) && empty($_POST[$field_name])) { |
|
551 | + give_set_error($value['error_id'], $value['error_message']); |
|
552 | 552 | } |
553 | 553 | } |
554 | 554 | |
555 | 555 | // Verify data. |
556 | - if ( $user_data ) { |
|
556 | + if ($user_data) { |
|
557 | 557 | // Collected logged in user data. |
558 | 558 | $valid_user_data = array( |
559 | 559 | 'user_id' => $user_ID, |
560 | - 'user_email' => isset( $_POST['give_email'] ) ? sanitize_email( $_POST['give_email'] ) : $user_data->user_email, |
|
561 | - 'user_first' => isset( $_POST['give_first'] ) && ! empty( $_POST['give_first'] ) ? sanitize_text_field( $_POST['give_first'] ) : $user_data->first_name, |
|
562 | - 'user_last' => isset( $_POST['give_last'] ) && ! empty( $_POST['give_last'] ) ? sanitize_text_field( $_POST['give_last'] ) : $user_data->last_name, |
|
560 | + 'user_email' => isset($_POST['give_email']) ? sanitize_email($_POST['give_email']) : $user_data->user_email, |
|
561 | + 'user_first' => isset($_POST['give_first']) && ! empty($_POST['give_first']) ? sanitize_text_field($_POST['give_first']) : $user_data->first_name, |
|
562 | + 'user_last' => isset($_POST['give_last']) && ! empty($_POST['give_last']) ? sanitize_text_field($_POST['give_last']) : $user_data->last_name, |
|
563 | 563 | ); |
564 | 564 | |
565 | - if ( ! is_email( $valid_user_data['user_email'] ) ) { |
|
566 | - give_set_error( 'email_invalid', esc_html__( 'Invalid email.', 'give' ) ); |
|
565 | + if ( ! is_email($valid_user_data['user_email'])) { |
|
566 | + give_set_error('email_invalid', esc_html__('Invalid email.', 'give')); |
|
567 | 567 | } |
568 | 568 | } else { |
569 | 569 | // Set invalid user error. |
570 | - give_set_error( 'invalid_user', esc_html__( 'The user information is invalid.', 'give' ) ); |
|
570 | + give_set_error('invalid_user', esc_html__('The user information is invalid.', 'give')); |
|
571 | 571 | } |
572 | 572 | } |
573 | 573 | |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | // Default user data. |
587 | 587 | $default_user_data = array( |
588 | 588 | 'give-form-id' => '', |
589 | - 'user_id' => - 1, // Assume there will be errors. |
|
589 | + 'user_id' => -1, // Assume there will be errors. |
|
590 | 590 | 'user_first' => '', |
591 | 591 | 'user_last' => '', |
592 | 592 | 'give_user_login' => false, |
@@ -596,14 +596,14 @@ discard block |
||
596 | 596 | ); |
597 | 597 | |
598 | 598 | // Get user data. |
599 | - $user_data = wp_parse_args( array_map( 'trim', give_clean( $_POST ) ), $default_user_data ); |
|
599 | + $user_data = wp_parse_args(array_map('trim', give_clean($_POST)), $default_user_data); |
|
600 | 600 | $registering_new_user = false; |
601 | - $form_id = absint( $user_data['give-form-id'] ); |
|
601 | + $form_id = absint($user_data['give-form-id']); |
|
602 | 602 | |
603 | 603 | // Start an empty array to collect valid user data. |
604 | 604 | $valid_user_data = array( |
605 | 605 | // Assume there will be errors. |
606 | - 'user_id' => - 1, |
|
606 | + 'user_id' => -1, |
|
607 | 607 | |
608 | 608 | // Get first name. |
609 | 609 | 'user_first' => $user_data['give_first'], |
@@ -613,25 +613,25 @@ discard block |
||
613 | 613 | ); |
614 | 614 | |
615 | 615 | // Loop through required fields and show error messages. |
616 | - foreach ( give_get_required_fields( $form_id ) as $field_name => $value ) { |
|
617 | - if ( in_array( $value, give_get_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) { |
|
618 | - give_set_error( $value['error_id'], $value['error_message'] ); |
|
616 | + foreach (give_get_required_fields($form_id) as $field_name => $value) { |
|
617 | + if (in_array($value, give_get_required_fields($form_id)) && empty($_POST[$field_name])) { |
|
618 | + give_set_error($value['error_id'], $value['error_message']); |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | |
622 | 622 | // Check if we have an username to register. |
623 | - if ( give_validate_username( $user_data['give_user_login'] ) ) { |
|
623 | + if (give_validate_username($user_data['give_user_login'])) { |
|
624 | 624 | $registering_new_user = true; |
625 | 625 | $valid_user_data['user_login'] = $user_data['give_user_login']; |
626 | 626 | } |
627 | 627 | |
628 | 628 | // Check if we have an email to verify. |
629 | - if ( give_validate_user_email( $user_data['give_email'], $registering_new_user ) ) { |
|
629 | + if (give_validate_user_email($user_data['give_email'], $registering_new_user)) { |
|
630 | 630 | $valid_user_data['user_email'] = $user_data['give_email']; |
631 | 631 | } |
632 | 632 | |
633 | 633 | // Check password. |
634 | - if ( give_validate_user_password( $user_data['give_user_pass'], $user_data['give_user_pass_confirm'], $registering_new_user ) ) { |
|
634 | + if (give_validate_user_password($user_data['give_user_pass'], $user_data['give_user_pass_confirm'], $registering_new_user)) { |
|
635 | 635 | // All is good to go. |
636 | 636 | $valid_user_data['user_pass'] = $user_data['give_user_pass']; |
637 | 637 | } |
@@ -651,36 +651,36 @@ discard block |
||
651 | 651 | // Start an array to collect valid user data. |
652 | 652 | $valid_user_data = array( |
653 | 653 | // Assume there will be errors. |
654 | - 'user_id' => - 1, |
|
654 | + 'user_id' => -1, |
|
655 | 655 | ); |
656 | 656 | |
657 | 657 | // Username. |
658 | - if ( ! isset( $_POST['give_user_login'] ) || $_POST['give_user_login'] == '' ) { |
|
659 | - give_set_error( 'must_log_in', __( 'You must register or login to complete your donation.', 'give' ) ); |
|
658 | + if ( ! isset($_POST['give_user_login']) || $_POST['give_user_login'] == '') { |
|
659 | + give_set_error('must_log_in', __('You must register or login to complete your donation.', 'give')); |
|
660 | 660 | |
661 | 661 | return $valid_user_data; |
662 | 662 | } |
663 | 663 | |
664 | 664 | // Get the user by login. |
665 | - $user_data = get_user_by( 'login', strip_tags( $_POST['give_user_login'] ) ); |
|
665 | + $user_data = get_user_by('login', strip_tags($_POST['give_user_login'])); |
|
666 | 666 | |
667 | 667 | // Check if user exists. |
668 | - if ( $user_data ) { |
|
668 | + if ($user_data) { |
|
669 | 669 | // Get password. |
670 | - $user_pass = isset( $_POST['give_user_pass'] ) ? $_POST['give_user_pass'] : false; |
|
670 | + $user_pass = isset($_POST['give_user_pass']) ? $_POST['give_user_pass'] : false; |
|
671 | 671 | |
672 | 672 | // Check user_pass. |
673 | - if ( $user_pass ) { |
|
673 | + if ($user_pass) { |
|
674 | 674 | // Check if password is valid. |
675 | - if ( ! wp_check_password( $user_pass, $user_data->user_pass, $user_data->ID ) ) { |
|
675 | + if ( ! wp_check_password($user_pass, $user_data->user_pass, $user_data->ID)) { |
|
676 | 676 | // Incorrect password. |
677 | 677 | give_set_error( |
678 | 678 | 'password_incorrect', |
679 | 679 | sprintf( |
680 | 680 | '%1$s <a href="%2$s">%3$s</a>', |
681 | - __( 'The password you entered is incorrect.', 'give' ), |
|
682 | - wp_lostpassword_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" ), |
|
683 | - __( 'Reset Password', 'give' ) |
|
681 | + __('The password you entered is incorrect.', 'give'), |
|
682 | + wp_lostpassword_url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"), |
|
683 | + __('Reset Password', 'give') |
|
684 | 684 | ) |
685 | 685 | ); |
686 | 686 | // All is correct. |
@@ -697,11 +697,11 @@ discard block |
||
697 | 697 | } |
698 | 698 | } else { |
699 | 699 | // Empty password. |
700 | - give_set_error( 'password_empty', __( 'Enter a password.', 'give' ) ); |
|
700 | + give_set_error('password_empty', __('Enter a password.', 'give')); |
|
701 | 701 | } |
702 | 702 | } else { |
703 | 703 | // No username. |
704 | - give_set_error( 'username_incorrect', __( 'The username you entered does not exist.', 'give' ) ); |
|
704 | + give_set_error('username_incorrect', __('The username you entered does not exist.', 'give')); |
|
705 | 705 | }// End if(). |
706 | 706 | |
707 | 707 | return $valid_user_data; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | */ |
717 | 717 | function give_donation_form_validate_guest_user() { |
718 | 718 | |
719 | - $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : ''; |
|
719 | + $form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : ''; |
|
720 | 720 | |
721 | 721 | // Start an array to collect valid user data. |
722 | 722 | $valid_user_data = array( |
@@ -725,38 +725,38 @@ discard block |
||
725 | 725 | ); |
726 | 726 | |
727 | 727 | // Show error message if user must be logged in. |
728 | - if ( give_logged_in_only( $form_id ) ) { |
|
729 | - give_set_error( 'logged_in_only', __( 'You must be logged in to donate.', 'give' ) ); |
|
728 | + if (give_logged_in_only($form_id)) { |
|
729 | + give_set_error('logged_in_only', __('You must be logged in to donate.', 'give')); |
|
730 | 730 | } |
731 | 731 | |
732 | 732 | // Get the guest email. |
733 | - $guest_email = isset( $_POST['give_email'] ) ? $_POST['give_email'] : false; |
|
733 | + $guest_email = isset($_POST['give_email']) ? $_POST['give_email'] : false; |
|
734 | 734 | |
735 | 735 | // Check email. |
736 | - if ( $guest_email && strlen( $guest_email ) > 0 ) { |
|
736 | + if ($guest_email && strlen($guest_email) > 0) { |
|
737 | 737 | // Validate email. |
738 | - if ( ! is_email( $guest_email ) ) { |
|
738 | + if ( ! is_email($guest_email)) { |
|
739 | 739 | // Invalid email. |
740 | - give_set_error( 'email_invalid', __( 'Invalid email.', 'give' ) ); |
|
740 | + give_set_error('email_invalid', __('Invalid email.', 'give')); |
|
741 | 741 | } else { |
742 | 742 | // All is good to go. |
743 | 743 | $valid_user_data['user_email'] = $guest_email; |
744 | 744 | |
745 | 745 | // Get user_id from donor if exist. |
746 | - $donor = new Give_Donor( $guest_email ); |
|
747 | - if ( $donor->id && $donor->user_id ) { |
|
746 | + $donor = new Give_Donor($guest_email); |
|
747 | + if ($donor->id && $donor->user_id) { |
|
748 | 748 | $valid_user_data['user_id'] = $donor->user_id; |
749 | 749 | } |
750 | 750 | } |
751 | 751 | } else { |
752 | 752 | // No email. |
753 | - give_set_error( 'email_empty', __( 'Enter an email.', 'give' ) ); |
|
753 | + give_set_error('email_empty', __('Enter an email.', 'give')); |
|
754 | 754 | } |
755 | 755 | |
756 | 756 | // Loop through required fields and show error messages. |
757 | - foreach ( give_get_required_fields( $form_id ) as $field_name => $value ) { |
|
758 | - if ( in_array( $value, give_get_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) { |
|
759 | - give_set_error( $value['error_id'], $value['error_message'] ); |
|
757 | + foreach (give_get_required_fields($form_id) as $field_name => $value) { |
|
758 | + if (in_array($value, give_get_required_fields($form_id)) && empty($_POST[$field_name])) { |
|
759 | + give_set_error($value['error_id'], $value['error_message']); |
|
760 | 760 | } |
761 | 761 | } |
762 | 762 | |
@@ -772,36 +772,36 @@ discard block |
||
772 | 772 | * @since 1.0 |
773 | 773 | * @return integer |
774 | 774 | */ |
775 | -function give_register_and_login_new_user( $user_data = array() ) { |
|
775 | +function give_register_and_login_new_user($user_data = array()) { |
|
776 | 776 | // Verify the array. |
777 | - if ( empty( $user_data ) ) { |
|
778 | - return - 1; |
|
777 | + if (empty($user_data)) { |
|
778 | + return -1; |
|
779 | 779 | } |
780 | 780 | |
781 | - if ( give_get_errors() ) { |
|
782 | - return - 1; |
|
781 | + if (give_get_errors()) { |
|
782 | + return -1; |
|
783 | 783 | } |
784 | 784 | |
785 | - $user_args = apply_filters( 'give_insert_user_args', array( |
|
786 | - 'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '', |
|
787 | - 'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '', |
|
788 | - 'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '', |
|
789 | - 'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '', |
|
790 | - 'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '', |
|
791 | - 'user_registered' => date( 'Y-m-d H:i:s' ), |
|
792 | - 'role' => get_option( 'default_role' ), |
|
793 | - ), $user_data ); |
|
785 | + $user_args = apply_filters('give_insert_user_args', array( |
|
786 | + 'user_login' => isset($user_data['user_login']) ? $user_data['user_login'] : '', |
|
787 | + 'user_pass' => isset($user_data['user_pass']) ? $user_data['user_pass'] : '', |
|
788 | + 'user_email' => isset($user_data['user_email']) ? $user_data['user_email'] : '', |
|
789 | + 'first_name' => isset($user_data['user_first']) ? $user_data['user_first'] : '', |
|
790 | + 'last_name' => isset($user_data['user_last']) ? $user_data['user_last'] : '', |
|
791 | + 'user_registered' => date('Y-m-d H:i:s'), |
|
792 | + 'role' => get_option('default_role'), |
|
793 | + ), $user_data); |
|
794 | 794 | |
795 | 795 | // Insert new user. |
796 | - $user_id = wp_insert_user( $user_args ); |
|
796 | + $user_id = wp_insert_user($user_args); |
|
797 | 797 | |
798 | 798 | // Validate inserted user. |
799 | - if ( is_wp_error( $user_id ) ) { |
|
800 | - return - 1; |
|
799 | + if (is_wp_error($user_id)) { |
|
800 | + return -1; |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | // Allow themes and plugins to filter the user data. |
804 | - $user_data = apply_filters( 'give_insert_user_data', $user_data, $user_args ); |
|
804 | + $user_data = apply_filters('give_insert_user_data', $user_data, $user_args); |
|
805 | 805 | |
806 | 806 | /** |
807 | 807 | * Fires after inserting user. |
@@ -811,10 +811,10 @@ discard block |
||
811 | 811 | * @param int $user_id User id. |
812 | 812 | * @param array $user_data Array containing user data. |
813 | 813 | */ |
814 | - do_action( 'give_insert_user', $user_id, $user_data ); |
|
814 | + do_action('give_insert_user', $user_id, $user_data); |
|
815 | 815 | |
816 | 816 | // Login new user. |
817 | - give_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] ); |
|
817 | + give_log_user_in($user_id, $user_data['user_login'], $user_data['user_pass']); |
|
818 | 818 | |
819 | 819 | // Return user id. |
820 | 820 | return $user_id; |
@@ -829,27 +829,27 @@ discard block |
||
829 | 829 | * @since 1.0 |
830 | 830 | * @return array|bool |
831 | 831 | */ |
832 | -function give_get_donation_form_user( $valid_data = array() ) { |
|
832 | +function give_get_donation_form_user($valid_data = array()) { |
|
833 | 833 | |
834 | 834 | // Initialize user. |
835 | 835 | $user = false; |
836 | - $is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; |
|
836 | + $is_ajax = defined('DOING_AJAX') && DOING_AJAX; |
|
837 | 837 | |
838 | - if ( $is_ajax ) { |
|
838 | + if ($is_ajax) { |
|
839 | 839 | // Do not create or login the user during the ajax submission (check for errors only). |
840 | 840 | return true; |
841 | - } elseif ( is_user_logged_in() ) { |
|
841 | + } elseif (is_user_logged_in()) { |
|
842 | 842 | // Set the valid user as the logged in collected data. |
843 | 843 | $user = $valid_data['logged_in_user']; |
844 | - } elseif ( $valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true ) { |
|
844 | + } elseif ($valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true) { |
|
845 | 845 | // New user registration. |
846 | - if ( $valid_data['need_new_user'] === true ) { |
|
846 | + if ($valid_data['need_new_user'] === true) { |
|
847 | 847 | // Set user. |
848 | 848 | $user = $valid_data['new_user_data']; |
849 | 849 | // Register and login new user. |
850 | - $user['user_id'] = give_register_and_login_new_user( $user ); |
|
850 | + $user['user_id'] = give_register_and_login_new_user($user); |
|
851 | 851 | // User login |
852 | - } elseif ( $valid_data['need_user_login'] === true && ! $is_ajax ) { |
|
852 | + } elseif ($valid_data['need_user_login'] === true && ! $is_ajax) { |
|
853 | 853 | |
854 | 854 | /** |
855 | 855 | * The login form is now processed in the give_process_donation_login() function. |
@@ -861,48 +861,48 @@ discard block |
||
861 | 861 | // Set user. |
862 | 862 | $user = $valid_data['login_user_data']; |
863 | 863 | // Login user. |
864 | - give_log_user_in( $user['user_id'], $user['user_login'], $user['user_pass'] ); |
|
864 | + give_log_user_in($user['user_id'], $user['user_login'], $user['user_pass']); |
|
865 | 865 | } |
866 | 866 | } |
867 | 867 | |
868 | 868 | // Check guest checkout. |
869 | - if ( false === $user && false === give_logged_in_only( $_POST['give-form-id'] ) ) { |
|
869 | + if (false === $user && false === give_logged_in_only($_POST['give-form-id'])) { |
|
870 | 870 | // Set user |
871 | 871 | $user = $valid_data['guest_user_data']; |
872 | 872 | } |
873 | 873 | |
874 | 874 | // Verify we have an user. |
875 | - if ( false === $user || empty( $user ) ) { |
|
875 | + if (false === $user || empty($user)) { |
|
876 | 876 | // Return false. |
877 | 877 | return false; |
878 | 878 | } |
879 | 879 | |
880 | 880 | // Get user first name. |
881 | - if ( ! isset( $user['user_first'] ) || strlen( trim( $user['user_first'] ) ) < 1 ) { |
|
882 | - $user['user_first'] = isset( $_POST['give_first'] ) ? strip_tags( trim( $_POST['give_first'] ) ) : ''; |
|
881 | + if ( ! isset($user['user_first']) || strlen(trim($user['user_first'])) < 1) { |
|
882 | + $user['user_first'] = isset($_POST['give_first']) ? strip_tags(trim($_POST['give_first'])) : ''; |
|
883 | 883 | } |
884 | 884 | |
885 | 885 | // Get user last name. |
886 | - if ( ! isset( $user['user_last'] ) || strlen( trim( $user['user_last'] ) ) < 1 ) { |
|
887 | - $user['user_last'] = isset( $_POST['give_last'] ) ? strip_tags( trim( $_POST['give_last'] ) ) : ''; |
|
886 | + if ( ! isset($user['user_last']) || strlen(trim($user['user_last'])) < 1) { |
|
887 | + $user['user_last'] = isset($_POST['give_last']) ? strip_tags(trim($_POST['give_last'])) : ''; |
|
888 | 888 | } |
889 | 889 | |
890 | 890 | // Get the user's billing address details. |
891 | 891 | $user['address'] = array(); |
892 | - $user['address']['line1'] = ! empty( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : false; |
|
893 | - $user['address']['line2'] = ! empty( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : false; |
|
894 | - $user['address']['city'] = ! empty( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : false; |
|
895 | - $user['address']['state'] = ! empty( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : false; |
|
896 | - $user['address']['country'] = ! empty( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : false; |
|
897 | - $user['address']['zip'] = ! empty( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : false; |
|
898 | - |
|
899 | - if ( empty( $user['address']['country'] ) ) { |
|
892 | + $user['address']['line1'] = ! empty($_POST['card_address']) ? sanitize_text_field($_POST['card_address']) : false; |
|
893 | + $user['address']['line2'] = ! empty($_POST['card_address_2']) ? sanitize_text_field($_POST['card_address_2']) : false; |
|
894 | + $user['address']['city'] = ! empty($_POST['card_city']) ? sanitize_text_field($_POST['card_city']) : false; |
|
895 | + $user['address']['state'] = ! empty($_POST['card_state']) ? sanitize_text_field($_POST['card_state']) : false; |
|
896 | + $user['address']['country'] = ! empty($_POST['billing_country']) ? sanitize_text_field($_POST['billing_country']) : false; |
|
897 | + $user['address']['zip'] = ! empty($_POST['card_zip']) ? sanitize_text_field($_POST['card_zip']) : false; |
|
898 | + |
|
899 | + if (empty($user['address']['country'])) { |
|
900 | 900 | $user['address'] = false; |
901 | 901 | } // End if(). |
902 | 902 | |
903 | - if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $user['address'] ) ) { |
|
903 | + if ( ! empty($user['user_id']) && $user['user_id'] > 0 && ! empty($user['address'])) { |
|
904 | 904 | // Store the address in the user's meta so the donation form can be pre-populated with it on return donation. |
905 | - update_user_meta( $user['user_id'], '_give_user_address', $user['address'] ); |
|
905 | + update_user_meta($user['user_id'], '_give_user_address', $user['address']); |
|
906 | 906 | } |
907 | 907 | |
908 | 908 | // Return valid user. |
@@ -921,16 +921,16 @@ discard block |
||
921 | 921 | $card_data = give_get_donation_cc_info(); |
922 | 922 | |
923 | 923 | // Validate the card zip. |
924 | - if ( ! empty( $card_data['card_zip'] ) ) { |
|
925 | - if ( ! give_donation_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) { |
|
926 | - give_set_error( 'invalid_cc_zip', __( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) ); |
|
924 | + if ( ! empty($card_data['card_zip'])) { |
|
925 | + if ( ! give_donation_form_validate_cc_zip($card_data['card_zip'], $card_data['card_country'])) { |
|
926 | + give_set_error('invalid_cc_zip', __('The zip / postal code you entered for your billing address is invalid.', 'give')); |
|
927 | 927 | } |
928 | 928 | } |
929 | 929 | |
930 | 930 | // Ensure no spaces. |
931 | - if ( ! empty( $card_data['card_number'] ) ) { |
|
932 | - $card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); // no "+" signs |
|
933 | - $card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces |
|
931 | + if ( ! empty($card_data['card_number'])) { |
|
932 | + $card_data['card_number'] = str_replace('+', '', $card_data['card_number']); // no "+" signs |
|
933 | + $card_data['card_number'] = str_replace(' ', '', $card_data['card_number']); // No spaces |
|
934 | 934 | } |
935 | 935 | |
936 | 936 | // This should validate card numbers at some point too. |
@@ -947,17 +947,17 @@ discard block |
||
947 | 947 | function give_get_donation_cc_info() { |
948 | 948 | |
949 | 949 | $cc_info = array(); |
950 | - $cc_info['card_name'] = isset( $_POST['card_name'] ) ? sanitize_text_field( $_POST['card_name'] ) : ''; |
|
951 | - $cc_info['card_number'] = isset( $_POST['card_number'] ) ? sanitize_text_field( $_POST['card_number'] ) : ''; |
|
952 | - $cc_info['card_cvc'] = isset( $_POST['card_cvc'] ) ? sanitize_text_field( $_POST['card_cvc'] ) : ''; |
|
953 | - $cc_info['card_exp_month'] = isset( $_POST['card_exp_month'] ) ? sanitize_text_field( $_POST['card_exp_month'] ) : ''; |
|
954 | - $cc_info['card_exp_year'] = isset( $_POST['card_exp_year'] ) ? sanitize_text_field( $_POST['card_exp_year'] ) : ''; |
|
955 | - $cc_info['card_address'] = isset( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : ''; |
|
956 | - $cc_info['card_address_2'] = isset( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : ''; |
|
957 | - $cc_info['card_city'] = isset( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : ''; |
|
958 | - $cc_info['card_state'] = isset( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : ''; |
|
959 | - $cc_info['card_country'] = isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : ''; |
|
960 | - $cc_info['card_zip'] = isset( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : ''; |
|
950 | + $cc_info['card_name'] = isset($_POST['card_name']) ? sanitize_text_field($_POST['card_name']) : ''; |
|
951 | + $cc_info['card_number'] = isset($_POST['card_number']) ? sanitize_text_field($_POST['card_number']) : ''; |
|
952 | + $cc_info['card_cvc'] = isset($_POST['card_cvc']) ? sanitize_text_field($_POST['card_cvc']) : ''; |
|
953 | + $cc_info['card_exp_month'] = isset($_POST['card_exp_month']) ? sanitize_text_field($_POST['card_exp_month']) : ''; |
|
954 | + $cc_info['card_exp_year'] = isset($_POST['card_exp_year']) ? sanitize_text_field($_POST['card_exp_year']) : ''; |
|
955 | + $cc_info['card_address'] = isset($_POST['card_address']) ? sanitize_text_field($_POST['card_address']) : ''; |
|
956 | + $cc_info['card_address_2'] = isset($_POST['card_address_2']) ? sanitize_text_field($_POST['card_address_2']) : ''; |
|
957 | + $cc_info['card_city'] = isset($_POST['card_city']) ? sanitize_text_field($_POST['card_city']) : ''; |
|
958 | + $cc_info['card_state'] = isset($_POST['card_state']) ? sanitize_text_field($_POST['card_state']) : ''; |
|
959 | + $cc_info['card_country'] = isset($_POST['billing_country']) ? sanitize_text_field($_POST['billing_country']) : ''; |
|
960 | + $cc_info['card_zip'] = isset($_POST['card_zip']) ? sanitize_text_field($_POST['card_zip']) : ''; |
|
961 | 961 | |
962 | 962 | // Return cc info. |
963 | 963 | return $cc_info; |
@@ -973,14 +973,14 @@ discard block |
||
973 | 973 | * |
974 | 974 | * @return bool|mixed |
975 | 975 | */ |
976 | -function give_donation_form_validate_cc_zip( $zip = 0, $country_code = '' ) { |
|
976 | +function give_donation_form_validate_cc_zip($zip = 0, $country_code = '') { |
|
977 | 977 | $ret = false; |
978 | 978 | |
979 | - if ( empty( $zip ) || empty( $country_code ) ) { |
|
979 | + if (empty($zip) || empty($country_code)) { |
|
980 | 980 | return $ret; |
981 | 981 | } |
982 | 982 | |
983 | - $country_code = strtoupper( $country_code ); |
|
983 | + $country_code = strtoupper($country_code); |
|
984 | 984 | |
985 | 985 | $zip_regex = array( |
986 | 986 | 'AD' => 'AD\d{3}', |
@@ -1140,11 +1140,11 @@ discard block |
||
1140 | 1140 | 'ZM' => '\d{5}', |
1141 | 1141 | ); |
1142 | 1142 | |
1143 | - if ( ! isset( $zip_regex[ $country_code ] ) || preg_match( '/' . $zip_regex[ $country_code ] . '/i', $zip ) ) { |
|
1143 | + if ( ! isset($zip_regex[$country_code]) || preg_match('/'.$zip_regex[$country_code].'/i', $zip)) { |
|
1144 | 1144 | $ret = true; |
1145 | 1145 | } |
1146 | 1146 | |
1147 | - return apply_filters( 'give_is_zip_valid', $ret, $zip, $country_code ); |
|
1147 | + return apply_filters('give_is_zip_valid', $ret, $zip, $country_code); |
|
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | |
@@ -1158,36 +1158,36 @@ discard block |
||
1158 | 1158 | * |
1159 | 1159 | * @return bool |
1160 | 1160 | */ |
1161 | -function give_validate_multi_donation_form_level( $valid_data, $data ) { |
|
1161 | +function give_validate_multi_donation_form_level($valid_data, $data) { |
|
1162 | 1162 | /* @var Give_Donate_Form $form */ |
1163 | - $form = new Give_Donate_Form( $data['give-form-id'] ); |
|
1163 | + $form = new Give_Donate_Form($data['give-form-id']); |
|
1164 | 1164 | |
1165 | 1165 | $donation_level_matched = false; |
1166 | 1166 | |
1167 | - if ( $form->is_multi_type_donation_form() ) { |
|
1167 | + if ($form->is_multi_type_donation_form()) { |
|
1168 | 1168 | |
1169 | 1169 | // Bailout. |
1170 | - if ( ! ( $variable_prices = $form->get_prices() ) ) { |
|
1170 | + if ( ! ($variable_prices = $form->get_prices())) { |
|
1171 | 1171 | return false; |
1172 | 1172 | } |
1173 | 1173 | |
1174 | 1174 | // Sanitize donation amount. |
1175 | - $data['give-amount'] = give_sanitize_amount( $data['give-amount'] ); |
|
1175 | + $data['give-amount'] = give_sanitize_amount($data['give-amount']); |
|
1176 | 1176 | |
1177 | 1177 | // Get number of decimals. |
1178 | 1178 | $default_decimals = give_get_price_decimals(); |
1179 | 1179 | |
1180 | - if ( $data['give-amount'] === give_sanitize_amount( give_get_price_option_amount( $data['give-form-id'], $data['give-price-id'] ), $default_decimals ) ) { |
|
1180 | + if ($data['give-amount'] === give_sanitize_amount(give_get_price_option_amount($data['give-form-id'], $data['give-price-id']), $default_decimals)) { |
|
1181 | 1181 | return true; |
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | // Find correct donation level from all donation levels. |
1185 | - foreach ( $variable_prices as $variable_price ) { |
|
1185 | + foreach ($variable_prices as $variable_price) { |
|
1186 | 1186 | // Sanitize level amount. |
1187 | - $variable_price['_give_amount'] = give_sanitize_amount( $variable_price['_give_amount'], $default_decimals ); |
|
1187 | + $variable_price['_give_amount'] = give_sanitize_amount($variable_price['_give_amount'], $default_decimals); |
|
1188 | 1188 | |
1189 | 1189 | // Set first match donation level ID. |
1190 | - if ( $data['give-amount'] === $variable_price['_give_amount'] ) { |
|
1190 | + if ($data['give-amount'] === $variable_price['_give_amount']) { |
|
1191 | 1191 | $_POST['give-price-id'] = $variable_price['_give_id']['level_id']; |
1192 | 1192 | $donation_level_matched = true; |
1193 | 1193 | break; |
@@ -1198,19 +1198,19 @@ discard block |
||
1198 | 1198 | // If yes then set price id to custom if amount is greater then custom minimum amount (if any). |
1199 | 1199 | if ( |
1200 | 1200 | ! $donation_level_matched |
1201 | - && ( give_is_setting_enabled( give_get_meta( $data['give-form-id'], '_give_custom_amount', true ) ) ) |
|
1201 | + && (give_is_setting_enabled(give_get_meta($data['give-form-id'], '_give_custom_amount', true))) |
|
1202 | 1202 | ) { |
1203 | 1203 | // Sanitize custom minimum amount. |
1204 | - $custom_minimum_amount = give_sanitize_amount( give_get_meta( $data['give-form-id'], '_give_custom_amount_minimum', true ), $default_decimals ); |
|
1204 | + $custom_minimum_amount = give_sanitize_amount(give_get_meta($data['give-form-id'], '_give_custom_amount_minimum', true), $default_decimals); |
|
1205 | 1205 | |
1206 | - if ( $data['give-amount'] >= $custom_minimum_amount ) { |
|
1206 | + if ($data['give-amount'] >= $custom_minimum_amount) { |
|
1207 | 1207 | $_POST['give-price-id'] = 'custom'; |
1208 | 1208 | $donation_level_matched = true; |
1209 | 1209 | } |
1210 | 1210 | } |
1211 | 1211 | }// End if(). |
1212 | 1212 | |
1213 | - return ( $donation_level_matched ? true : false ); |
|
1213 | + return ($donation_level_matched ? true : false); |
|
1214 | 1214 | } |
1215 | 1215 | |
1216 | -add_action( 'give_checkout_error_checks', 'give_validate_multi_donation_form_level', 10, 2 ); |
|
1216 | +add_action('give_checkout_error_checks', 'give_validate_multi_donation_form_level', 10, 2); |
@@ -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 | |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @param $args array The array of arguments that can be passed in and used for setting up this payment query. |
57 | 57 | */ |
58 | - public function __construct( $args = array() ) { |
|
58 | + public function __construct($args = array()) { |
|
59 | 59 | $defaults = array( |
60 | 60 | 'output' => 'payments', |
61 | - 'post_type' => array( 'give_payment' ), |
|
61 | + 'post_type' => array('give_payment'), |
|
62 | 62 | 'start_date' => false, |
63 | 63 | 'end_date' => false, |
64 | 64 | 'number' => 20, |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'give_forms' => null, |
80 | 80 | ); |
81 | 81 | |
82 | - $this->args = wp_parse_args( $args, $defaults ); |
|
82 | + $this->args = wp_parse_args($args, $defaults); |
|
83 | 83 | |
84 | 84 | $this->init(); |
85 | 85 | } |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | * @param $query_var |
94 | 94 | * @param $value |
95 | 95 | */ |
96 | - public function __set( $query_var, $value ) { |
|
97 | - if ( in_array( $query_var, array( 'meta_query', 'tax_query' ) ) ) { |
|
98 | - $this->args[ $query_var ][] = $value; |
|
96 | + public function __set($query_var, $value) { |
|
97 | + if (in_array($query_var, array('meta_query', 'tax_query'))) { |
|
98 | + $this->args[$query_var][] = $value; |
|
99 | 99 | } else { |
100 | - $this->args[ $query_var ] = $value; |
|
100 | + $this->args[$query_var] = $value; |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @param $query_var |
111 | 111 | */ |
112 | - public function __unset( $query_var ) { |
|
113 | - unset( $this->args[ $query_var ] ); |
|
112 | + public function __unset($query_var) { |
|
113 | + unset($this->args[$query_var]); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $this->children(); |
146 | 146 | $this->give_forms(); |
147 | 147 | |
148 | - add_filter( 'posts_orderby', array( $this, 'custom_orderby' ), 10, 2 ); |
|
148 | + add_filter('posts_orderby', array($this, 'custom_orderby'), 10, 2); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | private function unset_filters() { |
158 | 158 | $this->date_filter_post(); |
159 | - remove_filter( 'posts_orderby', array( $this, 'custom_orderby' ) ); |
|
159 | + remove_filter('posts_orderby', array($this, 'custom_orderby')); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -183,27 +183,27 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @param Give_Payments_Query $this Payments query object. |
185 | 185 | */ |
186 | - do_action( 'give_pre_get_payments', $this ); |
|
186 | + do_action('give_pre_get_payments', $this); |
|
187 | 187 | |
188 | - $query = new WP_Query( $this->args ); |
|
188 | + $query = new WP_Query($this->args); |
|
189 | 189 | |
190 | 190 | $custom_output = array( |
191 | 191 | 'payments', |
192 | 192 | 'give_payments', |
193 | 193 | ); |
194 | 194 | |
195 | - if ( ! in_array( $this->args['output'], $custom_output ) ) { |
|
195 | + if ( ! in_array($this->args['output'], $custom_output)) { |
|
196 | 196 | return $query->posts; |
197 | 197 | } |
198 | 198 | |
199 | - if ( $query->have_posts() ) { |
|
200 | - while ( $query->have_posts() ) { |
|
199 | + if ($query->have_posts()) { |
|
200 | + while ($query->have_posts()) { |
|
201 | 201 | $query->the_post(); |
202 | 202 | |
203 | 203 | $payment_id = get_post()->ID; |
204 | - $payment = new Give_Payment( $payment_id ); |
|
204 | + $payment = new Give_Payment($payment_id); |
|
205 | 205 | |
206 | - $this->payments[] = apply_filters( 'give_payment', $payment, $payment_id, $this ); |
|
206 | + $this->payments[] = apply_filters('give_payment', $payment, $payment_id, $this); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | wp_reset_postdata(); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * |
221 | 221 | * @param Give_Payments_Query $this Payments query object. |
222 | 222 | */ |
223 | - do_action( 'give_post_get_payments', $this ); |
|
223 | + do_action('give_post_get_payments', $this); |
|
224 | 224 | |
225 | 225 | return $this->payments; |
226 | 226 | } |
@@ -234,13 +234,13 @@ discard block |
||
234 | 234 | * @return void |
235 | 235 | */ |
236 | 236 | public function date_filter_pre() { |
237 | - if ( ! ( $this->args['start_date'] || $this->args['end_date'] ) ) { |
|
237 | + if ( ! ($this->args['start_date'] || $this->args['end_date'])) { |
|
238 | 238 | return; |
239 | 239 | } |
240 | 240 | |
241 | - $this->setup_dates( $this->args['start_date'], $this->args['end_date'] ); |
|
241 | + $this->setup_dates($this->args['start_date'], $this->args['end_date']); |
|
242 | 242 | |
243 | - add_filter( 'posts_where', array( $this, 'payments_where' ) ); |
|
243 | + add_filter('posts_where', array($this, 'payments_where')); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | * @return void |
254 | 254 | */ |
255 | 255 | public function date_filter_post() { |
256 | - if ( ! ( $this->args['start_date'] || $this->args['end_date'] ) ) { |
|
256 | + if ( ! ($this->args['start_date'] || $this->args['end_date'])) { |
|
257 | 257 | return; |
258 | 258 | } |
259 | 259 | |
260 | - remove_filter( 'posts_where', array( $this, 'payments_where' ) ); |
|
260 | + remove_filter('posts_where', array($this, 'payments_where')); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -269,12 +269,12 @@ discard block |
||
269 | 269 | * @return void |
270 | 270 | */ |
271 | 271 | public function status() { |
272 | - if ( ! isset ( $this->args['status'] ) ) { |
|
272 | + if ( ! isset ($this->args['status'])) { |
|
273 | 273 | return; |
274 | 274 | } |
275 | 275 | |
276 | - $this->__set( 'post_status', $this->args['status'] ); |
|
277 | - $this->__unset( 'status' ); |
|
276 | + $this->__set('post_status', $this->args['status']); |
|
277 | + $this->__unset('status'); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
@@ -286,12 +286,12 @@ discard block |
||
286 | 286 | * @return void |
287 | 287 | */ |
288 | 288 | public function page() { |
289 | - if ( ! isset ( $this->args['page'] ) ) { |
|
289 | + if ( ! isset ($this->args['page'])) { |
|
290 | 290 | return; |
291 | 291 | } |
292 | 292 | |
293 | - $this->__set( 'paged', $this->args['page'] ); |
|
294 | - $this->__unset( 'page' ); |
|
293 | + $this->__set('paged', $this->args['page']); |
|
294 | + $this->__unset('page'); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -304,17 +304,17 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function per_page() { |
306 | 306 | |
307 | - if ( ! isset( $this->args['number'] ) ) { |
|
307 | + if ( ! isset($this->args['number'])) { |
|
308 | 308 | return; |
309 | 309 | } |
310 | 310 | |
311 | - if ( $this->args['number'] == - 1 ) { |
|
312 | - $this->__set( 'nopaging', true ); |
|
311 | + if ($this->args['number'] == - 1) { |
|
312 | + $this->__set('nopaging', true); |
|
313 | 313 | } else { |
314 | - $this->__set( 'posts_per_page', $this->args['number'] ); |
|
314 | + $this->__set('posts_per_page', $this->args['number']); |
|
315 | 315 | } |
316 | 316 | |
317 | - $this->__unset( 'number' ); |
|
317 | + $this->__unset('number'); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | /** |
@@ -326,12 +326,12 @@ discard block |
||
326 | 326 | * @return void |
327 | 327 | */ |
328 | 328 | public function month() { |
329 | - if ( ! isset ( $this->args['month'] ) ) { |
|
329 | + if ( ! isset ($this->args['month'])) { |
|
330 | 330 | return; |
331 | 331 | } |
332 | 332 | |
333 | - $this->__set( 'monthnum', $this->args['month'] ); |
|
334 | - $this->__unset( 'month' ); |
|
333 | + $this->__set('monthnum', $this->args['month']); |
|
334 | + $this->__unset('month'); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -343,23 +343,23 @@ discard block |
||
343 | 343 | * @return void |
344 | 344 | */ |
345 | 345 | public function orderby() { |
346 | - switch ( $this->args['orderby'] ) { |
|
346 | + switch ($this->args['orderby']) { |
|
347 | 347 | case 'amount' : |
348 | - $this->__set( 'orderby', 'meta_value_num' ); |
|
349 | - $this->__set( 'meta_key', '_give_payment_total' ); |
|
348 | + $this->__set('orderby', 'meta_value_num'); |
|
349 | + $this->__set('meta_key', '_give_payment_total'); |
|
350 | 350 | break; |
351 | 351 | |
352 | 352 | case 'status' : |
353 | - $this->__set( 'orderby', 'post_status' ); |
|
353 | + $this->__set('orderby', 'post_status'); |
|
354 | 354 | break; |
355 | 355 | |
356 | 356 | case 'donation_form' : |
357 | - $this->__set( 'orderby', 'meta_value' ); |
|
358 | - $this->__set( 'meta_key', '_give_payment_form_title' ); |
|
357 | + $this->__set('orderby', 'meta_value'); |
|
358 | + $this->__set('meta_key', '_give_payment_form_title'); |
|
359 | 359 | break; |
360 | 360 | |
361 | 361 | default : |
362 | - $this->__set( 'orderby', $this->args['orderby'] ); |
|
362 | + $this->__set('orderby', $this->args['orderby']); |
|
363 | 363 | break; |
364 | 364 | } |
365 | 365 | } |
@@ -376,17 +376,17 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @return mixed |
378 | 378 | */ |
379 | - public function custom_orderby( $order, $query ) { |
|
379 | + public function custom_orderby($order, $query) { |
|
380 | 380 | global $wpdb; |
381 | 381 | |
382 | - $post_types = is_array( $query->query['post_type'] ) ? $query->query['post_type'] : array( $query->query['post_type'] ); |
|
383 | - if ( ! in_array( 'give_payment', $post_types ) || is_array( $query->query['orderby'] ) ) { |
|
382 | + $post_types = is_array($query->query['post_type']) ? $query->query['post_type'] : array($query->query['post_type']); |
|
383 | + if ( ! in_array('give_payment', $post_types) || is_array($query->query['orderby'])) { |
|
384 | 384 | return $order; |
385 | 385 | } |
386 | 386 | |
387 | - switch ( $query->query['orderby'] ) { |
|
387 | + switch ($query->query['orderby']) { |
|
388 | 388 | case 'post_status': |
389 | - $order = $wpdb->posts .'.post_status ' . strtoupper( $query->query['order'] ); |
|
389 | + $order = $wpdb->posts.'.post_status '.strtoupper($query->query['order']); |
|
390 | 390 | break; |
391 | 391 | } |
392 | 392 | |
@@ -402,20 +402,20 @@ discard block |
||
402 | 402 | * @return void |
403 | 403 | */ |
404 | 404 | public function user() { |
405 | - if ( is_null( $this->args['user'] ) ) { |
|
405 | + if (is_null($this->args['user'])) { |
|
406 | 406 | return; |
407 | 407 | } |
408 | 408 | |
409 | - if ( is_numeric( $this->args['user'] ) ) { |
|
409 | + if (is_numeric($this->args['user'])) { |
|
410 | 410 | $user_key = '_give_payment_user_id'; |
411 | 411 | } else { |
412 | 412 | $user_key = '_give_payment_user_email'; |
413 | 413 | } |
414 | 414 | |
415 | - $this->__set( 'meta_query', array( |
|
415 | + $this->__set('meta_query', array( |
|
416 | 416 | 'key' => $user_key, |
417 | 417 | 'value' => $this->args['user'], |
418 | - ) ); |
|
418 | + )); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
@@ -426,14 +426,14 @@ discard block |
||
426 | 426 | * @return void |
427 | 427 | */ |
428 | 428 | public function donor() { |
429 | - if ( is_null( $this->args['donor'] ) || ! is_numeric( $this->args['donor'] ) ) { |
|
429 | + if (is_null($this->args['donor']) || ! is_numeric($this->args['donor'])) { |
|
430 | 430 | return; |
431 | 431 | } |
432 | 432 | |
433 | - $this->__set( 'meta_query', array( |
|
433 | + $this->__set('meta_query', array( |
|
434 | 434 | 'key' => '_give_payment_customer_id', |
435 | 435 | 'value' => (int) $this->args['donor'], |
436 | - ) ); |
|
436 | + )); |
|
437 | 437 | } |
438 | 438 | |
439 | 439 | /** |
@@ -446,33 +446,33 @@ discard block |
||
446 | 446 | */ |
447 | 447 | public function search() { |
448 | 448 | |
449 | - if ( ! isset( $this->args['s'] ) ) { |
|
449 | + if ( ! isset($this->args['s'])) { |
|
450 | 450 | return; |
451 | 451 | } |
452 | 452 | |
453 | - $search = trim( $this->args['s'] ); |
|
453 | + $search = trim($this->args['s']); |
|
454 | 454 | |
455 | - if ( empty( $search ) ) { |
|
455 | + if (empty($search)) { |
|
456 | 456 | return; |
457 | 457 | } |
458 | 458 | |
459 | - $is_email = is_email( $search ) || strpos( $search, '@' ) !== false; |
|
460 | - $is_user = strpos( $search, strtolower( 'user:' ) ) !== false; |
|
459 | + $is_email = is_email($search) || strpos($search, '@') !== false; |
|
460 | + $is_user = strpos($search, strtolower('user:')) !== false; |
|
461 | 461 | |
462 | - if ( ! empty( $this->args['search_in_notes'] ) ) { |
|
462 | + if ( ! empty($this->args['search_in_notes'])) { |
|
463 | 463 | |
464 | - $notes = give_get_payment_notes( 0, $search ); |
|
464 | + $notes = give_get_payment_notes(0, $search); |
|
465 | 465 | |
466 | - if ( ! empty( $notes ) ) { |
|
466 | + if ( ! empty($notes)) { |
|
467 | 467 | |
468 | - $payment_ids = wp_list_pluck( (array) $notes, 'comment_post_ID' ); |
|
468 | + $payment_ids = wp_list_pluck((array) $notes, 'comment_post_ID'); |
|
469 | 469 | |
470 | - $this->__set( 'post__in', $payment_ids ); |
|
470 | + $this->__set('post__in', $payment_ids); |
|
471 | 471 | } |
472 | 472 | |
473 | - $this->__unset( 's' ); |
|
473 | + $this->__unset('s'); |
|
474 | 474 | |
475 | - } elseif ( $is_email || strlen( $search ) == 32 ) { |
|
475 | + } elseif ($is_email || strlen($search) == 32) { |
|
476 | 476 | |
477 | 477 | $key = $is_email ? '_give_payment_user_email' : '_give_payment_purchase_key'; |
478 | 478 | $search_meta = array( |
@@ -481,19 +481,19 @@ discard block |
||
481 | 481 | 'compare' => 'LIKE', |
482 | 482 | ); |
483 | 483 | |
484 | - $this->__set( 'meta_query', $search_meta ); |
|
485 | - $this->__unset( 's' ); |
|
484 | + $this->__set('meta_query', $search_meta); |
|
485 | + $this->__unset('s'); |
|
486 | 486 | |
487 | - } elseif ( $is_user ) { |
|
487 | + } elseif ($is_user) { |
|
488 | 488 | |
489 | 489 | $search_meta = array( |
490 | 490 | 'key' => '_give_payment_user_id', |
491 | - 'value' => trim( str_replace( 'user:', '', strtolower( $search ) ) ), |
|
491 | + 'value' => trim(str_replace('user:', '', strtolower($search))), |
|
492 | 492 | ); |
493 | 493 | |
494 | - $this->__set( 'meta_query', $search_meta ); |
|
494 | + $this->__set('meta_query', $search_meta); |
|
495 | 495 | |
496 | - if ( give_get_option( 'enable_sequential' ) ) { |
|
496 | + if (give_get_option('enable_sequential')) { |
|
497 | 497 | |
498 | 498 | $search_meta = array( |
499 | 499 | 'key' => '_give_payment_number', |
@@ -501,19 +501,19 @@ discard block |
||
501 | 501 | 'compare' => 'LIKE', |
502 | 502 | ); |
503 | 503 | |
504 | - $this->__set( 'meta_query', $search_meta ); |
|
504 | + $this->__set('meta_query', $search_meta); |
|
505 | 505 | |
506 | 506 | $this->args['meta_query']['relation'] = 'OR'; |
507 | 507 | |
508 | 508 | } |
509 | 509 | |
510 | - $this->__unset( 's' ); |
|
510 | + $this->__unset('s'); |
|
511 | 511 | |
512 | 512 | } elseif ( |
513 | - give_get_option( 'enable_sequential' ) && |
|
513 | + give_get_option('enable_sequential') && |
|
514 | 514 | ( |
515 | - false !== strpos( $search, give_get_option( 'sequential_prefix' ) ) || |
|
516 | - false !== strpos( $search, give_get_option( 'sequential_postfix' ) ) |
|
515 | + false !== strpos($search, give_get_option('sequential_prefix')) || |
|
516 | + false !== strpos($search, give_get_option('sequential_postfix')) |
|
517 | 517 | ) |
518 | 518 | ) { |
519 | 519 | |
@@ -523,29 +523,29 @@ discard block |
||
523 | 523 | 'compare' => 'LIKE', |
524 | 524 | ); |
525 | 525 | |
526 | - $this->__set( 'meta_query', $search_meta ); |
|
527 | - $this->__unset( 's' ); |
|
526 | + $this->__set('meta_query', $search_meta); |
|
527 | + $this->__unset('s'); |
|
528 | 528 | |
529 | - } elseif ( is_numeric( $search ) ) { |
|
529 | + } elseif (is_numeric($search)) { |
|
530 | 530 | |
531 | - $post = get_post( $search ); |
|
531 | + $post = get_post($search); |
|
532 | 532 | |
533 | - if ( is_object( $post ) && $post->post_type == 'give_payment' ) { |
|
533 | + if (is_object($post) && $post->post_type == 'give_payment') { |
|
534 | 534 | |
535 | 535 | $arr = array(); |
536 | 536 | $arr[] = $search; |
537 | - $this->__set( 'post__in', $arr ); |
|
538 | - $this->__unset( 's' ); |
|
537 | + $this->__set('post__in', $arr); |
|
538 | + $this->__unset('s'); |
|
539 | 539 | } |
540 | - } elseif ( '#' == substr( $search, 0, 1 ) ) { |
|
540 | + } elseif ('#' == substr($search, 0, 1)) { |
|
541 | 541 | |
542 | - $search = str_replace( '#:', '', $search ); |
|
543 | - $search = str_replace( '#', '', $search ); |
|
544 | - $this->__set( 'give_forms', $search ); |
|
545 | - $this->__unset( 's' ); |
|
542 | + $search = str_replace('#:', '', $search); |
|
543 | + $search = str_replace('#', '', $search); |
|
544 | + $this->__set('give_forms', $search); |
|
545 | + $this->__unset('s'); |
|
546 | 546 | |
547 | 547 | } else { |
548 | - $this->__set( 's', $search ); |
|
548 | + $this->__set('s', $search); |
|
549 | 549 | |
550 | 550 | } |
551 | 551 | |
@@ -560,16 +560,16 @@ discard block |
||
560 | 560 | * @return void |
561 | 561 | */ |
562 | 562 | public function mode() { |
563 | - if ( empty( $this->args['mode'] ) || $this->args['mode'] == 'all' ) { |
|
564 | - $this->__unset( 'mode' ); |
|
563 | + if (empty($this->args['mode']) || $this->args['mode'] == 'all') { |
|
564 | + $this->__unset('mode'); |
|
565 | 565 | |
566 | 566 | return; |
567 | 567 | } |
568 | 568 | |
569 | - $this->__set( 'meta_query', array( |
|
569 | + $this->__set('meta_query', array( |
|
570 | 570 | 'key' => '_give_payment_mode', |
571 | 571 | 'value' => $this->args['mode'], |
572 | - ) ); |
|
572 | + )); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | /** |
@@ -581,10 +581,10 @@ discard block |
||
581 | 581 | * @return void |
582 | 582 | */ |
583 | 583 | public function children() { |
584 | - if ( empty( $this->args['children'] ) ) { |
|
585 | - $this->__set( 'post_parent', 0 ); |
|
584 | + if (empty($this->args['children'])) { |
|
585 | + $this->__set('post_parent', 0); |
|
586 | 586 | } |
587 | - $this->__unset( 'children' ); |
|
587 | + $this->__unset('children'); |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
@@ -597,25 +597,25 @@ discard block |
||
597 | 597 | */ |
598 | 598 | public function give_forms() { |
599 | 599 | |
600 | - if ( empty( $this->args['give_forms'] ) ) { |
|
600 | + if (empty($this->args['give_forms'])) { |
|
601 | 601 | return; |
602 | 602 | } |
603 | 603 | |
604 | 604 | $compare = '='; |
605 | 605 | |
606 | - if ( is_array( $this->args['give_forms'] ) ) { |
|
606 | + if (is_array($this->args['give_forms'])) { |
|
607 | 607 | $compare = 'IN'; |
608 | 608 | } |
609 | 609 | |
610 | - $this->__set( 'meta_query', array( |
|
610 | + $this->__set('meta_query', array( |
|
611 | 611 | array( |
612 | 612 | 'key' => '_give_payment_form_id', |
613 | 613 | 'value' => $this->args['give_forms'], |
614 | 614 | 'compare' => $compare, |
615 | 615 | ), |
616 | - ) ); |
|
616 | + )); |
|
617 | 617 | |
618 | - $this->__unset( 'give_forms' ); |
|
618 | + $this->__unset('give_forms'); |
|
619 | 619 | |
620 | 620 | } |
621 | 621 |
@@ -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 | |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return bool $ret True if guest checkout is enabled, false otherwise |
29 | 29 | */ |
30 | -function give_no_guest_checkout( $form_id ) { |
|
30 | +function give_no_guest_checkout($form_id) { |
|
31 | 31 | |
32 | 32 | $backtrace = debug_backtrace(); |
33 | 33 | |
34 | - _give_deprecated_function( __FUNCTION__, '1.4.1', null, $backtrace ); |
|
34 | + _give_deprecated_function(__FUNCTION__, '1.4.1', null, $backtrace); |
|
35 | 35 | |
36 | - $ret = give_get_meta( $form_id, '_give_logged_in_only', true ); |
|
36 | + $ret = give_get_meta($form_id, '_give_logged_in_only', true); |
|
37 | 37 | |
38 | - return (bool) apply_filters( 'give_no_guest_checkout', give_is_setting_enabled( $ret ) ); |
|
38 | + return (bool) apply_filters('give_no_guest_checkout', give_is_setting_enabled($ret)); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | |
51 | 51 | $backtrace = debug_backtrace(); |
52 | 52 | |
53 | - _give_deprecated_function( __FUNCTION__, '1.8', null, $backtrace ); |
|
53 | + _give_deprecated_function(__FUNCTION__, '1.8', null, $backtrace); |
|
54 | 54 | |
55 | 55 | $views = array( |
56 | - 'sales' => __( 'Donations', 'give' ), |
|
57 | - 'gateway_errors' => __( 'Payment Errors', 'give' ), |
|
58 | - 'api_requests' => __( 'API Requests', 'give' ), |
|
56 | + 'sales' => __('Donations', 'give'), |
|
57 | + 'gateway_errors' => __('Payment Errors', 'give'), |
|
58 | + 'api_requests' => __('API Requests', 'give'), |
|
59 | 59 | ); |
60 | 60 | |
61 | - $views = apply_filters( 'give_log_views', $views ); |
|
61 | + $views = apply_filters('give_log_views', $views); |
|
62 | 62 | |
63 | 63 | return $views; |
64 | 64 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $backtrace = debug_backtrace(); |
75 | 75 | |
76 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_agree_to_terms', $backtrace ); |
|
76 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_agree_to_terms', $backtrace); |
|
77 | 77 | |
78 | 78 | // Call new renamed function. |
79 | 79 | give_donation_form_validate_agree_to_terms(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $backtrace = debug_backtrace(); |
92 | 92 | |
93 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_logged_in_user', $backtrace ); |
|
93 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_logged_in_user', $backtrace); |
|
94 | 94 | |
95 | 95 | // Call new renamed function. |
96 | 96 | give_donation_form_validate_logged_in_user(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $backtrace = debug_backtrace(); |
109 | 109 | |
110 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_gateway', $backtrace ); |
|
110 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_gateway', $backtrace); |
|
111 | 111 | |
112 | 112 | // Call new renamed function. |
113 | 113 | give_donation_form_validate_gateway(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | $backtrace = debug_backtrace(); |
126 | 126 | |
127 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_fields', $backtrace ); |
|
127 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_fields', $backtrace); |
|
128 | 128 | |
129 | 129 | // Call new renamed function. |
130 | 130 | give_donation_form_validate_fields(); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $backtrace = debug_backtrace(); |
143 | 143 | |
144 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_cc', $backtrace ); |
|
144 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_cc', $backtrace); |
|
145 | 145 | |
146 | 146 | // Call new renamed function. |
147 | 147 | give_donation_form_validate_cc(); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | $backtrace = debug_backtrace(); |
160 | 160 | |
161 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_get_donation_cc_info', $backtrace ); |
|
161 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_get_donation_cc_info', $backtrace); |
|
162 | 162 | |
163 | 163 | // Call new renamed function. |
164 | 164 | give_get_donation_cc_info(); |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | * @param int $zip |
176 | 176 | * @param string $country_code |
177 | 177 | */ |
178 | -function give_purchase_form_validate_cc_zip( $zip = 0, $country_code = '' ) { |
|
178 | +function give_purchase_form_validate_cc_zip($zip = 0, $country_code = '') { |
|
179 | 179 | |
180 | 180 | $backtrace = debug_backtrace(); |
181 | 181 | |
182 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_cc_zip', $backtrace ); |
|
182 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_cc_zip', $backtrace); |
|
183 | 183 | |
184 | 184 | // Call new renamed function. |
185 | - give_donation_form_validate_cc_zip( $zip, $country_code ); |
|
185 | + give_donation_form_validate_cc_zip($zip, $country_code); |
|
186 | 186 | |
187 | 187 | } |
188 | 188 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | $backtrace = debug_backtrace(); |
198 | 198 | |
199 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_user_login', $backtrace ); |
|
199 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_user_login', $backtrace); |
|
200 | 200 | |
201 | 201 | // Call new renamed function. |
202 | 202 | give_donation_form_validate_user_login(); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | $backtrace = debug_backtrace(); |
215 | 215 | |
216 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_guest_user', $backtrace ); |
|
216 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_guest_user', $backtrace); |
|
217 | 217 | |
218 | 218 | // Call new renamed function. |
219 | 219 | give_donation_form_validate_guest_user(); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | $backtrace = debug_backtrace(); |
232 | 232 | |
233 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_new_user', $backtrace ); |
|
233 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_donation_form_validate_new_user', $backtrace); |
|
234 | 234 | |
235 | 235 | // Call new renamed function. |
236 | 236 | give_donation_form_validate_new_user(); |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | * |
247 | 247 | * @param array $valid_data |
248 | 248 | */ |
249 | -function give_get_purchase_form_user( $valid_data = array() ) { |
|
249 | +function give_get_purchase_form_user($valid_data = array()) { |
|
250 | 250 | |
251 | 251 | $backtrace = debug_backtrace(); |
252 | 252 | |
253 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_get_donation_form_user', $backtrace ); |
|
253 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_get_donation_form_user', $backtrace); |
|
254 | 254 | |
255 | 255 | // Call new renamed function. |
256 | - give_get_donation_form_user( $valid_data ); |
|
256 | + give_get_donation_form_user($valid_data); |
|
257 | 257 | |
258 | 258 | } |
259 | 259 | |
@@ -269,12 +269,12 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return string |
271 | 271 | */ |
272 | -function give_checkout_button_purchase( $form_id ) { |
|
272 | +function give_checkout_button_purchase($form_id) { |
|
273 | 273 | $backtrace = debug_backtrace(); |
274 | 274 | |
275 | - _give_deprecated_function( __FUNCTION__, '1.8.8', 'give_get_donation_form_submit_button', $backtrace ); |
|
275 | + _give_deprecated_function(__FUNCTION__, '1.8.8', 'give_get_donation_form_submit_button', $backtrace); |
|
276 | 276 | |
277 | - return give_get_donation_form_submit_button( $form_id ); |
|
277 | + return give_get_donation_form_submit_button($form_id); |
|
278 | 278 | |
279 | 279 | } |
280 | 280 | |
@@ -287,13 +287,13 @@ discard block |
||
287 | 287 | * |
288 | 288 | * @return int $customer_id Customer ID. |
289 | 289 | */ |
290 | -function give_get_payment_customer_id( $payment_id ) { |
|
290 | +function give_get_payment_customer_id($payment_id) { |
|
291 | 291 | |
292 | 292 | $backtrace = debug_backtrace(); |
293 | 293 | |
294 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_get_payment_donor_id', $backtrace ); |
|
294 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_get_payment_donor_id', $backtrace); |
|
295 | 295 | |
296 | - return give_get_payment_donor_id( $payment_id ); |
|
296 | + return give_get_payment_donor_id($payment_id); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | |
309 | 309 | $backtrace = debug_backtrace(); |
310 | 310 | |
311 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_get_total_donations', $backtrace ); |
|
311 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_get_total_donations', $backtrace); |
|
312 | 312 | |
313 | 313 | return give_get_total_donations(); |
314 | 314 | } |
@@ -326,13 +326,13 @@ discard block |
||
326 | 326 | * |
327 | 327 | * @return int The total number of donations |
328 | 328 | */ |
329 | -function give_count_purchases_of_customer( $user = null ) { |
|
329 | +function give_count_purchases_of_customer($user = null) { |
|
330 | 330 | |
331 | 331 | $backtrace = debug_backtrace(); |
332 | 332 | |
333 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_count_donations_of_donor', $backtrace ); |
|
333 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_count_donations_of_donor', $backtrace); |
|
334 | 334 | |
335 | - return give_count_donations_of_donor( $user ); |
|
335 | + return give_count_donations_of_donor($user); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | * |
349 | 349 | * @return array |
350 | 350 | */ |
351 | -function give_get_purchase_stats_by_user( $user = '' ) { |
|
351 | +function give_get_purchase_stats_by_user($user = '') { |
|
352 | 352 | |
353 | 353 | $backtrace = debug_backtrace(); |
354 | 354 | |
355 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_get_donation_stats_by_user', $backtrace ); |
|
355 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_get_donation_stats_by_user', $backtrace); |
|
356 | 356 | |
357 | - return give_get_donation_stats_by_user( $user ); |
|
357 | + return give_get_donation_stats_by_user($user); |
|
358 | 358 | |
359 | 359 | } |
360 | 360 | |
@@ -372,13 +372,13 @@ discard block |
||
372 | 372 | * |
373 | 373 | * @return bool|object List of all user donations |
374 | 374 | */ |
375 | -function give_get_users_purchases( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) { |
|
375 | +function give_get_users_purchases($user = 0, $number = 20, $pagination = false, $status = 'complete') { |
|
376 | 376 | |
377 | 377 | $backtrace = debug_backtrace(); |
378 | 378 | |
379 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_get_users_donations', $backtrace ); |
|
379 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_get_users_donations', $backtrace); |
|
380 | 380 | |
381 | - return give_get_users_donations( $user, $number, $pagination, $status ); |
|
381 | + return give_get_users_donations($user, $number, $pagination, $status); |
|
382 | 382 | |
383 | 383 | } |
384 | 384 | |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | * |
396 | 396 | * @return bool True if has donated, false other wise. |
397 | 397 | */ |
398 | -function give_has_purchases( $user_id = null ) { |
|
398 | +function give_has_purchases($user_id = null) { |
|
399 | 399 | |
400 | 400 | $backtrace = debug_backtrace(); |
401 | 401 | |
402 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_has_donations', $backtrace ); |
|
402 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_has_donations', $backtrace); |
|
403 | 403 | |
404 | - return give_has_donations( $user_id ); |
|
404 | + return give_has_donations($user_id); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | /** |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | function give_count_total_customers() { |
416 | 416 | $backtrace = debug_backtrace(); |
417 | 417 | |
418 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_count_total_donors', $backtrace ); |
|
418 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_count_total_donors', $backtrace); |
|
419 | 419 | |
420 | 420 | return give_count_total_donors(); |
421 | 421 | } |
@@ -430,13 +430,13 @@ discard block |
||
430 | 430 | * |
431 | 431 | * @return float The total amount the user has spent |
432 | 432 | */ |
433 | -function give_purchase_total_of_user( $user = null ) { |
|
433 | +function give_purchase_total_of_user($user = null) { |
|
434 | 434 | |
435 | 435 | $backtrace = debug_backtrace(); |
436 | 436 | |
437 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_donation_total_of_user', $backtrace ); |
|
437 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_donation_total_of_user', $backtrace); |
|
438 | 438 | |
439 | - return give_donation_total_of_user( $user ); |
|
439 | + return give_donation_total_of_user($user); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | /** |
@@ -450,13 +450,13 @@ discard block |
||
450 | 450 | * |
451 | 451 | * @return void |
452 | 452 | */ |
453 | -function give_delete_purchase( $payment_id = 0, $update_customer = true ) { |
|
453 | +function give_delete_purchase($payment_id = 0, $update_customer = true) { |
|
454 | 454 | |
455 | 455 | $backtrace = debug_backtrace(); |
456 | 456 | |
457 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_delete_donation', $backtrace ); |
|
457 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_delete_donation', $backtrace); |
|
458 | 458 | |
459 | - give_delete_donation( $payment_id, $update_customer ); |
|
459 | + give_delete_donation($payment_id, $update_customer); |
|
460 | 460 | |
461 | 461 | } |
462 | 462 | |
@@ -474,13 +474,13 @@ discard block |
||
474 | 474 | * |
475 | 475 | * @return void |
476 | 476 | */ |
477 | -function give_undo_purchase( $form_id = false, $payment_id ) { |
|
477 | +function give_undo_purchase($form_id = false, $payment_id) { |
|
478 | 478 | |
479 | 479 | $backtrace = debug_backtrace(); |
480 | 480 | |
481 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_undo_donation', $backtrace ); |
|
481 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_undo_donation', $backtrace); |
|
482 | 482 | |
483 | - give_undo_donation( $payment_id ); |
|
483 | + give_undo_donation($payment_id); |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | |
@@ -493,12 +493,12 @@ discard block |
||
493 | 493 | * |
494 | 494 | * @return void |
495 | 495 | */ |
496 | -function give_trigger_purchase_delete( $data ) { |
|
496 | +function give_trigger_purchase_delete($data) { |
|
497 | 497 | $backtrace = debug_backtrace(); |
498 | 498 | |
499 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_trigger_donation_delete', $backtrace ); |
|
499 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_trigger_donation_delete', $backtrace); |
|
500 | 500 | |
501 | - give_trigger_donation_delete( $data ); |
|
501 | + give_trigger_donation_delete($data); |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | |
@@ -512,12 +512,12 @@ discard block |
||
512 | 512 | * |
513 | 513 | * @return bool|int |
514 | 514 | */ |
515 | -function give_increase_purchase_count( $form_id = 0, $quantity = 1 ) { |
|
515 | +function give_increase_purchase_count($form_id = 0, $quantity = 1) { |
|
516 | 516 | $backtrace = debug_backtrace(); |
517 | 517 | |
518 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_increase_donation_count', $backtrace ); |
|
518 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_increase_donation_count', $backtrace); |
|
519 | 519 | |
520 | - give_increase_donation_count( $form_id, $quantity ); |
|
520 | + give_increase_donation_count($form_id, $quantity); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | |
@@ -536,12 +536,12 @@ discard block |
||
536 | 536 | * |
537 | 537 | * @return void |
538 | 538 | */ |
539 | -function give_record_sale_in_log( $give_form_id = 0, $payment_id, $price_id = false, $sale_date = null ) { |
|
539 | +function give_record_sale_in_log($give_form_id = 0, $payment_id, $price_id = false, $sale_date = null) { |
|
540 | 540 | $backtrace = debug_backtrace(); |
541 | 541 | |
542 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'give_record_donation_in_log', $backtrace ); |
|
542 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'give_record_donation_in_log', $backtrace); |
|
543 | 543 | |
544 | - give_record_donation_in_log( $give_form_id, $payment_id, $price_id, $sale_date ); |
|
544 | + give_record_donation_in_log($give_form_id, $payment_id, $price_id, $sale_date); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | /** |
@@ -558,12 +558,12 @@ discard block |
||
558 | 558 | * |
559 | 559 | * @return void |
560 | 560 | */ |
561 | -function give_print_errors( $form_id ) { |
|
561 | +function give_print_errors($form_id) { |
|
562 | 562 | $backtrace = debug_backtrace(); |
563 | 563 | |
564 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'Give_Notice::print_frontend_errors', $backtrace ); |
|
564 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'Give_Notice::print_frontend_errors', $backtrace); |
|
565 | 565 | |
566 | - do_action( 'give_frontend_notices', $form_id ); |
|
566 | + do_action('give_frontend_notices', $form_id); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | /** |
@@ -579,12 +579,12 @@ discard block |
||
579 | 579 | * |
580 | 580 | * @return string $error |
581 | 581 | */ |
582 | -function give_output_error( $message, $echo = true, $error_id = 'warning' ) { |
|
582 | +function give_output_error($message, $echo = true, $error_id = 'warning') { |
|
583 | 583 | $backtrace = debug_backtrace(); |
584 | 584 | |
585 | - _give_deprecated_function( __FUNCTION__, '1.8.9', 'Give_Notice::print_frontend_notice', $backtrace ); |
|
585 | + _give_deprecated_function(__FUNCTION__, '1.8.9', 'Give_Notice::print_frontend_notice', $backtrace); |
|
586 | 586 | |
587 | - Give()->notices->print_frontend_notice( $message, $echo, $error_id ); |
|
587 | + Give()->notices->print_frontend_notice($message, $echo, $error_id); |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | |
@@ -600,11 +600,11 @@ discard block |
||
600 | 600 | * |
601 | 601 | * @return string |
602 | 602 | */ |
603 | -function give_get_purchase_summary( $purchase_data, $email = true ) { |
|
603 | +function give_get_purchase_summary($purchase_data, $email = true) { |
|
604 | 604 | |
605 | 605 | $backtrace = debug_backtrace(); |
606 | 606 | |
607 | - _give_deprecated_function( __FUNCTION__, '1.8.12', 'give_payment_gateway_donation_summary', $backtrace ); |
|
607 | + _give_deprecated_function(__FUNCTION__, '1.8.12', 'give_payment_gateway_donation_summary', $backtrace); |
|
608 | 608 | |
609 | 609 | give_payment_gateway_donation_summary($purchase_data, $email); |
610 | 610 |
@@ -10,13 +10,13 @@ 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 | |
17 | 17 | // Load WP_List_Table if not loaded. |
18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
18 | +if ( ! class_exists('WP_List_Table')) { |
|
19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | public function __construct() { |
127 | 127 | |
128 | 128 | // Set parent defaults. |
129 | - parent::__construct( array( |
|
130 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records. |
|
131 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records. |
|
132 | - 'ajax' => false, // Does this table support ajax? |
|
133 | - ) ); |
|
129 | + parent::__construct(array( |
|
130 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records. |
|
131 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records. |
|
132 | + 'ajax' => false, // Does this table support ajax? |
|
133 | + )); |
|
134 | 134 | |
135 | 135 | $this->process_bulk_action(); |
136 | 136 | $this->get_payment_counts(); |
137 | - $this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); |
|
137 | + $this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -143,54 +143,54 @@ discard block |
||
143 | 143 | * @return void |
144 | 144 | */ |
145 | 145 | public function advanced_filters() { |
146 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; |
|
147 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null; |
|
148 | - $status = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : ''; |
|
149 | - $donor = isset( $_GET['donor'] ) ? sanitize_text_field( $_GET['donor'] ) : ''; |
|
150 | - $search = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : ''; |
|
151 | - $form_id = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0; |
|
146 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null; |
|
147 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null; |
|
148 | + $status = isset($_GET['status']) ? sanitize_text_field($_GET['status']) : ''; |
|
149 | + $donor = isset($_GET['donor']) ? sanitize_text_field($_GET['donor']) : ''; |
|
150 | + $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : ''; |
|
151 | + $form_id = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : 0; |
|
152 | 152 | ?> |
153 | 153 | <div id="give-payment-filters" class="give-filters"> |
154 | - <?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?> |
|
154 | + <?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?> |
|
155 | 155 | <div id="give-payment-date-filters"> |
156 | 156 | <div class="give-filter give-filter-half"> |
157 | 157 | <label for="start-date" |
158 | - class="give-start-date-label"><?php esc_html_e( 'Start Date', 'give' ); ?></label> |
|
158 | + class="give-start-date-label"><?php esc_html_e('Start Date', 'give'); ?></label> |
|
159 | 159 | <input type="text" id="start-date" name="start-date" class="give_datepicker" |
160 | 160 | value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy" /> |
161 | 161 | </div> |
162 | 162 | <div class="give-filter give-filter-half"> |
163 | - <label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date', 'give' ); ?></label> |
|
163 | + <label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date', 'give'); ?></label> |
|
164 | 164 | <input type="text" id="end-date" name="end-date" class="give_datepicker" |
165 | 165 | value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy" /> |
166 | 166 | </div> |
167 | 167 | </div> |
168 | 168 | <div id="give-payment-form-filter" class="give-filter"> |
169 | 169 | <label for="-date" |
170 | - class="give-start-date-label"><?php esc_html_e( 'Form', 'give' ); ?></label> |
|
170 | + class="give-start-date-label"><?php esc_html_e('Form', 'give'); ?></label> |
|
171 | 171 | <?php |
172 | 172 | // Filter Donations by Donation Forms. |
173 | - echo Give()->html->forms_dropdown( array( |
|
173 | + echo Give()->html->forms_dropdown(array( |
|
174 | 174 | 'name' => 'form_id', |
175 | 175 | 'class' => 'give-donation-forms-filter', |
176 | 176 | 'selected' => $form_id, // Make sure to have $form_id set to 0, if there is no selection. |
177 | 177 | 'chosen' => true, |
178 | - 'number' => - 1, |
|
179 | - ) ); |
|
178 | + 'number' => -1, |
|
179 | + )); |
|
180 | 180 | ?> |
181 | 181 | </div> |
182 | 182 | |
183 | - <?php if ( ! empty( $status ) ) : ?> |
|
184 | - <input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>" /> |
|
183 | + <?php if ( ! empty($status)) : ?> |
|
184 | + <input type="hidden" name="status" value="<?php echo esc_attr($status); ?>" /> |
|
185 | 185 | <?php endif; ?> |
186 | 186 | |
187 | 187 | <div class="give-filter"> |
188 | - <?php submit_button( __( 'Apply', 'give' ), 'secondary', '', false ); ?> |
|
188 | + <?php submit_button(__('Apply', 'give'), 'secondary', '', false); ?> |
|
189 | 189 | <?php |
190 | 190 | // Clear active filters button. |
191 | - if ( ! empty( $start_date ) || ! empty( $end_date ) || ! empty( $donor ) || ! empty( $search ) || ! empty( $status ) || ! empty( $form_id ) ) : ?> |
|
192 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" |
|
193 | - class="button give-clear-filters-button"><?php esc_html_e( 'Clear Filters', 'give' ); ?></a> |
|
191 | + if ( ! empty($start_date) || ! empty($end_date) || ! empty($donor) || ! empty($search) || ! empty($status) || ! empty($form_id)) : ?> |
|
192 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" |
|
193 | + class="button give-clear-filters-button"><?php esc_html_e('Clear Filters', 'give'); ?></a> |
|
194 | 194 | <?php endif; ?> |
195 | 195 | </div> |
196 | 196 | </div> |
@@ -209,18 +209,18 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @return void |
211 | 211 | */ |
212 | - public function search_box( $text, $input_id ) { |
|
213 | - if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { |
|
212 | + public function search_box($text, $input_id) { |
|
213 | + if (empty($_REQUEST['s']) && ! $this->has_items()) { |
|
214 | 214 | return; |
215 | 215 | } |
216 | 216 | |
217 | - $input_id = $input_id . '-search-input'; |
|
217 | + $input_id = $input_id.'-search-input'; |
|
218 | 218 | |
219 | - if ( ! empty( $_REQUEST['orderby'] ) ) { |
|
220 | - echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
|
219 | + if ( ! empty($_REQUEST['orderby'])) { |
|
220 | + echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />'; |
|
221 | 221 | } |
222 | - if ( ! empty( $_REQUEST['order'] ) ) { |
|
223 | - echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
|
222 | + if ( ! empty($_REQUEST['order'])) { |
|
223 | + echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />'; |
|
224 | 224 | } |
225 | 225 | ?> |
226 | 226 | <div class="give-filter give-filter-search" role="search"> |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | * |
233 | 233 | * @since 1.7 |
234 | 234 | */ |
235 | - do_action( 'give_payment_history_search' ); |
|
235 | + do_action('give_payment_history_search'); |
|
236 | 236 | ?> |
237 | 237 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
238 | 238 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" /> |
239 | - <?php submit_button( $text, 'button', false, false, array( |
|
239 | + <?php submit_button($text, 'button', false, false, array( |
|
240 | 240 | 'ID' => 'search-submit', |
241 | - ) ); ?><br /> |
|
241 | + )); ?><br /> |
|
242 | 242 | </div> |
243 | 243 | <?php |
244 | 244 | } |
@@ -252,48 +252,48 @@ discard block |
||
252 | 252 | */ |
253 | 253 | public function get_views() { |
254 | 254 | |
255 | - $current = isset( $_GET['status'] ) ? $_GET['status'] : ''; |
|
255 | + $current = isset($_GET['status']) ? $_GET['status'] : ''; |
|
256 | 256 | $views = array(); |
257 | 257 | $tabs = array( |
258 | 258 | 'all' => array( |
259 | 259 | 'total_count', |
260 | - esc_html__( 'All', 'give' ), |
|
260 | + esc_html__('All', 'give'), |
|
261 | 261 | ), |
262 | 262 | 'publish' => array( |
263 | 263 | 'complete_count', |
264 | - esc_html__( 'Completed', 'give' ), |
|
264 | + esc_html__('Completed', 'give'), |
|
265 | 265 | ), |
266 | 266 | 'pending' => array( |
267 | 267 | 'pending_count', |
268 | - esc_html__( 'Pending', 'give' ), |
|
268 | + esc_html__('Pending', 'give'), |
|
269 | 269 | ), |
270 | 270 | 'processing' => array( |
271 | 271 | 'processing_count', |
272 | - esc_html__( 'Processing', 'give' ), |
|
272 | + esc_html__('Processing', 'give'), |
|
273 | 273 | ), |
274 | 274 | 'refunded' => array( |
275 | 275 | 'refunded_count', |
276 | - esc_html__( 'Refunded', 'give' ), |
|
276 | + esc_html__('Refunded', 'give'), |
|
277 | 277 | ), |
278 | 278 | 'revoked' => array( |
279 | 279 | 'revoked_count', |
280 | - esc_html__( 'Revoked', 'give' ), |
|
280 | + esc_html__('Revoked', 'give'), |
|
281 | 281 | ), |
282 | 282 | 'failed' => array( |
283 | 283 | 'failed_count', |
284 | - esc_html__( 'Failed', 'give' ), |
|
284 | + esc_html__('Failed', 'give'), |
|
285 | 285 | ), |
286 | 286 | 'cancelled' => array( |
287 | 287 | 'cancelled_count', |
288 | - esc_html__( 'Cancelled', 'give' ), |
|
288 | + esc_html__('Cancelled', 'give'), |
|
289 | 289 | ), |
290 | 290 | 'abandoned' => array( |
291 | 291 | 'abandoned_count', |
292 | - esc_html__( 'Abandoned', 'give' ), |
|
292 | + esc_html__('Abandoned', 'give'), |
|
293 | 293 | ), |
294 | 294 | ); |
295 | 295 | |
296 | - foreach ( $tabs as $key => $tab ) { |
|
296 | + foreach ($tabs as $key => $tab) { |
|
297 | 297 | $count_key = $tab[0]; |
298 | 298 | $name = $tab[1]; |
299 | 299 | $count = $this->$count_key; |
@@ -308,19 +308,19 @@ discard block |
||
308 | 308 | * @param string $key Current view tab value. |
309 | 309 | * @param int $count Number of donation inside the tab. |
310 | 310 | */ |
311 | - if ( 'all' === $key || $key === $current || apply_filters( 'give_payments_table_show_all_status', 0 < $count, $key, $count ) ) { |
|
311 | + if ('all' === $key || $key === $current || apply_filters('give_payments_table_show_all_status', 0 < $count, $key, $count)) { |
|
312 | 312 | |
313 | - $views[ $key ] = sprintf( |
|
313 | + $views[$key] = sprintf( |
|
314 | 314 | '<a href="%s" %s >%s <span class="count">(%s)</span></a>', |
315 | - esc_url( ( 'all' === (string) $key ) ? remove_query_arg( array( 'status', 'paged' ) ) : add_query_arg( array( 'status' => $key, 'paged' => false ) ) ), |
|
316 | - ( ( 'all' === $key && empty( $current ) ) ) ? 'class="current"' : ( $current == $key ) ? 'class="current"' : '', |
|
315 | + esc_url(('all' === (string) $key) ? remove_query_arg(array('status', 'paged')) : add_query_arg(array('status' => $key, 'paged' => false))), |
|
316 | + (('all' === $key && empty($current))) ? 'class="current"' : ($current == $key) ? 'class="current"' : '', |
|
317 | 317 | $name, |
318 | 318 | $count |
319 | 319 | ); |
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | - return apply_filters( 'give_payments_table_views', $views ); |
|
323 | + return apply_filters('give_payments_table_views', $views); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
@@ -333,15 +333,15 @@ discard block |
||
333 | 333 | public function get_columns() { |
334 | 334 | $columns = array( |
335 | 335 | 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text. |
336 | - 'donation' => esc_html__( 'Donation', 'give' ), |
|
337 | - 'donation_form' => esc_html__( 'Donation Form', 'give' ), |
|
338 | - 'status' => esc_html__( 'Status', 'give' ), |
|
339 | - 'date' => esc_html__( 'Date', 'give' ), |
|
340 | - 'amount' => esc_html__( 'Amount', 'give' ), |
|
341 | - 'details' => esc_html__( 'Details', 'give' ), |
|
336 | + 'donation' => esc_html__('Donation', 'give'), |
|
337 | + 'donation_form' => esc_html__('Donation Form', 'give'), |
|
338 | + 'status' => esc_html__('Status', 'give'), |
|
339 | + 'date' => esc_html__('Date', 'give'), |
|
340 | + 'amount' => esc_html__('Amount', 'give'), |
|
341 | + 'details' => esc_html__('Details', 'give'), |
|
342 | 342 | ); |
343 | 343 | |
344 | - return apply_filters( 'give_payments_table_columns', $columns ); |
|
344 | + return apply_filters('give_payments_table_columns', $columns); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -353,14 +353,14 @@ discard block |
||
353 | 353 | */ |
354 | 354 | public function get_sortable_columns() { |
355 | 355 | $columns = array( |
356 | - 'donation' => array( 'ID', true ), |
|
357 | - 'donation_form' => array( 'donation_form', false ), |
|
358 | - 'status' => array( 'status', false ), |
|
359 | - 'amount' => array( 'amount', false ), |
|
360 | - 'date' => array( 'date', false ), |
|
356 | + 'donation' => array('ID', true), |
|
357 | + 'donation_form' => array('donation_form', false), |
|
358 | + 'status' => array('status', false), |
|
359 | + 'amount' => array('amount', false), |
|
360 | + 'date' => array('date', false), |
|
361 | 361 | ); |
362 | 362 | |
363 | - return apply_filters( 'give_payments_table_sortable_columns', $columns ); |
|
363 | + return apply_filters('give_payments_table_sortable_columns', $columns); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | /** |
@@ -386,55 +386,55 @@ discard block |
||
386 | 386 | * |
387 | 387 | * @return string Column Name |
388 | 388 | */ |
389 | - public function column_default( $payment, $column_name ) { |
|
389 | + public function column_default($payment, $column_name) { |
|
390 | 390 | |
391 | - $single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details' ) ) ); |
|
392 | - $row_actions = $this->get_row_actions( $payment ); |
|
391 | + $single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details'))); |
|
392 | + $row_actions = $this->get_row_actions($payment); |
|
393 | 393 | |
394 | - switch ( $column_name ) { |
|
394 | + switch ($column_name) { |
|
395 | 395 | case 'donation' : |
396 | - $value = sprintf( '<a href="%1$s" data-tooltip="%2$s">#%3$s</a> %4$s %5$s<br>', $single_donation_url, sprintf( esc_attr__( 'View Donation #%s', 'give' ), $payment->ID ), $payment->ID, esc_html__( 'by', 'give' ), $this->get_donor( $payment ) ); |
|
397 | - $value .= $this->get_donor_email( $payment ); |
|
398 | - $value .= $this->row_actions( $row_actions ); |
|
396 | + $value = sprintf('<a href="%1$s" data-tooltip="%2$s">#%3$s</a> %4$s %5$s<br>', $single_donation_url, sprintf(esc_attr__('View Donation #%s', 'give'), $payment->ID), $payment->ID, esc_html__('by', 'give'), $this->get_donor($payment)); |
|
397 | + $value .= $this->get_donor_email($payment); |
|
398 | + $value .= $this->row_actions($row_actions); |
|
399 | 399 | break; |
400 | 400 | |
401 | 401 | case 'amount' : |
402 | - $amount = ! empty( $payment->total ) ? $payment->total : 0; |
|
403 | - $value = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) ); |
|
404 | - $value .= sprintf( '<br><small>%1$s %2$s</small>', __( 'via', 'give' ), give_get_gateway_admin_label( $payment->gateway ) ); |
|
402 | + $amount = ! empty($payment->total) ? $payment->total : 0; |
|
403 | + $value = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID)); |
|
404 | + $value .= sprintf('<br><small>%1$s %2$s</small>', __('via', 'give'), give_get_gateway_admin_label($payment->gateway)); |
|
405 | 405 | break; |
406 | 406 | |
407 | 407 | case 'donation_form' : |
408 | - $form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title; |
|
409 | - $value = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>'; |
|
410 | - $level = give_get_payment_form_title( $payment->meta, true ); |
|
408 | + $form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title; |
|
409 | + $value = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>'; |
|
410 | + $level = give_get_payment_form_title($payment->meta, true); |
|
411 | 411 | |
412 | - if ( ! empty( $level ) ) { |
|
412 | + if ( ! empty($level)) { |
|
413 | 413 | $value .= $level; |
414 | 414 | } |
415 | 415 | |
416 | 416 | break; |
417 | 417 | |
418 | 418 | case 'date' : |
419 | - $date = strtotime( $payment->date ); |
|
420 | - $value = date_i18n( give_date_format(), $date ); |
|
419 | + $date = strtotime($payment->date); |
|
420 | + $value = date_i18n(give_date_format(), $date); |
|
421 | 421 | break; |
422 | 422 | |
423 | 423 | case 'status' : |
424 | - $value = $this->get_payment_status( $payment ); |
|
424 | + $value = $this->get_payment_status($payment); |
|
425 | 425 | break; |
426 | 426 | |
427 | 427 | case 'details' : |
428 | - $value = sprintf( '<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', $single_donation_url, sprintf( esc_attr__( 'View Donation #%s', 'give' ), $payment->ID ) ); |
|
428 | + $value = sprintf('<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', $single_donation_url, sprintf(esc_attr__('View Donation #%s', 'give'), $payment->ID)); |
|
429 | 429 | break; |
430 | 430 | |
431 | 431 | default: |
432 | - $value = isset( $payment->$column_name ) ? $payment->$column_name : ''; |
|
432 | + $value = isset($payment->$column_name) ? $payment->$column_name : ''; |
|
433 | 433 | break; |
434 | 434 | |
435 | 435 | }// End switch(). |
436 | 436 | |
437 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name ); |
|
437 | + return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | /** |
@@ -447,17 +447,17 @@ discard block |
||
447 | 447 | * |
448 | 448 | * @return string Data shown in the Email column |
449 | 449 | */ |
450 | - public function get_donor_email( $payment ) { |
|
450 | + public function get_donor_email($payment) { |
|
451 | 451 | |
452 | - $email = give_get_payment_user_email( $payment->ID ); |
|
452 | + $email = give_get_payment_user_email($payment->ID); |
|
453 | 453 | |
454 | - if ( empty( $email ) ) { |
|
455 | - $email = esc_html__( '(unknown)', 'give' ); |
|
454 | + if (empty($email)) { |
|
455 | + $email = esc_html__('(unknown)', 'give'); |
|
456 | 456 | } |
457 | 457 | |
458 | - $value = '<a href="mailto:' . $email . '" data-tooltip="' . esc_attr__( 'Email donor', 'give' ) . '">' . $email . '</a>'; |
|
458 | + $value = '<a href="mailto:'.$email.'" data-tooltip="'.esc_attr__('Email donor', 'give').'">'.$email.'</a>'; |
|
459 | 459 | |
460 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' ); |
|
460 | + return apply_filters('give_payments_table_column', $value, $payment->ID, 'email'); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | /** |
@@ -469,32 +469,32 @@ discard block |
||
469 | 469 | * |
470 | 470 | * @return array $actions |
471 | 471 | */ |
472 | - function get_row_actions( $payment ) { |
|
472 | + function get_row_actions($payment) { |
|
473 | 473 | |
474 | 474 | $actions = array(); |
475 | - $email = give_get_payment_user_email( $payment->ID ); |
|
475 | + $email = give_get_payment_user_email($payment->ID); |
|
476 | 476 | |
477 | 477 | // Add search term string back to base URL. |
478 | - $search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' ); |
|
479 | - if ( ! empty( $search_terms ) ) { |
|
480 | - $this->base_url = add_query_arg( 's', $search_terms, $this->base_url ); |
|
478 | + $search_terms = (isset($_GET['s']) ? trim($_GET['s']) : ''); |
|
479 | + if ( ! empty($search_terms)) { |
|
480 | + $this->base_url = add_query_arg('s', $search_terms, $this->base_url); |
|
481 | 481 | } |
482 | 482 | |
483 | - if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) { |
|
483 | + if (give_is_payment_complete($payment->ID) && ! empty($email)) { |
|
484 | 484 | |
485 | - $actions['email_links'] = sprintf( '<a class="resend-single-donation-receipt" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url( add_query_arg( array( |
|
485 | + $actions['email_links'] = sprintf('<a class="resend-single-donation-receipt" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url(add_query_arg(array( |
|
486 | 486 | 'give-action' => 'email_links', |
487 | 487 | 'purchase_id' => $payment->ID, |
488 | - ), $this->base_url ), 'give_payment_nonce' ), sprintf( esc_attr__( 'Resend Donation %s Receipt', 'give' ), $payment->ID ), esc_html__( 'Resend Receipt', 'give' ) ); |
|
488 | + ), $this->base_url), 'give_payment_nonce'), sprintf(esc_attr__('Resend Donation %s Receipt', 'give'), $payment->ID), esc_html__('Resend Receipt', 'give')); |
|
489 | 489 | |
490 | 490 | } |
491 | 491 | |
492 | - $actions['delete'] = sprintf( '<a class="delete-single-donation" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url( add_query_arg( array( |
|
492 | + $actions['delete'] = sprintf('<a class="delete-single-donation" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url(add_query_arg(array( |
|
493 | 493 | 'give-action' => 'delete_payment', |
494 | 494 | 'purchase_id' => $payment->ID, |
495 | - ), $this->base_url ), 'give_donation_nonce' ), sprintf( esc_attr__( 'Delete Donation %s', 'give' ), $payment->ID ), esc_html__( 'Delete', 'give' ) ); |
|
495 | + ), $this->base_url), 'give_donation_nonce'), sprintf(esc_attr__('Delete Donation %s', 'give'), $payment->ID), esc_html__('Delete', 'give')); |
|
496 | 496 | |
497 | - return apply_filters( 'give_payment_row_actions', $actions, $payment ); |
|
497 | + return apply_filters('give_payment_row_actions', $actions, $payment); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | |
@@ -508,10 +508,10 @@ discard block |
||
508 | 508 | * |
509 | 509 | * @return string Data shown in the Email column |
510 | 510 | */ |
511 | - function get_payment_status( $payment ) { |
|
512 | - $value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>'; |
|
513 | - if ( $payment->mode == 'test' ) { |
|
514 | - $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>'; |
|
511 | + function get_payment_status($payment) { |
|
512 | + $value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>'; |
|
513 | + if ($payment->mode == 'test') { |
|
514 | + $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>'; |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | return $value; |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | * |
528 | 528 | * @return string Displays a checkbox. |
529 | 529 | */ |
530 | - public function column_cb( $payment ) { |
|
531 | - return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', 'payment', $payment->ID ); |
|
530 | + public function column_cb($payment) { |
|
531 | + return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />', 'payment', $payment->ID); |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | /** |
@@ -541,8 +541,8 @@ discard block |
||
541 | 541 | * |
542 | 542 | * @return string Displays a checkbox. |
543 | 543 | */ |
544 | - public function get_payment_id( $payment ) { |
|
545 | - return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>'; |
|
544 | + public function get_payment_id($payment) { |
|
545 | + return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>'; |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | /** |
@@ -555,32 +555,32 @@ discard block |
||
555 | 555 | * |
556 | 556 | * @return string Data shown in the User column |
557 | 557 | */ |
558 | - public function get_donor( $payment ) { |
|
558 | + public function get_donor($payment) { |
|
559 | 559 | |
560 | - $donor_id = give_get_payment_donor_id( $payment->ID ); |
|
561 | - $donor_billing_name = give_get_donor_name_by( $payment->ID, 'donation' ); |
|
562 | - $donor_name = give_get_donor_name_by( $donor_id, 'donor' ); |
|
560 | + $donor_id = give_get_payment_donor_id($payment->ID); |
|
561 | + $donor_billing_name = give_get_donor_name_by($payment->ID, 'donation'); |
|
562 | + $donor_name = give_get_donor_name_by($donor_id, 'donor'); |
|
563 | 563 | |
564 | 564 | $value = ''; |
565 | - if ( ! empty( $donor_id ) ) { |
|
565 | + if ( ! empty($donor_id)) { |
|
566 | 566 | |
567 | 567 | // Check whether the donor name and WP_User name is same or not. |
568 | - if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) { |
|
569 | - $value .= $donor_billing_name . ' ('; |
|
568 | + if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) { |
|
569 | + $value .= $donor_billing_name.' ('; |
|
570 | 570 | } |
571 | 571 | |
572 | - $value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>'; |
|
572 | + $value .= '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id")).'">'.$donor_name.'</a>'; |
|
573 | 573 | |
574 | 574 | // Check whether the donor name and WP_User name is same or not. |
575 | - if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) { |
|
575 | + if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) { |
|
576 | 576 | $value .= ')'; |
577 | 577 | } |
578 | 578 | } else { |
579 | - $email = give_get_payment_user_email( $payment->ID ); |
|
580 | - $value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>'; |
|
579 | + $email = give_get_payment_user_email($payment->ID); |
|
580 | + $value .= '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>'; |
|
581 | 581 | } |
582 | 582 | |
583 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' ); |
|
583 | + return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor'); |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | /** |
@@ -592,20 +592,20 @@ discard block |
||
592 | 592 | */ |
593 | 593 | public function get_bulk_actions() { |
594 | 594 | $actions = array( |
595 | - 'delete' => __( 'Delete', 'give' ), |
|
596 | - 'set-status-publish' => __( 'Set To Completed', 'give' ), |
|
597 | - 'set-status-pending' => __( 'Set To Pending', 'give' ), |
|
598 | - 'set-status-processing' => __( 'Set To Processing', 'give' ), |
|
599 | - 'set-status-refunded' => __( 'Set To Refunded', 'give' ), |
|
600 | - 'set-status-revoked' => __( 'Set To Revoked', 'give' ), |
|
601 | - 'set-status-failed' => __( 'Set To Failed', 'give' ), |
|
602 | - 'set-status-cancelled' => __( 'Set To Cancelled', 'give' ), |
|
603 | - 'set-status-abandoned' => __( 'Set To Abandoned', 'give' ), |
|
604 | - 'set-status-preapproval' => __( 'Set To Preapproval', 'give' ), |
|
605 | - 'resend-receipt' => __( 'Resend Email Receipts', 'give' ), |
|
595 | + 'delete' => __('Delete', 'give'), |
|
596 | + 'set-status-publish' => __('Set To Completed', 'give'), |
|
597 | + 'set-status-pending' => __('Set To Pending', 'give'), |
|
598 | + 'set-status-processing' => __('Set To Processing', 'give'), |
|
599 | + 'set-status-refunded' => __('Set To Refunded', 'give'), |
|
600 | + 'set-status-revoked' => __('Set To Revoked', 'give'), |
|
601 | + 'set-status-failed' => __('Set To Failed', 'give'), |
|
602 | + 'set-status-cancelled' => __('Set To Cancelled', 'give'), |
|
603 | + 'set-status-abandoned' => __('Set To Abandoned', 'give'), |
|
604 | + 'set-status-preapproval' => __('Set To Preapproval', 'give'), |
|
605 | + 'resend-receipt' => __('Resend Email Receipts', 'give'), |
|
606 | 606 | ); |
607 | 607 | |
608 | - return apply_filters( 'give_payments_table_bulk_actions', $actions ); |
|
608 | + return apply_filters('give_payments_table_bulk_actions', $actions); |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | /** |
@@ -616,63 +616,63 @@ discard block |
||
616 | 616 | * @return void |
617 | 617 | */ |
618 | 618 | public function process_bulk_action() { |
619 | - $ids = isset( $_GET['payment'] ) ? $_GET['payment'] : false; |
|
619 | + $ids = isset($_GET['payment']) ? $_GET['payment'] : false; |
|
620 | 620 | $action = $this->current_action(); |
621 | 621 | |
622 | - if ( ! is_array( $ids ) ) { |
|
623 | - $ids = array( $ids ); |
|
622 | + if ( ! is_array($ids)) { |
|
623 | + $ids = array($ids); |
|
624 | 624 | } |
625 | 625 | |
626 | - if ( empty( $action ) ) { |
|
626 | + if (empty($action)) { |
|
627 | 627 | return; |
628 | 628 | } |
629 | 629 | |
630 | - foreach ( $ids as $id ) { |
|
630 | + foreach ($ids as $id) { |
|
631 | 631 | |
632 | 632 | // Detect when a bulk action is being triggered. |
633 | - switch ( $this->current_action() ) { |
|
633 | + switch ($this->current_action()) { |
|
634 | 634 | |
635 | 635 | case'delete': |
636 | - give_delete_donation( $id ); |
|
636 | + give_delete_donation($id); |
|
637 | 637 | break; |
638 | 638 | |
639 | 639 | case 'set-status-publish': |
640 | - give_update_payment_status( $id, 'publish' ); |
|
640 | + give_update_payment_status($id, 'publish'); |
|
641 | 641 | break; |
642 | 642 | |
643 | 643 | case 'set-status-pending': |
644 | - give_update_payment_status( $id, 'pending' ); |
|
644 | + give_update_payment_status($id, 'pending'); |
|
645 | 645 | break; |
646 | 646 | |
647 | 647 | case 'set-status-processing': |
648 | - give_update_payment_status( $id, 'processing' ); |
|
648 | + give_update_payment_status($id, 'processing'); |
|
649 | 649 | break; |
650 | 650 | |
651 | 651 | case 'set-status-refunded': |
652 | - give_update_payment_status( $id, 'refunded' ); |
|
652 | + give_update_payment_status($id, 'refunded'); |
|
653 | 653 | break; |
654 | 654 | case 'set-status-revoked': |
655 | - give_update_payment_status( $id, 'revoked' ); |
|
655 | + give_update_payment_status($id, 'revoked'); |
|
656 | 656 | break; |
657 | 657 | |
658 | 658 | case 'set-status-failed': |
659 | - give_update_payment_status( $id, 'failed' ); |
|
659 | + give_update_payment_status($id, 'failed'); |
|
660 | 660 | break; |
661 | 661 | |
662 | 662 | case 'set-status-cancelled': |
663 | - give_update_payment_status( $id, 'cancelled' ); |
|
663 | + give_update_payment_status($id, 'cancelled'); |
|
664 | 664 | break; |
665 | 665 | |
666 | 666 | case 'set-status-abandoned': |
667 | - give_update_payment_status( $id, 'abandoned' ); |
|
667 | + give_update_payment_status($id, 'abandoned'); |
|
668 | 668 | break; |
669 | 669 | |
670 | 670 | case 'set-status-preapproval': |
671 | - give_update_payment_status( $id, 'preapproval' ); |
|
671 | + give_update_payment_status($id, 'preapproval'); |
|
672 | 672 | break; |
673 | 673 | |
674 | 674 | case 'resend-receipt': |
675 | - give_email_donation_receipt( $id, false ); |
|
675 | + give_email_donation_receipt($id, false); |
|
676 | 676 | break; |
677 | 677 | }// End switch(). |
678 | 678 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | * @param int $id The ID of the payment. |
685 | 685 | * @param string $current_action The action that is being triggered. |
686 | 686 | */ |
687 | - do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() ); |
|
687 | + do_action('give_payments_table_do_bulk_action', $id, $this->current_action()); |
|
688 | 688 | }// End foreach(). |
689 | 689 | |
690 | 690 | } |
@@ -700,31 +700,31 @@ discard block |
||
700 | 700 | |
701 | 701 | $args = array(); |
702 | 702 | |
703 | - if ( isset( $_GET['user'] ) ) { |
|
704 | - $args['user'] = urldecode( $_GET['user'] ); |
|
705 | - } elseif ( isset( $_GET['donor'] ) ) { |
|
706 | - $args['donor'] = absint( $_GET['donor'] ); |
|
707 | - } elseif ( isset( $_GET['s'] ) ) { |
|
708 | - $is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false; |
|
709 | - if ( $is_user ) { |
|
710 | - $args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) ); |
|
711 | - unset( $args['s'] ); |
|
703 | + if (isset($_GET['user'])) { |
|
704 | + $args['user'] = urldecode($_GET['user']); |
|
705 | + } elseif (isset($_GET['donor'])) { |
|
706 | + $args['donor'] = absint($_GET['donor']); |
|
707 | + } elseif (isset($_GET['s'])) { |
|
708 | + $is_user = strpos($_GET['s'], strtolower('user:')) !== false; |
|
709 | + if ($is_user) { |
|
710 | + $args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s'])))); |
|
711 | + unset($args['s']); |
|
712 | 712 | } else { |
713 | - $args['s'] = sanitize_text_field( $_GET['s'] ); |
|
713 | + $args['s'] = sanitize_text_field($_GET['s']); |
|
714 | 714 | } |
715 | 715 | } |
716 | 716 | |
717 | - if ( ! empty( $_GET['start-date'] ) ) { |
|
718 | - $args['start-date'] = urldecode( $_GET['start-date'] ); |
|
717 | + if ( ! empty($_GET['start-date'])) { |
|
718 | + $args['start-date'] = urldecode($_GET['start-date']); |
|
719 | 719 | } |
720 | 720 | |
721 | - if ( ! empty( $_GET['end-date'] ) ) { |
|
722 | - $args['end-date'] = urldecode( $_GET['end-date'] ); |
|
721 | + if ( ! empty($_GET['end-date'])) { |
|
722 | + $args['end-date'] = urldecode($_GET['end-date']); |
|
723 | 723 | } |
724 | 724 | |
725 | - $args['form_id'] = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null; |
|
725 | + $args['form_id'] = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : null; |
|
726 | 726 | |
727 | - $payment_count = give_count_payments( $args ); |
|
727 | + $payment_count = give_count_payments($args); |
|
728 | 728 | $this->complete_count = $payment_count->publish; |
729 | 729 | $this->pending_count = $payment_count->pending; |
730 | 730 | $this->processing_count = $payment_count->processing; |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | $this->cancelled_count = $payment_count->cancelled; |
735 | 735 | $this->abandoned_count = $payment_count->abandoned; |
736 | 736 | |
737 | - foreach ( $payment_count as $count ) { |
|
737 | + foreach ($payment_count as $count) { |
|
738 | 738 | $this->total_count += $count; |
739 | 739 | } |
740 | 740 | } |
@@ -749,28 +749,28 @@ discard block |
||
749 | 749 | public function payments_data() { |
750 | 750 | |
751 | 751 | $per_page = $this->per_page; |
752 | - $orderby = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID'; |
|
753 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC'; |
|
754 | - $user = isset( $_GET['user'] ) ? $_GET['user'] : null; |
|
755 | - $donor = isset( $_GET['donor'] ) ? $_GET['donor'] : null; |
|
756 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys(); |
|
757 | - $meta_key = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null; |
|
758 | - $year = isset( $_GET['year'] ) ? $_GET['year'] : null; |
|
759 | - $month = isset( $_GET['m'] ) ? $_GET['m'] : null; |
|
760 | - $day = isset( $_GET['day'] ) ? $_GET['day'] : null; |
|
761 | - $search = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null; |
|
762 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; |
|
763 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date; |
|
764 | - $form_id = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null; |
|
765 | - |
|
766 | - if ( ! empty( $search ) ) { |
|
752 | + $orderby = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID'; |
|
753 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; |
|
754 | + $user = isset($_GET['user']) ? $_GET['user'] : null; |
|
755 | + $donor = isset($_GET['donor']) ? $_GET['donor'] : null; |
|
756 | + $status = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys(); |
|
757 | + $meta_key = isset($_GET['meta_key']) ? $_GET['meta_key'] : null; |
|
758 | + $year = isset($_GET['year']) ? $_GET['year'] : null; |
|
759 | + $month = isset($_GET['m']) ? $_GET['m'] : null; |
|
760 | + $day = isset($_GET['day']) ? $_GET['day'] : null; |
|
761 | + $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null; |
|
762 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null; |
|
763 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date; |
|
764 | + $form_id = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : null; |
|
765 | + |
|
766 | + if ( ! empty($search)) { |
|
767 | 767 | $status = 'any'; // Force all payment statuses when searching. |
768 | 768 | } |
769 | 769 | |
770 | 770 | $args = array( |
771 | 771 | 'output' => 'payments', |
772 | 772 | 'number' => $per_page, |
773 | - 'page' => isset( $_GET['paged'] ) ? $_GET['paged'] : null, |
|
773 | + 'page' => isset($_GET['paged']) ? $_GET['paged'] : null, |
|
774 | 774 | 'orderby' => $orderby, |
775 | 775 | 'order' => $order, |
776 | 776 | 'user' => $user, |
@@ -786,12 +786,12 @@ discard block |
||
786 | 786 | 'give_forms' => $form_id, |
787 | 787 | ); |
788 | 788 | |
789 | - if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) { |
|
789 | + if (is_string($search) && false !== strpos($search, 'txn:')) { |
|
790 | 790 | $args['search_in_notes'] = true; |
791 | - $args['s'] = trim( str_replace( 'txn:', '', $args['s'] ) ); |
|
791 | + $args['s'] = trim(str_replace('txn:', '', $args['s'])); |
|
792 | 792 | } |
793 | 793 | |
794 | - $p_query = new Give_Payments_Query( $args ); |
|
794 | + $p_query = new Give_Payments_Query($args); |
|
795 | 795 | |
796 | 796 | return $p_query->get_payments(); |
797 | 797 | |
@@ -811,17 +811,17 @@ discard block |
||
811 | 811 | */ |
812 | 812 | public function prepare_items() { |
813 | 813 | |
814 | - wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) ); |
|
814 | + wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's')); |
|
815 | 815 | |
816 | 816 | $columns = $this->get_columns(); |
817 | 817 | $hidden = array(); // No hidden columns. |
818 | 818 | $sortable = $this->get_sortable_columns(); |
819 | 819 | $data = $this->payments_data(); |
820 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : 'any'; |
|
820 | + $status = isset($_GET['status']) ? $_GET['status'] : 'any'; |
|
821 | 821 | |
822 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
822 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
823 | 823 | |
824 | - switch ( $status ) { |
|
824 | + switch ($status) { |
|
825 | 825 | case 'publish': |
826 | 826 | $total_items = $this->complete_count; |
827 | 827 | break; |
@@ -851,20 +851,20 @@ discard block |
||
851 | 851 | break; |
852 | 852 | default: |
853 | 853 | // Retrieve the count of the non-default-Give status. |
854 | - $count = wp_count_posts( 'give_payment' ); |
|
855 | - $total_items = isset( $count->{$status} ) ? $count->{$status} : 0; |
|
854 | + $count = wp_count_posts('give_payment'); |
|
855 | + $total_items = isset($count->{$status} ) ? $count->{$status} : 0; |
|
856 | 856 | break; |
857 | 857 | } |
858 | 858 | |
859 | 859 | $this->items = $data; |
860 | 860 | |
861 | - $this->set_pagination_args( array( |
|
861 | + $this->set_pagination_args(array( |
|
862 | 862 | 'total_items' => $total_items, |
863 | 863 | // We have to calculate the total number of items. |
864 | 864 | 'per_page' => $this->per_page, |
865 | 865 | // We have to determine how many items to show on a page. |
866 | - 'total_pages' => ceil( $total_items / $this->per_page ), |
|
866 | + 'total_pages' => ceil($total_items / $this->per_page), |
|
867 | 867 | // We have to calculate the total number of pages. |
868 | - ) ); |
|
868 | + )); |
|
869 | 869 | } |
870 | 870 | } |