@@ -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 | |
@@ -26,15 +26,15 @@ discard block |
||
26 | 26 | * @global $wpdb |
27 | 27 | * @return void |
28 | 28 | */ |
29 | -function give_install( $network_wide = false ) { |
|
29 | +function give_install($network_wide = false) { |
|
30 | 30 | |
31 | 31 | global $wpdb; |
32 | 32 | |
33 | - if ( is_multisite() && $network_wide ) { |
|
33 | + if (is_multisite() && $network_wide) { |
|
34 | 34 | |
35 | - foreach ( $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs LIMIT 100" ) as $blog_id ) { |
|
35 | + foreach ($wpdb->get_col("SELECT blog_id FROM $wpdb->blogs LIMIT 100") as $blog_id) { |
|
36 | 36 | |
37 | - switch_to_blog( $blog_id ); |
|
37 | + switch_to_blog($blog_id); |
|
38 | 38 | give_run_install(); |
39 | 39 | restore_current_blog(); |
40 | 40 | |
@@ -62,34 +62,34 @@ discard block |
||
62 | 62 | give_setup_post_types(); |
63 | 63 | |
64 | 64 | // Clear the permalinks. |
65 | - flush_rewrite_rules( false ); |
|
65 | + flush_rewrite_rules(false); |
|
66 | 66 | |
67 | 67 | // Add Upgraded From Option. |
68 | - $current_version = get_option( 'give_version' ); |
|
69 | - if ( $current_version ) { |
|
70 | - update_option( 'give_version_upgraded_from', $current_version ); |
|
68 | + $current_version = get_option('give_version'); |
|
69 | + if ($current_version) { |
|
70 | + update_option('give_version_upgraded_from', $current_version); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // Setup some default options. |
74 | 74 | $options = array(); |
75 | 75 | |
76 | 76 | //Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency. |
77 | - if ( empty( $current_version ) ) { |
|
78 | - $options = array_merge( $options, give_get_default_settings() ); |
|
77 | + if (empty($current_version)) { |
|
78 | + $options = array_merge($options, give_get_default_settings()); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // Populate the default values. |
82 | - update_option( 'give_settings', array_merge( $give_options, $options ) ); |
|
82 | + update_option('give_settings', array_merge($give_options, $options)); |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Run plugin upgrades. |
86 | 86 | * |
87 | 87 | * @since 1.8 |
88 | 88 | */ |
89 | - do_action( 'give_upgrades' ); |
|
89 | + do_action('give_upgrades'); |
|
90 | 90 | |
91 | - if ( GIVE_VERSION !== get_option( 'give_version' ) ) { |
|
92 | - update_option( 'give_version', GIVE_VERSION ); |
|
91 | + if (GIVE_VERSION !== get_option('give_version')) { |
|
92 | + update_option('give_version', GIVE_VERSION); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | // Create Give roles. |
@@ -98,18 +98,18 @@ discard block |
||
98 | 98 | $roles->add_caps(); |
99 | 99 | |
100 | 100 | $api = new Give_API(); |
101 | - update_option( 'give_default_api_version', 'v' . $api->get_version() ); |
|
101 | + update_option('give_default_api_version', 'v'.$api->get_version()); |
|
102 | 102 | |
103 | 103 | // Check for PHP Session support, and enable if available. |
104 | 104 | $give_sessions = new Give_Session(); |
105 | 105 | $give_sessions->use_php_sessions(); |
106 | 106 | |
107 | 107 | // Add a temporary option to note that Give pages have been created. |
108 | - Give_Cache::set( '_give_installed', $options, 30, true ); |
|
108 | + Give_Cache::set('_give_installed', $options, 30, true); |
|
109 | 109 | |
110 | - if ( ! $current_version ) { |
|
110 | + if ( ! $current_version) { |
|
111 | 111 | |
112 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
112 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
113 | 113 | |
114 | 114 | // When new upgrade routines are added, mark them as complete on fresh install. |
115 | 115 | $upgrade_routines = array( |
@@ -123,18 +123,18 @@ discard block |
||
123 | 123 | 'v1812_update_donor_purchase_values' |
124 | 124 | ); |
125 | 125 | |
126 | - foreach ( $upgrade_routines as $upgrade ) { |
|
127 | - give_set_upgrade_complete( $upgrade ); |
|
126 | + foreach ($upgrade_routines as $upgrade) { |
|
127 | + give_set_upgrade_complete($upgrade); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | 131 | // Bail if activating from network, or bulk. |
132 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
132 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
133 | 133 | return; |
134 | 134 | } |
135 | 135 | |
136 | 136 | // Add the transient to redirect. |
137 | - Give_Cache::set( '_give_activation_redirect', true, 30, true ); |
|
137 | + Give_Cache::set('_give_activation_redirect', true, 30, true); |
|
138 | 138 | |
139 | 139 | // Set 'Donation Form' meta box enabled by default. |
140 | 140 | give_nav_donation_metabox_enabled(); |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | * @param int $site_id The Site ID. |
155 | 155 | * @param array $meta Blog Meta. |
156 | 156 | */ |
157 | -function give_on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { |
|
157 | +function give_on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) { |
|
158 | 158 | |
159 | - if ( is_plugin_active_for_network( GIVE_PLUGIN_BASENAME ) ) { |
|
159 | + if (is_plugin_active_for_network(GIVE_PLUGIN_BASENAME)) { |
|
160 | 160 | |
161 | - switch_to_blog( $blog_id ); |
|
161 | + switch_to_blog($blog_id); |
|
162 | 162 | give_install(); |
163 | 163 | restore_current_blog(); |
164 | 164 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | } |
168 | 168 | |
169 | -add_action( 'wpmu_new_blog', 'give_on_create_blog', 10, 6 ); |
|
169 | +add_action('wpmu_new_blog', 'give_on_create_blog', 10, 6); |
|
170 | 170 | |
171 | 171 | |
172 | 172 | /** |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @return array The tables to drop. |
181 | 181 | */ |
182 | -function give_wpmu_drop_tables( $tables, $blog_id ) { |
|
182 | +function give_wpmu_drop_tables($tables, $blog_id) { |
|
183 | 183 | |
184 | - switch_to_blog( $blog_id ); |
|
184 | + switch_to_blog($blog_id); |
|
185 | 185 | $donors_db = new Give_DB_Donors(); |
186 | 186 | $donor_meta_db = new Give_DB_Donor_Meta(); |
187 | 187 | |
188 | - if ( $donors_db->installed() ) { |
|
188 | + if ($donors_db->installed()) { |
|
189 | 189 | $tables[] = $donors_db->table_name; |
190 | 190 | $tables[] = $donor_meta_db->table_name; |
191 | 191 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | } |
197 | 197 | |
198 | -add_filter( 'wpmu_drop_tables', 'give_wpmu_drop_tables', 10, 2 ); |
|
198 | +add_filter('wpmu_drop_tables', 'give_wpmu_drop_tables', 10, 2); |
|
199 | 199 | |
200 | 200 | /** |
201 | 201 | * Post-installation |
@@ -207,16 +207,16 @@ discard block |
||
207 | 207 | */ |
208 | 208 | function give_after_install() { |
209 | 209 | |
210 | - if ( ! is_admin() ) { |
|
210 | + if ( ! is_admin()) { |
|
211 | 211 | return; |
212 | 212 | } |
213 | 213 | |
214 | - $give_options = Give_Cache::get( '_give_installed', true ); |
|
215 | - $give_table_check = get_option( '_give_table_check', false ); |
|
214 | + $give_options = Give_Cache::get('_give_installed', true); |
|
215 | + $give_table_check = get_option('_give_table_check', false); |
|
216 | 216 | |
217 | - if ( false === $give_table_check || current_time( 'timestamp' ) > $give_table_check ) { |
|
217 | + if (false === $give_table_check || current_time('timestamp') > $give_table_check) { |
|
218 | 218 | |
219 | - if ( ! @Give()->donor_meta->installed() ) { |
|
219 | + if ( ! @Give()->donor_meta->installed()) { |
|
220 | 220 | |
221 | 221 | // Create the donor meta database. |
222 | 222 | // (this ensures it creates it on multisite instances where it is network activated). |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | } |
226 | 226 | |
227 | - if ( ! @Give()->donors->installed() ) { |
|
227 | + if ( ! @Give()->donors->installed()) { |
|
228 | 228 | // Create the donor database. |
229 | 229 | // (this ensures it creates it on multisite instances where it is network activated). |
230 | 230 | @Give()->donors->create_table(); |
@@ -236,22 +236,22 @@ discard block |
||
236 | 236 | * |
237 | 237 | * @param array $give_options Give plugin options. |
238 | 238 | */ |
239 | - do_action( 'give_after_install', $give_options ); |
|
239 | + do_action('give_after_install', $give_options); |
|
240 | 240 | } |
241 | 241 | |
242 | - update_option( '_give_table_check', ( current_time( 'timestamp' ) + WEEK_IN_SECONDS ) ); |
|
242 | + update_option('_give_table_check', (current_time('timestamp') + WEEK_IN_SECONDS)); |
|
243 | 243 | |
244 | 244 | } |
245 | 245 | |
246 | 246 | // Delete the transient |
247 | - if ( false !== $give_options ) { |
|
248 | - Give_Cache::delete( Give_Cache::get_key( '_give_installed' ) ); |
|
247 | + if (false !== $give_options) { |
|
248 | + Give_Cache::delete(Give_Cache::get_key('_give_installed')); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
252 | 252 | } |
253 | 253 | |
254 | -add_action( 'admin_init', 'give_after_install' ); |
|
254 | +add_action('admin_init', 'give_after_install'); |
|
255 | 255 | |
256 | 256 | |
257 | 257 | /** |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | |
267 | 267 | global $wp_roles; |
268 | 268 | |
269 | - if ( ! is_object( $wp_roles ) ) { |
|
269 | + if ( ! is_object($wp_roles)) { |
|
270 | 270 | return; |
271 | 271 | } |
272 | 272 | |
273 | - if ( ! array_key_exists( 'give_manager', $wp_roles->roles ) ) { |
|
273 | + if ( ! array_key_exists('give_manager', $wp_roles->roles)) { |
|
274 | 274 | |
275 | 275 | // Create Give plugin roles |
276 | 276 | $roles = new Give_Roles(); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | } |
283 | 283 | |
284 | -add_action( 'admin_init', 'give_install_roles_on_network' ); |
|
284 | +add_action('admin_init', 'give_install_roles_on_network'); |
|
285 | 285 | |
286 | 286 | /** |
287 | 287 | * Default core setting values. |
@@ -317,14 +317,14 @@ discard block |
||
317 | 317 | 'uninstall_on_delete' => 'disabled', |
318 | 318 | 'the_content_filter' => 'enabled', |
319 | 319 | 'scripts_footer' => 'disabled', |
320 | - 'agree_to_terms_label' => __( 'Agree to Terms?', 'give' ), |
|
320 | + 'agree_to_terms_label' => __('Agree to Terms?', 'give'), |
|
321 | 321 | 'agreement_text' => give_get_default_agreement_text(), |
322 | 322 | |
323 | 323 | // Paypal IPN verification. |
324 | 324 | 'paypal_verification' => 'enabled', |
325 | 325 | |
326 | 326 | // Default is manual gateway. |
327 | - 'gateways' => array( 'manual' => 1, 'offline' => 1 ), |
|
327 | + 'gateways' => array('manual' => 1, 'offline' => 1), |
|
328 | 328 | 'default_gateway' => 'manual', |
329 | 329 | |
330 | 330 | // Offline gateway setup. |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | */ |
350 | 350 | function give_get_default_agreement_text() { |
351 | 351 | |
352 | - $org_name = get_bloginfo( 'name' ); |
|
352 | + $org_name = get_bloginfo('name'); |
|
353 | 353 | |
354 | 354 | $agreement = sprintf( |
355 | 355 | '<p>Acceptance of any contribution, gift or grant is at the discretion of the %1$s. The %1$s will not accept any gift unless it can be used or expended consistently with the purpose and mission of the %1$s.</p> |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $org_name |
364 | 364 | ); |
365 | 365 | |
366 | - return apply_filters( 'give_get_default_agreement_text', $agreement, $org_name ); |
|
366 | + return apply_filters('give_get_default_agreement_text', $agreement, $org_name); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | |
@@ -372,22 +372,22 @@ discard block |
||
372 | 372 | * |
373 | 373 | * @since 1.8.11 |
374 | 374 | */ |
375 | -function give_create_pages(){ |
|
375 | +function give_create_pages() { |
|
376 | 376 | |
377 | 377 | // Bailout if pages already created. |
378 | - if( get_option( 'give_install_pages_created') ) { |
|
378 | + if (get_option('give_install_pages_created')) { |
|
379 | 379 | return false; |
380 | 380 | } |
381 | 381 | |
382 | 382 | $options = array(); |
383 | 383 | |
384 | 384 | // Checks if the Success Page option exists AND that the page exists. |
385 | - if ( ! get_post( give_get_option( 'success_page' ) ) ) { |
|
385 | + if ( ! get_post(give_get_option('success_page'))) { |
|
386 | 386 | |
387 | 387 | // Donation Confirmation (Success) Page |
388 | 388 | $success = wp_insert_post( |
389 | 389 | array( |
390 | - 'post_title' => esc_html__( 'Donation Confirmation', 'give' ), |
|
390 | + 'post_title' => esc_html__('Donation Confirmation', 'give'), |
|
391 | 391 | 'post_content' => '[give_receipt]', |
392 | 392 | 'post_status' => 'publish', |
393 | 393 | 'post_author' => 1, |
@@ -401,13 +401,13 @@ discard block |
||
401 | 401 | } |
402 | 402 | |
403 | 403 | // Checks if the Failure Page option exists AND that the page exists. |
404 | - if ( ! get_post( give_get_option( 'failure_page' ) ) ) { |
|
404 | + if ( ! get_post(give_get_option('failure_page'))) { |
|
405 | 405 | |
406 | 406 | // Failed Donation Page |
407 | 407 | $failed = wp_insert_post( |
408 | 408 | array( |
409 | - 'post_title' => esc_html__( 'Donation Failed', 'give' ), |
|
410 | - 'post_content' => esc_html__( 'We\'re sorry, your donation failed to process. Please try again or contact site support.', 'give' ), |
|
409 | + 'post_title' => esc_html__('Donation Failed', 'give'), |
|
410 | + 'post_content' => esc_html__('We\'re sorry, your donation failed to process. Please try again or contact site support.', 'give'), |
|
411 | 411 | 'post_status' => 'publish', |
412 | 412 | 'post_author' => 1, |
413 | 413 | 'post_type' => 'page', |
@@ -419,11 +419,11 @@ discard block |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | // Checks if the History Page option exists AND that the page exists. |
422 | - if ( ! get_post( give_get_option( 'history_page' ) ) ) { |
|
422 | + if ( ! get_post(give_get_option('history_page'))) { |
|
423 | 423 | // Donation History Page |
424 | 424 | $history = wp_insert_post( |
425 | 425 | array( |
426 | - 'post_title' => esc_html__( 'Donation History', 'give' ), |
|
426 | + 'post_title' => esc_html__('Donation History', 'give'), |
|
427 | 427 | 'post_content' => '[donation_history]', |
428 | 428 | 'post_status' => 'publish', |
429 | 429 | 'post_author' => 1, |
@@ -435,10 +435,10 @@ discard block |
||
435 | 435 | $options['history_page'] = $history; |
436 | 436 | } |
437 | 437 | |
438 | - if( ! empty( $options ) ) { |
|
439 | - update_option( 'give_settings', array_merge( give_get_settings(), $options ) ); |
|
438 | + if ( ! empty($options)) { |
|
439 | + update_option('give_settings', array_merge(give_get_settings(), $options)); |
|
440 | 440 | } |
441 | 441 | |
442 | - add_option( 'give_install_pages_created', 1, '', 'no' ); |
|
442 | + add_option('give_install_pages_created', 1, '', 'no'); |
|
443 | 443 | } |
444 | -add_action( 'admin_init', 'give_create_pages', -1 ); |
|
444 | +add_action('admin_init', 'give_create_pages', -1); |
@@ -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,20 +97,19 @@ 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'] ) ? |
|
103 | - (float) apply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give-amount'] ) ) : |
|
104 | - '0.00'; |
|
105 | - $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']) ? |
|
103 | + (float) apply_filters('give_donation_total', give_maybe_sanitize_amount($_POST['give-amount'])) : '0.00'; |
|
104 | + $purchase_key = strtolower(md5($user['user_email'].date('Y-m-d H:i:s').$auth_key.uniqid('give', true))); |
|
106 | 105 | |
107 | 106 | // Setup donation information |
108 | 107 | $donation_data = array( |
109 | 108 | 'price' => $price, |
110 | 109 | 'purchase_key' => $purchase_key, |
111 | 110 | 'user_email' => $user['user_email'], |
112 | - 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ), |
|
113 | - 'user_info' => stripslashes_deep( $user_info ), |
|
111 | + 'date' => date('Y-m-d H:i:s', current_time('timestamp')), |
|
112 | + 'user_info' => stripslashes_deep($user_info), |
|
114 | 113 | 'post_data' => $_POST, |
115 | 114 | 'gateway' => $valid_data['gateway'], |
116 | 115 | 'card_info' => $valid_data['cc_info'], |
@@ -130,10 +129,10 @@ discard block |
||
130 | 129 | * @param array $user_info Array containing basic user information. |
131 | 130 | * @param bool|array $valid_data Validate fields. |
132 | 131 | */ |
133 | - do_action( 'give_checkout_before_gateway', $_POST, $user_info, $valid_data ); |
|
132 | + do_action('give_checkout_before_gateway', $_POST, $user_info, $valid_data); |
|
134 | 133 | |
135 | 134 | // Sanity check for price |
136 | - if ( ! $donation_data['price'] ) { |
|
135 | + if ( ! $donation_data['price']) { |
|
137 | 136 | // Revert to manual |
138 | 137 | $donation_data['gateway'] = 'manual'; |
139 | 138 | $_POST['give-gateway'] = 'manual'; |
@@ -144,27 +143,27 @@ discard block |
||
144 | 143 | * |
145 | 144 | * @since 1.7 |
146 | 145 | */ |
147 | - $donation_data = apply_filters( 'give_donation_data_before_gateway', $donation_data, $valid_data ); |
|
146 | + $donation_data = apply_filters('give_donation_data_before_gateway', $donation_data, $valid_data); |
|
148 | 147 | |
149 | 148 | // Setup the data we're storing in the donation session |
150 | 149 | $session_data = $donation_data; |
151 | 150 | |
152 | 151 | // Make sure credit card numbers are never stored in sessions |
153 | - unset( $session_data['card_info']['card_number'] ); |
|
154 | - unset( $session_data['post_data']['card_number'] ); |
|
152 | + unset($session_data['card_info']['card_number']); |
|
153 | + unset($session_data['post_data']['card_number']); |
|
155 | 154 | |
156 | 155 | // Used for showing data to non logged-in users after donation, and for other plugins needing donation data. |
157 | - give_set_purchase_session( $session_data ); |
|
156 | + give_set_purchase_session($session_data); |
|
158 | 157 | |
159 | 158 | // Send info to the gateway for payment processing |
160 | - give_send_to_gateway( $donation_data['gateway'], $donation_data ); |
|
159 | + give_send_to_gateway($donation_data['gateway'], $donation_data); |
|
161 | 160 | give_die(); |
162 | 161 | |
163 | 162 | } |
164 | 163 | |
165 | -add_action( 'give_purchase', 'give_process_donation_form' ); |
|
166 | -add_action( 'wp_ajax_give_process_donation', 'give_process_donation_form' ); |
|
167 | -add_action( 'wp_ajax_nopriv_give_process_donation', 'give_process_donation_form' ); |
|
164 | +add_action('give_purchase', 'give_process_donation_form'); |
|
165 | +add_action('wp_ajax_give_process_donation', 'give_process_donation_form'); |
|
166 | +add_action('wp_ajax_nopriv_give_process_donation', 'give_process_donation_form'); |
|
168 | 167 | |
169 | 168 | |
170 | 169 | /** |
@@ -177,29 +176,29 @@ discard block |
||
177 | 176 | * |
178 | 177 | * @return void |
179 | 178 | */ |
180 | -function give_check_logged_in_user_for_existing_email( $valid_data, $post ) { |
|
179 | +function give_check_logged_in_user_for_existing_email($valid_data, $post) { |
|
181 | 180 | |
182 | 181 | // Verify that the email address belongs to this customer. |
183 | - if ( is_user_logged_in() ) { |
|
182 | + if (is_user_logged_in()) { |
|
184 | 183 | |
185 | - $submitted_email = $valid_data['logged_in_user']['user_email']; |
|
186 | - $customer = new Give_Donor( get_current_user_id(), true ); |
|
184 | + $submitted_email = $valid_data['logged_in_user']['user_email']; |
|
185 | + $customer = new Give_Donor(get_current_user_id(), true); |
|
187 | 186 | |
188 | 187 | // If this email address is not registered with this customer, see if it belongs to any other customer |
189 | 188 | if ( |
190 | 189 | $submitted_email !== $customer->email |
191 | - && ( is_array( $customer->emails ) && ! in_array( $submitted_email, $customer->emails ) ) |
|
190 | + && (is_array($customer->emails) && ! in_array($submitted_email, $customer->emails)) |
|
192 | 191 | ) { |
193 | - $found_customer = new Give_Donor( $submitted_email ); |
|
192 | + $found_customer = new Give_Donor($submitted_email); |
|
194 | 193 | |
195 | - if ( $found_customer->id > 0 ) { |
|
196 | - 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 ) ); |
|
194 | + if ($found_customer->id > 0) { |
|
195 | + 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)); |
|
197 | 196 | } |
198 | 197 | } |
199 | 198 | } |
200 | 199 | } |
201 | 200 | |
202 | -add_action( 'give_checkout_error_checks', 'give_check_logged_in_user_for_existing_email', 10, 2 ); |
|
201 | +add_action('give_checkout_error_checks', 'give_check_logged_in_user_for_existing_email', 10, 2); |
|
203 | 202 | |
204 | 203 | /** |
205 | 204 | * Process the checkout login form |
@@ -209,49 +208,49 @@ discard block |
||
209 | 208 | * @return void |
210 | 209 | */ |
211 | 210 | function give_process_form_login() { |
212 | - $is_ajax = isset( $_POST['give_ajax'] ); |
|
211 | + $is_ajax = isset($_POST['give_ajax']); |
|
213 | 212 | |
214 | 213 | $user_data = give_donation_form_validate_user_login(); |
215 | 214 | |
216 | - if ( give_get_errors() || $user_data['user_id'] < 1 ) { |
|
217 | - if ( $is_ajax ) { |
|
215 | + if (give_get_errors() || $user_data['user_id'] < 1) { |
|
216 | + if ($is_ajax) { |
|
218 | 217 | /** |
219 | 218 | * Fires when AJAX sends back errors from the donation form. |
220 | 219 | * |
221 | 220 | * @since 1.0 |
222 | 221 | */ |
223 | 222 | ob_start(); |
224 | - do_action( 'give_ajax_donation_errors' ); |
|
223 | + do_action('give_ajax_donation_errors'); |
|
225 | 224 | $message = ob_get_contents(); |
226 | 225 | ob_end_clean(); |
227 | - wp_send_json_error( $message ); |
|
226 | + wp_send_json_error($message); |
|
228 | 227 | } else { |
229 | - wp_redirect( $_SERVER['HTTP_REFERER'] ); |
|
228 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
230 | 229 | exit; |
231 | 230 | } |
232 | 231 | } |
233 | 232 | |
234 | - give_log_user_in( $user_data['user_id'], $user_data['user_login'], $user_data['user_pass'] ); |
|
233 | + give_log_user_in($user_data['user_id'], $user_data['user_login'], $user_data['user_pass']); |
|
235 | 234 | |
236 | - if ( $is_ajax ) { |
|
235 | + if ($is_ajax) { |
|
237 | 236 | $message = Give()->notices->print_frontend_notice( |
238 | 237 | sprintf( |
239 | 238 | /* translators: %s: user first name */ |
240 | - esc_html__( 'Welcome %s! You have successfully logged into your account.', 'give' ), |
|
241 | - ( ! empty( $user_data['user_first'] ) ) ? $user_data['user_first'] : $user_data['user_login'] |
|
239 | + esc_html__('Welcome %s! You have successfully logged into your account.', 'give'), |
|
240 | + ( ! empty($user_data['user_first'])) ? $user_data['user_first'] : $user_data['user_login'] |
|
242 | 241 | ), |
243 | 242 | false, |
244 | 243 | 'success' |
245 | 244 | ); |
246 | 245 | |
247 | - wp_send_json_success( $message ); |
|
246 | + wp_send_json_success($message); |
|
248 | 247 | } else { |
249 | - wp_redirect( $_SERVER['HTTP_REFERER'] ); |
|
248 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
250 | 249 | } |
251 | 250 | } |
252 | 251 | |
253 | -add_action( 'wp_ajax_give_process_donation_login', 'give_process_form_login' ); |
|
254 | -add_action( 'wp_ajax_nopriv_give_process_donation_login', 'give_process_form_login' ); |
|
252 | +add_action('wp_ajax_give_process_donation_login', 'give_process_form_login'); |
|
253 | +add_action('wp_ajax_nopriv_give_process_donation_login', 'give_process_form_login'); |
|
255 | 254 | |
256 | 255 | /** |
257 | 256 | * Donation Form Validate Fields. |
@@ -263,55 +262,55 @@ discard block |
||
263 | 262 | function give_donation_form_validate_fields() { |
264 | 263 | |
265 | 264 | // Check if there is $_POST |
266 | - if ( empty( $_POST ) ) { |
|
265 | + if (empty($_POST)) { |
|
267 | 266 | return false; |
268 | 267 | } |
269 | 268 | |
270 | - $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : ''; |
|
269 | + $form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : ''; |
|
271 | 270 | |
272 | 271 | // Start an array to collect valid data |
273 | 272 | $valid_data = array( |
274 | 273 | 'gateway' => give_donation_form_validate_gateway(), // Gateway fallback (amount is validated here) |
275 | - 'need_new_user' => false, // New user flag |
|
276 | - 'need_user_login' => false, // Login user flag |
|
277 | - 'logged_user_data' => array(), // Logged user collected data |
|
278 | - 'new_user_data' => array(), // New user collected data |
|
279 | - 'login_user_data' => array(), // Login user collected data |
|
280 | - 'guest_user_data' => array(), // Guest user collected data |
|
281 | - 'cc_info' => give_donation_form_validate_cc(),// Credit card info |
|
274 | + 'need_new_user' => false, // New user flag |
|
275 | + 'need_user_login' => false, // Login user flag |
|
276 | + 'logged_user_data' => array(), // Logged user collected data |
|
277 | + 'new_user_data' => array(), // New user collected data |
|
278 | + 'login_user_data' => array(), // Login user collected data |
|
279 | + 'guest_user_data' => array(), // Guest user collected data |
|
280 | + 'cc_info' => give_donation_form_validate_cc(), // Credit card info |
|
282 | 281 | ); |
283 | 282 | |
284 | 283 | // Validate Honeypot First |
285 | - if ( ! empty( $_POST['give-honeypot'] ) ) { |
|
286 | - give_set_error( 'invalid_honeypot', esc_html__( 'Honeypot field detected. Go away bad bot!', 'give' ) ); |
|
284 | + if ( ! empty($_POST['give-honeypot'])) { |
|
285 | + give_set_error('invalid_honeypot', esc_html__('Honeypot field detected. Go away bad bot!', 'give')); |
|
287 | 286 | } |
288 | 287 | |
289 | 288 | // Validate agree to terms |
290 | - if ( give_is_terms_enabled( $form_id ) ) { |
|
289 | + if (give_is_terms_enabled($form_id)) { |
|
291 | 290 | give_donation_form_validate_agree_to_terms(); |
292 | 291 | } |
293 | 292 | |
294 | 293 | // Stop processing donor registration, if donor registration is optional and donor can do guest checkout. |
295 | 294 | // If registration form username field is empty that means donor do not want to registration instead want guest checkout. |
296 | 295 | if ( |
297 | - ! give_logged_in_only( $form_id ) |
|
298 | - && isset( $_POST['give-purchase-var'] ) |
|
296 | + ! give_logged_in_only($form_id) |
|
297 | + && isset($_POST['give-purchase-var']) |
|
299 | 298 | && $_POST['give-purchase-var'] == 'needs-to-register' |
300 | - && empty( $_POST['give_user_login'] ) |
|
299 | + && empty($_POST['give_user_login']) |
|
301 | 300 | ) { |
302 | - unset( $_POST['give-purchase-var'] ); |
|
301 | + unset($_POST['give-purchase-var']); |
|
303 | 302 | } |
304 | 303 | |
305 | - if ( is_user_logged_in() ) { |
|
304 | + if (is_user_logged_in()) { |
|
306 | 305 | // Collect logged in user data. |
307 | 306 | $valid_data['logged_in_user'] = give_donation_form_validate_logged_in_user(); |
308 | - } elseif ( isset( $_POST['give-purchase-var'] ) && $_POST['give-purchase-var'] == 'needs-to-register' ) { |
|
307 | + } elseif (isset($_POST['give-purchase-var']) && $_POST['give-purchase-var'] == 'needs-to-register') { |
|
309 | 308 | // Set new user registration as required. |
310 | 309 | $valid_data['need_new_user'] = true; |
311 | 310 | // Validate new user data. |
312 | 311 | $valid_data['new_user_data'] = give_donation_form_validate_new_user(); |
313 | 312 | // Check if login validation is needed. |
314 | - } elseif ( isset( $_POST['give-purchase-var'] ) && $_POST['give-purchase-var'] == 'needs-to-login' ) { |
|
313 | + } elseif (isset($_POST['give-purchase-var']) && $_POST['give-purchase-var'] == 'needs-to-login') { |
|
315 | 314 | // Set user login as required. |
316 | 315 | $valid_data['need_user_login'] = true; |
317 | 316 | // Validate users login info. |
@@ -336,41 +335,41 @@ discard block |
||
336 | 335 | */ |
337 | 336 | function give_donation_form_validate_gateway() { |
338 | 337 | |
339 | - $form_id = isset( $_REQUEST['give-form-id'] ) ? $_REQUEST['give-form-id'] : 0; |
|
340 | - $amount = isset( $_REQUEST['give-amount'] ) ? give_maybe_sanitize_amount( $_REQUEST['give-amount'] ) : 0; |
|
341 | - $gateway = give_get_default_gateway( $form_id ); |
|
338 | + $form_id = isset($_REQUEST['give-form-id']) ? $_REQUEST['give-form-id'] : 0; |
|
339 | + $amount = isset($_REQUEST['give-amount']) ? give_maybe_sanitize_amount($_REQUEST['give-amount']) : 0; |
|
340 | + $gateway = give_get_default_gateway($form_id); |
|
342 | 341 | |
343 | 342 | // Check if a gateway value is present. |
344 | - if ( ! empty( $_REQUEST['give-gateway'] ) ) { |
|
343 | + if ( ! empty($_REQUEST['give-gateway'])) { |
|
345 | 344 | |
346 | - $gateway = sanitize_text_field( $_REQUEST['give-gateway'] ); |
|
345 | + $gateway = sanitize_text_field($_REQUEST['give-gateway']); |
|
347 | 346 | |
348 | 347 | // Is amount being donated in LIVE mode 0.00? If so, error: |
349 | - if ( $amount == 0 && ! give_is_test_mode() ) { |
|
348 | + if ($amount == 0 && ! give_is_test_mode()) { |
|
350 | 349 | |
351 | - give_set_error( 'invalid_donation_amount', __( 'Please insert a valid donation amount.', 'give' ) ); |
|
350 | + give_set_error('invalid_donation_amount', __('Please insert a valid donation amount.', 'give')); |
|
352 | 351 | |
353 | 352 | } // End if(). |
354 | - elseif ( ! give_verify_minimum_price() ) { |
|
353 | + elseif ( ! give_verify_minimum_price()) { |
|
355 | 354 | // translators: %s: minimum donation amount. |
356 | 355 | give_set_error( |
357 | 356 | 'invalid_donation_minimum', |
358 | 357 | sprintf( |
359 | 358 | /* translators: %s: minimum donation amount */ |
360 | - __( 'This form has a minimum donation amount of %s.', 'give' ), |
|
361 | - give_currency_filter( give_format_amount( give_get_form_minimum_price( $form_id ), array( 'sanitize' => false ) ) ) |
|
359 | + __('This form has a minimum donation amount of %s.', 'give'), |
|
360 | + give_currency_filter(give_format_amount(give_get_form_minimum_price($form_id), array('sanitize' => false))) |
|
362 | 361 | ) |
363 | 362 | ); |
364 | 363 | |
365 | 364 | } //Is this test mode zero donation? Let it through but set to manual gateway. |
366 | - elseif ( $amount == 0 && give_is_test_mode() ) { |
|
365 | + elseif ($amount == 0 && give_is_test_mode()) { |
|
367 | 366 | |
368 | 367 | $gateway = 'manual'; |
369 | 368 | |
370 | 369 | } //Check if this gateway is active. |
371 | - elseif ( ! give_is_gateway_active( $gateway ) ) { |
|
370 | + elseif ( ! give_is_gateway_active($gateway)) { |
|
372 | 371 | |
373 | - give_set_error( 'invalid_gateway', __( 'The selected payment gateway is not enabled.', 'give' ) ); |
|
372 | + give_set_error('invalid_gateway', __('The selected payment gateway is not enabled.', 'give')); |
|
374 | 373 | |
375 | 374 | } |
376 | 375 | } |
@@ -388,21 +387,21 @@ discard block |
||
388 | 387 | */ |
389 | 388 | function give_verify_minimum_price() { |
390 | 389 | |
391 | - $amount = give_maybe_sanitize_amount( $_REQUEST['give-amount'] ); |
|
392 | - $form_id = isset( $_REQUEST['give-form-id'] ) ? $_REQUEST['give-form-id'] : 0; |
|
393 | - $price_id = isset( $_REQUEST['give-price-id'] ) ? $_REQUEST['give-price-id'] : null; |
|
394 | - $variable_prices = give_has_variable_prices( $form_id ); |
|
390 | + $amount = give_maybe_sanitize_amount($_REQUEST['give-amount']); |
|
391 | + $form_id = isset($_REQUEST['give-form-id']) ? $_REQUEST['give-form-id'] : 0; |
|
392 | + $price_id = isset($_REQUEST['give-price-id']) ? $_REQUEST['give-price-id'] : null; |
|
393 | + $variable_prices = give_has_variable_prices($form_id); |
|
395 | 394 | |
396 | - if ( $variable_prices && in_array( $price_id, give_get_variable_price_ids( $form_id ) ) ) { |
|
395 | + if ($variable_prices && in_array($price_id, give_get_variable_price_ids($form_id))) { |
|
397 | 396 | |
398 | - $price_level_amount = give_get_price_option_amount( $form_id, $price_id ); |
|
397 | + $price_level_amount = give_get_price_option_amount($form_id, $price_id); |
|
399 | 398 | |
400 | - if ( $price_level_amount == $amount ) { |
|
399 | + if ($price_level_amount == $amount) { |
|
401 | 400 | return true; |
402 | 401 | } |
403 | 402 | } |
404 | 403 | |
405 | - if ( give_get_form_minimum_price( $form_id ) > $amount ) { |
|
404 | + if (give_get_form_minimum_price($form_id) > $amount) { |
|
406 | 405 | return false; |
407 | 406 | } |
408 | 407 | |
@@ -418,9 +417,9 @@ discard block |
||
418 | 417 | */ |
419 | 418 | function give_donation_form_validate_agree_to_terms() { |
420 | 419 | // Validate agree to terms. |
421 | - if ( ! isset( $_POST['give_agree_to_terms'] ) || $_POST['give_agree_to_terms'] != 1 ) { |
|
420 | + if ( ! isset($_POST['give_agree_to_terms']) || $_POST['give_agree_to_terms'] != 1) { |
|
422 | 421 | // User did not agree. |
423 | - give_set_error( 'agree_to_terms', apply_filters( 'give_agree_to_terms_text', __( 'You must agree to the terms and conditions.', 'give' ) ) ); |
|
422 | + give_set_error('agree_to_terms', apply_filters('give_agree_to_terms_text', __('You must agree to the terms and conditions.', 'give'))); |
|
424 | 423 | } |
425 | 424 | } |
426 | 425 | |
@@ -434,59 +433,59 @@ discard block |
||
434 | 433 | * |
435 | 434 | * @return array |
436 | 435 | */ |
437 | -function give_get_required_fields( $form_id ) { |
|
436 | +function give_get_required_fields($form_id) { |
|
438 | 437 | |
439 | - $payment_mode = give_get_chosen_gateway( $form_id ); |
|
438 | + $payment_mode = give_get_chosen_gateway($form_id); |
|
440 | 439 | |
441 | 440 | $required_fields = array( |
442 | 441 | 'give_email' => array( |
443 | 442 | 'error_id' => 'invalid_email', |
444 | - 'error_message' => __( 'Please enter a valid email address.', 'give' ), |
|
443 | + 'error_message' => __('Please enter a valid email address.', 'give'), |
|
445 | 444 | ), |
446 | 445 | 'give_first' => array( |
447 | 446 | 'error_id' => 'invalid_first_name', |
448 | - 'error_message' => __( 'Please enter your first name.', 'give' ), |
|
447 | + 'error_message' => __('Please enter your first name.', 'give'), |
|
449 | 448 | ), |
450 | 449 | ); |
451 | 450 | |
452 | - $require_address = give_require_billing_address( $payment_mode ); |
|
451 | + $require_address = give_require_billing_address($payment_mode); |
|
453 | 452 | |
454 | - if ( $require_address ) { |
|
455 | - $required_fields['card_address'] = array( |
|
453 | + if ($require_address) { |
|
454 | + $required_fields['card_address'] = array( |
|
456 | 455 | 'error_id' => 'invalid_card_address', |
457 | - 'error_message' => __( 'Please enter your primary billing address.', 'give' ), |
|
456 | + 'error_message' => __('Please enter your primary billing address.', 'give'), |
|
458 | 457 | ); |
459 | - $required_fields['card_zip'] = array( |
|
458 | + $required_fields['card_zip'] = array( |
|
460 | 459 | 'error_id' => 'invalid_zip_code', |
461 | - 'error_message' => __( 'Please enter your zip / postal code.', 'give' ), |
|
460 | + 'error_message' => __('Please enter your zip / postal code.', 'give'), |
|
462 | 461 | ); |
463 | - $required_fields['card_city'] = array( |
|
462 | + $required_fields['card_city'] = array( |
|
464 | 463 | 'error_id' => 'invalid_city', |
465 | - 'error_message' => __( 'Please enter your billing city.', 'give' ), |
|
464 | + 'error_message' => __('Please enter your billing city.', 'give'), |
|
466 | 465 | ); |
467 | 466 | $required_fields['billing_country'] = array( |
468 | 467 | 'error_id' => 'invalid_country', |
469 | - 'error_message' => __( 'Please select your billing country.', 'give' ), |
|
468 | + 'error_message' => __('Please select your billing country.', 'give'), |
|
470 | 469 | ); |
471 | 470 | |
472 | 471 | |
473 | - $required_fields['card_state'] = array( |
|
472 | + $required_fields['card_state'] = array( |
|
474 | 473 | 'error_id' => 'invalid_state', |
475 | - 'error_message' => __( 'Please enter billing state / province / County.', 'give' ), |
|
474 | + 'error_message' => __('Please enter billing state / province / County.', 'give'), |
|
476 | 475 | ); |
477 | 476 | |
478 | 477 | // Check if billing country alredy exists. |
479 | - if ( ! empty( $_POST['billing_country'] ) ) { |
|
478 | + if ( ! empty($_POST['billing_country'])) { |
|
480 | 479 | // Get the value from $_POST. |
481 | - $country = sanitize_text_field( $_POST['billing_country'] ); |
|
480 | + $country = sanitize_text_field($_POST['billing_country']); |
|
482 | 481 | |
483 | 482 | // Get the country list that does not required any states init. |
484 | 483 | $states_country = give_states_not_required_country_list(); |
485 | 484 | |
486 | 485 | // Check if states is empty or not. |
487 | - if ( array_key_exists( $country, $states_country ) ) { |
|
486 | + if (array_key_exists($country, $states_country)) { |
|
488 | 487 | // If states is empty remove the required feilds of state in billing cart. |
489 | - unset( $required_fields['card_state'] ); |
|
488 | + unset($required_fields['card_state']); |
|
490 | 489 | } |
491 | 490 | } |
492 | 491 | } |
@@ -496,7 +495,7 @@ discard block |
||
496 | 495 | * |
497 | 496 | * @since 1.7 |
498 | 497 | */ |
499 | - $required_fields = apply_filters( 'give_donation_form_required_fields', $required_fields, $form_id ); |
|
498 | + $required_fields = apply_filters('give_donation_form_required_fields', $required_fields, $form_id); |
|
500 | 499 | |
501 | 500 | return $required_fields; |
502 | 501 | |
@@ -511,16 +510,16 @@ discard block |
||
511 | 510 | * |
512 | 511 | * @return bool |
513 | 512 | */ |
514 | -function give_require_billing_address( $payment_mode ) { |
|
513 | +function give_require_billing_address($payment_mode) { |
|
515 | 514 | |
516 | 515 | $return = false; |
517 | 516 | |
518 | - if ( isset( $_POST['billing_country'] ) || did_action( "give_{$payment_mode}_cc_form" ) || did_action( 'give_cc_form' ) ) { |
|
517 | + if (isset($_POST['billing_country']) || did_action("give_{$payment_mode}_cc_form") || did_action('give_cc_form')) { |
|
519 | 518 | $return = true; |
520 | 519 | } |
521 | 520 | |
522 | 521 | // Let payment gateways and other extensions determine if address fields should be required. |
523 | - return apply_filters( 'give_require_billing_address', $return ); |
|
522 | + return apply_filters('give_require_billing_address', $return); |
|
524 | 523 | |
525 | 524 | } |
526 | 525 | |
@@ -534,42 +533,42 @@ discard block |
||
534 | 533 | function give_donation_form_validate_logged_in_user() { |
535 | 534 | global $user_ID; |
536 | 535 | |
537 | - $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : ''; |
|
536 | + $form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : ''; |
|
538 | 537 | |
539 | 538 | // Start empty array to collect valid user data. |
540 | 539 | $valid_user_data = array( |
541 | 540 | // Assume there will be errors. |
542 | - 'user_id' => - 1, |
|
541 | + 'user_id' => -1, |
|
543 | 542 | ); |
544 | 543 | |
545 | 544 | // Verify there is a user_ID. |
546 | - if ( $user_ID > 0 ) { |
|
545 | + if ($user_ID > 0) { |
|
547 | 546 | // Get the logged in user data. |
548 | - $user_data = get_userdata( $user_ID ); |
|
547 | + $user_data = get_userdata($user_ID); |
|
549 | 548 | |
550 | 549 | // Loop through required fields and show error messages. |
551 | - foreach ( give_get_required_fields( $form_id ) as $field_name => $value ) { |
|
552 | - if ( in_array( $value, give_get_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) { |
|
553 | - give_set_error( $value['error_id'], $value['error_message'] ); |
|
550 | + foreach (give_get_required_fields($form_id) as $field_name => $value) { |
|
551 | + if (in_array($value, give_get_required_fields($form_id)) && empty($_POST[$field_name])) { |
|
552 | + give_set_error($value['error_id'], $value['error_message']); |
|
554 | 553 | } |
555 | 554 | } |
556 | 555 | |
557 | 556 | // Verify data. |
558 | - if ( $user_data ) { |
|
557 | + if ($user_data) { |
|
559 | 558 | // Collected logged in user data. |
560 | 559 | $valid_user_data = array( |
561 | 560 | 'user_id' => $user_ID, |
562 | - 'user_email' => isset( $_POST['give_email'] ) ? sanitize_email( $_POST['give_email'] ) : $user_data->user_email, |
|
563 | - 'user_first' => isset( $_POST['give_first'] ) && ! empty( $_POST['give_first'] ) ? sanitize_text_field( $_POST['give_first'] ) : $user_data->first_name, |
|
564 | - 'user_last' => isset( $_POST['give_last'] ) && ! empty( $_POST['give_last'] ) ? sanitize_text_field( $_POST['give_last'] ) : $user_data->last_name, |
|
561 | + 'user_email' => isset($_POST['give_email']) ? sanitize_email($_POST['give_email']) : $user_data->user_email, |
|
562 | + 'user_first' => isset($_POST['give_first']) && ! empty($_POST['give_first']) ? sanitize_text_field($_POST['give_first']) : $user_data->first_name, |
|
563 | + 'user_last' => isset($_POST['give_last']) && ! empty($_POST['give_last']) ? sanitize_text_field($_POST['give_last']) : $user_data->last_name, |
|
565 | 564 | ); |
566 | 565 | |
567 | - if ( ! is_email( $valid_user_data['user_email'] ) ) { |
|
568 | - give_set_error( 'email_invalid', esc_html__( 'Invalid email.', 'give' ) ); |
|
566 | + if ( ! is_email($valid_user_data['user_email'])) { |
|
567 | + give_set_error('email_invalid', esc_html__('Invalid email.', 'give')); |
|
569 | 568 | } |
570 | 569 | } else { |
571 | 570 | // Set invalid user error. |
572 | - give_set_error( 'invalid_user', esc_html__( 'The user information is invalid.', 'give' ) ); |
|
571 | + give_set_error('invalid_user', esc_html__('The user information is invalid.', 'give')); |
|
573 | 572 | } |
574 | 573 | } |
575 | 574 | |
@@ -588,7 +587,7 @@ discard block |
||
588 | 587 | // Default user data. |
589 | 588 | $default_user_data = array( |
590 | 589 | 'give-form-id' => '', |
591 | - 'user_id' => - 1, // Assume there will be errors. |
|
590 | + 'user_id' => -1, // Assume there will be errors. |
|
592 | 591 | 'user_first' => '', |
593 | 592 | 'user_last' => '', |
594 | 593 | 'give_user_login' => false, |
@@ -598,14 +597,14 @@ discard block |
||
598 | 597 | ); |
599 | 598 | |
600 | 599 | // Get user data. |
601 | - $user_data = wp_parse_args( array_map( 'trim', give_clean( $_POST ) ), $default_user_data ); |
|
600 | + $user_data = wp_parse_args(array_map('trim', give_clean($_POST)), $default_user_data); |
|
602 | 601 | $registering_new_user = false; |
603 | - $form_id = absint( $user_data['give-form-id'] ); |
|
602 | + $form_id = absint($user_data['give-form-id']); |
|
604 | 603 | |
605 | 604 | // Start an empty array to collect valid user data. |
606 | 605 | $valid_user_data = array( |
607 | 606 | // Assume there will be errors. |
608 | - 'user_id' => - 1, |
|
607 | + 'user_id' => -1, |
|
609 | 608 | |
610 | 609 | // Get first name. |
611 | 610 | 'user_first' => $user_data['give_first'], |
@@ -615,25 +614,25 @@ discard block |
||
615 | 614 | ); |
616 | 615 | |
617 | 616 | // Loop through required fields and show error messages. |
618 | - foreach ( give_get_required_fields( $form_id ) as $field_name => $value ) { |
|
619 | - if ( in_array( $value, give_get_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) { |
|
620 | - give_set_error( $value['error_id'], $value['error_message'] ); |
|
617 | + foreach (give_get_required_fields($form_id) as $field_name => $value) { |
|
618 | + if (in_array($value, give_get_required_fields($form_id)) && empty($_POST[$field_name])) { |
|
619 | + give_set_error($value['error_id'], $value['error_message']); |
|
621 | 620 | } |
622 | 621 | } |
623 | 622 | |
624 | 623 | // Check if we have an username to register. |
625 | - if ( give_validate_username( $user_data['give_user_login'] ) ) { |
|
624 | + if (give_validate_username($user_data['give_user_login'])) { |
|
626 | 625 | $registering_new_user = true; |
627 | 626 | $valid_user_data['user_login'] = $user_data['give_user_login']; |
628 | 627 | } |
629 | 628 | |
630 | 629 | // Check if we have an email to verify. |
631 | - if ( give_validate_user_email( $user_data['give_email'], $registering_new_user ) ) { |
|
630 | + if (give_validate_user_email($user_data['give_email'], $registering_new_user)) { |
|
632 | 631 | $valid_user_data['user_email'] = $user_data['give_email']; |
633 | 632 | } |
634 | 633 | |
635 | 634 | // Check password. |
636 | - if ( give_validate_user_password( $user_data['give_user_pass'], $user_data['give_user_pass_confirm'], $registering_new_user ) ) { |
|
635 | + if (give_validate_user_password($user_data['give_user_pass'], $user_data['give_user_pass_confirm'], $registering_new_user)) { |
|
637 | 636 | // All is good to go. |
638 | 637 | $valid_user_data['user_pass'] = $user_data['give_user_pass']; |
639 | 638 | } |
@@ -653,36 +652,36 @@ discard block |
||
653 | 652 | // Start an array to collect valid user data. |
654 | 653 | $valid_user_data = array( |
655 | 654 | // Assume there will be errors. |
656 | - 'user_id' => - 1, |
|
655 | + 'user_id' => -1, |
|
657 | 656 | ); |
658 | 657 | |
659 | 658 | // Username. |
660 | - if ( ! isset( $_POST['give_user_login'] ) || $_POST['give_user_login'] == '' ) { |
|
661 | - give_set_error( 'must_log_in', __( 'You must register or login to complete your donation.', 'give' ) ); |
|
659 | + if ( ! isset($_POST['give_user_login']) || $_POST['give_user_login'] == '') { |
|
660 | + give_set_error('must_log_in', __('You must register or login to complete your donation.', 'give')); |
|
662 | 661 | |
663 | 662 | return $valid_user_data; |
664 | 663 | } |
665 | 664 | |
666 | 665 | // Get the user by login. |
667 | - $user_data = get_user_by( 'login', strip_tags( $_POST['give_user_login'] ) ); |
|
666 | + $user_data = get_user_by('login', strip_tags($_POST['give_user_login'])); |
|
668 | 667 | |
669 | 668 | // Check if user exists. |
670 | - if ( $user_data ) { |
|
669 | + if ($user_data) { |
|
671 | 670 | // Get password. |
672 | - $user_pass = isset( $_POST['give_user_pass'] ) ? $_POST['give_user_pass'] : false; |
|
671 | + $user_pass = isset($_POST['give_user_pass']) ? $_POST['give_user_pass'] : false; |
|
673 | 672 | |
674 | 673 | // Check user_pass. |
675 | - if ( $user_pass ) { |
|
674 | + if ($user_pass) { |
|
676 | 675 | // Check if password is valid. |
677 | - if ( ! wp_check_password( $user_pass, $user_data->user_pass, $user_data->ID ) ) { |
|
676 | + if ( ! wp_check_password($user_pass, $user_data->user_pass, $user_data->ID)) { |
|
678 | 677 | // Incorrect password. |
679 | 678 | give_set_error( |
680 | 679 | 'password_incorrect', |
681 | 680 | sprintf( |
682 | 681 | '%1$s <a href="%2$s">%3$s</a>', |
683 | - __( 'The password you entered is incorrect.', 'give' ), |
|
684 | - wp_lostpassword_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" ), |
|
685 | - __( 'Reset Password', 'give' ) |
|
682 | + __('The password you entered is incorrect.', 'give'), |
|
683 | + wp_lostpassword_url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"), |
|
684 | + __('Reset Password', 'give') |
|
686 | 685 | ) |
687 | 686 | ); |
688 | 687 | // All is correct. |
@@ -699,11 +698,11 @@ discard block |
||
699 | 698 | } |
700 | 699 | } else { |
701 | 700 | // Empty password. |
702 | - give_set_error( 'password_empty', __( 'Enter a password.', 'give' ) ); |
|
701 | + give_set_error('password_empty', __('Enter a password.', 'give')); |
|
703 | 702 | } |
704 | 703 | } else { |
705 | 704 | // No username. |
706 | - give_set_error( 'username_incorrect', __( 'The username you entered does not exist.', 'give' ) ); |
|
705 | + give_set_error('username_incorrect', __('The username you entered does not exist.', 'give')); |
|
707 | 706 | }// End if(). |
708 | 707 | |
709 | 708 | return $valid_user_data; |
@@ -718,7 +717,7 @@ discard block |
||
718 | 717 | */ |
719 | 718 | function give_donation_form_validate_guest_user() { |
720 | 719 | |
721 | - $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : ''; |
|
720 | + $form_id = isset($_POST['give-form-id']) ? $_POST['give-form-id'] : ''; |
|
722 | 721 | |
723 | 722 | // Start an array to collect valid user data. |
724 | 723 | $valid_user_data = array( |
@@ -727,38 +726,38 @@ discard block |
||
727 | 726 | ); |
728 | 727 | |
729 | 728 | // Show error message if user must be logged in. |
730 | - if ( give_logged_in_only( $form_id ) ) { |
|
731 | - give_set_error( 'logged_in_only', __( 'You must be logged in to donate.', 'give' ) ); |
|
729 | + if (give_logged_in_only($form_id)) { |
|
730 | + give_set_error('logged_in_only', __('You must be logged in to donate.', 'give')); |
|
732 | 731 | } |
733 | 732 | |
734 | 733 | // Get the guest email. |
735 | - $guest_email = isset( $_POST['give_email'] ) ? $_POST['give_email'] : false; |
|
734 | + $guest_email = isset($_POST['give_email']) ? $_POST['give_email'] : false; |
|
736 | 735 | |
737 | 736 | // Check email. |
738 | - if ( $guest_email && strlen( $guest_email ) > 0 ) { |
|
737 | + if ($guest_email && strlen($guest_email) > 0) { |
|
739 | 738 | // Validate email. |
740 | - if ( ! is_email( $guest_email ) ) { |
|
739 | + if ( ! is_email($guest_email)) { |
|
741 | 740 | // Invalid email. |
742 | - give_set_error( 'email_invalid', __( 'Invalid email.', 'give' ) ); |
|
741 | + give_set_error('email_invalid', __('Invalid email.', 'give')); |
|
743 | 742 | } else { |
744 | 743 | // All is good to go. |
745 | 744 | $valid_user_data['user_email'] = $guest_email; |
746 | 745 | |
747 | 746 | // Get user_id from donor if exist. |
748 | - $donor = new Give_Donor( $guest_email ); |
|
749 | - if ( $donor->id && $donor->user_id ) { |
|
747 | + $donor = new Give_Donor($guest_email); |
|
748 | + if ($donor->id && $donor->user_id) { |
|
750 | 749 | $valid_user_data['user_id'] = $donor->user_id; |
751 | 750 | } |
752 | 751 | } |
753 | 752 | } else { |
754 | 753 | // No email. |
755 | - give_set_error( 'email_empty', __( 'Enter an email.', 'give' ) ); |
|
754 | + give_set_error('email_empty', __('Enter an email.', 'give')); |
|
756 | 755 | } |
757 | 756 | |
758 | 757 | // Loop through required fields and show error messages. |
759 | - foreach ( give_get_required_fields( $form_id ) as $field_name => $value ) { |
|
760 | - if ( in_array( $value, give_get_required_fields( $form_id ) ) && empty( $_POST[ $field_name ] ) ) { |
|
761 | - give_set_error( $value['error_id'], $value['error_message'] ); |
|
758 | + foreach (give_get_required_fields($form_id) as $field_name => $value) { |
|
759 | + if (in_array($value, give_get_required_fields($form_id)) && empty($_POST[$field_name])) { |
|
760 | + give_set_error($value['error_id'], $value['error_message']); |
|
762 | 761 | } |
763 | 762 | } |
764 | 763 | |
@@ -774,36 +773,36 @@ discard block |
||
774 | 773 | * @since 1.0 |
775 | 774 | * @return integer |
776 | 775 | */ |
777 | -function give_register_and_login_new_user( $user_data = array() ) { |
|
776 | +function give_register_and_login_new_user($user_data = array()) { |
|
778 | 777 | // Verify the array. |
779 | - if ( empty( $user_data ) ) { |
|
780 | - return - 1; |
|
778 | + if (empty($user_data)) { |
|
779 | + return -1; |
|
781 | 780 | } |
782 | 781 | |
783 | - if ( give_get_errors() ) { |
|
784 | - return - 1; |
|
782 | + if (give_get_errors()) { |
|
783 | + return -1; |
|
785 | 784 | } |
786 | 785 | |
787 | - $user_args = apply_filters( 'give_insert_user_args', array( |
|
788 | - 'user_login' => isset( $user_data['user_login'] ) ? $user_data['user_login'] : '', |
|
789 | - 'user_pass' => isset( $user_data['user_pass'] ) ? $user_data['user_pass'] : '', |
|
790 | - 'user_email' => isset( $user_data['user_email'] ) ? $user_data['user_email'] : '', |
|
791 | - 'first_name' => isset( $user_data['user_first'] ) ? $user_data['user_first'] : '', |
|
792 | - 'last_name' => isset( $user_data['user_last'] ) ? $user_data['user_last'] : '', |
|
793 | - 'user_registered' => date( 'Y-m-d H:i:s' ), |
|
794 | - 'role' => get_option( 'default_role' ), |
|
795 | - ), $user_data ); |
|
786 | + $user_args = apply_filters('give_insert_user_args', array( |
|
787 | + 'user_login' => isset($user_data['user_login']) ? $user_data['user_login'] : '', |
|
788 | + 'user_pass' => isset($user_data['user_pass']) ? $user_data['user_pass'] : '', |
|
789 | + 'user_email' => isset($user_data['user_email']) ? $user_data['user_email'] : '', |
|
790 | + 'first_name' => isset($user_data['user_first']) ? $user_data['user_first'] : '', |
|
791 | + 'last_name' => isset($user_data['user_last']) ? $user_data['user_last'] : '', |
|
792 | + 'user_registered' => date('Y-m-d H:i:s'), |
|
793 | + 'role' => get_option('default_role'), |
|
794 | + ), $user_data); |
|
796 | 795 | |
797 | 796 | // Insert new user. |
798 | - $user_id = wp_insert_user( $user_args ); |
|
797 | + $user_id = wp_insert_user($user_args); |
|
799 | 798 | |
800 | 799 | // Validate inserted user. |
801 | - if ( is_wp_error( $user_id ) ) { |
|
802 | - return - 1; |
|
800 | + if (is_wp_error($user_id)) { |
|
801 | + return -1; |
|
803 | 802 | } |
804 | 803 | |
805 | 804 | // Allow themes and plugins to filter the user data. |
806 | - $user_data = apply_filters( 'give_insert_user_data', $user_data, $user_args ); |
|
805 | + $user_data = apply_filters('give_insert_user_data', $user_data, $user_args); |
|
807 | 806 | |
808 | 807 | /** |
809 | 808 | * Fires after inserting user. |
@@ -813,10 +812,10 @@ discard block |
||
813 | 812 | * @param int $user_id User id. |
814 | 813 | * @param array $user_data Array containing user data. |
815 | 814 | */ |
816 | - do_action( 'give_insert_user', $user_id, $user_data ); |
|
815 | + do_action('give_insert_user', $user_id, $user_data); |
|
817 | 816 | |
818 | 817 | // Login new user. |
819 | - give_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] ); |
|
818 | + give_log_user_in($user_id, $user_data['user_login'], $user_data['user_pass']); |
|
820 | 819 | |
821 | 820 | // Return user id. |
822 | 821 | return $user_id; |
@@ -831,27 +830,27 @@ discard block |
||
831 | 830 | * @since 1.0 |
832 | 831 | * @return array|bool |
833 | 832 | */ |
834 | -function give_get_donation_form_user( $valid_data = array() ) { |
|
833 | +function give_get_donation_form_user($valid_data = array()) { |
|
835 | 834 | |
836 | 835 | // Initialize user. |
837 | 836 | $user = false; |
838 | - $is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; |
|
837 | + $is_ajax = defined('DOING_AJAX') && DOING_AJAX; |
|
839 | 838 | |
840 | - if ( $is_ajax ) { |
|
839 | + if ($is_ajax) { |
|
841 | 840 | // Do not create or login the user during the ajax submission (check for errors only). |
842 | 841 | return true; |
843 | - } elseif ( is_user_logged_in() ) { |
|
842 | + } elseif (is_user_logged_in()) { |
|
844 | 843 | // Set the valid user as the logged in collected data. |
845 | 844 | $user = $valid_data['logged_in_user']; |
846 | - } elseif ( $valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true ) { |
|
845 | + } elseif ($valid_data['need_new_user'] === true || $valid_data['need_user_login'] === true) { |
|
847 | 846 | // New user registration. |
848 | - if ( $valid_data['need_new_user'] === true ) { |
|
847 | + if ($valid_data['need_new_user'] === true) { |
|
849 | 848 | // Set user. |
850 | 849 | $user = $valid_data['new_user_data']; |
851 | 850 | // Register and login new user. |
852 | - $user['user_id'] = give_register_and_login_new_user( $user ); |
|
851 | + $user['user_id'] = give_register_and_login_new_user($user); |
|
853 | 852 | // User login |
854 | - } elseif ( $valid_data['need_user_login'] === true && ! $is_ajax ) { |
|
853 | + } elseif ($valid_data['need_user_login'] === true && ! $is_ajax) { |
|
855 | 854 | |
856 | 855 | /** |
857 | 856 | * The login form is now processed in the give_process_donation_login() function. |
@@ -863,48 +862,48 @@ discard block |
||
863 | 862 | // Set user. |
864 | 863 | $user = $valid_data['login_user_data']; |
865 | 864 | // Login user. |
866 | - give_log_user_in( $user['user_id'], $user['user_login'], $user['user_pass'] ); |
|
865 | + give_log_user_in($user['user_id'], $user['user_login'], $user['user_pass']); |
|
867 | 866 | } |
868 | 867 | } |
869 | 868 | |
870 | 869 | // Check guest checkout. |
871 | - if ( false === $user && false === give_logged_in_only( $_POST['give-form-id'] ) ) { |
|
870 | + if (false === $user && false === give_logged_in_only($_POST['give-form-id'])) { |
|
872 | 871 | // Set user |
873 | 872 | $user = $valid_data['guest_user_data']; |
874 | 873 | } |
875 | 874 | |
876 | 875 | // Verify we have an user. |
877 | - if ( false === $user || empty( $user ) ) { |
|
876 | + if (false === $user || empty($user)) { |
|
878 | 877 | // Return false. |
879 | 878 | return false; |
880 | 879 | } |
881 | 880 | |
882 | 881 | // Get user first name. |
883 | - if ( ! isset( $user['user_first'] ) || strlen( trim( $user['user_first'] ) ) < 1 ) { |
|
884 | - $user['user_first'] = isset( $_POST['give_first'] ) ? strip_tags( trim( $_POST['give_first'] ) ) : ''; |
|
882 | + if ( ! isset($user['user_first']) || strlen(trim($user['user_first'])) < 1) { |
|
883 | + $user['user_first'] = isset($_POST['give_first']) ? strip_tags(trim($_POST['give_first'])) : ''; |
|
885 | 884 | } |
886 | 885 | |
887 | 886 | // Get user last name. |
888 | - if ( ! isset( $user['user_last'] ) || strlen( trim( $user['user_last'] ) ) < 1 ) { |
|
889 | - $user['user_last'] = isset( $_POST['give_last'] ) ? strip_tags( trim( $_POST['give_last'] ) ) : ''; |
|
887 | + if ( ! isset($user['user_last']) || strlen(trim($user['user_last'])) < 1) { |
|
888 | + $user['user_last'] = isset($_POST['give_last']) ? strip_tags(trim($_POST['give_last'])) : ''; |
|
890 | 889 | } |
891 | 890 | |
892 | 891 | // Get the user's billing address details. |
893 | 892 | $user['address'] = array(); |
894 | - $user['address']['line1'] = ! empty( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : false; |
|
895 | - $user['address']['line2'] = ! empty( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : false; |
|
896 | - $user['address']['city'] = ! empty( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : false; |
|
897 | - $user['address']['state'] = ! empty( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : false; |
|
898 | - $user['address']['country'] = ! empty( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : false; |
|
899 | - $user['address']['zip'] = ! empty( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : false; |
|
900 | - |
|
901 | - if ( empty( $user['address']['country'] ) ) { |
|
893 | + $user['address']['line1'] = ! empty($_POST['card_address']) ? sanitize_text_field($_POST['card_address']) : false; |
|
894 | + $user['address']['line2'] = ! empty($_POST['card_address_2']) ? sanitize_text_field($_POST['card_address_2']) : false; |
|
895 | + $user['address']['city'] = ! empty($_POST['card_city']) ? sanitize_text_field($_POST['card_city']) : false; |
|
896 | + $user['address']['state'] = ! empty($_POST['card_state']) ? sanitize_text_field($_POST['card_state']) : false; |
|
897 | + $user['address']['country'] = ! empty($_POST['billing_country']) ? sanitize_text_field($_POST['billing_country']) : false; |
|
898 | + $user['address']['zip'] = ! empty($_POST['card_zip']) ? sanitize_text_field($_POST['card_zip']) : false; |
|
899 | + |
|
900 | + if (empty($user['address']['country'])) { |
|
902 | 901 | $user['address'] = false; |
903 | 902 | } // End if(). |
904 | 903 | |
905 | - if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $user['address'] ) ) { |
|
904 | + if ( ! empty($user['user_id']) && $user['user_id'] > 0 && ! empty($user['address'])) { |
|
906 | 905 | // Store the address in the user's meta so the donation form can be pre-populated with it on return donation. |
907 | - update_user_meta( $user['user_id'], '_give_user_address', $user['address'] ); |
|
906 | + update_user_meta($user['user_id'], '_give_user_address', $user['address']); |
|
908 | 907 | } |
909 | 908 | |
910 | 909 | // Return valid user. |
@@ -923,16 +922,16 @@ discard block |
||
923 | 922 | $card_data = give_get_donation_cc_info(); |
924 | 923 | |
925 | 924 | // Validate the card zip. |
926 | - if ( ! empty( $card_data['card_zip'] ) ) { |
|
927 | - if ( ! give_donation_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) { |
|
928 | - give_set_error( 'invalid_cc_zip', __( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) ); |
|
925 | + if ( ! empty($card_data['card_zip'])) { |
|
926 | + if ( ! give_donation_form_validate_cc_zip($card_data['card_zip'], $card_data['card_country'])) { |
|
927 | + give_set_error('invalid_cc_zip', __('The zip / postal code you entered for your billing address is invalid.', 'give')); |
|
929 | 928 | } |
930 | 929 | } |
931 | 930 | |
932 | 931 | // Ensure no spaces. |
933 | - if ( ! empty( $card_data['card_number'] ) ) { |
|
934 | - $card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); // no "+" signs |
|
935 | - $card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces |
|
932 | + if ( ! empty($card_data['card_number'])) { |
|
933 | + $card_data['card_number'] = str_replace('+', '', $card_data['card_number']); // no "+" signs |
|
934 | + $card_data['card_number'] = str_replace(' ', '', $card_data['card_number']); // No spaces |
|
936 | 935 | } |
937 | 936 | |
938 | 937 | // This should validate card numbers at some point too. |
@@ -949,17 +948,17 @@ discard block |
||
949 | 948 | function give_get_donation_cc_info() { |
950 | 949 | |
951 | 950 | $cc_info = array(); |
952 | - $cc_info['card_name'] = isset( $_POST['card_name'] ) ? sanitize_text_field( $_POST['card_name'] ) : ''; |
|
953 | - $cc_info['card_number'] = isset( $_POST['card_number'] ) ? sanitize_text_field( $_POST['card_number'] ) : ''; |
|
954 | - $cc_info['card_cvc'] = isset( $_POST['card_cvc'] ) ? sanitize_text_field( $_POST['card_cvc'] ) : ''; |
|
955 | - $cc_info['card_exp_month'] = isset( $_POST['card_exp_month'] ) ? sanitize_text_field( $_POST['card_exp_month'] ) : ''; |
|
956 | - $cc_info['card_exp_year'] = isset( $_POST['card_exp_year'] ) ? sanitize_text_field( $_POST['card_exp_year'] ) : ''; |
|
957 | - $cc_info['card_address'] = isset( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : ''; |
|
958 | - $cc_info['card_address_2'] = isset( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : ''; |
|
959 | - $cc_info['card_city'] = isset( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : ''; |
|
960 | - $cc_info['card_state'] = isset( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : ''; |
|
961 | - $cc_info['card_country'] = isset( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : ''; |
|
962 | - $cc_info['card_zip'] = isset( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : ''; |
|
951 | + $cc_info['card_name'] = isset($_POST['card_name']) ? sanitize_text_field($_POST['card_name']) : ''; |
|
952 | + $cc_info['card_number'] = isset($_POST['card_number']) ? sanitize_text_field($_POST['card_number']) : ''; |
|
953 | + $cc_info['card_cvc'] = isset($_POST['card_cvc']) ? sanitize_text_field($_POST['card_cvc']) : ''; |
|
954 | + $cc_info['card_exp_month'] = isset($_POST['card_exp_month']) ? sanitize_text_field($_POST['card_exp_month']) : ''; |
|
955 | + $cc_info['card_exp_year'] = isset($_POST['card_exp_year']) ? sanitize_text_field($_POST['card_exp_year']) : ''; |
|
956 | + $cc_info['card_address'] = isset($_POST['card_address']) ? sanitize_text_field($_POST['card_address']) : ''; |
|
957 | + $cc_info['card_address_2'] = isset($_POST['card_address_2']) ? sanitize_text_field($_POST['card_address_2']) : ''; |
|
958 | + $cc_info['card_city'] = isset($_POST['card_city']) ? sanitize_text_field($_POST['card_city']) : ''; |
|
959 | + $cc_info['card_state'] = isset($_POST['card_state']) ? sanitize_text_field($_POST['card_state']) : ''; |
|
960 | + $cc_info['card_country'] = isset($_POST['billing_country']) ? sanitize_text_field($_POST['billing_country']) : ''; |
|
961 | + $cc_info['card_zip'] = isset($_POST['card_zip']) ? sanitize_text_field($_POST['card_zip']) : ''; |
|
963 | 962 | |
964 | 963 | // Return cc info. |
965 | 964 | return $cc_info; |
@@ -975,14 +974,14 @@ discard block |
||
975 | 974 | * |
976 | 975 | * @return bool|mixed |
977 | 976 | */ |
978 | -function give_donation_form_validate_cc_zip( $zip = 0, $country_code = '' ) { |
|
977 | +function give_donation_form_validate_cc_zip($zip = 0, $country_code = '') { |
|
979 | 978 | $ret = false; |
980 | 979 | |
981 | - if ( empty( $zip ) || empty( $country_code ) ) { |
|
980 | + if (empty($zip) || empty($country_code)) { |
|
982 | 981 | return $ret; |
983 | 982 | } |
984 | 983 | |
985 | - $country_code = strtoupper( $country_code ); |
|
984 | + $country_code = strtoupper($country_code); |
|
986 | 985 | |
987 | 986 | $zip_regex = array( |
988 | 987 | 'AD' => 'AD\d{3}', |
@@ -1142,11 +1141,11 @@ discard block |
||
1142 | 1141 | 'ZM' => '\d{5}', |
1143 | 1142 | ); |
1144 | 1143 | |
1145 | - if ( ! isset( $zip_regex[ $country_code ] ) || preg_match( '/' . $zip_regex[ $country_code ] . '/i', $zip ) ) { |
|
1144 | + if ( ! isset($zip_regex[$country_code]) || preg_match('/'.$zip_regex[$country_code].'/i', $zip)) { |
|
1146 | 1145 | $ret = true; |
1147 | 1146 | } |
1148 | 1147 | |
1149 | - return apply_filters( 'give_is_zip_valid', $ret, $zip, $country_code ); |
|
1148 | + return apply_filters('give_is_zip_valid', $ret, $zip, $country_code); |
|
1150 | 1149 | } |
1151 | 1150 | |
1152 | 1151 | |
@@ -1160,33 +1159,33 @@ discard block |
||
1160 | 1159 | * |
1161 | 1160 | * @return bool |
1162 | 1161 | */ |
1163 | -function give_validate_multi_donation_form_level( $valid_data, $data ) { |
|
1162 | +function give_validate_multi_donation_form_level($valid_data, $data) { |
|
1164 | 1163 | /* @var Give_Donate_Form $form */ |
1165 | - $form = new Give_Donate_Form( $data['give-form-id'] ); |
|
1164 | + $form = new Give_Donate_Form($data['give-form-id']); |
|
1166 | 1165 | |
1167 | 1166 | $donation_level_matched = false; |
1168 | 1167 | |
1169 | - if ( $form->is_multi_type_donation_form() ) { |
|
1168 | + if ($form->is_multi_type_donation_form()) { |
|
1170 | 1169 | |
1171 | 1170 | // Bailout. |
1172 | - if ( ! ( $variable_prices = $form->get_prices() ) ) { |
|
1171 | + if ( ! ($variable_prices = $form->get_prices())) { |
|
1173 | 1172 | return false; |
1174 | 1173 | } |
1175 | 1174 | |
1176 | 1175 | // Sanitize donation amount. |
1177 | - $data['give-amount'] = give_maybe_sanitize_amount( $data['give-amount'] ); |
|
1176 | + $data['give-amount'] = give_maybe_sanitize_amount($data['give-amount']); |
|
1178 | 1177 | |
1179 | - if ( $data['give-amount'] === give_maybe_sanitize_amount( give_get_price_option_amount( $data['give-form-id'], $data['give-price-id'] ) ) ) { |
|
1178 | + if ($data['give-amount'] === give_maybe_sanitize_amount(give_get_price_option_amount($data['give-form-id'], $data['give-price-id']))) { |
|
1180 | 1179 | return true; |
1181 | 1180 | } |
1182 | 1181 | |
1183 | 1182 | // Find correct donation level from all donation levels. |
1184 | - foreach ( $variable_prices as $variable_price ) { |
|
1183 | + foreach ($variable_prices as $variable_price) { |
|
1185 | 1184 | // Sanitize level amount. |
1186 | - $variable_price['_give_amount'] = give_maybe_sanitize_amount( $variable_price['_give_amount'] ); |
|
1185 | + $variable_price['_give_amount'] = give_maybe_sanitize_amount($variable_price['_give_amount']); |
|
1187 | 1186 | |
1188 | 1187 | // Set first match donation level ID. |
1189 | - if ( $data['give-amount'] === $variable_price['_give_amount'] ) { |
|
1188 | + if ($data['give-amount'] === $variable_price['_give_amount']) { |
|
1190 | 1189 | $_POST['give-price-id'] = $variable_price['_give_id']['level_id']; |
1191 | 1190 | $donation_level_matched = true; |
1192 | 1191 | break; |
@@ -1197,19 +1196,19 @@ discard block |
||
1197 | 1196 | // If yes then set price id to custom if amount is greater then custom minimum amount (if any). |
1198 | 1197 | if ( |
1199 | 1198 | ! $donation_level_matched |
1200 | - && ( give_is_setting_enabled( give_get_meta( $data['give-form-id'], '_give_custom_amount', true ) ) ) |
|
1199 | + && (give_is_setting_enabled(give_get_meta($data['give-form-id'], '_give_custom_amount', true))) |
|
1201 | 1200 | ) { |
1202 | 1201 | // Sanitize custom minimum amount. |
1203 | - $custom_minimum_amount = give_maybe_sanitize_amount( give_get_meta( $data['give-form-id'], '_give_custom_amount_minimum', true ) ); |
|
1202 | + $custom_minimum_amount = give_maybe_sanitize_amount(give_get_meta($data['give-form-id'], '_give_custom_amount_minimum', true)); |
|
1204 | 1203 | |
1205 | - if ( $data['give-amount'] >= $custom_minimum_amount ) { |
|
1204 | + if ($data['give-amount'] >= $custom_minimum_amount) { |
|
1206 | 1205 | $_POST['give-price-id'] = 'custom'; |
1207 | 1206 | $donation_level_matched = true; |
1208 | 1207 | } |
1209 | 1208 | } |
1210 | 1209 | }// End if(). |
1211 | 1210 | |
1212 | - return ( $donation_level_matched ? true : false ); |
|
1211 | + return ($donation_level_matched ? true : false); |
|
1213 | 1212 | } |
1214 | 1213 | |
1215 | -add_action( 'give_checkout_error_checks', 'give_validate_multi_donation_form_level', 10, 2 ); |
|
1214 | +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 | |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_get_actions() { |
27 | 27 | |
28 | - $_get_action = ! empty( $_GET['give_action'] ) ? $_GET['give_action'] : null; |
|
28 | + $_get_action = ! empty($_GET['give_action']) ? $_GET['give_action'] : null; |
|
29 | 29 | |
30 | 30 | // Add backward compatibility to give-action param ( $_GET ) |
31 | - if( empty( $_get_action ) ) { |
|
32 | - $_get_action = ! empty( $_GET['give-action'] ) ? $_GET['give-action'] : null; |
|
31 | + if (empty($_get_action)) { |
|
32 | + $_get_action = ! empty($_GET['give-action']) ? $_GET['give-action'] : null; |
|
33 | 33 | } |
34 | 34 | |
35 | - if ( isset( $_get_action ) ) { |
|
35 | + if (isset($_get_action)) { |
|
36 | 36 | /** |
37 | 37 | * Fires in WordPress init or admin init, when give_action is present in $_GET. |
38 | 38 | * |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $_GET Array of HTTP GET variables. |
42 | 42 | */ |
43 | - do_action( "give_{$_get_action}", $_GET ); |
|
43 | + do_action("give_{$_get_action}", $_GET); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | } |
47 | 47 | |
48 | -add_action( 'init', 'give_get_actions' ); |
|
48 | +add_action('init', 'give_get_actions'); |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Hooks Give actions, when present in the $_POST super global. Every give_action |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | function give_post_actions() { |
60 | 60 | |
61 | - $_post_action = ! empty( $_POST['give_action'] ) ? $_POST['give_action'] : null; |
|
61 | + $_post_action = ! empty($_POST['give_action']) ? $_POST['give_action'] : null; |
|
62 | 62 | |
63 | 63 | |
64 | 64 | // Add backward compatibility to give-action param ( $_POST ). |
65 | - if( empty( $_post_action ) ) { |
|
66 | - $_post_action = ! empty( $_POST['give-action'] ) ? $_POST['give-action'] : null; |
|
65 | + if (empty($_post_action)) { |
|
66 | + $_post_action = ! empty($_POST['give-action']) ? $_POST['give-action'] : null; |
|
67 | 67 | } |
68 | 68 | |
69 | - if ( isset( $_post_action ) ) { |
|
69 | + if (isset($_post_action)) { |
|
70 | 70 | /** |
71 | 71 | * Fires in WordPress init or admin init, when give_action is present in $_POST. |
72 | 72 | * |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @param array $_POST Array of HTTP POST variables. |
76 | 76 | */ |
77 | - do_action( "give_{$_post_action}", $_POST ); |
|
77 | + do_action("give_{$_post_action}", $_POST); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | } |
81 | 81 | |
82 | -add_action( 'init', 'give_post_actions' ); |
|
82 | +add_action('init', 'give_post_actions'); |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Connect WordPress user with Donor. |
@@ -89,28 +89,28 @@ discard block |
||
89 | 89 | * @param array $user_data User Data |
90 | 90 | * @return void |
91 | 91 | */ |
92 | -function give_connect_donor_to_wpuser( $user_id, $user_data ){ |
|
92 | +function give_connect_donor_to_wpuser($user_id, $user_data) { |
|
93 | 93 | /* @var Give_Donor $donor */ |
94 | - $donor = new Give_Donor( $user_data['user_email'] ); |
|
94 | + $donor = new Give_Donor($user_data['user_email']); |
|
95 | 95 | |
96 | 96 | // Validate donor id and check if do nor is already connect to wp user or not. |
97 | - if( $donor->id && ! $donor->user_id ) { |
|
97 | + if ($donor->id && ! $donor->user_id) { |
|
98 | 98 | |
99 | 99 | // Update donor user_id. |
100 | - if( $donor->update( array( 'user_id' => $user_id ) ) ) { |
|
101 | - $donor_note = sprintf( esc_html__( 'WordPress user #%d is connected to #%d', 'give' ), $user_id, $donor->id ); |
|
102 | - $donor->add_note( $donor_note ); |
|
100 | + if ($donor->update(array('user_id' => $user_id))) { |
|
101 | + $donor_note = sprintf(esc_html__('WordPress user #%d is connected to #%d', 'give'), $user_id, $donor->id); |
|
102 | + $donor->add_note($donor_note); |
|
103 | 103 | |
104 | 104 | // Update user_id meta in payments. |
105 | - if( ! empty( $donor->payment_ids ) && ( $donations = explode( ',', $donor->payment_ids ) ) ) { |
|
106 | - foreach ( $donations as $donation ) { |
|
107 | - give_update_meta( $donation, '_give_payment_user_id', $user_id ); |
|
105 | + if ( ! empty($donor->payment_ids) && ($donations = explode(',', $donor->payment_ids))) { |
|
106 | + foreach ($donations as $donation) { |
|
107 | + give_update_meta($donation, '_give_payment_user_id', $user_id); |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
113 | -add_action( 'give_insert_user', 'give_connect_donor_to_wpuser', 10, 2 ); |
|
113 | +add_action('give_insert_user', 'give_connect_donor_to_wpuser', 10, 2); |
|
114 | 114 | |
115 | 115 | |
116 | 116 | /** |
@@ -124,24 +124,24 @@ discard block |
||
124 | 124 | function give_validate_license_when_site_migrated() { |
125 | 125 | // Store current site address if not already stored. |
126 | 126 | $homeurl = home_url(); |
127 | - if( ! get_option( 'give_site_address_before_migrate' ) ) { |
|
127 | + if ( ! get_option('give_site_address_before_migrate')) { |
|
128 | 128 | // Update site address. |
129 | - update_option( 'give_site_address_before_migrate', $homeurl ); |
|
129 | + update_option('give_site_address_before_migrate', $homeurl); |
|
130 | 130 | |
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
134 | - if( $homeurl !== get_option( 'give_site_address_before_migrate' ) ) { |
|
134 | + if ($homeurl !== get_option('give_site_address_before_migrate')) { |
|
135 | 135 | // Immediately run cron. |
136 | - wp_schedule_single_event( time() , 'give_validate_license_when_site_migrated' ); |
|
136 | + wp_schedule_single_event(time(), 'give_validate_license_when_site_migrated'); |
|
137 | 137 | |
138 | 138 | // Update site address. |
139 | - update_option( 'give_site_address_before_migrate', home_url() ); |
|
139 | + update_option('give_site_address_before_migrate', home_url()); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | } |
143 | -add_action( 'init', 'give_validate_license_when_site_migrated' ); |
|
144 | -add_action( 'admin_init', 'give_validate_license_when_site_migrated' ); |
|
143 | +add_action('init', 'give_validate_license_when_site_migrated'); |
|
144 | +add_action('admin_init', 'give_validate_license_when_site_migrated'); |
|
145 | 145 | |
146 | 146 | |
147 | 147 | /** |
@@ -150,18 +150,18 @@ discard block |
||
150 | 150 | * @since 1.8 |
151 | 151 | * @param $data |
152 | 152 | */ |
153 | -function give_donor_batch_export_complete( $data ) { |
|
153 | +function give_donor_batch_export_complete($data) { |
|
154 | 154 | // Remove donor ids cache. |
155 | - if( |
|
156 | - isset( $data['class'] ) |
|
155 | + if ( |
|
156 | + isset($data['class']) |
|
157 | 157 | && 'Give_Batch_Donors_Export' === $data['class'] |
158 | - && ! empty( $data['forms'] ) |
|
159 | - && isset( $data['give_export_option']['query_id'] ) |
|
158 | + && ! empty($data['forms']) |
|
159 | + && isset($data['give_export_option']['query_id']) |
|
160 | 160 | ) { |
161 | - Give_Cache::delete( Give_Cache::get_key( $data['give_export_option']['query_id'] ) ); |
|
161 | + Give_Cache::delete(Give_Cache::get_key($data['give_export_option']['query_id'])); |
|
162 | 162 | } |
163 | 163 | } |
164 | -add_action('give_file_export_complete', 'give_donor_batch_export_complete' ); |
|
164 | +add_action('give_file_export_complete', 'give_donor_batch_export_complete'); |
|
165 | 165 | |
166 | 166 | /** |
167 | 167 | * Print css for wordpress setting pages. |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | /* @var WP_Screen $screen */ |
173 | 173 | $screen = get_current_screen(); |
174 | 174 | |
175 | - if( ! ( $screen instanceof WP_Screen ) ) { |
|
175 | + if ( ! ($screen instanceof WP_Screen)) { |
|
176 | 176 | return false; |
177 | 177 | } |
178 | 178 | |
179 | - switch ( true ) { |
|
180 | - case ( 'plugins' === $screen->base || 'plugins-network' === $screen->base ): |
|
179 | + switch (true) { |
|
180 | + case ('plugins' === $screen->base || 'plugins-network' === $screen->base): |
|
181 | 181 | ?> |
182 | 182 | <style> |
183 | 183 | tr.active.update + tr.give-addon-notice-tr td{ |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | <?php |
211 | 211 | } |
212 | 212 | } |
213 | -add_action( 'admin_head', 'give_admin_quick_css' ); |
|
213 | +add_action('admin_head', 'give_admin_quick_css'); |
|
214 | 214 | |
215 | 215 | |
216 | 216 | /** |
@@ -223,25 +223,25 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @return void |
225 | 225 | */ |
226 | -function give_set_donation_levels_max_min_amount( $form_id ) { |
|
226 | +function give_set_donation_levels_max_min_amount($form_id) { |
|
227 | 227 | if ( |
228 | - ( 'set' === $_POST['_give_price_option'] ) || |
|
229 | - ( in_array( '_give_donation_levels', $_POST ) && count( $_POST['_give_donation_levels'] ) <= 0 ) || |
|
230 | - ! ( $donation_levels_amounts = wp_list_pluck( $_POST['_give_donation_levels'], '_give_amount' ) ) |
|
228 | + ('set' === $_POST['_give_price_option']) || |
|
229 | + (in_array('_give_donation_levels', $_POST) && count($_POST['_give_donation_levels']) <= 0) || |
|
230 | + ! ($donation_levels_amounts = wp_list_pluck($_POST['_give_donation_levels'], '_give_amount')) |
|
231 | 231 | ) { |
232 | 232 | // Delete old meta. |
233 | - give_delete_meta( $form_id, '_give_levels_minimum_amount' ); |
|
234 | - give_delete_meta( $form_id, '_give_levels_maximum_amount' ); |
|
233 | + give_delete_meta($form_id, '_give_levels_minimum_amount'); |
|
234 | + give_delete_meta($form_id, '_give_levels_maximum_amount'); |
|
235 | 235 | |
236 | 236 | return; |
237 | 237 | } |
238 | 238 | |
239 | - $min_amount = min( $donation_levels_amounts ); |
|
240 | - $max_amount = max( $donation_levels_amounts ); |
|
239 | + $min_amount = min($donation_levels_amounts); |
|
240 | + $max_amount = max($donation_levels_amounts); |
|
241 | 241 | |
242 | 242 | // Set Minimum and Maximum amount for Multi Level Donation Forms |
243 | - give_update_meta( $form_id, '_give_levels_minimum_amount', $min_amount ? give_sanitize_amount_for_db( $min_amount ) : 0 ); |
|
244 | - give_update_meta( $form_id, '_give_levels_maximum_amount', $max_amount? give_sanitize_amount_for_db( $max_amount ) : 0 ); |
|
243 | + give_update_meta($form_id, '_give_levels_minimum_amount', $min_amount ? give_sanitize_amount_for_db($min_amount) : 0); |
|
244 | + give_update_meta($form_id, '_give_levels_maximum_amount', $max_amount ? give_sanitize_amount_for_db($max_amount) : 0); |
|
245 | 245 | } |
246 | 246 | |
247 | -add_action( 'give_pre_process_give_forms_meta', 'give_set_donation_levels_max_min_amount', 30 ); |
|
248 | 247 | \ No newline at end of file |
248 | +add_action('give_pre_process_give_forms_meta', 'give_set_donation_levels_max_min_amount', 30); |
|
249 | 249 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | */ |
24 | 24 | function give_is_test_mode() { |
25 | 25 | |
26 | - $ret = give_is_setting_enabled( give_get_option( 'test_mode' ) ); |
|
26 | + $ret = give_is_setting_enabled(give_get_option('test_mode')); |
|
27 | 27 | |
28 | - return (bool) apply_filters( 'give_is_test_mode', $ret ); |
|
28 | + return (bool) apply_filters('give_is_test_mode', $ret); |
|
29 | 29 | |
30 | 30 | } |
31 | 31 | |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | function give_get_currency() { |
39 | 39 | |
40 | - $currency = give_get_option( 'currency', 'USD' ); |
|
40 | + $currency = give_get_option('currency', 'USD'); |
|
41 | 41 | |
42 | - return apply_filters( 'give_currency', $currency ); |
|
42 | + return apply_filters('give_currency', $currency); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | */ |
52 | 52 | function give_get_currency_position() { |
53 | 53 | |
54 | - $currency_pos = give_get_option( 'currency_position', 'before' ); |
|
54 | + $currency_pos = give_get_option('currency_position', 'before'); |
|
55 | 55 | |
56 | - return apply_filters( 'give_currency_position', $currency_pos ); |
|
56 | + return apply_filters('give_currency_position', $currency_pos); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -66,39 +66,39 @@ discard block |
||
66 | 66 | |
67 | 67 | function give_get_currencies() { |
68 | 68 | $currencies = array( |
69 | - 'USD' => __( 'US Dollars ($)', 'give' ), |
|
70 | - 'EUR' => __( 'Euros (€)', 'give' ), |
|
71 | - 'GBP' => __( 'Pounds Sterling (£)', 'give' ), |
|
72 | - 'AUD' => __( 'Australian Dollars ($)', 'give' ), |
|
73 | - 'BRL' => __( 'Brazilian Real (R$)', 'give' ), |
|
74 | - 'CAD' => __( 'Canadian Dollars ($)', 'give' ), |
|
75 | - 'CZK' => __( 'Czech Koruna (Kč)', 'give' ), |
|
76 | - 'DKK' => __( 'Danish Krone (kr.)', 'give' ), |
|
77 | - 'HKD' => __( 'Hong Kong Dollar ($)', 'give' ), |
|
78 | - 'HUF' => __( 'Hungarian Forint (Ft)', 'give' ), |
|
79 | - 'ILS' => __( 'Israeli Shekel (₪)', 'give' ), |
|
80 | - 'JPY' => __( 'Japanese Yen (¥)', 'give' ), |
|
81 | - 'MYR' => __( 'Malaysian Ringgits (RM)', 'give' ), |
|
82 | - 'MXN' => __( 'Mexican Peso ($)', 'give' ), |
|
83 | - 'MAD' => __( 'Moroccan Dirham (.د.م)', 'give' ), |
|
84 | - 'NZD' => __( 'New Zealand Dollar ($)', 'give' ), |
|
85 | - 'NOK' => __( 'Norwegian Krone (Kr.)', 'give' ), |
|
86 | - 'PHP' => __( 'Philippine Pesos (₱)', 'give' ), |
|
87 | - 'PLN' => __( 'Polish Zloty (zł)', 'give' ), |
|
88 | - 'SGD' => __( 'Singapore Dollar ($)', 'give' ), |
|
89 | - 'KRW' => __( 'South Korean Won (₩)', 'give' ), |
|
90 | - 'ZAR' => __( 'South African Rand (R)', 'give' ), |
|
91 | - 'SEK' => __( 'Swedish Krona (kr)', 'give' ), |
|
92 | - 'CHF' => __( 'Swiss Franc (CHF)', 'give' ), |
|
93 | - 'TWD' => __( 'Taiwan New Dollars (NT$)', 'give' ), |
|
94 | - 'THB' => __( 'Thai Baht (฿)', 'give' ), |
|
95 | - 'INR' => __( 'Indian Rupee (₹)', 'give' ), |
|
96 | - 'TRY' => __( 'Turkish Lira (₺)', 'give' ), |
|
97 | - 'RIAL' => __( 'Iranian Rial (﷼)', 'give' ), |
|
98 | - 'RUB' => __( 'Russian Rubles (руб)', 'give' ), |
|
69 | + 'USD' => __('US Dollars ($)', 'give'), |
|
70 | + 'EUR' => __('Euros (€)', 'give'), |
|
71 | + 'GBP' => __('Pounds Sterling (£)', 'give'), |
|
72 | + 'AUD' => __('Australian Dollars ($)', 'give'), |
|
73 | + 'BRL' => __('Brazilian Real (R$)', 'give'), |
|
74 | + 'CAD' => __('Canadian Dollars ($)', 'give'), |
|
75 | + 'CZK' => __('Czech Koruna (Kč)', 'give'), |
|
76 | + 'DKK' => __('Danish Krone (kr.)', 'give'), |
|
77 | + 'HKD' => __('Hong Kong Dollar ($)', 'give'), |
|
78 | + 'HUF' => __('Hungarian Forint (Ft)', 'give'), |
|
79 | + 'ILS' => __('Israeli Shekel (₪)', 'give'), |
|
80 | + 'JPY' => __('Japanese Yen (¥)', 'give'), |
|
81 | + 'MYR' => __('Malaysian Ringgits (RM)', 'give'), |
|
82 | + 'MXN' => __('Mexican Peso ($)', 'give'), |
|
83 | + 'MAD' => __('Moroccan Dirham (.د.م)', 'give'), |
|
84 | + 'NZD' => __('New Zealand Dollar ($)', 'give'), |
|
85 | + 'NOK' => __('Norwegian Krone (Kr.)', 'give'), |
|
86 | + 'PHP' => __('Philippine Pesos (₱)', 'give'), |
|
87 | + 'PLN' => __('Polish Zloty (zł)', 'give'), |
|
88 | + 'SGD' => __('Singapore Dollar ($)', 'give'), |
|
89 | + 'KRW' => __('South Korean Won (₩)', 'give'), |
|
90 | + 'ZAR' => __('South African Rand (R)', 'give'), |
|
91 | + 'SEK' => __('Swedish Krona (kr)', 'give'), |
|
92 | + 'CHF' => __('Swiss Franc (CHF)', 'give'), |
|
93 | + 'TWD' => __('Taiwan New Dollars (NT$)', 'give'), |
|
94 | + 'THB' => __('Thai Baht (฿)', 'give'), |
|
95 | + 'INR' => __('Indian Rupee (₹)', 'give'), |
|
96 | + 'TRY' => __('Turkish Lira (₺)', 'give'), |
|
97 | + 'RIAL' => __('Iranian Rial (﷼)', 'give'), |
|
98 | + 'RUB' => __('Russian Rubles (руб)', 'give'), |
|
99 | 99 | ); |
100 | 100 | |
101 | - return apply_filters( 'give_currencies', $currencies ); |
|
101 | + return apply_filters('give_currencies', $currencies); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | * |
116 | 116 | * @return string The symbol to use for the currency |
117 | 117 | */ |
118 | -function give_currency_symbol( $currency = '', $decode_currency = false ) { |
|
118 | +function give_currency_symbol($currency = '', $decode_currency = false) { |
|
119 | 119 | |
120 | - if ( empty( $currency ) ) { |
|
120 | + if (empty($currency)) { |
|
121 | 121 | $currency = give_get_currency(); |
122 | 122 | } |
123 | - switch ( $currency ) : |
|
123 | + switch ($currency) : |
|
124 | 124 | case 'GBP' : |
125 | 125 | $symbol = '£'; |
126 | 126 | break; |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | break; |
199 | 199 | endswitch; |
200 | 200 | |
201 | - $symbol = ( ! $decode_currency ? $symbol : html_entity_decode( $symbol ) ); |
|
201 | + $symbol = ( ! $decode_currency ? $symbol : html_entity_decode($symbol)); |
|
202 | 202 | |
203 | - return apply_filters( 'give_currency_symbol', $symbol, $currency ); |
|
203 | + return apply_filters('give_currency_symbol', $symbol, $currency); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -213,16 +213,16 @@ discard block |
||
213 | 213 | * |
214 | 214 | * @return string |
215 | 215 | */ |
216 | -function give_get_currency_name( $currency_code ) { |
|
216 | +function give_get_currency_name($currency_code) { |
|
217 | 217 | $currency_name = ''; |
218 | 218 | $currency_names = give_get_currencies(); |
219 | 219 | |
220 | - if ( $currency_code && array_key_exists( $currency_code, $currency_names ) ) { |
|
221 | - $currency_name = explode( '(', $currency_names[ $currency_code ] ); |
|
222 | - $currency_name = trim( current( $currency_name ) ); |
|
220 | + if ($currency_code && array_key_exists($currency_code, $currency_names)) { |
|
221 | + $currency_name = explode('(', $currency_names[$currency_code]); |
|
222 | + $currency_name = trim(current($currency_name)); |
|
223 | 223 | } |
224 | 224 | |
225 | - return apply_filters( 'give_currency_name', $currency_name, $currency_code ); |
|
225 | + return apply_filters('give_currency_name', $currency_name, $currency_code); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -236,21 +236,21 @@ discard block |
||
236 | 236 | |
237 | 237 | global $wp; |
238 | 238 | |
239 | - if ( get_option( 'permalink_structure' ) ) { |
|
240 | - $base = trailingslashit( home_url( $wp->request ) ); |
|
239 | + if (get_option('permalink_structure')) { |
|
240 | + $base = trailingslashit(home_url($wp->request)); |
|
241 | 241 | } else { |
242 | - $base = add_query_arg( $wp->query_string, '', trailingslashit( home_url( $wp->request ) ) ); |
|
243 | - $base = remove_query_arg( array( 'post_type', 'name' ), $base ); |
|
242 | + $base = add_query_arg($wp->query_string, '', trailingslashit(home_url($wp->request))); |
|
243 | + $base = remove_query_arg(array('post_type', 'name'), $base); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | $scheme = is_ssl() ? 'https' : 'http'; |
247 | - $current_uri = set_url_scheme( $base, $scheme ); |
|
247 | + $current_uri = set_url_scheme($base, $scheme); |
|
248 | 248 | |
249 | - if ( is_front_page() ) { |
|
250 | - $current_uri = home_url( '/' ); |
|
249 | + if (is_front_page()) { |
|
250 | + $current_uri = home_url('/'); |
|
251 | 251 | } |
252 | 252 | |
253 | - return apply_filters( 'give_get_current_page_url', $current_uri ); |
|
253 | + return apply_filters('give_get_current_page_url', $current_uri); |
|
254 | 254 | |
255 | 255 | } |
256 | 256 | |
@@ -272,15 +272,15 @@ discard block |
||
272 | 272 | */ |
273 | 273 | $gateways = give_get_enabled_payment_gateways(); |
274 | 274 | |
275 | - if ( count( $gateways ) == 1 && ! isset( $gateways['paypal'] ) && ! isset( $gateways['manual'] ) ) { |
|
275 | + if (count($gateways) == 1 && ! isset($gateways['paypal']) && ! isset($gateways['manual'])) { |
|
276 | 276 | $ret = true; |
277 | - } elseif ( count( $gateways ) == 1 ) { |
|
277 | + } elseif (count($gateways) == 1) { |
|
278 | 278 | $ret = false; |
279 | - } elseif ( count( $gateways ) == 2 && isset( $gateways['paypal'] ) && isset( $gateways['manual'] ) ) { |
|
279 | + } elseif (count($gateways) == 2 && isset($gateways['paypal']) && isset($gateways['manual'])) { |
|
280 | 280 | $ret = false; |
281 | 281 | } |
282 | 282 | |
283 | - return (bool) apply_filters( 'give_verify_credit_cards', $ret ); |
|
283 | + return (bool) apply_filters('give_verify_credit_cards', $ret); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -292,26 +292,26 @@ discard block |
||
292 | 292 | function give_get_timezone_id() { |
293 | 293 | |
294 | 294 | // if site timezone string exists, return it. |
295 | - if ( $timezone = get_option( 'timezone_string' ) ) { |
|
295 | + if ($timezone = get_option('timezone_string')) { |
|
296 | 296 | return $timezone; |
297 | 297 | } |
298 | 298 | |
299 | 299 | // get UTC offset, if it isn't set return UTC. |
300 | - if ( ! ( $utc_offset = 3600 * get_option( 'gmt_offset', 0 ) ) ) { |
|
300 | + if ( ! ($utc_offset = 3600 * get_option('gmt_offset', 0))) { |
|
301 | 301 | return 'UTC'; |
302 | 302 | } |
303 | 303 | |
304 | 304 | // attempt to guess the timezone string from the UTC offset. |
305 | - $timezone = timezone_name_from_abbr( '', $utc_offset ); |
|
305 | + $timezone = timezone_name_from_abbr('', $utc_offset); |
|
306 | 306 | |
307 | 307 | // last try, guess timezone string manually. |
308 | - if ( $timezone === false ) { |
|
308 | + if ($timezone === false) { |
|
309 | 309 | |
310 | - $is_dst = date( 'I' ); |
|
310 | + $is_dst = date('I'); |
|
311 | 311 | |
312 | - foreach ( timezone_abbreviations_list() as $abbr ) { |
|
313 | - foreach ( $abbr as $city ) { |
|
314 | - if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset ) { |
|
312 | + foreach (timezone_abbreviations_list() as $abbr) { |
|
313 | + foreach ($abbr as $city) { |
|
314 | + if ($city['dst'] == $is_dst && $city['offset'] == $utc_offset) { |
|
315 | 315 | return $city['timezone_id']; |
316 | 316 | } |
317 | 317 | } |
@@ -335,17 +335,17 @@ discard block |
||
335 | 335 | |
336 | 336 | $ip = '127.0.0.1'; |
337 | 337 | |
338 | - if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { |
|
338 | + if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
339 | 339 | // check ip from share internet |
340 | 340 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
341 | - } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { |
|
341 | + } elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
|
342 | 342 | // to check ip is pass from proxy |
343 | 343 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
344 | - } elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) { |
|
344 | + } elseif ( ! empty($_SERVER['REMOTE_ADDR'])) { |
|
345 | 345 | $ip = $_SERVER['REMOTE_ADDR']; |
346 | 346 | } |
347 | 347 | |
348 | - return apply_filters( 'give_get_ip', $ip ); |
|
348 | + return apply_filters('give_get_ip', $ip); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
@@ -360,9 +360,9 @@ discard block |
||
360 | 360 | * |
361 | 361 | * @uses Give()->session->set() |
362 | 362 | */ |
363 | -function give_set_purchase_session( $purchase_data = array() ) { |
|
364 | - Give()->session->set( 'give_purchase', $purchase_data ); |
|
365 | - Give()->session->set( 'give_email', $purchase_data['user_email'] ); |
|
363 | +function give_set_purchase_session($purchase_data = array()) { |
|
364 | + Give()->session->set('give_purchase', $purchase_data); |
|
365 | + Give()->session->set('give_email', $purchase_data['user_email']); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | * @return mixed array | false |
377 | 377 | */ |
378 | 378 | function give_get_purchase_session() { |
379 | - return Give()->session->get( 'give_purchase' ); |
|
379 | + return Give()->session->get('give_purchase'); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
@@ -392,40 +392,40 @@ discard block |
||
392 | 392 | * |
393 | 393 | * @return string |
394 | 394 | */ |
395 | -function give_payment_gateway_donation_summary( $donation_data, $name_and_email = true, $length = 255 ) { |
|
395 | +function give_payment_gateway_donation_summary($donation_data, $name_and_email = true, $length = 255) { |
|
396 | 396 | |
397 | 397 | $summary = ''; |
398 | 398 | |
399 | - $form_id = isset( $donation_data['post_data']['give-form-id'] ) ? $donation_data['post_data']['give-form-id'] : ''; |
|
399 | + $form_id = isset($donation_data['post_data']['give-form-id']) ? $donation_data['post_data']['give-form-id'] : ''; |
|
400 | 400 | |
401 | 401 | // Form title. |
402 | - if ( isset( $donation_data['post_data']['give-form-title'] ) ) { |
|
402 | + if (isset($donation_data['post_data']['give-form-title'])) { |
|
403 | 403 | $summary .= $donation_data['post_data']['give-form-title']; |
404 | 404 | } |
405 | 405 | // Form multilevel if applicable. |
406 | - if ( isset( $donation_data['post_data']['give-price-id'] ) ) { |
|
407 | - $summary .= ': ' . give_get_price_option_name( $form_id, $donation_data['post_data']['give-price-id'] ); |
|
406 | + if (isset($donation_data['post_data']['give-price-id'])) { |
|
407 | + $summary .= ': '.give_get_price_option_name($form_id, $donation_data['post_data']['give-price-id']); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | // Add Donor's name + email if requested. |
411 | - if ( $name_and_email ) { |
|
411 | + if ($name_and_email) { |
|
412 | 412 | |
413 | 413 | // First name |
414 | - if ( isset( $donation_data['user_info']['first_name'] ) && ! empty( $donation_data['user_info']['first_name'] ) ) { |
|
415 | - $summary .= ' - ' . $donation_data['user_info']['first_name']; |
|
414 | + if (isset($donation_data['user_info']['first_name']) && ! empty($donation_data['user_info']['first_name'])) { |
|
415 | + $summary .= ' - '.$donation_data['user_info']['first_name']; |
|
416 | 416 | } |
417 | 417 | |
418 | - if ( isset( $donation_data['user_info']['last_name'] ) && ! empty( $donation_data['user_info']['last_name'] ) ) { |
|
419 | - $summary .= ' ' . $donation_data['user_info']['last_name']; |
|
418 | + if (isset($donation_data['user_info']['last_name']) && ! empty($donation_data['user_info']['last_name'])) { |
|
419 | + $summary .= ' '.$donation_data['user_info']['last_name']; |
|
420 | 420 | } |
421 | 421 | |
422 | - $summary .= ' (' . $donation_data['user_email'] . ')'; |
|
422 | + $summary .= ' ('.$donation_data['user_email'].')'; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | // Cut the length |
426 | - $summary = substr( $summary, 0, $length ); |
|
426 | + $summary = substr($summary, 0, $length); |
|
427 | 427 | |
428 | - return apply_filters( 'give_payment_gateway_donation_summary', $summary ); |
|
428 | + return apply_filters('give_payment_gateway_donation_summary', $summary); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | |
@@ -440,31 +440,31 @@ discard block |
||
440 | 440 | function give_get_host() { |
441 | 441 | $host = false; |
442 | 442 | |
443 | - if ( defined( 'WPE_APIKEY' ) ) { |
|
443 | + if (defined('WPE_APIKEY')) { |
|
444 | 444 | $host = 'WP Engine'; |
445 | - } elseif ( defined( 'PAGELYBIN' ) ) { |
|
445 | + } elseif (defined('PAGELYBIN')) { |
|
446 | 446 | $host = 'Pagely'; |
447 | - } elseif ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) { |
|
447 | + } elseif (DB_HOST == 'localhost:/tmp/mysql5.sock') { |
|
448 | 448 | $host = 'ICDSoft'; |
449 | - } elseif ( DB_HOST == 'mysqlv5' ) { |
|
449 | + } elseif (DB_HOST == 'mysqlv5') { |
|
450 | 450 | $host = 'NetworkSolutions'; |
451 | - } elseif ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) { |
|
451 | + } elseif (strpos(DB_HOST, 'ipagemysql.com') !== false) { |
|
452 | 452 | $host = 'iPage'; |
453 | - } elseif ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) { |
|
453 | + } elseif (strpos(DB_HOST, 'ipowermysql.com') !== false) { |
|
454 | 454 | $host = 'IPower'; |
455 | - } elseif ( strpos( DB_HOST, '.gridserver.com' ) !== false ) { |
|
455 | + } elseif (strpos(DB_HOST, '.gridserver.com') !== false) { |
|
456 | 456 | $host = 'MediaTemple Grid'; |
457 | - } elseif ( strpos( DB_HOST, '.pair.com' ) !== false ) { |
|
457 | + } elseif (strpos(DB_HOST, '.pair.com') !== false) { |
|
458 | 458 | $host = 'pair Networks'; |
459 | - } elseif ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) { |
|
459 | + } elseif (strpos(DB_HOST, '.stabletransit.com') !== false) { |
|
460 | 460 | $host = 'Rackspace Cloud'; |
461 | - } elseif ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) { |
|
461 | + } elseif (strpos(DB_HOST, '.sysfix.eu') !== false) { |
|
462 | 462 | $host = 'SysFix.eu Power Hosting'; |
463 | - } elseif ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) { |
|
463 | + } elseif (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) { |
|
464 | 464 | $host = 'Flywheel'; |
465 | 465 | } else { |
466 | 466 | // Adding a general fallback for data gathering |
467 | - $host = 'DBH: ' . DB_HOST . ', SRV: ' . $_SERVER['SERVER_NAME']; |
|
467 | + $host = 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME']; |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | return $host; |
@@ -480,67 +480,67 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @return bool true if host matches, false if not |
482 | 482 | */ |
483 | -function give_is_host( $host = false ) { |
|
483 | +function give_is_host($host = false) { |
|
484 | 484 | |
485 | 485 | $return = false; |
486 | 486 | |
487 | - if ( $host ) { |
|
488 | - $host = str_replace( ' ', '', strtolower( $host ) ); |
|
487 | + if ($host) { |
|
488 | + $host = str_replace(' ', '', strtolower($host)); |
|
489 | 489 | |
490 | - switch ( $host ) { |
|
490 | + switch ($host) { |
|
491 | 491 | case 'wpengine': |
492 | - if ( defined( 'WPE_APIKEY' ) ) { |
|
492 | + if (defined('WPE_APIKEY')) { |
|
493 | 493 | $return = true; |
494 | 494 | } |
495 | 495 | break; |
496 | 496 | case 'pagely': |
497 | - if ( defined( 'PAGELYBIN' ) ) { |
|
497 | + if (defined('PAGELYBIN')) { |
|
498 | 498 | $return = true; |
499 | 499 | } |
500 | 500 | break; |
501 | 501 | case 'icdsoft': |
502 | - if ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) { |
|
502 | + if (DB_HOST == 'localhost:/tmp/mysql5.sock') { |
|
503 | 503 | $return = true; |
504 | 504 | } |
505 | 505 | break; |
506 | 506 | case 'networksolutions': |
507 | - if ( DB_HOST == 'mysqlv5' ) { |
|
507 | + if (DB_HOST == 'mysqlv5') { |
|
508 | 508 | $return = true; |
509 | 509 | } |
510 | 510 | break; |
511 | 511 | case 'ipage': |
512 | - if ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) { |
|
512 | + if (strpos(DB_HOST, 'ipagemysql.com') !== false) { |
|
513 | 513 | $return = true; |
514 | 514 | } |
515 | 515 | break; |
516 | 516 | case 'ipower': |
517 | - if ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) { |
|
517 | + if (strpos(DB_HOST, 'ipowermysql.com') !== false) { |
|
518 | 518 | $return = true; |
519 | 519 | } |
520 | 520 | break; |
521 | 521 | case 'mediatemplegrid': |
522 | - if ( strpos( DB_HOST, '.gridserver.com' ) !== false ) { |
|
522 | + if (strpos(DB_HOST, '.gridserver.com') !== false) { |
|
523 | 523 | $return = true; |
524 | 524 | } |
525 | 525 | break; |
526 | 526 | case 'pairnetworks': |
527 | - if ( strpos( DB_HOST, '.pair.com' ) !== false ) { |
|
527 | + if (strpos(DB_HOST, '.pair.com') !== false) { |
|
528 | 528 | $return = true; |
529 | 529 | } |
530 | 530 | break; |
531 | 531 | case 'rackspacecloud': |
532 | - if ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) { |
|
532 | + if (strpos(DB_HOST, '.stabletransit.com') !== false) { |
|
533 | 533 | $return = true; |
534 | 534 | } |
535 | 535 | break; |
536 | 536 | case 'sysfix.eu': |
537 | 537 | case 'sysfix.eupowerhosting': |
538 | - if ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) { |
|
538 | + if (strpos(DB_HOST, '.sysfix.eu') !== false) { |
|
539 | 539 | $return = true; |
540 | 540 | } |
541 | 541 | break; |
542 | 542 | case 'flywheel': |
543 | - if ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) { |
|
543 | + if (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) { |
|
544 | 544 | $return = true; |
545 | 545 | } |
546 | 546 | break; |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | * @param string $replacement Optional. The function that should have been called. |
574 | 574 | * @param array $backtrace Optional. Contains stack backtrace of deprecated function. |
575 | 575 | */ |
576 | -function _give_deprecated_function( $function, $version, $replacement = null, $backtrace = null ) { |
|
576 | +function _give_deprecated_function($function, $version, $replacement = null, $backtrace = null) { |
|
577 | 577 | |
578 | 578 | /** |
579 | 579 | * Fires while give deprecated function call occurs. |
@@ -586,19 +586,19 @@ discard block |
||
586 | 586 | * @param string $replacement Optional. The function that should have been called. |
587 | 587 | * @param string $version The plugin version that deprecated the function. |
588 | 588 | */ |
589 | - do_action( 'give_deprecated_function_run', $function, $replacement, $version ); |
|
589 | + do_action('give_deprecated_function_run', $function, $replacement, $version); |
|
590 | 590 | |
591 | - $show_errors = current_user_can( 'manage_options' ); |
|
591 | + $show_errors = current_user_can('manage_options'); |
|
592 | 592 | |
593 | 593 | // Allow plugin to filter the output error trigger. |
594 | - if ( WP_DEBUG && apply_filters( 'give_deprecated_function_trigger_error', $show_errors ) ) { |
|
595 | - if ( ! is_null( $replacement ) ) { |
|
596 | - trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give' ), $function, $version, $replacement ) ); |
|
597 | - trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. |
|
594 | + if (WP_DEBUG && apply_filters('give_deprecated_function_trigger_error', $show_errors)) { |
|
595 | + if ( ! is_null($replacement)) { |
|
596 | + trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give'), $function, $version, $replacement)); |
|
597 | + trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. |
|
598 | 598 | // Alternatively we could dump this to a file. |
599 | 599 | } else { |
600 | - trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give' ), $function, $version ) ); |
|
601 | - trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. |
|
600 | + trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give'), $function, $version)); |
|
601 | + trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. |
|
602 | 602 | // Alternatively we could dump this to a file. |
603 | 603 | } |
604 | 604 | } |
@@ -612,8 +612,8 @@ discard block |
||
612 | 612 | * @return string $post_id |
613 | 613 | */ |
614 | 614 | function give_get_admin_post_id() { |
615 | - $post_id = isset( $_GET['post'] ) ? $_GET['post'] : null; |
|
616 | - if ( ! $post_id && isset( $_POST['post_id'] ) ) { |
|
615 | + $post_id = isset($_GET['post']) ? $_GET['post'] : null; |
|
616 | + if ( ! $post_id && isset($_POST['post_id'])) { |
|
617 | 617 | $post_id = $_POST['post_id']; |
618 | 618 | } |
619 | 619 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * @return string Arg separator output |
628 | 628 | */ |
629 | 629 | function give_get_php_arg_separator_output() { |
630 | - return ini_get( 'arg_separator.output' ); |
|
630 | + return ini_get('arg_separator.output'); |
|
631 | 631 | } |
632 | 632 | |
633 | 633 | |
@@ -642,10 +642,10 @@ discard block |
||
642 | 642 | * |
643 | 643 | * @return string Short month name |
644 | 644 | */ |
645 | -function give_month_num_to_name( $n ) { |
|
646 | - $timestamp = mktime( 0, 0, 0, $n, 1, 2005 ); |
|
645 | +function give_month_num_to_name($n) { |
|
646 | + $timestamp = mktime(0, 0, 0, $n, 1, 2005); |
|
647 | 647 | |
648 | - return date_i18n( 'M', $timestamp ); |
|
648 | + return date_i18n('M', $timestamp); |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | |
@@ -658,10 +658,10 @@ discard block |
||
658 | 658 | * |
659 | 659 | * @return bool Whether or not function is disabled. |
660 | 660 | */ |
661 | -function give_is_func_disabled( $function ) { |
|
662 | - $disabled = explode( ',', ini_get( 'disable_functions' ) ); |
|
661 | +function give_is_func_disabled($function) { |
|
662 | + $disabled = explode(',', ini_get('disable_functions')); |
|
663 | 663 | |
664 | - return in_array( $function, $disabled ); |
|
664 | + return in_array($function, $disabled); |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | function give_get_newsletter() { |
674 | 674 | ?> |
675 | 675 | |
676 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
676 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
677 | 677 | |
678 | 678 | <div class="give-newsletter-form-wrap"> |
679 | 679 | |
@@ -681,33 +681,33 @@ discard block |
||
681 | 681 | method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" |
682 | 682 | target="_blank" novalidate> |
683 | 683 | <div class="give-newsletter-confirmation"> |
684 | - <p><?php esc_html_e( 'Thanks for Subscribing!', 'give' ); ?> :)</p> |
|
684 | + <p><?php esc_html_e('Thanks for Subscribing!', 'give'); ?> :)</p> |
|
685 | 685 | </div> |
686 | 686 | |
687 | 687 | <table class="form-table give-newsletter-form"> |
688 | 688 | <tr valign="middle"> |
689 | 689 | <td> |
690 | 690 | <label for="mce-EMAIL" |
691 | - class="screen-reader-text"><?php esc_html_e( 'Email Address (required)', 'give' ); ?></label> |
|
691 | + class="screen-reader-text"><?php esc_html_e('Email Address (required)', 'give'); ?></label> |
|
692 | 692 | <input type="email" name="EMAIL" id="mce-EMAIL" |
693 | - placeholder="<?php esc_attr_e( 'Email Address (required)', 'give' ); ?>" |
|
693 | + placeholder="<?php esc_attr_e('Email Address (required)', 'give'); ?>" |
|
694 | 694 | class="required email" value=""> |
695 | 695 | </td> |
696 | 696 | <td> |
697 | 697 | <label for="mce-FNAME" |
698 | - class="screen-reader-text"><?php esc_html_e( 'First Name', 'give' ); ?></label> |
|
698 | + class="screen-reader-text"><?php esc_html_e('First Name', 'give'); ?></label> |
|
699 | 699 | <input type="text" name="FNAME" id="mce-FNAME" |
700 | - placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>" class="" value=""> |
|
700 | + placeholder="<?php esc_attr_e('First Name', 'give'); ?>" class="" value=""> |
|
701 | 701 | </td> |
702 | 702 | <td> |
703 | 703 | <label for="mce-LNAME" |
704 | - class="screen-reader-text"><?php esc_html_e( 'Last Name', 'give' ); ?></label> |
|
704 | + class="screen-reader-text"><?php esc_html_e('Last Name', 'give'); ?></label> |
|
705 | 705 | <input type="text" name="LNAME" id="mce-LNAME" |
706 | - placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>" class="" value=""> |
|
706 | + placeholder="<?php esc_attr_e('Last Name', 'give'); ?>" class="" value=""> |
|
707 | 707 | </td> |
708 | 708 | <td> |
709 | 709 | <input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button" |
710 | - value="<?php esc_attr_e( 'Subscribe', 'give' ); ?>"> |
|
710 | + value="<?php esc_attr_e('Subscribe', 'give'); ?>"> |
|
711 | 711 | </td> |
712 | 712 | </tr> |
713 | 713 | </table> |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | * |
760 | 760 | * @return string |
761 | 761 | */ |
762 | -function give_svg_icons( $icon ) { |
|
762 | +function give_svg_icons($icon) { |
|
763 | 763 | |
764 | 764 | // Store your SVGs in an associative array |
765 | 765 | $svgs = array( |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | ); |
772 | 772 | |
773 | 773 | // Return the chosen icon's SVG string |
774 | - return $svgs[ $icon ]; |
|
774 | + return $svgs[$icon]; |
|
775 | 775 | } |
776 | 776 | |
777 | 777 | /** |
@@ -783,15 +783,15 @@ discard block |
||
783 | 783 | * |
784 | 784 | * @return mixed |
785 | 785 | */ |
786 | -function modify_nav_menu_meta_box_object( $post_type ) { |
|
787 | - if ( isset( $post_type->name ) && $post_type->name == 'give_forms' ) { |
|
788 | - $post_type->labels->name = esc_html__( 'Donation Forms', 'give' ); |
|
786 | +function modify_nav_menu_meta_box_object($post_type) { |
|
787 | + if (isset($post_type->name) && $post_type->name == 'give_forms') { |
|
788 | + $post_type->labels->name = esc_html__('Donation Forms', 'give'); |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | return $post_type; |
792 | 792 | } |
793 | 793 | |
794 | -add_filter( 'nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object' ); |
|
794 | +add_filter('nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object'); |
|
795 | 795 | |
796 | 796 | /** |
797 | 797 | * Enable 'Donation Form' meta enabled by default on Menu page. |
@@ -801,22 +801,22 @@ discard block |
||
801 | 801 | function give_nav_donation_metabox_enabled() { |
802 | 802 | |
803 | 803 | // Return false, if it fails to retrieve hidden meta box list and is not admin. |
804 | - if ( ( ! $hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus' ) ) || ! is_admin() ) { |
|
804 | + if (( ! $hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus')) || ! is_admin()) { |
|
805 | 805 | return false; |
806 | 806 | } |
807 | 807 | |
808 | 808 | // Return false, In case, we don't find 'Donation Form' in hidden meta box list. |
809 | - if ( ! in_array( 'add-post-type-give_forms', $hidden_meta_boxes, true ) ) { |
|
809 | + if ( ! in_array('add-post-type-give_forms', $hidden_meta_boxes, true)) { |
|
810 | 810 | return false; |
811 | 811 | } |
812 | 812 | |
813 | 813 | // Exclude 'Donation Form' value from hidden meta box's list. |
814 | - $hidden_meta_boxes = array_diff( $hidden_meta_boxes, array( 'add-post-type-give_forms' ) ); |
|
814 | + $hidden_meta_boxes = array_diff($hidden_meta_boxes, array('add-post-type-give_forms')); |
|
815 | 815 | |
816 | 816 | // Get current user ID. |
817 | 817 | $user = wp_get_current_user(); |
818 | 818 | |
819 | - update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true ); |
|
819 | + update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true); |
|
820 | 820 | } |
821 | 821 | |
822 | 822 | /** |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | * @license https://opensource.org/licenses/MIT MIT |
831 | 831 | */ |
832 | 832 | |
833 | -if ( ! function_exists( 'array_column' ) ) { |
|
833 | +if ( ! function_exists('array_column')) { |
|
834 | 834 | /** |
835 | 835 | * Returns the values from a single column of the input array, identified by |
836 | 836 | * the $columnKey. |
@@ -849,53 +849,53 @@ discard block |
||
849 | 849 | * |
850 | 850 | * @return array |
851 | 851 | */ |
852 | - function array_column( $input = null, $columnKey = null, $indexKey = null ) { |
|
852 | + function array_column($input = null, $columnKey = null, $indexKey = null) { |
|
853 | 853 | // Using func_get_args() in order to check for proper number of |
854 | 854 | // parameters and trigger errors exactly as the built-in array_column() |
855 | 855 | // does in PHP 5.5. |
856 | 856 | $argc = func_num_args(); |
857 | 857 | $params = func_get_args(); |
858 | 858 | |
859 | - if ( $argc < 2 ) { |
|
860 | - trigger_error( sprintf( esc_html__( 'array_column() expects at least 2 parameters, %s given.', 'give' ), $argc ), E_USER_WARNING ); |
|
859 | + if ($argc < 2) { |
|
860 | + trigger_error(sprintf(esc_html__('array_column() expects at least 2 parameters, %s given.', 'give'), $argc), E_USER_WARNING); |
|
861 | 861 | |
862 | 862 | return null; |
863 | 863 | } |
864 | 864 | |
865 | - if ( ! is_array( $params[0] ) ) { |
|
866 | - trigger_error( sprintf( esc_html__( 'array_column() expects parameter 1 to be array, %s given.', 'give' ), gettype( $params[0] ) ), E_USER_WARNING ); |
|
865 | + if ( ! is_array($params[0])) { |
|
866 | + trigger_error(sprintf(esc_html__('array_column() expects parameter 1 to be array, %s given.', 'give'), gettype($params[0])), E_USER_WARNING); |
|
867 | 867 | |
868 | 868 | return null; |
869 | 869 | } |
870 | 870 | |
871 | - if ( ! is_int( $params[1] ) |
|
872 | - && ! is_float( $params[1] ) |
|
873 | - && ! is_string( $params[1] ) |
|
871 | + if ( ! is_int($params[1]) |
|
872 | + && ! is_float($params[1]) |
|
873 | + && ! is_string($params[1]) |
|
874 | 874 | && $params[1] !== null |
875 | - && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) ) |
|
875 | + && ! (is_object($params[1]) && method_exists($params[1], '__toString')) |
|
876 | 876 | ) { |
877 | - trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING ); |
|
877 | + trigger_error(esc_html__('array_column(): The column key should be either a string or an integer.', 'give'), E_USER_WARNING); |
|
878 | 878 | |
879 | 879 | return false; |
880 | 880 | } |
881 | 881 | |
882 | - if ( isset( $params[2] ) |
|
883 | - && ! is_int( $params[2] ) |
|
884 | - && ! is_float( $params[2] ) |
|
885 | - && ! is_string( $params[2] ) |
|
886 | - && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) ) |
|
882 | + if (isset($params[2]) |
|
883 | + && ! is_int($params[2]) |
|
884 | + && ! is_float($params[2]) |
|
885 | + && ! is_string($params[2]) |
|
886 | + && ! (is_object($params[2]) && method_exists($params[2], '__toString')) |
|
887 | 887 | ) { |
888 | - trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING ); |
|
888 | + trigger_error(esc_html__('array_column(): The index key should be either a string or an integer.', 'give'), E_USER_WARNING); |
|
889 | 889 | |
890 | 890 | return false; |
891 | 891 | } |
892 | 892 | |
893 | 893 | $paramsInput = $params[0]; |
894 | - $paramsColumnKey = ( $params[1] !== null ) ? (string) $params[1] : null; |
|
894 | + $paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null; |
|
895 | 895 | |
896 | 896 | $paramsIndexKey = null; |
897 | - if ( isset( $params[2] ) ) { |
|
898 | - if ( is_float( $params[2] ) || is_int( $params[2] ) ) { |
|
897 | + if (isset($params[2])) { |
|
898 | + if (is_float($params[2]) || is_int($params[2])) { |
|
899 | 899 | $paramsIndexKey = (int) $params[2]; |
900 | 900 | } else { |
901 | 901 | $paramsIndexKey = (string) $params[2]; |
@@ -904,26 +904,26 @@ discard block |
||
904 | 904 | |
905 | 905 | $resultArray = array(); |
906 | 906 | |
907 | - foreach ( $paramsInput as $row ) { |
|
907 | + foreach ($paramsInput as $row) { |
|
908 | 908 | $key = $value = null; |
909 | 909 | $keySet = $valueSet = false; |
910 | 910 | |
911 | - if ( $paramsIndexKey !== null && array_key_exists( $paramsIndexKey, $row ) ) { |
|
911 | + if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) { |
|
912 | 912 | $keySet = true; |
913 | - $key = (string) $row[ $paramsIndexKey ]; |
|
913 | + $key = (string) $row[$paramsIndexKey]; |
|
914 | 914 | } |
915 | 915 | |
916 | - if ( $paramsColumnKey === null ) { |
|
916 | + if ($paramsColumnKey === null) { |
|
917 | 917 | $valueSet = true; |
918 | 918 | $value = $row; |
919 | - } elseif ( is_array( $row ) && array_key_exists( $paramsColumnKey, $row ) ) { |
|
919 | + } elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) { |
|
920 | 920 | $valueSet = true; |
921 | - $value = $row[ $paramsColumnKey ]; |
|
921 | + $value = $row[$paramsColumnKey]; |
|
922 | 922 | } |
923 | 923 | |
924 | - if ( $valueSet ) { |
|
925 | - if ( $keySet ) { |
|
926 | - $resultArray[ $key ] = $value; |
|
924 | + if ($valueSet) { |
|
925 | + if ($keySet) { |
|
926 | + $resultArray[$key] = $value; |
|
927 | 927 | } else { |
928 | 928 | $resultArray[] = $value; |
929 | 929 | } |
@@ -943,40 +943,40 @@ discard block |
||
943 | 943 | * |
944 | 944 | * @return bool Whether the receipt is visible or not. |
945 | 945 | */ |
946 | -function give_can_view_receipt( $payment_key = '' ) { |
|
946 | +function give_can_view_receipt($payment_key = '') { |
|
947 | 947 | |
948 | 948 | $return = false; |
949 | 949 | |
950 | - if ( empty( $payment_key ) ) { |
|
950 | + if (empty($payment_key)) { |
|
951 | 951 | return $return; |
952 | 952 | } |
953 | 953 | |
954 | 954 | global $give_receipt_args; |
955 | 955 | |
956 | - $give_receipt_args['id'] = give_get_purchase_id_by_key( $payment_key ); |
|
956 | + $give_receipt_args['id'] = give_get_purchase_id_by_key($payment_key); |
|
957 | 957 | |
958 | - $user_id = (int) give_get_payment_user_id( $give_receipt_args['id'] ); |
|
958 | + $user_id = (int) give_get_payment_user_id($give_receipt_args['id']); |
|
959 | 959 | |
960 | - $payment_meta = give_get_payment_meta( $give_receipt_args['id'] ); |
|
960 | + $payment_meta = give_get_payment_meta($give_receipt_args['id']); |
|
961 | 961 | |
962 | - if ( is_user_logged_in() ) { |
|
963 | - if ( $user_id === (int) get_current_user_id() ) { |
|
962 | + if (is_user_logged_in()) { |
|
963 | + if ($user_id === (int) get_current_user_id()) { |
|
964 | 964 | $return = true; |
965 | - } elseif ( wp_get_current_user()->user_email === give_get_payment_user_email( $give_receipt_args['id'] ) ) { |
|
965 | + } elseif (wp_get_current_user()->user_email === give_get_payment_user_email($give_receipt_args['id'])) { |
|
966 | 966 | $return = true; |
967 | - } elseif ( current_user_can( 'view_give_sensitive_data' ) ) { |
|
967 | + } elseif (current_user_can('view_give_sensitive_data')) { |
|
968 | 968 | $return = true; |
969 | 969 | } |
970 | 970 | } |
971 | 971 | |
972 | 972 | $session = give_get_purchase_session(); |
973 | - if ( ! empty( $session ) && ! is_user_logged_in() ) { |
|
974 | - if ( $session['purchase_key'] === $payment_meta['key'] ) { |
|
973 | + if ( ! empty($session) && ! is_user_logged_in()) { |
|
974 | + if ($session['purchase_key'] === $payment_meta['key']) { |
|
975 | 975 | $return = true; |
976 | 976 | } |
977 | 977 | } |
978 | 978 | |
979 | - return (bool) apply_filters( 'give_can_view_receipt', $return, $payment_key ); |
|
979 | + return (bool) apply_filters('give_can_view_receipt', $return, $payment_key); |
|
980 | 980 | |
981 | 981 | } |
982 | 982 | |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | * |
986 | 986 | * Fallback in case the calendar extension is not loaded in PHP; Only supports Gregorian calendar |
987 | 987 | */ |
988 | -if ( ! function_exists( 'cal_days_in_month' ) ) { |
|
988 | +if ( ! function_exists('cal_days_in_month')) { |
|
989 | 989 | /** |
990 | 990 | * cal_days_in_month |
991 | 991 | * |
@@ -995,8 +995,8 @@ discard block |
||
995 | 995 | * |
996 | 996 | * @return bool|string |
997 | 997 | */ |
998 | - function cal_days_in_month( $calendar, $month, $year ) { |
|
999 | - return date( 't', mktime( 0, 0, 0, $month, 1, $year ) ); |
|
998 | + function cal_days_in_month($calendar, $month, $year) { |
|
999 | + return date('t', mktime(0, 0, 0, $month, 1, $year)); |
|
1000 | 1000 | } |
1001 | 1001 | } |
1002 | 1002 | |
@@ -1015,42 +1015,42 @@ discard block |
||
1015 | 1015 | */ |
1016 | 1016 | function give_get_plugins() { |
1017 | 1017 | $plugins = get_plugins(); |
1018 | - $active_plugin_paths = (array) get_option( 'active_plugins', array() ); |
|
1018 | + $active_plugin_paths = (array) get_option('active_plugins', array()); |
|
1019 | 1019 | |
1020 | - if ( is_multisite() ) { |
|
1021 | - $network_activated_plugin_paths = array_keys( get_site_option( 'active_sitewide_plugins', array() ) ); |
|
1022 | - $active_plugin_paths = array_merge( $active_plugin_paths, $network_activated_plugin_paths ); |
|
1020 | + if (is_multisite()) { |
|
1021 | + $network_activated_plugin_paths = array_keys(get_site_option('active_sitewide_plugins', array())); |
|
1022 | + $active_plugin_paths = array_merge($active_plugin_paths, $network_activated_plugin_paths); |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | - foreach ( $plugins as $plugin_path => $plugin_data ) { |
|
1025 | + foreach ($plugins as $plugin_path => $plugin_data) { |
|
1026 | 1026 | // Is plugin active? |
1027 | - if ( in_array( $plugin_path, $active_plugin_paths ) ) { |
|
1028 | - $plugins[ $plugin_path ]['Status'] = 'active'; |
|
1027 | + if (in_array($plugin_path, $active_plugin_paths)) { |
|
1028 | + $plugins[$plugin_path]['Status'] = 'active'; |
|
1029 | 1029 | } else { |
1030 | - $plugins[ $plugin_path ]['Status'] = 'inactive'; |
|
1030 | + $plugins[$plugin_path]['Status'] = 'inactive'; |
|
1031 | 1031 | } |
1032 | 1032 | |
1033 | - $dirname = strtolower( dirname( $plugin_path ) ); |
|
1033 | + $dirname = strtolower(dirname($plugin_path)); |
|
1034 | 1034 | |
1035 | 1035 | // Is plugin a Give add-on by WordImpress? |
1036 | - if ( strstr( $dirname, 'give-' ) && strstr( $plugin_data['AuthorURI'], 'wordimpress.com' ) ) { |
|
1036 | + if (strstr($dirname, 'give-') && strstr($plugin_data['AuthorURI'], 'wordimpress.com')) { |
|
1037 | 1037 | // Plugin is a Give-addon. |
1038 | - $plugins[ $plugin_path ]['Type'] = 'add-on'; |
|
1038 | + $plugins[$plugin_path]['Type'] = 'add-on'; |
|
1039 | 1039 | |
1040 | 1040 | // Get license info from database. |
1041 | - $plugin_name = str_replace( 'Give - ', '', $plugin_data['Name'] ); |
|
1042 | - $db_option = 'give_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $plugin_name ) ) ) . '_license_active'; |
|
1043 | - $license_active = get_option( $db_option ); |
|
1041 | + $plugin_name = str_replace('Give - ', '', $plugin_data['Name']); |
|
1042 | + $db_option = 'give_'.preg_replace('/[^a-zA-Z0-9_\s]/', '', str_replace(' ', '_', strtolower($plugin_name))).'_license_active'; |
|
1043 | + $license_active = get_option($db_option); |
|
1044 | 1044 | |
1045 | 1045 | // Does a valid license exist? |
1046 | - if ( ! empty( $license_active ) && 'valid' === $license_active->license ) { |
|
1047 | - $plugins[ $plugin_path ]['License'] = true; |
|
1046 | + if ( ! empty($license_active) && 'valid' === $license_active->license) { |
|
1047 | + $plugins[$plugin_path]['License'] = true; |
|
1048 | 1048 | } else { |
1049 | - $plugins[ $plugin_path ]['License'] = false; |
|
1049 | + $plugins[$plugin_path]['License'] = false; |
|
1050 | 1050 | } |
1051 | 1051 | } else { |
1052 | 1052 | // Plugin is not a Give add-on. |
1053 | - $plugins[ $plugin_path ]['Type'] = 'other'; |
|
1053 | + $plugins[$plugin_path]['Type'] = 'other'; |
|
1054 | 1054 | } |
1055 | 1055 | } |
1056 | 1056 | |
@@ -1067,16 +1067,16 @@ discard block |
||
1067 | 1067 | * |
1068 | 1068 | * @return bool |
1069 | 1069 | */ |
1070 | -function give_is_terms_enabled( $form_id ) { |
|
1071 | - $form_option = give_get_meta( $form_id, '_give_terms_option', true ); |
|
1070 | +function give_is_terms_enabled($form_id) { |
|
1071 | + $form_option = give_get_meta($form_id, '_give_terms_option', true); |
|
1072 | 1072 | |
1073 | 1073 | if ( |
1074 | - give_is_setting_enabled( $form_option, 'global' ) |
|
1075 | - && give_is_setting_enabled( give_get_option( 'terms' ) ) |
|
1074 | + give_is_setting_enabled($form_option, 'global') |
|
1075 | + && give_is_setting_enabled(give_get_option('terms')) |
|
1076 | 1076 | ) { |
1077 | 1077 | return true; |
1078 | 1078 | |
1079 | - } elseif ( give_is_setting_enabled( $form_option ) ) { |
|
1079 | + } elseif (give_is_setting_enabled($form_option)) { |
|
1080 | 1080 | return true; |
1081 | 1081 | |
1082 | 1082 | } else { |
@@ -1100,9 +1100,9 @@ discard block |
||
1100 | 1100 | * |
1101 | 1101 | * @return WP_Error|bool |
1102 | 1102 | */ |
1103 | -function give_delete_donation_stats( $date_range = '', $args = array() ) { |
|
1103 | +function give_delete_donation_stats($date_range = '', $args = array()) { |
|
1104 | 1104 | // Delete all cache. |
1105 | - $status = Give_Cache::delete( Give_Cache::get_options_like( 'give_stats' ) ); |
|
1105 | + $status = Give_Cache::delete(Give_Cache::get_options_like('give_stats')); |
|
1106 | 1106 | |
1107 | 1107 | /** |
1108 | 1108 | * Fire the action when donation stats delete. |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | * @param string|array $date_range |
1113 | 1113 | * @param array $args |
1114 | 1114 | */ |
1115 | - do_action( 'give_delete_donation_stats', $status, $date_range, $args ); |
|
1115 | + do_action('give_delete_donation_stats', $status, $date_range, $args); |
|
1116 | 1116 | |
1117 | 1117 | return $status; |
1118 | 1118 | } |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | * |
1131 | 1131 | * @return mixed |
1132 | 1132 | */ |
1133 | -function give_get_meta( $id, $meta_key, $single = false, $default = false ) { |
|
1133 | +function give_get_meta($id, $meta_key, $single = false, $default = false) { |
|
1134 | 1134 | /** |
1135 | 1135 | * Filter the meta value |
1136 | 1136 | * |
@@ -1138,14 +1138,14 @@ discard block |
||
1138 | 1138 | */ |
1139 | 1139 | $meta_value = apply_filters( |
1140 | 1140 | 'give_get_meta', |
1141 | - get_post_meta( $id, $meta_key, $single ), |
|
1141 | + get_post_meta($id, $meta_key, $single), |
|
1142 | 1142 | $id, |
1143 | 1143 | $meta_key, |
1144 | 1144 | $default |
1145 | 1145 | ); |
1146 | 1146 | |
1147 | 1147 | if ( |
1148 | - ( empty( $meta_key ) || empty( $meta_value ) ) |
|
1148 | + (empty($meta_key) || empty($meta_value)) |
|
1149 | 1149 | && $default |
1150 | 1150 | ) { |
1151 | 1151 | $meta_value = $default; |
@@ -1166,15 +1166,15 @@ discard block |
||
1166 | 1166 | * |
1167 | 1167 | * @return mixed |
1168 | 1168 | */ |
1169 | -function give_update_meta( $id, $meta_key, $meta_value, $prev_value = '' ) { |
|
1170 | - $status = update_post_meta( $id, $meta_key, $meta_value, $prev_value ); |
|
1169 | +function give_update_meta($id, $meta_key, $meta_value, $prev_value = '') { |
|
1170 | + $status = update_post_meta($id, $meta_key, $meta_value, $prev_value); |
|
1171 | 1171 | |
1172 | 1172 | /** |
1173 | 1173 | * Filter the meta value update status |
1174 | 1174 | * |
1175 | 1175 | * @since 1.8.8 |
1176 | 1176 | */ |
1177 | - return apply_filters( 'give_update_meta', $status, $id, $meta_key, $meta_value ); |
|
1177 | + return apply_filters('give_update_meta', $status, $id, $meta_key, $meta_value); |
|
1178 | 1178 | } |
1179 | 1179 | |
1180 | 1180 | /** |
@@ -1188,15 +1188,15 @@ discard block |
||
1188 | 1188 | * |
1189 | 1189 | * @return mixed |
1190 | 1190 | */ |
1191 | -function give_delete_meta( $id, $meta_key, $meta_value = '' ) { |
|
1192 | - $status = delete_post_meta( $id, $meta_key, $meta_value ); |
|
1191 | +function give_delete_meta($id, $meta_key, $meta_value = '') { |
|
1192 | + $status = delete_post_meta($id, $meta_key, $meta_value); |
|
1193 | 1193 | |
1194 | 1194 | /** |
1195 | 1195 | * Filter the meta value delete status |
1196 | 1196 | * |
1197 | 1197 | * @since 1.8.8 |
1198 | 1198 | */ |
1199 | - return apply_filters( 'give_delete_meta', $status, $id, $meta_key, $meta_value ); |
|
1199 | + return apply_filters('give_delete_meta', $status, $id, $meta_key, $meta_value); |
|
1200 | 1200 | } |
1201 | 1201 | |
1202 | 1202 | /** |
@@ -1208,15 +1208,15 @@ discard block |
||
1208 | 1208 | * |
1209 | 1209 | * @return bool If the action has been added to the completed actions array |
1210 | 1210 | */ |
1211 | -function give_has_upgrade_completed( $upgrade_action = '' ) { |
|
1211 | +function give_has_upgrade_completed($upgrade_action = '') { |
|
1212 | 1212 | |
1213 | - if ( empty( $upgrade_action ) ) { |
|
1213 | + if (empty($upgrade_action)) { |
|
1214 | 1214 | return false; |
1215 | 1215 | } |
1216 | 1216 | |
1217 | 1217 | $completed_upgrades = give_get_completed_upgrades(); |
1218 | 1218 | |
1219 | - return in_array( $upgrade_action, $completed_upgrades ); |
|
1219 | + return in_array($upgrade_action, $completed_upgrades); |
|
1220 | 1220 | |
1221 | 1221 | } |
1222 | 1222 | |
@@ -1228,8 +1228,8 @@ discard block |
||
1228 | 1228 | * @return mixed When nothing to resume returns false, otherwise starts the upgrade where it left off |
1229 | 1229 | */ |
1230 | 1230 | function give_maybe_resume_upgrade() { |
1231 | - $doing_upgrade = get_option( 'give_doing_upgrade', false ); |
|
1232 | - if ( empty( $doing_upgrade ) ) { |
|
1231 | + $doing_upgrade = get_option('give_doing_upgrade', false); |
|
1232 | + if (empty($doing_upgrade)) { |
|
1233 | 1233 | return false; |
1234 | 1234 | } |
1235 | 1235 | |
@@ -1245,9 +1245,9 @@ discard block |
||
1245 | 1245 | * |
1246 | 1246 | * @return bool If the function was successfully added |
1247 | 1247 | */ |
1248 | -function give_set_upgrade_complete( $upgrade_action = '' ) { |
|
1248 | +function give_set_upgrade_complete($upgrade_action = '') { |
|
1249 | 1249 | |
1250 | - if ( empty( $upgrade_action ) ) { |
|
1250 | + if (empty($upgrade_action)) { |
|
1251 | 1251 | return false; |
1252 | 1252 | } |
1253 | 1253 | |
@@ -1255,16 +1255,16 @@ discard block |
||
1255 | 1255 | $completed_upgrades[] = $upgrade_action; |
1256 | 1256 | |
1257 | 1257 | // Remove any blanks, and only show uniques. |
1258 | - $completed_upgrades = array_unique( array_values( $completed_upgrades ) ); |
|
1258 | + $completed_upgrades = array_unique(array_values($completed_upgrades)); |
|
1259 | 1259 | |
1260 | 1260 | /** |
1261 | 1261 | * Fire the action when any upgrade set to complete. |
1262 | 1262 | * |
1263 | 1263 | * @since 1.8.12 |
1264 | 1264 | */ |
1265 | - do_action( 'give_set_upgrade_completed', $upgrade_action, $completed_upgrades ); |
|
1265 | + do_action('give_set_upgrade_completed', $upgrade_action, $completed_upgrades); |
|
1266 | 1266 | |
1267 | - return update_option( 'give_completed_upgrades', $completed_upgrades ); |
|
1267 | + return update_option('give_completed_upgrades', $completed_upgrades); |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | /** |
@@ -1275,7 +1275,7 @@ discard block |
||
1275 | 1275 | */ |
1276 | 1276 | function give_get_completed_upgrades() { |
1277 | 1277 | |
1278 | - return (array) get_option( 'give_completed_upgrades' ); |
|
1278 | + return (array) get_option('give_completed_upgrades'); |
|
1279 | 1279 | |
1280 | 1280 | } |
1281 | 1281 |
@@ -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 | /** |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | * |
385 | 385 | * @param array $states Contain the list of states in array key format where key of the array is there respected country code. |
386 | 386 | */ |
387 | - return (array) apply_filters( 'give_states_list', $states ); |
|
387 | + return (array) apply_filters('give_states_list', $states); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
@@ -399,9 +399,9 @@ discard block |
||
399 | 399 | function give_no_states_country_list() { |
400 | 400 | $country_list = array(); |
401 | 401 | $locale = give_get_country_locale(); |
402 | - foreach ( $locale as $key => $value ) { |
|
403 | - if ( ! empty( $value['state'] ) && isset( $value['state']['hidden'] ) && true === $value['state']['hidden'] ) { |
|
404 | - $country_list[ $key ] = $value['state']; |
|
402 | + foreach ($locale as $key => $value) { |
|
403 | + if ( ! empty($value['state']) && isset($value['state']['hidden']) && true === $value['state']['hidden']) { |
|
404 | + $country_list[$key] = $value['state']; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * |
413 | 413 | * @param array $country Contain key as there country code & value as there country name. |
414 | 414 | */ |
415 | - return (array) apply_filters( 'give_no_states_country_list', $country_list ); |
|
415 | + return (array) apply_filters('give_no_states_country_list', $country_list); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -427,9 +427,9 @@ discard block |
||
427 | 427 | function give_states_not_required_country_list() { |
428 | 428 | $country_list = array(); |
429 | 429 | $locale = give_get_country_locale(); |
430 | - foreach ( $locale as $key => $value ) { |
|
431 | - if ( ! empty( $value['state'] ) && isset( $value['state']['required'] ) && false === $value['state']['required'] ) { |
|
432 | - $country_list[ $key ] = $value['state']; |
|
430 | + foreach ($locale as $key => $value) { |
|
431 | + if ( ! empty($value['state']) && isset($value['state']['required']) && false === $value['state']['required']) { |
|
432 | + $country_list[$key] = $value['state']; |
|
433 | 433 | } |
434 | 434 | } |
435 | 435 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | * |
441 | 441 | * @param array $country Contain key as there country code & value as there country name. |
442 | 442 | */ |
443 | - return (array) apply_filters( 'give_states_not_required_country_list', $country_list ); |
|
443 | + return (array) apply_filters('give_states_not_required_country_list', $country_list); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
@@ -452,14 +452,14 @@ discard block |
||
452 | 452 | */ |
453 | 453 | function give_get_states_label() { |
454 | 454 | $country_states_label = array(); |
455 | - $default_label = __( 'State', 'give' ); |
|
455 | + $default_label = __('State', 'give'); |
|
456 | 456 | $locale = give_get_country_locale(); |
457 | - foreach ( $locale as $key => $value ) { |
|
457 | + foreach ($locale as $key => $value) { |
|
458 | 458 | $label = $default_label; |
459 | - if ( ! empty( $value['state'] ) && ! empty( $value['state']['label'] ) ) { |
|
459 | + if ( ! empty($value['state']) && ! empty($value['state']['label'])) { |
|
460 | 460 | $label = $value['state']['label']; |
461 | 461 | } |
462 | - $country_states_label[ $key ] = $label; |
|
462 | + $country_states_label[$key] = $label; |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | * |
470 | 470 | * @param array $country Contain key as there country code & value as there country name. |
471 | 471 | */ |
472 | - return (array) apply_filters( 'give_get_states_label', $country_states_label ); |
|
472 | + return (array) apply_filters('give_get_states_label', $country_states_label); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | /** |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * @return array |
481 | 481 | */ |
482 | 482 | function give_get_country_locale() { |
483 | - return (array) apply_filters( 'give_get_country_locale', array( |
|
483 | + return (array) apply_filters('give_get_country_locale', array( |
|
484 | 484 | 'AE' => array( |
485 | 485 | 'state' => array( |
486 | 486 | 'required' => false, |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | ), |
501 | 501 | 'AU' => array( |
502 | 502 | 'state' => array( |
503 | - 'label' => __( 'State', 'give' ), |
|
503 | + 'label' => __('State', 'give'), |
|
504 | 504 | ), |
505 | 505 | ), |
506 | 506 | 'AX' => array( |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | ), |
511 | 511 | 'BD' => array( |
512 | 512 | 'state' => array( |
513 | - 'label' => __( 'District', 'give' ), |
|
513 | + 'label' => __('District', 'give'), |
|
514 | 514 | ), |
515 | 515 | ), |
516 | 516 | 'BE' => array( |
517 | 517 | 'state' => array( |
518 | 518 | 'required' => false, |
519 | - 'label' => __( 'Province', 'give' ), |
|
519 | + 'label' => __('Province', 'give'), |
|
520 | 520 | 'hidden' => true, |
521 | 521 | ), |
522 | 522 | ), |
@@ -527,24 +527,24 @@ discard block |
||
527 | 527 | ), |
528 | 528 | 'CA' => array( |
529 | 529 | 'state' => array( |
530 | - 'label' => __( 'Province', 'give' ), |
|
530 | + 'label' => __('Province', 'give'), |
|
531 | 531 | ), |
532 | 532 | ), |
533 | 533 | 'CH' => array( |
534 | 534 | 'state' => array( |
535 | - 'label' => __( 'Canton', 'give' ), |
|
535 | + 'label' => __('Canton', 'give'), |
|
536 | 536 | 'required' => false, |
537 | 537 | 'hidden' => true, |
538 | 538 | ), |
539 | 539 | ), |
540 | 540 | 'CL' => array( |
541 | 541 | 'state' => array( |
542 | - 'label' => __( 'Region', 'give' ), |
|
542 | + 'label' => __('Region', 'give'), |
|
543 | 543 | ), |
544 | 544 | ), |
545 | 545 | 'CN' => array( |
546 | 546 | 'state' => array( |
547 | - 'label' => __( 'Province', 'give' ), |
|
547 | + 'label' => __('Province', 'give'), |
|
548 | 548 | ), |
549 | 549 | ), |
550 | 550 | 'CZ' => array( |
@@ -595,23 +595,23 @@ discard block |
||
595 | 595 | ), |
596 | 596 | 'HK' => array( |
597 | 597 | 'state' => array( |
598 | - 'label' => __( 'Region', 'give' ), |
|
598 | + 'label' => __('Region', 'give'), |
|
599 | 599 | ), |
600 | 600 | ), |
601 | 601 | 'HU' => array( |
602 | 602 | 'state' => array( |
603 | - 'label' => __( 'County', 'give' ), |
|
603 | + 'label' => __('County', 'give'), |
|
604 | 604 | 'hidden' => true, |
605 | 605 | ), |
606 | 606 | ), |
607 | 607 | 'ID' => array( |
608 | 608 | 'state' => array( |
609 | - 'label' => __( 'Province', 'give' ), |
|
609 | + 'label' => __('Province', 'give'), |
|
610 | 610 | ), |
611 | 611 | ), |
612 | 612 | 'IE' => array( |
613 | 613 | 'state' => array( |
614 | - 'label' => __( 'County', 'give' ), |
|
614 | + 'label' => __('County', 'give'), |
|
615 | 615 | ), |
616 | 616 | ), |
617 | 617 | 'IS' => array( |
@@ -628,12 +628,12 @@ discard block |
||
628 | 628 | 'IT' => array( |
629 | 629 | 'state' => array( |
630 | 630 | 'required' => true, |
631 | - 'label' => __( 'Province', 'give' ), |
|
631 | + 'label' => __('Province', 'give'), |
|
632 | 632 | ), |
633 | 633 | ), |
634 | 634 | 'JP' => array( |
635 | 635 | 'state' => array( |
636 | - 'label' => __( 'Prefecture', 'give' ), |
|
636 | + 'label' => __('Prefecture', 'give'), |
|
637 | 637 | ), |
638 | 638 | ), |
639 | 639 | 'KR' => array( |
@@ -659,14 +659,14 @@ discard block |
||
659 | 659 | 'NL' => array( |
660 | 660 | 'state' => array( |
661 | 661 | 'required' => false, |
662 | - 'label' => __( 'Province', 'give' ), |
|
662 | + 'label' => __('Province', 'give'), |
|
663 | 663 | 'hidden' => true, |
664 | 664 | ), |
665 | 665 | ), |
666 | 666 | 'NZ' => array( |
667 | 667 | 'state' => array( |
668 | 668 | 'required' => false, |
669 | - 'label' => __( 'Region', 'give' ), |
|
669 | + 'label' => __('Region', 'give'), |
|
670 | 670 | 'hidden' => true, |
671 | 671 | ), |
672 | 672 | ), |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | ), |
679 | 679 | 'NP' => array( |
680 | 680 | 'state' => array( |
681 | - 'label' => __( 'State / Zone', 'give' ), |
|
681 | + 'label' => __('State / Zone', 'give'), |
|
682 | 682 | ), |
683 | 683 | ), |
684 | 684 | 'PL' => array( |
@@ -722,12 +722,12 @@ discard block |
||
722 | 722 | ), |
723 | 723 | 'ES' => array( |
724 | 724 | 'state' => array( |
725 | - 'label' => __( 'Province', 'give' ), |
|
725 | + 'label' => __('Province', 'give'), |
|
726 | 726 | ), |
727 | 727 | ), |
728 | 728 | 'LI' => array( |
729 | 729 | 'state' => array( |
730 | - 'label' => __( 'Municipality', 'give' ), |
|
730 | + 'label' => __('Municipality', 'give'), |
|
731 | 731 | 'required' => false, |
732 | 732 | 'hidden' => true, |
733 | 733 | ), |
@@ -745,17 +745,17 @@ discard block |
||
745 | 745 | ), |
746 | 746 | 'TR' => array( |
747 | 747 | 'state' => array( |
748 | - 'label' => __( 'Province', 'give' ), |
|
748 | + 'label' => __('Province', 'give'), |
|
749 | 749 | ), |
750 | 750 | ), |
751 | 751 | 'US' => array( |
752 | 752 | 'state' => array( |
753 | - 'label' => __( 'State', 'give' ), |
|
753 | + 'label' => __('State', 'give'), |
|
754 | 754 | ), |
755 | 755 | ), |
756 | 756 | 'GB' => array( |
757 | 757 | 'state' => array( |
758 | - 'label' => __( 'County', 'give' ), |
|
758 | + 'label' => __('County', 'give'), |
|
759 | 759 | 'required' => false, |
760 | 760 | ), |
761 | 761 | ), |
@@ -772,10 +772,10 @@ discard block |
||
772 | 772 | ), |
773 | 773 | 'ZA' => array( |
774 | 774 | 'state' => array( |
775 | - 'label' => __( 'Province', 'give' ), |
|
775 | + 'label' => __('Province', 'give'), |
|
776 | 776 | ), |
777 | 777 | ), |
778 | - ) ); |
|
778 | + )); |
|
779 | 779 | } |
780 | 780 | |
781 | 781 | /** |
@@ -787,90 +787,90 @@ discard block |
||
787 | 787 | function give_get_turkey_states_list() { |
788 | 788 | $states = array( |
789 | 789 | '' => '', |
790 | - 'TR01' => __( 'Adana', 'give' ), |
|
791 | - 'TR02' => __( 'Adıyaman', 'give' ), |
|
792 | - 'TR03' => __( 'Afyon', 'give' ), |
|
793 | - 'TR04' => __( 'Ağrı', 'give' ), |
|
794 | - 'TR05' => __( 'Amasya', 'give' ), |
|
795 | - 'TR06' => __( 'Ankara', 'give' ), |
|
796 | - 'TR07' => __( 'Antalya', 'give' ), |
|
797 | - 'TR08' => __( 'Artvin', 'give' ), |
|
798 | - 'TR09' => __( 'Aydın', 'give' ), |
|
799 | - 'TR10' => __( 'Balıkesir', 'give' ), |
|
800 | - 'TR11' => __( 'Bilecik', 'give' ), |
|
801 | - 'TR12' => __( 'Bingöl', 'give' ), |
|
802 | - 'TR13' => __( 'Bitlis', 'give' ), |
|
803 | - 'TR14' => __( 'Bolu', 'give' ), |
|
804 | - 'TR15' => __( 'Burdur', 'give' ), |
|
805 | - 'TR16' => __( 'Bursa', 'give' ), |
|
806 | - 'TR17' => __( 'Çanakkale', 'give' ), |
|
807 | - 'TR18' => __( 'Çankırı', 'give' ), |
|
808 | - 'TR19' => __( 'Çorum', 'give' ), |
|
809 | - 'TR20' => __( 'Denizli', 'give' ), |
|
810 | - 'TR21' => __( 'Diyarbakır', 'give' ), |
|
811 | - 'TR22' => __( 'Edirne', 'give' ), |
|
812 | - 'TR23' => __( 'Elazığ', 'give' ), |
|
813 | - 'TR24' => __( 'Erzincan', 'give' ), |
|
814 | - 'TR25' => __( 'Erzurum', 'give' ), |
|
815 | - 'TR26' => __( 'Eskişehir', 'give' ), |
|
816 | - 'TR27' => __( 'Gaziantep', 'give' ), |
|
817 | - 'TR28' => __( 'Giresun', 'give' ), |
|
818 | - 'TR29' => __( 'Gümüşhane', 'give' ), |
|
819 | - 'TR30' => __( 'Hakkari', 'give' ), |
|
820 | - 'TR31' => __( 'Hatay', 'give' ), |
|
821 | - 'TR32' => __( 'Isparta', 'give' ), |
|
822 | - 'TR33' => __( 'İçel', 'give' ), |
|
823 | - 'TR34' => __( 'İstanbul', 'give' ), |
|
824 | - 'TR35' => __( 'İzmir', 'give' ), |
|
825 | - 'TR36' => __( 'Kars', 'give' ), |
|
826 | - 'TR37' => __( 'Kastamonu', 'give' ), |
|
827 | - 'TR38' => __( 'Kayseri', 'give' ), |
|
828 | - 'TR39' => __( 'Kırklareli', 'give' ), |
|
829 | - 'TR40' => __( 'Kırşehir', 'give' ), |
|
830 | - 'TR41' => __( 'Kocaeli', 'give' ), |
|
831 | - 'TR42' => __( 'Konya', 'give' ), |
|
832 | - 'TR43' => __( 'Kütahya', 'give' ), |
|
833 | - 'TR44' => __( 'Malatya', 'give' ), |
|
834 | - 'TR45' => __( 'Manisa', 'give' ), |
|
835 | - 'TR46' => __( 'Kahramanmaraş', 'give' ), |
|
836 | - 'TR47' => __( 'Mardin', 'give' ), |
|
837 | - 'TR48' => __( 'Muğla', 'give' ), |
|
838 | - 'TR49' => __( 'Muş', 'give' ), |
|
839 | - 'TR50' => __( 'Nevşehir', 'give' ), |
|
840 | - 'TR51' => __( 'Niğde', 'give' ), |
|
841 | - 'TR52' => __( 'Ordu', 'give' ), |
|
842 | - 'TR53' => __( 'Rize', 'give' ), |
|
843 | - 'TR54' => __( 'Sakarya', 'give' ), |
|
844 | - 'TR55' => __( 'Samsun', 'give' ), |
|
845 | - 'TR56' => __( 'Siirt', 'give' ), |
|
846 | - 'TR57' => __( 'Sinop', 'give' ), |
|
847 | - 'TR58' => __( 'Sivas', 'give' ), |
|
848 | - 'TR59' => __( 'Tekirdağ', 'give' ), |
|
849 | - 'TR60' => __( 'Tokat', 'give' ), |
|
850 | - 'TR61' => __( 'Trabzon', 'give' ), |
|
851 | - 'TR62' => __( 'Tunceli', 'give' ), |
|
852 | - 'TR63' => __( 'Şanlıurfa', 'give' ), |
|
853 | - 'TR64' => __( 'Uşak', 'give' ), |
|
854 | - 'TR65' => __( 'Van', 'give' ), |
|
855 | - 'TR66' => __( 'Yozgat', 'give' ), |
|
856 | - 'TR67' => __( 'Zonguldak', 'give' ), |
|
857 | - 'TR68' => __( 'Aksaray', 'give' ), |
|
858 | - 'TR69' => __( 'Bayburt', 'give' ), |
|
859 | - 'TR70' => __( 'Karaman', 'give' ), |
|
860 | - 'TR71' => __( 'Kırıkkale', 'give' ), |
|
861 | - 'TR72' => __( 'Batman', 'give' ), |
|
862 | - 'TR73' => __( 'Şırnak', 'give' ), |
|
863 | - 'TR74' => __( 'Bartın', 'give' ), |
|
864 | - 'TR75' => __( 'Ardahan', 'give' ), |
|
865 | - 'TR76' => __( 'Iğdır', 'give' ), |
|
866 | - 'TR77' => __( 'Yalova', 'give' ), |
|
867 | - 'TR78' => __( 'Karabük', 'give' ), |
|
868 | - 'TR79' => __( 'Kilis', 'give' ), |
|
869 | - 'TR80' => __( 'Osmaniye', 'give' ), |
|
870 | - 'TR81' => __( 'Düzce', 'give' ), |
|
790 | + 'TR01' => __('Adana', 'give'), |
|
791 | + 'TR02' => __('Adıyaman', 'give'), |
|
792 | + 'TR03' => __('Afyon', 'give'), |
|
793 | + 'TR04' => __('Ağrı', 'give'), |
|
794 | + 'TR05' => __('Amasya', 'give'), |
|
795 | + 'TR06' => __('Ankara', 'give'), |
|
796 | + 'TR07' => __('Antalya', 'give'), |
|
797 | + 'TR08' => __('Artvin', 'give'), |
|
798 | + 'TR09' => __('Aydın', 'give'), |
|
799 | + 'TR10' => __('Balıkesir', 'give'), |
|
800 | + 'TR11' => __('Bilecik', 'give'), |
|
801 | + 'TR12' => __('Bingöl', 'give'), |
|
802 | + 'TR13' => __('Bitlis', 'give'), |
|
803 | + 'TR14' => __('Bolu', 'give'), |
|
804 | + 'TR15' => __('Burdur', 'give'), |
|
805 | + 'TR16' => __('Bursa', 'give'), |
|
806 | + 'TR17' => __('Çanakkale', 'give'), |
|
807 | + 'TR18' => __('Çankırı', 'give'), |
|
808 | + 'TR19' => __('Çorum', 'give'), |
|
809 | + 'TR20' => __('Denizli', 'give'), |
|
810 | + 'TR21' => __('Diyarbakır', 'give'), |
|
811 | + 'TR22' => __('Edirne', 'give'), |
|
812 | + 'TR23' => __('Elazığ', 'give'), |
|
813 | + 'TR24' => __('Erzincan', 'give'), |
|
814 | + 'TR25' => __('Erzurum', 'give'), |
|
815 | + 'TR26' => __('Eskişehir', 'give'), |
|
816 | + 'TR27' => __('Gaziantep', 'give'), |
|
817 | + 'TR28' => __('Giresun', 'give'), |
|
818 | + 'TR29' => __('Gümüşhane', 'give'), |
|
819 | + 'TR30' => __('Hakkari', 'give'), |
|
820 | + 'TR31' => __('Hatay', 'give'), |
|
821 | + 'TR32' => __('Isparta', 'give'), |
|
822 | + 'TR33' => __('İçel', 'give'), |
|
823 | + 'TR34' => __('İstanbul', 'give'), |
|
824 | + 'TR35' => __('İzmir', 'give'), |
|
825 | + 'TR36' => __('Kars', 'give'), |
|
826 | + 'TR37' => __('Kastamonu', 'give'), |
|
827 | + 'TR38' => __('Kayseri', 'give'), |
|
828 | + 'TR39' => __('Kırklareli', 'give'), |
|
829 | + 'TR40' => __('Kırşehir', 'give'), |
|
830 | + 'TR41' => __('Kocaeli', 'give'), |
|
831 | + 'TR42' => __('Konya', 'give'), |
|
832 | + 'TR43' => __('Kütahya', 'give'), |
|
833 | + 'TR44' => __('Malatya', 'give'), |
|
834 | + 'TR45' => __('Manisa', 'give'), |
|
835 | + 'TR46' => __('Kahramanmaraş', 'give'), |
|
836 | + 'TR47' => __('Mardin', 'give'), |
|
837 | + 'TR48' => __('Muğla', 'give'), |
|
838 | + 'TR49' => __('Muş', 'give'), |
|
839 | + 'TR50' => __('Nevşehir', 'give'), |
|
840 | + 'TR51' => __('Niğde', 'give'), |
|
841 | + 'TR52' => __('Ordu', 'give'), |
|
842 | + 'TR53' => __('Rize', 'give'), |
|
843 | + 'TR54' => __('Sakarya', 'give'), |
|
844 | + 'TR55' => __('Samsun', 'give'), |
|
845 | + 'TR56' => __('Siirt', 'give'), |
|
846 | + 'TR57' => __('Sinop', 'give'), |
|
847 | + 'TR58' => __('Sivas', 'give'), |
|
848 | + 'TR59' => __('Tekirdağ', 'give'), |
|
849 | + 'TR60' => __('Tokat', 'give'), |
|
850 | + 'TR61' => __('Trabzon', 'give'), |
|
851 | + 'TR62' => __('Tunceli', 'give'), |
|
852 | + 'TR63' => __('Şanlıurfa', 'give'), |
|
853 | + 'TR64' => __('Uşak', 'give'), |
|
854 | + 'TR65' => __('Van', 'give'), |
|
855 | + 'TR66' => __('Yozgat', 'give'), |
|
856 | + 'TR67' => __('Zonguldak', 'give'), |
|
857 | + 'TR68' => __('Aksaray', 'give'), |
|
858 | + 'TR69' => __('Bayburt', 'give'), |
|
859 | + 'TR70' => __('Karaman', 'give'), |
|
860 | + 'TR71' => __('Kırıkkale', 'give'), |
|
861 | + 'TR72' => __('Batman', 'give'), |
|
862 | + 'TR73' => __('Şırnak', 'give'), |
|
863 | + 'TR74' => __('Bartın', 'give'), |
|
864 | + 'TR75' => __('Ardahan', 'give'), |
|
865 | + 'TR76' => __('Iğdır', 'give'), |
|
866 | + 'TR77' => __('Yalova', 'give'), |
|
867 | + 'TR78' => __('Karabük', 'give'), |
|
868 | + 'TR79' => __('Kilis', 'give'), |
|
869 | + 'TR80' => __('Osmaniye', 'give'), |
|
870 | + 'TR81' => __('Düzce', 'give'), |
|
871 | 871 | ); |
872 | 872 | |
873 | - return apply_filters( 'give_turkey_states', $states ); |
|
873 | + return apply_filters('give_turkey_states', $states); |
|
874 | 874 | } |
875 | 875 | |
876 | 876 | /** |
@@ -882,51 +882,51 @@ discard block |
||
882 | 882 | function give_get_romania_states_list() { |
883 | 883 | $states = array( |
884 | 884 | '' => '', |
885 | - 'AB' => __( 'Alba', 'give' ), |
|
886 | - 'AR' => __( 'Arad', 'give' ), |
|
887 | - 'AG' => __( 'Arges', 'give' ), |
|
888 | - 'BC' => __( 'Bacau', 'give' ), |
|
889 | - 'BH' => __( 'Bihor', 'give' ), |
|
890 | - 'BN' => __( 'Bistrita-Nasaud', 'give' ), |
|
891 | - 'BT' => __( 'Botosani', 'give' ), |
|
892 | - 'BR' => __( 'Braila', 'give' ), |
|
893 | - 'BV' => __( 'Brasov', 'give' ), |
|
894 | - 'B' => __( 'Bucuresti', 'give' ), |
|
895 | - 'BZ' => __( 'Buzau', 'give' ), |
|
896 | - 'CL' => __( 'Calarasi', 'give' ), |
|
897 | - 'CS' => __( 'Caras-Severin', 'give' ), |
|
898 | - 'CJ' => __( 'Cluj', 'give' ), |
|
899 | - 'CT' => __( 'Constanta', 'give' ), |
|
900 | - 'CV' => __( 'Covasna', 'give' ), |
|
901 | - 'DB' => __( 'Dambovita', 'give' ), |
|
902 | - 'DJ' => __( 'Dolj', 'give' ), |
|
903 | - 'GL' => __( 'Galati', 'give' ), |
|
904 | - 'GR' => __( 'Giurgiu', 'give' ), |
|
905 | - 'GJ' => __( 'Gorj', 'give' ), |
|
906 | - 'HR' => __( 'Harghita', 'give' ), |
|
907 | - 'HD' => __( 'Hunedoara', 'give' ), |
|
908 | - 'IL' => __( 'Ialomita', 'give' ), |
|
909 | - 'IS' => __( 'Iasi', 'give' ), |
|
910 | - 'IF' => __( 'Ilfov', 'give' ), |
|
911 | - 'MM' => __( 'Maramures', 'give' ), |
|
912 | - 'MH' => __( 'Mehedinti', 'give' ), |
|
913 | - 'MS' => __( 'Mures', 'give' ), |
|
914 | - 'NT' => __( 'Neamt', 'give' ), |
|
915 | - 'OT' => __( 'Olt', 'give' ), |
|
916 | - 'PH' => __( 'Prahova', 'give' ), |
|
917 | - 'SJ' => __( 'Salaj', 'give' ), |
|
918 | - 'SM' => __( 'Satu Mare', 'give' ), |
|
919 | - 'SB' => __( 'Sibiu', 'give' ), |
|
920 | - 'SV' => __( 'Suceava', 'give' ), |
|
921 | - 'TR' => __( 'Teleorman', 'give' ), |
|
922 | - 'TM' => __( 'Timis', 'give' ), |
|
923 | - 'TL' => __( 'Tulcea', 'give' ), |
|
924 | - 'VL' => __( 'Valcea', 'give' ), |
|
925 | - 'VS' => __( 'Vaslui', 'give' ), |
|
926 | - 'VN' => __( 'Vrancea', 'give' ), |
|
885 | + 'AB' => __('Alba', 'give'), |
|
886 | + 'AR' => __('Arad', 'give'), |
|
887 | + 'AG' => __('Arges', 'give'), |
|
888 | + 'BC' => __('Bacau', 'give'), |
|
889 | + 'BH' => __('Bihor', 'give'), |
|
890 | + 'BN' => __('Bistrita-Nasaud', 'give'), |
|
891 | + 'BT' => __('Botosani', 'give'), |
|
892 | + 'BR' => __('Braila', 'give'), |
|
893 | + 'BV' => __('Brasov', 'give'), |
|
894 | + 'B' => __('Bucuresti', 'give'), |
|
895 | + 'BZ' => __('Buzau', 'give'), |
|
896 | + 'CL' => __('Calarasi', 'give'), |
|
897 | + 'CS' => __('Caras-Severin', 'give'), |
|
898 | + 'CJ' => __('Cluj', 'give'), |
|
899 | + 'CT' => __('Constanta', 'give'), |
|
900 | + 'CV' => __('Covasna', 'give'), |
|
901 | + 'DB' => __('Dambovita', 'give'), |
|
902 | + 'DJ' => __('Dolj', 'give'), |
|
903 | + 'GL' => __('Galati', 'give'), |
|
904 | + 'GR' => __('Giurgiu', 'give'), |
|
905 | + 'GJ' => __('Gorj', 'give'), |
|
906 | + 'HR' => __('Harghita', 'give'), |
|
907 | + 'HD' => __('Hunedoara', 'give'), |
|
908 | + 'IL' => __('Ialomita', 'give'), |
|
909 | + 'IS' => __('Iasi', 'give'), |
|
910 | + 'IF' => __('Ilfov', 'give'), |
|
911 | + 'MM' => __('Maramures', 'give'), |
|
912 | + 'MH' => __('Mehedinti', 'give'), |
|
913 | + 'MS' => __('Mures', 'give'), |
|
914 | + 'NT' => __('Neamt', 'give'), |
|
915 | + 'OT' => __('Olt', 'give'), |
|
916 | + 'PH' => __('Prahova', 'give'), |
|
917 | + 'SJ' => __('Salaj', 'give'), |
|
918 | + 'SM' => __('Satu Mare', 'give'), |
|
919 | + 'SB' => __('Sibiu', 'give'), |
|
920 | + 'SV' => __('Suceava', 'give'), |
|
921 | + 'TR' => __('Teleorman', 'give'), |
|
922 | + 'TM' => __('Timis', 'give'), |
|
923 | + 'TL' => __('Tulcea', 'give'), |
|
924 | + 'VL' => __('Valcea', 'give'), |
|
925 | + 'VS' => __('Vaslui', 'give'), |
|
926 | + 'VN' => __('Vrancea', 'give'), |
|
927 | 927 | ); |
928 | 928 | |
929 | - return apply_filters( 'give_romania_states', $states ); |
|
929 | + return apply_filters('give_romania_states', $states); |
|
930 | 930 | } |
931 | 931 | |
932 | 932 | /** |
@@ -938,17 +938,17 @@ discard block |
||
938 | 938 | function give_get_pakistan_states_list() { |
939 | 939 | $states = array( |
940 | 940 | '' => '', |
941 | - 'JK' => __( 'Azad Kashmir', 'give' ), |
|
942 | - 'BA' => __( 'Balochistan', 'give' ), |
|
943 | - 'TA' => __( 'FATA', 'give' ), |
|
944 | - 'GB' => __( 'Gilgit Baltistan', 'give' ), |
|
945 | - 'IS' => __( 'Islamabad Capital Territory', 'give' ), |
|
946 | - 'KP' => __( 'Khyber Pakhtunkhwa', 'give' ), |
|
947 | - 'PB' => __( 'Punjab', 'give' ), |
|
948 | - 'SD' => __( 'Sindh', 'give' ), |
|
941 | + 'JK' => __('Azad Kashmir', 'give'), |
|
942 | + 'BA' => __('Balochistan', 'give'), |
|
943 | + 'TA' => __('FATA', 'give'), |
|
944 | + 'GB' => __('Gilgit Baltistan', 'give'), |
|
945 | + 'IS' => __('Islamabad Capital Territory', 'give'), |
|
946 | + 'KP' => __('Khyber Pakhtunkhwa', 'give'), |
|
947 | + 'PB' => __('Punjab', 'give'), |
|
948 | + 'SD' => __('Sindh', 'give'), |
|
949 | 949 | ); |
950 | 950 | |
951 | - return apply_filters( 'give_pakistan_states', $states ); |
|
951 | + return apply_filters('give_pakistan_states', $states); |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | /** |
@@ -960,91 +960,91 @@ discard block |
||
960 | 960 | function give_get_philippines_states_list() { |
961 | 961 | $states = array( |
962 | 962 | '' => '', |
963 | - 'ABR' => __( 'Abra', 'give' ), |
|
964 | - 'AGN' => __( 'Agusan del Norte', 'give' ), |
|
965 | - 'AGS' => __( 'Agusan del Sur', 'give' ), |
|
966 | - 'AKL' => __( 'Aklan', 'give' ), |
|
967 | - 'ALB' => __( 'Albay', 'give' ), |
|
968 | - 'ANT' => __( 'Antique', 'give' ), |
|
969 | - 'APA' => __( 'Apayao', 'give' ), |
|
970 | - 'AUR' => __( 'Aurora', 'give' ), |
|
971 | - 'BAS' => __( 'Basilan', 'give' ), |
|
972 | - 'BAN' => __( 'Bataan', 'give' ), |
|
973 | - 'BTN' => __( 'Batanes', 'give' ), |
|
974 | - 'BTG' => __( 'Batangas', 'give' ), |
|
975 | - 'BEN' => __( 'Benguet', 'give' ), |
|
976 | - 'BIL' => __( 'Biliran', 'give' ), |
|
977 | - 'BOH' => __( 'Bohol', 'give' ), |
|
978 | - 'BUK' => __( 'Bukidnon', 'give' ), |
|
979 | - 'BUL' => __( 'Bulacan', 'give' ), |
|
980 | - 'CAG' => __( 'Cagayan', 'give' ), |
|
981 | - 'CAN' => __( 'Camarines Norte', 'give' ), |
|
982 | - 'CAS' => __( 'Camarines Sur', 'give' ), |
|
983 | - 'CAM' => __( 'Camiguin', 'give' ), |
|
984 | - 'CAP' => __( 'Capiz', 'give' ), |
|
985 | - 'CAT' => __( 'Catanduanes', 'give' ), |
|
986 | - 'CAV' => __( 'Cavite', 'give' ), |
|
987 | - 'CEB' => __( 'Cebu', 'give' ), |
|
988 | - 'COM' => __( 'Compostela Valley', 'give' ), |
|
989 | - 'NCO' => __( 'Cotabato', 'give' ), |
|
990 | - 'DAV' => __( 'Davao del Norte', 'give' ), |
|
991 | - 'DAS' => __( 'Davao del Sur', 'give' ), |
|
992 | - 'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned |
|
993 | - 'DAO' => __( 'Davao Oriental', 'give' ), |
|
994 | - 'DIN' => __( 'Dinagat Islands', 'give' ), |
|
995 | - 'EAS' => __( 'Eastern Samar', 'give' ), |
|
996 | - 'GUI' => __( 'Guimaras', 'give' ), |
|
997 | - 'IFU' => __( 'Ifugao', 'give' ), |
|
998 | - 'ILN' => __( 'Ilocos Norte', 'give' ), |
|
999 | - 'ILS' => __( 'Ilocos Sur', 'give' ), |
|
1000 | - 'ILI' => __( 'Iloilo', 'give' ), |
|
1001 | - 'ISA' => __( 'Isabela', 'give' ), |
|
1002 | - 'KAL' => __( 'Kalinga', 'give' ), |
|
1003 | - 'LUN' => __( 'La Union', 'give' ), |
|
1004 | - 'LAG' => __( 'Laguna', 'give' ), |
|
1005 | - 'LAN' => __( 'Lanao del Norte', 'give' ), |
|
1006 | - 'LAS' => __( 'Lanao del Sur', 'give' ), |
|
1007 | - 'LEY' => __( 'Leyte', 'give' ), |
|
1008 | - 'MAG' => __( 'Maguindanao', 'give' ), |
|
1009 | - 'MAD' => __( 'Marinduque', 'give' ), |
|
1010 | - 'MAS' => __( 'Masbate', 'give' ), |
|
1011 | - 'MSC' => __( 'Misamis Occidental', 'give' ), |
|
1012 | - 'MSR' => __( 'Misamis Oriental', 'give' ), |
|
1013 | - 'MOU' => __( 'Mountain Province', 'give' ), |
|
1014 | - 'NEC' => __( 'Negros Occidental', 'give' ), |
|
1015 | - 'NER' => __( 'Negros Oriental', 'give' ), |
|
1016 | - 'NSA' => __( 'Northern Samar', 'give' ), |
|
1017 | - 'NUE' => __( 'Nueva Ecija', 'give' ), |
|
1018 | - 'NUV' => __( 'Nueva Vizcaya', 'give' ), |
|
1019 | - 'MDC' => __( 'Occidental Mindoro', 'give' ), |
|
1020 | - 'MDR' => __( 'Oriental Mindoro', 'give' ), |
|
1021 | - 'PLW' => __( 'Palawan', 'give' ), |
|
1022 | - 'PAM' => __( 'Pampanga', 'give' ), |
|
1023 | - 'PAN' => __( 'Pangasinan', 'give' ), |
|
1024 | - 'QUE' => __( 'Quezon', 'give' ), |
|
1025 | - 'QUI' => __( 'Quirino', 'give' ), |
|
1026 | - 'RIZ' => __( 'Rizal', 'give' ), |
|
1027 | - 'ROM' => __( 'Romblon', 'give' ), |
|
1028 | - 'WSA' => __( 'Samar', 'give' ), |
|
1029 | - 'SAR' => __( 'Sarangani', 'give' ), |
|
1030 | - 'SIQ' => __( 'Siquijor', 'give' ), |
|
1031 | - 'SOR' => __( 'Sorsogon', 'give' ), |
|
1032 | - 'SCO' => __( 'South Cotabato', 'give' ), |
|
1033 | - 'SLE' => __( 'Southern Leyte', 'give' ), |
|
1034 | - 'SUK' => __( 'Sultan Kudarat', 'give' ), |
|
1035 | - 'SLU' => __( 'Sulu', 'give' ), |
|
1036 | - 'SUN' => __( 'Surigao del Norte', 'give' ), |
|
1037 | - 'SUR' => __( 'Surigao del Sur', 'give' ), |
|
1038 | - 'TAR' => __( 'Tarlac', 'give' ), |
|
1039 | - 'TAW' => __( 'Tawi-Tawi', 'give' ), |
|
1040 | - 'ZMB' => __( 'Zambales', 'give' ), |
|
1041 | - 'ZAN' => __( 'Zamboanga del Norte', 'give' ), |
|
1042 | - 'ZAS' => __( 'Zamboanga del Sur', 'give' ), |
|
1043 | - 'ZSI' => __( 'Zamboanga Sibugay', 'give' ), |
|
1044 | - '00' => __( 'Metro Manila', 'give' ), |
|
963 | + 'ABR' => __('Abra', 'give'), |
|
964 | + 'AGN' => __('Agusan del Norte', 'give'), |
|
965 | + 'AGS' => __('Agusan del Sur', 'give'), |
|
966 | + 'AKL' => __('Aklan', 'give'), |
|
967 | + 'ALB' => __('Albay', 'give'), |
|
968 | + 'ANT' => __('Antique', 'give'), |
|
969 | + 'APA' => __('Apayao', 'give'), |
|
970 | + 'AUR' => __('Aurora', 'give'), |
|
971 | + 'BAS' => __('Basilan', 'give'), |
|
972 | + 'BAN' => __('Bataan', 'give'), |
|
973 | + 'BTN' => __('Batanes', 'give'), |
|
974 | + 'BTG' => __('Batangas', 'give'), |
|
975 | + 'BEN' => __('Benguet', 'give'), |
|
976 | + 'BIL' => __('Biliran', 'give'), |
|
977 | + 'BOH' => __('Bohol', 'give'), |
|
978 | + 'BUK' => __('Bukidnon', 'give'), |
|
979 | + 'BUL' => __('Bulacan', 'give'), |
|
980 | + 'CAG' => __('Cagayan', 'give'), |
|
981 | + 'CAN' => __('Camarines Norte', 'give'), |
|
982 | + 'CAS' => __('Camarines Sur', 'give'), |
|
983 | + 'CAM' => __('Camiguin', 'give'), |
|
984 | + 'CAP' => __('Capiz', 'give'), |
|
985 | + 'CAT' => __('Catanduanes', 'give'), |
|
986 | + 'CAV' => __('Cavite', 'give'), |
|
987 | + 'CEB' => __('Cebu', 'give'), |
|
988 | + 'COM' => __('Compostela Valley', 'give'), |
|
989 | + 'NCO' => __('Cotabato', 'give'), |
|
990 | + 'DAV' => __('Davao del Norte', 'give'), |
|
991 | + 'DAS' => __('Davao del Sur', 'give'), |
|
992 | + 'DAC' => __('Davao Occidental', 'give'), // TODO: Needs to be updated when ISO code is assigned |
|
993 | + 'DAO' => __('Davao Oriental', 'give'), |
|
994 | + 'DIN' => __('Dinagat Islands', 'give'), |
|
995 | + 'EAS' => __('Eastern Samar', 'give'), |
|
996 | + 'GUI' => __('Guimaras', 'give'), |
|
997 | + 'IFU' => __('Ifugao', 'give'), |
|
998 | + 'ILN' => __('Ilocos Norte', 'give'), |
|
999 | + 'ILS' => __('Ilocos Sur', 'give'), |
|
1000 | + 'ILI' => __('Iloilo', 'give'), |
|
1001 | + 'ISA' => __('Isabela', 'give'), |
|
1002 | + 'KAL' => __('Kalinga', 'give'), |
|
1003 | + 'LUN' => __('La Union', 'give'), |
|
1004 | + 'LAG' => __('Laguna', 'give'), |
|
1005 | + 'LAN' => __('Lanao del Norte', 'give'), |
|
1006 | + 'LAS' => __('Lanao del Sur', 'give'), |
|
1007 | + 'LEY' => __('Leyte', 'give'), |
|
1008 | + 'MAG' => __('Maguindanao', 'give'), |
|
1009 | + 'MAD' => __('Marinduque', 'give'), |
|
1010 | + 'MAS' => __('Masbate', 'give'), |
|
1011 | + 'MSC' => __('Misamis Occidental', 'give'), |
|
1012 | + 'MSR' => __('Misamis Oriental', 'give'), |
|
1013 | + 'MOU' => __('Mountain Province', 'give'), |
|
1014 | + 'NEC' => __('Negros Occidental', 'give'), |
|
1015 | + 'NER' => __('Negros Oriental', 'give'), |
|
1016 | + 'NSA' => __('Northern Samar', 'give'), |
|
1017 | + 'NUE' => __('Nueva Ecija', 'give'), |
|
1018 | + 'NUV' => __('Nueva Vizcaya', 'give'), |
|
1019 | + 'MDC' => __('Occidental Mindoro', 'give'), |
|
1020 | + 'MDR' => __('Oriental Mindoro', 'give'), |
|
1021 | + 'PLW' => __('Palawan', 'give'), |
|
1022 | + 'PAM' => __('Pampanga', 'give'), |
|
1023 | + 'PAN' => __('Pangasinan', 'give'), |
|
1024 | + 'QUE' => __('Quezon', 'give'), |
|
1025 | + 'QUI' => __('Quirino', 'give'), |
|
1026 | + 'RIZ' => __('Rizal', 'give'), |
|
1027 | + 'ROM' => __('Romblon', 'give'), |
|
1028 | + 'WSA' => __('Samar', 'give'), |
|
1029 | + 'SAR' => __('Sarangani', 'give'), |
|
1030 | + 'SIQ' => __('Siquijor', 'give'), |
|
1031 | + 'SOR' => __('Sorsogon', 'give'), |
|
1032 | + 'SCO' => __('South Cotabato', 'give'), |
|
1033 | + 'SLE' => __('Southern Leyte', 'give'), |
|
1034 | + 'SUK' => __('Sultan Kudarat', 'give'), |
|
1035 | + 'SLU' => __('Sulu', 'give'), |
|
1036 | + 'SUN' => __('Surigao del Norte', 'give'), |
|
1037 | + 'SUR' => __('Surigao del Sur', 'give'), |
|
1038 | + 'TAR' => __('Tarlac', 'give'), |
|
1039 | + 'TAW' => __('Tawi-Tawi', 'give'), |
|
1040 | + 'ZMB' => __('Zambales', 'give'), |
|
1041 | + 'ZAN' => __('Zamboanga del Norte', 'give'), |
|
1042 | + 'ZAS' => __('Zamboanga del Sur', 'give'), |
|
1043 | + 'ZSI' => __('Zamboanga Sibugay', 'give'), |
|
1044 | + '00' => __('Metro Manila', 'give'), |
|
1045 | 1045 | ); |
1046 | 1046 | |
1047 | - return apply_filters( 'give_philippines_states', $states ); |
|
1047 | + return apply_filters('give_philippines_states', $states); |
|
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | /** |
@@ -1056,35 +1056,35 @@ discard block |
||
1056 | 1056 | function give_get_peru_states_list() { |
1057 | 1057 | $states = array( |
1058 | 1058 | '' => '', |
1059 | - 'CAL' => __( 'El Callao', 'give' ), |
|
1060 | - 'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ), |
|
1061 | - 'AMA' => __( 'Amazonas', 'give' ), |
|
1062 | - 'ANC' => __( 'Ancash', 'give' ), |
|
1063 | - 'APU' => __( 'Apurímac', 'give' ), |
|
1064 | - 'ARE' => __( 'Arequipa', 'give' ), |
|
1065 | - 'AYA' => __( 'Ayacucho', 'give' ), |
|
1066 | - 'CAJ' => __( 'Cajamarca', 'give' ), |
|
1067 | - 'CUS' => __( 'Cusco', 'give' ), |
|
1068 | - 'HUV' => __( 'Huancavelica', 'give' ), |
|
1069 | - 'HUC' => __( 'Huánuco', 'give' ), |
|
1070 | - 'ICA' => __( 'Ica', 'give' ), |
|
1071 | - 'JUN' => __( 'Junín', 'give' ), |
|
1072 | - 'LAL' => __( 'La Libertad', 'give' ), |
|
1073 | - 'LAM' => __( 'Lambayeque', 'give' ), |
|
1074 | - 'LIM' => __( 'Lima', 'give' ), |
|
1075 | - 'LOR' => __( 'Loreto', 'give' ), |
|
1076 | - 'MDD' => __( 'Madre de Dios', 'give' ), |
|
1077 | - 'MOQ' => __( 'Moquegua', 'give' ), |
|
1078 | - 'PAS' => __( 'Pasco', 'give' ), |
|
1079 | - 'PIU' => __( 'Piura', 'give' ), |
|
1080 | - 'PUN' => __( 'Puno', 'give' ), |
|
1081 | - 'SAM' => __( 'San Martín', 'give' ), |
|
1082 | - 'TAC' => __( 'Tacna', 'give' ), |
|
1083 | - 'TUM' => __( 'Tumbes', 'give' ), |
|
1084 | - 'UCA' => __( 'Ucayali', 'give' ), |
|
1059 | + 'CAL' => __('El Callao', 'give'), |
|
1060 | + 'LMA' => __('Municipalidad Metropolitana de Lima', 'give'), |
|
1061 | + 'AMA' => __('Amazonas', 'give'), |
|
1062 | + 'ANC' => __('Ancash', 'give'), |
|
1063 | + 'APU' => __('Apurímac', 'give'), |
|
1064 | + 'ARE' => __('Arequipa', 'give'), |
|
1065 | + 'AYA' => __('Ayacucho', 'give'), |
|
1066 | + 'CAJ' => __('Cajamarca', 'give'), |
|
1067 | + 'CUS' => __('Cusco', 'give'), |
|
1068 | + 'HUV' => __('Huancavelica', 'give'), |
|
1069 | + 'HUC' => __('Huánuco', 'give'), |
|
1070 | + 'ICA' => __('Ica', 'give'), |
|
1071 | + 'JUN' => __('Junín', 'give'), |
|
1072 | + 'LAL' => __('La Libertad', 'give'), |
|
1073 | + 'LAM' => __('Lambayeque', 'give'), |
|
1074 | + 'LIM' => __('Lima', 'give'), |
|
1075 | + 'LOR' => __('Loreto', 'give'), |
|
1076 | + 'MDD' => __('Madre de Dios', 'give'), |
|
1077 | + 'MOQ' => __('Moquegua', 'give'), |
|
1078 | + 'PAS' => __('Pasco', 'give'), |
|
1079 | + 'PIU' => __('Piura', 'give'), |
|
1080 | + 'PUN' => __('Puno', 'give'), |
|
1081 | + 'SAM' => __('San Martín', 'give'), |
|
1082 | + 'TAC' => __('Tacna', 'give'), |
|
1083 | + 'TUM' => __('Tumbes', 'give'), |
|
1084 | + 'UCA' => __('Ucayali', 'give'), |
|
1085 | 1085 | ); |
1086 | 1086 | |
1087 | - return apply_filters( 'give_peru_states', $states ); |
|
1087 | + return apply_filters('give_peru_states', $states); |
|
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | /** |
@@ -1096,23 +1096,23 @@ discard block |
||
1096 | 1096 | function give_get_nepal_states_list() { |
1097 | 1097 | $states = array( |
1098 | 1098 | '' => '', |
1099 | - 'BAG' => __( 'Bagmati', 'give' ), |
|
1100 | - 'BHE' => __( 'Bheri', 'give' ), |
|
1101 | - 'DHA' => __( 'Dhaulagiri', 'give' ), |
|
1102 | - 'GAN' => __( 'Gandaki', 'give' ), |
|
1103 | - 'JAN' => __( 'Janakpur', 'give' ), |
|
1104 | - 'KAR' => __( 'Karnali', 'give' ), |
|
1105 | - 'KOS' => __( 'Koshi', 'give' ), |
|
1106 | - 'LUM' => __( 'Lumbini', 'give' ), |
|
1107 | - 'MAH' => __( 'Mahakali', 'give' ), |
|
1108 | - 'MEC' => __( 'Mechi', 'give' ), |
|
1109 | - 'NAR' => __( 'Narayani', 'give' ), |
|
1110 | - 'RAP' => __( 'Rapti', 'give' ), |
|
1111 | - 'SAG' => __( 'Sagarmatha', 'give' ), |
|
1112 | - 'SET' => __( 'Seti', 'give' ), |
|
1099 | + 'BAG' => __('Bagmati', 'give'), |
|
1100 | + 'BHE' => __('Bheri', 'give'), |
|
1101 | + 'DHA' => __('Dhaulagiri', 'give'), |
|
1102 | + 'GAN' => __('Gandaki', 'give'), |
|
1103 | + 'JAN' => __('Janakpur', 'give'), |
|
1104 | + 'KAR' => __('Karnali', 'give'), |
|
1105 | + 'KOS' => __('Koshi', 'give'), |
|
1106 | + 'LUM' => __('Lumbini', 'give'), |
|
1107 | + 'MAH' => __('Mahakali', 'give'), |
|
1108 | + 'MEC' => __('Mechi', 'give'), |
|
1109 | + 'NAR' => __('Narayani', 'give'), |
|
1110 | + 'RAP' => __('Rapti', 'give'), |
|
1111 | + 'SAG' => __('Sagarmatha', 'give'), |
|
1112 | + 'SET' => __('Seti', 'give'), |
|
1113 | 1113 | ); |
1114 | 1114 | |
1115 | - return apply_filters( 'give_nepal_states', $states ); |
|
1115 | + return apply_filters('give_nepal_states', $states); |
|
1116 | 1116 | } |
1117 | 1117 | |
1118 | 1118 | /** |
@@ -1124,46 +1124,46 @@ discard block |
||
1124 | 1124 | function give_get_nigerian_states_list() { |
1125 | 1125 | $states = array( |
1126 | 1126 | '' => '', |
1127 | - 'AB' => __( 'Abia', 'give' ), |
|
1128 | - 'FC' => __( 'Abuja', 'give' ), |
|
1129 | - 'AD' => __( 'Adamawa', 'give' ), |
|
1130 | - 'AK' => __( 'Akwa Ibom', 'give' ), |
|
1131 | - 'AN' => __( 'Anambra', 'give' ), |
|
1132 | - 'BA' => __( 'Bauchi', 'give' ), |
|
1133 | - 'BY' => __( 'Bayelsa', 'give' ), |
|
1134 | - 'BE' => __( 'Benue', 'give' ), |
|
1135 | - 'BO' => __( 'Borno', 'give' ), |
|
1136 | - 'CR' => __( 'Cross River', 'give' ), |
|
1137 | - 'DE' => __( 'Delta', 'give' ), |
|
1138 | - 'EB' => __( 'Ebonyi', 'give' ), |
|
1139 | - 'ED' => __( 'Edo', 'give' ), |
|
1140 | - 'EK' => __( 'Ekiti', 'give' ), |
|
1141 | - 'EN' => __( 'Enugu', 'give' ), |
|
1142 | - 'GO' => __( 'Gombe', 'give' ), |
|
1143 | - 'IM' => __( 'Imo', 'give' ), |
|
1144 | - 'JI' => __( 'Jigawa', 'give' ), |
|
1145 | - 'KD' => __( 'Kaduna', 'give' ), |
|
1146 | - 'KN' => __( 'Kano', 'give' ), |
|
1147 | - 'KT' => __( 'Katsina', 'give' ), |
|
1148 | - 'KE' => __( 'Kebbi', 'give' ), |
|
1149 | - 'KO' => __( 'Kogi', 'give' ), |
|
1150 | - 'KW' => __( 'Kwara', 'give' ), |
|
1151 | - 'LA' => __( 'Lagos', 'give' ), |
|
1152 | - 'NA' => __( 'Nasarawa', 'give' ), |
|
1153 | - 'NI' => __( 'Niger', 'give' ), |
|
1154 | - 'OG' => __( 'Ogun', 'give' ), |
|
1155 | - 'ON' => __( 'Ondo', 'give' ), |
|
1156 | - 'OS' => __( 'Osun', 'give' ), |
|
1157 | - 'OY' => __( 'Oyo', 'give' ), |
|
1158 | - 'PL' => __( 'Plateau', 'give' ), |
|
1159 | - 'RI' => __( 'Rivers', 'give' ), |
|
1160 | - 'SO' => __( 'Sokoto', 'give' ), |
|
1161 | - 'TA' => __( 'Taraba', 'give' ), |
|
1162 | - 'YO' => __( 'Yobe', 'give' ), |
|
1163 | - 'ZA' => __( 'Zamfara', 'give' ), |
|
1127 | + 'AB' => __('Abia', 'give'), |
|
1128 | + 'FC' => __('Abuja', 'give'), |
|
1129 | + 'AD' => __('Adamawa', 'give'), |
|
1130 | + 'AK' => __('Akwa Ibom', 'give'), |
|
1131 | + 'AN' => __('Anambra', 'give'), |
|
1132 | + 'BA' => __('Bauchi', 'give'), |
|
1133 | + 'BY' => __('Bayelsa', 'give'), |
|
1134 | + 'BE' => __('Benue', 'give'), |
|
1135 | + 'BO' => __('Borno', 'give'), |
|
1136 | + 'CR' => __('Cross River', 'give'), |
|
1137 | + 'DE' => __('Delta', 'give'), |
|
1138 | + 'EB' => __('Ebonyi', 'give'), |
|
1139 | + 'ED' => __('Edo', 'give'), |
|
1140 | + 'EK' => __('Ekiti', 'give'), |
|
1141 | + 'EN' => __('Enugu', 'give'), |
|
1142 | + 'GO' => __('Gombe', 'give'), |
|
1143 | + 'IM' => __('Imo', 'give'), |
|
1144 | + 'JI' => __('Jigawa', 'give'), |
|
1145 | + 'KD' => __('Kaduna', 'give'), |
|
1146 | + 'KN' => __('Kano', 'give'), |
|
1147 | + 'KT' => __('Katsina', 'give'), |
|
1148 | + 'KE' => __('Kebbi', 'give'), |
|
1149 | + 'KO' => __('Kogi', 'give'), |
|
1150 | + 'KW' => __('Kwara', 'give'), |
|
1151 | + 'LA' => __('Lagos', 'give'), |
|
1152 | + 'NA' => __('Nasarawa', 'give'), |
|
1153 | + 'NI' => __('Niger', 'give'), |
|
1154 | + 'OG' => __('Ogun', 'give'), |
|
1155 | + 'ON' => __('Ondo', 'give'), |
|
1156 | + 'OS' => __('Osun', 'give'), |
|
1157 | + 'OY' => __('Oyo', 'give'), |
|
1158 | + 'PL' => __('Plateau', 'give'), |
|
1159 | + 'RI' => __('Rivers', 'give'), |
|
1160 | + 'SO' => __('Sokoto', 'give'), |
|
1161 | + 'TA' => __('Taraba', 'give'), |
|
1162 | + 'YO' => __('Yobe', 'give'), |
|
1163 | + 'ZA' => __('Zamfara', 'give'), |
|
1164 | 1164 | ); |
1165 | 1165 | |
1166 | - return apply_filters( 'give_nigerian_states', $states ); |
|
1166 | + return apply_filters('give_nigerian_states', $states); |
|
1167 | 1167 | } |
1168 | 1168 | |
1169 | 1169 | /** |
@@ -1175,41 +1175,41 @@ discard block |
||
1175 | 1175 | function give_get_mexico_states_list() { |
1176 | 1176 | $states = array( |
1177 | 1177 | '' => '', |
1178 | - 'Distrito Federal' => __( 'Distrito Federal', 'give' ), |
|
1179 | - 'Jalisco' => __( 'Jalisco', 'give' ), |
|
1180 | - 'Nuevo Leon' => __( 'Nuevo León', 'give' ), |
|
1181 | - 'Aguascalientes' => __( 'Aguascalientes', 'give' ), |
|
1182 | - 'Baja California' => __( 'Baja California', 'give' ), |
|
1183 | - 'Baja California Sur' => __( 'Baja California Sur', 'give' ), |
|
1184 | - 'Campeche' => __( 'Campeche', 'give' ), |
|
1185 | - 'Chiapas' => __( 'Chiapas', 'give' ), |
|
1186 | - 'Chihuahua' => __( 'Chihuahua', 'give' ), |
|
1187 | - 'Coahuila' => __( 'Coahuila', 'give' ), |
|
1188 | - 'Colima' => __( 'Colima', 'give' ), |
|
1189 | - 'Durango' => __( 'Durango', 'give' ), |
|
1190 | - 'Guanajuato' => __( 'Guanajuato', 'give' ), |
|
1191 | - 'Guerrero' => __( 'Guerrero', 'give' ), |
|
1192 | - 'Hidalgo' => __( 'Hidalgo', 'give' ), |
|
1193 | - 'Estado de Mexico' => __( 'Edo. de México', 'give' ), |
|
1194 | - 'Michoacan' => __( 'Michoacán', 'give' ), |
|
1195 | - 'Morelos' => __( 'Morelos', 'give' ), |
|
1196 | - 'Nayarit' => __( 'Nayarit', 'give' ), |
|
1197 | - 'Oaxaca' => __( 'Oaxaca', 'give' ), |
|
1198 | - 'Puebla' => __( 'Puebla', 'give' ), |
|
1199 | - 'Queretaro' => __( 'Querétaro', 'give' ), |
|
1200 | - 'Quintana Roo' => __( 'Quintana Roo', 'give' ), |
|
1201 | - 'San Luis Potosi' => __( 'San Luis Potosí', 'give' ), |
|
1202 | - 'Sinaloa' => __( 'Sinaloa', 'give' ), |
|
1203 | - 'Sonora' => __( 'Sonora', 'give' ), |
|
1204 | - 'Tabasco' => __( 'Tabasco', 'give' ), |
|
1205 | - 'Tamaulipas' => __( 'Tamaulipas', 'give' ), |
|
1206 | - 'Tlaxcala' => __( 'Tlaxcala', 'give' ), |
|
1207 | - 'Veracruz' => __( 'Veracruz', 'give' ), |
|
1208 | - 'Yucatan' => __( 'Yucatán', 'give' ), |
|
1209 | - 'Zacatecas' => __( 'Zacatecas', 'give' ), |
|
1178 | + 'Distrito Federal' => __('Distrito Federal', 'give'), |
|
1179 | + 'Jalisco' => __('Jalisco', 'give'), |
|
1180 | + 'Nuevo Leon' => __('Nuevo León', 'give'), |
|
1181 | + 'Aguascalientes' => __('Aguascalientes', 'give'), |
|
1182 | + 'Baja California' => __('Baja California', 'give'), |
|
1183 | + 'Baja California Sur' => __('Baja California Sur', 'give'), |
|
1184 | + 'Campeche' => __('Campeche', 'give'), |
|
1185 | + 'Chiapas' => __('Chiapas', 'give'), |
|
1186 | + 'Chihuahua' => __('Chihuahua', 'give'), |
|
1187 | + 'Coahuila' => __('Coahuila', 'give'), |
|
1188 | + 'Colima' => __('Colima', 'give'), |
|
1189 | + 'Durango' => __('Durango', 'give'), |
|
1190 | + 'Guanajuato' => __('Guanajuato', 'give'), |
|
1191 | + 'Guerrero' => __('Guerrero', 'give'), |
|
1192 | + 'Hidalgo' => __('Hidalgo', 'give'), |
|
1193 | + 'Estado de Mexico' => __('Edo. de México', 'give'), |
|
1194 | + 'Michoacan' => __('Michoacán', 'give'), |
|
1195 | + 'Morelos' => __('Morelos', 'give'), |
|
1196 | + 'Nayarit' => __('Nayarit', 'give'), |
|
1197 | + 'Oaxaca' => __('Oaxaca', 'give'), |
|
1198 | + 'Puebla' => __('Puebla', 'give'), |
|
1199 | + 'Queretaro' => __('Querétaro', 'give'), |
|
1200 | + 'Quintana Roo' => __('Quintana Roo', 'give'), |
|
1201 | + 'San Luis Potosi' => __('San Luis Potosí', 'give'), |
|
1202 | + 'Sinaloa' => __('Sinaloa', 'give'), |
|
1203 | + 'Sonora' => __('Sonora', 'give'), |
|
1204 | + 'Tabasco' => __('Tabasco', 'give'), |
|
1205 | + 'Tamaulipas' => __('Tamaulipas', 'give'), |
|
1206 | + 'Tlaxcala' => __('Tlaxcala', 'give'), |
|
1207 | + 'Veracruz' => __('Veracruz', 'give'), |
|
1208 | + 'Yucatan' => __('Yucatán', 'give'), |
|
1209 | + 'Zacatecas' => __('Zacatecas', 'give'), |
|
1210 | 1210 | ); |
1211 | 1211 | |
1212 | - return apply_filters( 'give_mexico_states', $states ); |
|
1212 | + return apply_filters('give_mexico_states', $states); |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | /** |
@@ -1221,56 +1221,56 @@ discard block |
||
1221 | 1221 | function give_get_japan_states_list() { |
1222 | 1222 | $states = array( |
1223 | 1223 | '' => '', |
1224 | - 'JP01' => __( 'Hokkaido', 'give' ), |
|
1225 | - 'JP02' => __( 'Aomori', 'give' ), |
|
1226 | - 'JP03' => __( 'Iwate', 'give' ), |
|
1227 | - 'JP04' => __( 'Miyagi', 'give' ), |
|
1228 | - 'JP05' => __( 'Akita', 'give' ), |
|
1229 | - 'JP06' => __( 'Yamagata', 'give' ), |
|
1230 | - 'JP07' => __( 'Fukushima', 'give' ), |
|
1231 | - 'JP08' => __( 'Ibaraki', 'give' ), |
|
1232 | - 'JP09' => __( 'Tochigi', 'give' ), |
|
1233 | - 'JP10' => __( 'Gunma', 'give' ), |
|
1234 | - 'JP11' => __( 'Saitama', 'give' ), |
|
1235 | - 'JP12' => __( 'Chiba', 'give' ), |
|
1236 | - 'JP13' => __( 'Tokyo', 'give' ), |
|
1237 | - 'JP14' => __( 'Kanagawa', 'give' ), |
|
1238 | - 'JP15' => __( 'Niigata', 'give' ), |
|
1239 | - 'JP16' => __( 'Toyama', 'give' ), |
|
1240 | - 'JP17' => __( 'Ishikawa', 'give' ), |
|
1241 | - 'JP18' => __( 'Fukui', 'give' ), |
|
1242 | - 'JP19' => __( 'Yamanashi', 'give' ), |
|
1243 | - 'JP20' => __( 'Nagano', 'give' ), |
|
1244 | - 'JP21' => __( 'Gifu', 'give' ), |
|
1245 | - 'JP22' => __( 'Shizuoka', 'give' ), |
|
1246 | - 'JP23' => __( 'Aichi', 'give' ), |
|
1247 | - 'JP24' => __( 'Mie', 'give' ), |
|
1248 | - 'JP25' => __( 'Shiga', 'give' ), |
|
1249 | - 'JP26' => __( 'Kyoto', 'give' ), |
|
1250 | - 'JP27' => __( 'Osaka', 'give' ), |
|
1251 | - 'JP28' => __( 'Hyogo', 'give' ), |
|
1252 | - 'JP29' => __( 'Nara', 'give' ), |
|
1253 | - 'JP30' => __( 'Wakayama', 'give' ), |
|
1254 | - 'JP31' => __( 'Tottori', 'give' ), |
|
1255 | - 'JP32' => __( 'Shimane', 'give' ), |
|
1256 | - 'JP33' => __( 'Okayama', 'give' ), |
|
1257 | - 'JP34' => __( 'Hiroshima', 'give' ), |
|
1258 | - 'JP35' => __( 'Yamaguchi', 'give' ), |
|
1259 | - 'JP36' => __( 'Tokushima', 'give' ), |
|
1260 | - 'JP37' => __( 'Kagawa', 'give' ), |
|
1261 | - 'JP38' => __( 'Ehime', 'give' ), |
|
1262 | - 'JP39' => __( 'Kochi', 'give' ), |
|
1263 | - 'JP40' => __( 'Fukuoka', 'give' ), |
|
1264 | - 'JP41' => __( 'Saga', 'give' ), |
|
1265 | - 'JP42' => __( 'Nagasaki', 'give' ), |
|
1266 | - 'JP43' => __( 'Kumamoto', 'give' ), |
|
1267 | - 'JP44' => __( 'Oita', 'give' ), |
|
1268 | - 'JP45' => __( 'Miyazaki', 'give' ), |
|
1269 | - 'JP46' => __( 'Kagoshima', 'give' ), |
|
1270 | - 'JP47' => __( 'Okinawa', 'give' ), |
|
1224 | + 'JP01' => __('Hokkaido', 'give'), |
|
1225 | + 'JP02' => __('Aomori', 'give'), |
|
1226 | + 'JP03' => __('Iwate', 'give'), |
|
1227 | + 'JP04' => __('Miyagi', 'give'), |
|
1228 | + 'JP05' => __('Akita', 'give'), |
|
1229 | + 'JP06' => __('Yamagata', 'give'), |
|
1230 | + 'JP07' => __('Fukushima', 'give'), |
|
1231 | + 'JP08' => __('Ibaraki', 'give'), |
|
1232 | + 'JP09' => __('Tochigi', 'give'), |
|
1233 | + 'JP10' => __('Gunma', 'give'), |
|
1234 | + 'JP11' => __('Saitama', 'give'), |
|
1235 | + 'JP12' => __('Chiba', 'give'), |
|
1236 | + 'JP13' => __('Tokyo', 'give'), |
|
1237 | + 'JP14' => __('Kanagawa', 'give'), |
|
1238 | + 'JP15' => __('Niigata', 'give'), |
|
1239 | + 'JP16' => __('Toyama', 'give'), |
|
1240 | + 'JP17' => __('Ishikawa', 'give'), |
|
1241 | + 'JP18' => __('Fukui', 'give'), |
|
1242 | + 'JP19' => __('Yamanashi', 'give'), |
|
1243 | + 'JP20' => __('Nagano', 'give'), |
|
1244 | + 'JP21' => __('Gifu', 'give'), |
|
1245 | + 'JP22' => __('Shizuoka', 'give'), |
|
1246 | + 'JP23' => __('Aichi', 'give'), |
|
1247 | + 'JP24' => __('Mie', 'give'), |
|
1248 | + 'JP25' => __('Shiga', 'give'), |
|
1249 | + 'JP26' => __('Kyoto', 'give'), |
|
1250 | + 'JP27' => __('Osaka', 'give'), |
|
1251 | + 'JP28' => __('Hyogo', 'give'), |
|
1252 | + 'JP29' => __('Nara', 'give'), |
|
1253 | + 'JP30' => __('Wakayama', 'give'), |
|
1254 | + 'JP31' => __('Tottori', 'give'), |
|
1255 | + 'JP32' => __('Shimane', 'give'), |
|
1256 | + 'JP33' => __('Okayama', 'give'), |
|
1257 | + 'JP34' => __('Hiroshima', 'give'), |
|
1258 | + 'JP35' => __('Yamaguchi', 'give'), |
|
1259 | + 'JP36' => __('Tokushima', 'give'), |
|
1260 | + 'JP37' => __('Kagawa', 'give'), |
|
1261 | + 'JP38' => __('Ehime', 'give'), |
|
1262 | + 'JP39' => __('Kochi', 'give'), |
|
1263 | + 'JP40' => __('Fukuoka', 'give'), |
|
1264 | + 'JP41' => __('Saga', 'give'), |
|
1265 | + 'JP42' => __('Nagasaki', 'give'), |
|
1266 | + 'JP43' => __('Kumamoto', 'give'), |
|
1267 | + 'JP44' => __('Oita', 'give'), |
|
1268 | + 'JP45' => __('Miyazaki', 'give'), |
|
1269 | + 'JP46' => __('Kagoshima', 'give'), |
|
1270 | + 'JP47' => __('Okinawa', 'give'), |
|
1271 | 1271 | ); |
1272 | 1272 | |
1273 | - return apply_filters( 'give_japan_states', $states ); |
|
1273 | + return apply_filters('give_japan_states', $states); |
|
1274 | 1274 | } |
1275 | 1275 | |
1276 | 1276 | /** |
@@ -1282,119 +1282,119 @@ discard block |
||
1282 | 1282 | function give_get_italy_states_list() { |
1283 | 1283 | $states = array( |
1284 | 1284 | '' => '', |
1285 | - 'AG' => __( 'Agrigento', 'give' ), |
|
1286 | - 'AL' => __( 'Alessandria', 'give' ), |
|
1287 | - 'AN' => __( 'Ancona', 'give' ), |
|
1288 | - 'AO' => __( 'Aosta', 'give' ), |
|
1289 | - 'AR' => __( 'Arezzo', 'give' ), |
|
1290 | - 'AP' => __( 'Ascoli Piceno', 'give' ), |
|
1291 | - 'AT' => __( 'Asti', 'give' ), |
|
1292 | - 'AV' => __( 'Avellino', 'give' ), |
|
1293 | - 'BA' => __( 'Bari', 'give' ), |
|
1294 | - 'BT' => __( 'Barletta-Andria-Trani', 'give' ), |
|
1295 | - 'BL' => __( 'Belluno', 'give' ), |
|
1296 | - 'BN' => __( 'Benevento', 'give' ), |
|
1297 | - 'BG' => __( 'Bergamo', 'give' ), |
|
1298 | - 'BI' => __( 'Biella', 'give' ), |
|
1299 | - 'BO' => __( 'Bologna', 'give' ), |
|
1300 | - 'BZ' => __( 'Bolzano', 'give' ), |
|
1301 | - 'BS' => __( 'Brescia', 'give' ), |
|
1302 | - 'BR' => __( 'Brindisi', 'give' ), |
|
1303 | - 'CA' => __( 'Cagliari', 'give' ), |
|
1304 | - 'CL' => __( 'Caltanissetta', 'give' ), |
|
1305 | - 'CB' => __( 'Campobasso', 'give' ), |
|
1306 | - 'CI' => __( 'Carbonia-Iglesias', 'give' ), |
|
1307 | - 'CE' => __( 'Caserta', 'give' ), |
|
1308 | - 'CT' => __( 'Catania', 'give' ), |
|
1309 | - 'CZ' => __( 'Catanzaro', 'give' ), |
|
1310 | - 'CH' => __( 'Chieti', 'give' ), |
|
1311 | - 'CO' => __( 'Como', 'give' ), |
|
1312 | - 'CS' => __( 'Cosenza', 'give' ), |
|
1313 | - 'CR' => __( 'Cremona', 'give' ), |
|
1314 | - 'KR' => __( 'Crotone', 'give' ), |
|
1315 | - 'CN' => __( 'Cuneo', 'give' ), |
|
1316 | - 'EN' => __( 'Enna', 'give' ), |
|
1317 | - 'FM' => __( 'Fermo', 'give' ), |
|
1318 | - 'FE' => __( 'Ferrara', 'give' ), |
|
1319 | - 'FI' => __( 'Firenze', 'give' ), |
|
1320 | - 'FG' => __( 'Foggia', 'give' ), |
|
1321 | - 'FC' => __( 'Forlì-Cesena', 'give' ), |
|
1322 | - 'FR' => __( 'Frosinone', 'give' ), |
|
1323 | - 'GE' => __( 'Genova', 'give' ), |
|
1324 | - 'GO' => __( 'Gorizia', 'give' ), |
|
1325 | - 'GR' => __( 'Grosseto', 'give' ), |
|
1326 | - 'IM' => __( 'Imperia', 'give' ), |
|
1327 | - 'IS' => __( 'Isernia', 'give' ), |
|
1328 | - 'SP' => __( 'La Spezia', 'give' ), |
|
1329 | - 'AQ' => __( "L'Aquila", 'give' ), |
|
1330 | - 'LT' => __( 'Latina', 'give' ), |
|
1331 | - 'LE' => __( 'Lecce', 'give' ), |
|
1332 | - 'LC' => __( 'Lecco', 'give' ), |
|
1333 | - 'LI' => __( 'Livorno', 'give' ), |
|
1334 | - 'LO' => __( 'Lodi', 'give' ), |
|
1335 | - 'LU' => __( 'Lucca', 'give' ), |
|
1336 | - 'MC' => __( 'Macerata', 'give' ), |
|
1337 | - 'MN' => __( 'Mantova', 'give' ), |
|
1338 | - 'MS' => __( 'Massa-Carrara', 'give' ), |
|
1339 | - 'MT' => __( 'Matera', 'give' ), |
|
1340 | - 'ME' => __( 'Messina', 'give' ), |
|
1341 | - 'MI' => __( 'Milano', 'give' ), |
|
1342 | - 'MO' => __( 'Modena', 'give' ), |
|
1343 | - 'MB' => __( 'Monza e della Brianza', 'give' ), |
|
1344 | - 'NA' => __( 'Napoli', 'give' ), |
|
1345 | - 'NO' => __( 'Novara', 'give' ), |
|
1346 | - 'NU' => __( 'Nuoro', 'give' ), |
|
1347 | - 'OT' => __( 'Olbia-Tempio', 'give' ), |
|
1348 | - 'OR' => __( 'Oristano', 'give' ), |
|
1349 | - 'PD' => __( 'Padova', 'give' ), |
|
1350 | - 'PA' => __( 'Palermo', 'give' ), |
|
1351 | - 'PR' => __( 'Parma', 'give' ), |
|
1352 | - 'PV' => __( 'Pavia', 'give' ), |
|
1353 | - 'PG' => __( 'Perugia', 'give' ), |
|
1354 | - 'PU' => __( 'Pesaro e Urbino', 'give' ), |
|
1355 | - 'PE' => __( 'Pescara', 'give' ), |
|
1356 | - 'PC' => __( 'Piacenza', 'give' ), |
|
1357 | - 'PI' => __( 'Pisa', 'give' ), |
|
1358 | - 'PT' => __( 'Pistoia', 'give' ), |
|
1359 | - 'PN' => __( 'Pordenone', 'give' ), |
|
1360 | - 'PZ' => __( 'Potenza', 'give' ), |
|
1361 | - 'PO' => __( 'Prato', 'give' ), |
|
1362 | - 'RG' => __( 'Ragusa', 'give' ), |
|
1363 | - 'RA' => __( 'Ravenna', 'give' ), |
|
1364 | - 'RC' => __( 'Reggio Calabria', 'give' ), |
|
1365 | - 'RE' => __( 'Reggio Emilia', 'give' ), |
|
1366 | - 'RI' => __( 'Rieti', 'give' ), |
|
1367 | - 'RN' => __( 'Rimini', 'give' ), |
|
1368 | - 'RM' => __( 'Roma', 'give' ), |
|
1369 | - 'RO' => __( 'Rovigo', 'give' ), |
|
1370 | - 'SA' => __( 'Salerno', 'give' ), |
|
1371 | - 'VS' => __( 'Medio Campidano', 'give' ), |
|
1372 | - 'SS' => __( 'Sassari', 'give' ), |
|
1373 | - 'SV' => __( 'Savona', 'give' ), |
|
1374 | - 'SI' => __( 'Siena', 'give' ), |
|
1375 | - 'SR' => __( 'Siracusa', 'give' ), |
|
1376 | - 'SO' => __( 'Sondrio', 'give' ), |
|
1377 | - 'TA' => __( 'Taranto', 'give' ), |
|
1378 | - 'TE' => __( 'Teramo', 'give' ), |
|
1379 | - 'TR' => __( 'Terni', 'give' ), |
|
1380 | - 'TO' => __( 'Torino', 'give' ), |
|
1381 | - 'OG' => __( 'Ogliastra', 'give' ), |
|
1382 | - 'TP' => __( 'Trapani', 'give' ), |
|
1383 | - 'TN' => __( 'Trento', 'give' ), |
|
1384 | - 'TV' => __( 'Treviso', 'give' ), |
|
1385 | - 'TS' => __( 'Trieste', 'give' ), |
|
1386 | - 'UD' => __( 'Udine', 'give' ), |
|
1387 | - 'VA' => __( 'Varese', 'give' ), |
|
1388 | - 'VE' => __( 'Venezia', 'give' ), |
|
1389 | - 'VB' => __( 'Verbano-Cusio-Ossola', 'give' ), |
|
1390 | - 'VC' => __( 'Vercelli', 'give' ), |
|
1391 | - 'VR' => __( 'Verona', 'give' ), |
|
1392 | - 'VV' => __( 'Vibo Valentia', 'give' ), |
|
1393 | - 'VI' => __( 'Vicenza', 'give' ), |
|
1394 | - 'VT' => __( 'Viterbo', 'give' ), |
|
1285 | + 'AG' => __('Agrigento', 'give'), |
|
1286 | + 'AL' => __('Alessandria', 'give'), |
|
1287 | + 'AN' => __('Ancona', 'give'), |
|
1288 | + 'AO' => __('Aosta', 'give'), |
|
1289 | + 'AR' => __('Arezzo', 'give'), |
|
1290 | + 'AP' => __('Ascoli Piceno', 'give'), |
|
1291 | + 'AT' => __('Asti', 'give'), |
|
1292 | + 'AV' => __('Avellino', 'give'), |
|
1293 | + 'BA' => __('Bari', 'give'), |
|
1294 | + 'BT' => __('Barletta-Andria-Trani', 'give'), |
|
1295 | + 'BL' => __('Belluno', 'give'), |
|
1296 | + 'BN' => __('Benevento', 'give'), |
|
1297 | + 'BG' => __('Bergamo', 'give'), |
|
1298 | + 'BI' => __('Biella', 'give'), |
|
1299 | + 'BO' => __('Bologna', 'give'), |
|
1300 | + 'BZ' => __('Bolzano', 'give'), |
|
1301 | + 'BS' => __('Brescia', 'give'), |
|
1302 | + 'BR' => __('Brindisi', 'give'), |
|
1303 | + 'CA' => __('Cagliari', 'give'), |
|
1304 | + 'CL' => __('Caltanissetta', 'give'), |
|
1305 | + 'CB' => __('Campobasso', 'give'), |
|
1306 | + 'CI' => __('Carbonia-Iglesias', 'give'), |
|
1307 | + 'CE' => __('Caserta', 'give'), |
|
1308 | + 'CT' => __('Catania', 'give'), |
|
1309 | + 'CZ' => __('Catanzaro', 'give'), |
|
1310 | + 'CH' => __('Chieti', 'give'), |
|
1311 | + 'CO' => __('Como', 'give'), |
|
1312 | + 'CS' => __('Cosenza', 'give'), |
|
1313 | + 'CR' => __('Cremona', 'give'), |
|
1314 | + 'KR' => __('Crotone', 'give'), |
|
1315 | + 'CN' => __('Cuneo', 'give'), |
|
1316 | + 'EN' => __('Enna', 'give'), |
|
1317 | + 'FM' => __('Fermo', 'give'), |
|
1318 | + 'FE' => __('Ferrara', 'give'), |
|
1319 | + 'FI' => __('Firenze', 'give'), |
|
1320 | + 'FG' => __('Foggia', 'give'), |
|
1321 | + 'FC' => __('Forlì-Cesena', 'give'), |
|
1322 | + 'FR' => __('Frosinone', 'give'), |
|
1323 | + 'GE' => __('Genova', 'give'), |
|
1324 | + 'GO' => __('Gorizia', 'give'), |
|
1325 | + 'GR' => __('Grosseto', 'give'), |
|
1326 | + 'IM' => __('Imperia', 'give'), |
|
1327 | + 'IS' => __('Isernia', 'give'), |
|
1328 | + 'SP' => __('La Spezia', 'give'), |
|
1329 | + 'AQ' => __("L'Aquila", 'give'), |
|
1330 | + 'LT' => __('Latina', 'give'), |
|
1331 | + 'LE' => __('Lecce', 'give'), |
|
1332 | + 'LC' => __('Lecco', 'give'), |
|
1333 | + 'LI' => __('Livorno', 'give'), |
|
1334 | + 'LO' => __('Lodi', 'give'), |
|
1335 | + 'LU' => __('Lucca', 'give'), |
|
1336 | + 'MC' => __('Macerata', 'give'), |
|
1337 | + 'MN' => __('Mantova', 'give'), |
|
1338 | + 'MS' => __('Massa-Carrara', 'give'), |
|
1339 | + 'MT' => __('Matera', 'give'), |
|
1340 | + 'ME' => __('Messina', 'give'), |
|
1341 | + 'MI' => __('Milano', 'give'), |
|
1342 | + 'MO' => __('Modena', 'give'), |
|
1343 | + 'MB' => __('Monza e della Brianza', 'give'), |
|
1344 | + 'NA' => __('Napoli', 'give'), |
|
1345 | + 'NO' => __('Novara', 'give'), |
|
1346 | + 'NU' => __('Nuoro', 'give'), |
|
1347 | + 'OT' => __('Olbia-Tempio', 'give'), |
|
1348 | + 'OR' => __('Oristano', 'give'), |
|
1349 | + 'PD' => __('Padova', 'give'), |
|
1350 | + 'PA' => __('Palermo', 'give'), |
|
1351 | + 'PR' => __('Parma', 'give'), |
|
1352 | + 'PV' => __('Pavia', 'give'), |
|
1353 | + 'PG' => __('Perugia', 'give'), |
|
1354 | + 'PU' => __('Pesaro e Urbino', 'give'), |
|
1355 | + 'PE' => __('Pescara', 'give'), |
|
1356 | + 'PC' => __('Piacenza', 'give'), |
|
1357 | + 'PI' => __('Pisa', 'give'), |
|
1358 | + 'PT' => __('Pistoia', 'give'), |
|
1359 | + 'PN' => __('Pordenone', 'give'), |
|
1360 | + 'PZ' => __('Potenza', 'give'), |
|
1361 | + 'PO' => __('Prato', 'give'), |
|
1362 | + 'RG' => __('Ragusa', 'give'), |
|
1363 | + 'RA' => __('Ravenna', 'give'), |
|
1364 | + 'RC' => __('Reggio Calabria', 'give'), |
|
1365 | + 'RE' => __('Reggio Emilia', 'give'), |
|
1366 | + 'RI' => __('Rieti', 'give'), |
|
1367 | + 'RN' => __('Rimini', 'give'), |
|
1368 | + 'RM' => __('Roma', 'give'), |
|
1369 | + 'RO' => __('Rovigo', 'give'), |
|
1370 | + 'SA' => __('Salerno', 'give'), |
|
1371 | + 'VS' => __('Medio Campidano', 'give'), |
|
1372 | + 'SS' => __('Sassari', 'give'), |
|
1373 | + 'SV' => __('Savona', 'give'), |
|
1374 | + 'SI' => __('Siena', 'give'), |
|
1375 | + 'SR' => __('Siracusa', 'give'), |
|
1376 | + 'SO' => __('Sondrio', 'give'), |
|
1377 | + 'TA' => __('Taranto', 'give'), |
|
1378 | + 'TE' => __('Teramo', 'give'), |
|
1379 | + 'TR' => __('Terni', 'give'), |
|
1380 | + 'TO' => __('Torino', 'give'), |
|
1381 | + 'OG' => __('Ogliastra', 'give'), |
|
1382 | + 'TP' => __('Trapani', 'give'), |
|
1383 | + 'TN' => __('Trento', 'give'), |
|
1384 | + 'TV' => __('Treviso', 'give'), |
|
1385 | + 'TS' => __('Trieste', 'give'), |
|
1386 | + 'UD' => __('Udine', 'give'), |
|
1387 | + 'VA' => __('Varese', 'give'), |
|
1388 | + 'VE' => __('Venezia', 'give'), |
|
1389 | + 'VB' => __('Verbano-Cusio-Ossola', 'give'), |
|
1390 | + 'VC' => __('Vercelli', 'give'), |
|
1391 | + 'VR' => __('Verona', 'give'), |
|
1392 | + 'VV' => __('Vibo Valentia', 'give'), |
|
1393 | + 'VI' => __('Vicenza', 'give'), |
|
1394 | + 'VT' => __('Viterbo', 'give'), |
|
1395 | 1395 | ); |
1396 | 1396 | |
1397 | - return apply_filters( 'give_italy_states', $states ); |
|
1397 | + return apply_filters('give_italy_states', $states); |
|
1398 | 1398 | } |
1399 | 1399 | |
1400 | 1400 | /** |
@@ -1406,40 +1406,40 @@ discard block |
||
1406 | 1406 | function give_get_iran_states_list() { |
1407 | 1407 | $states = array( |
1408 | 1408 | '' => '', |
1409 | - 'KHZ' => __( 'Khuzestan (خوزستان)', 'give' ), |
|
1410 | - 'THR' => __( 'Tehran (تهران)', 'give' ), |
|
1411 | - 'ILM' => __( 'Ilaam (ایلام)', 'give' ), |
|
1412 | - 'BHR' => __( 'Bushehr (بوشهر)', 'give' ), |
|
1413 | - 'ADL' => __( 'Ardabil (اردبیل)', 'give' ), |
|
1414 | - 'ESF' => __( 'Isfahan (اصفهان)', 'give' ), |
|
1415 | - 'YZD' => __( 'Yazd (یزد)', 'give' ), |
|
1416 | - 'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ), |
|
1417 | - 'KRN' => __( 'Kerman (کرمان)', 'give' ), |
|
1418 | - 'HDN' => __( 'Hamadan (همدان)', 'give' ), |
|
1419 | - 'GZN' => __( 'Ghazvin (قزوین)', 'give' ), |
|
1420 | - 'ZJN' => __( 'Zanjan (زنجان)', 'give' ), |
|
1421 | - 'LRS' => __( 'Luristan (لرستان)', 'give' ), |
|
1422 | - 'ABZ' => __( 'Alborz (البرز)', 'give' ), |
|
1423 | - 'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ), |
|
1424 | - 'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ), |
|
1425 | - 'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ), |
|
1426 | - 'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ), |
|
1427 | - 'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ), |
|
1428 | - 'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ), |
|
1429 | - 'SMN' => __( 'Semnan (سمنان)', 'give' ), |
|
1430 | - 'FRS' => __( 'Fars (فارس)', 'give' ), |
|
1431 | - 'QHM' => __( 'Qom (قم)', 'give' ), |
|
1432 | - 'KRD' => __( 'Kurdistan / کردستان)', 'give' ), |
|
1433 | - 'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ), |
|
1434 | - 'GLS' => __( 'Golestan (گلستان)', 'give' ), |
|
1435 | - 'GIL' => __( 'Gilan (گیلان)', 'give' ), |
|
1436 | - 'MZN' => __( 'Mazandaran (مازندران)', 'give' ), |
|
1437 | - 'MKZ' => __( 'Markazi (مرکزی)', 'give' ), |
|
1438 | - 'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ), |
|
1439 | - 'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ), |
|
1409 | + 'KHZ' => __('Khuzestan (خوزستان)', 'give'), |
|
1410 | + 'THR' => __('Tehran (تهران)', 'give'), |
|
1411 | + 'ILM' => __('Ilaam (ایلام)', 'give'), |
|
1412 | + 'BHR' => __('Bushehr (بوشهر)', 'give'), |
|
1413 | + 'ADL' => __('Ardabil (اردبیل)', 'give'), |
|
1414 | + 'ESF' => __('Isfahan (اصفهان)', 'give'), |
|
1415 | + 'YZD' => __('Yazd (یزد)', 'give'), |
|
1416 | + 'KRH' => __('Kermanshah (کرمانشاه)', 'give'), |
|
1417 | + 'KRN' => __('Kerman (کرمان)', 'give'), |
|
1418 | + 'HDN' => __('Hamadan (همدان)', 'give'), |
|
1419 | + 'GZN' => __('Ghazvin (قزوین)', 'give'), |
|
1420 | + 'ZJN' => __('Zanjan (زنجان)', 'give'), |
|
1421 | + 'LRS' => __('Luristan (لرستان)', 'give'), |
|
1422 | + 'ABZ' => __('Alborz (البرز)', 'give'), |
|
1423 | + 'EAZ' => __('East Azarbaijan (آذربایجان شرقی)', 'give'), |
|
1424 | + 'WAZ' => __('West Azarbaijan (آذربایجان غربی)', 'give'), |
|
1425 | + 'CHB' => __('Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give'), |
|
1426 | + 'SKH' => __('South Khorasan (خراسان جنوبی)', 'give'), |
|
1427 | + 'RKH' => __('Razavi Khorasan (خراسان رضوی)', 'give'), |
|
1428 | + 'NKH' => __('North Khorasan (خراسان جنوبی)', 'give'), |
|
1429 | + 'SMN' => __('Semnan (سمنان)', 'give'), |
|
1430 | + 'FRS' => __('Fars (فارس)', 'give'), |
|
1431 | + 'QHM' => __('Qom (قم)', 'give'), |
|
1432 | + 'KRD' => __('Kurdistan / کردستان)', 'give'), |
|
1433 | + 'KBD' => __('Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give'), |
|
1434 | + 'GLS' => __('Golestan (گلستان)', 'give'), |
|
1435 | + 'GIL' => __('Gilan (گیلان)', 'give'), |
|
1436 | + 'MZN' => __('Mazandaran (مازندران)', 'give'), |
|
1437 | + 'MKZ' => __('Markazi (مرکزی)', 'give'), |
|
1438 | + 'HRZ' => __('Hormozgan (هرمزگان)', 'give'), |
|
1439 | + 'SBN' => __('Sistan and Baluchestan (سیستان و بلوچستان)', 'give'), |
|
1440 | 1440 | ); |
1441 | 1441 | |
1442 | - return apply_filters( 'give_iran_states', $states ); |
|
1442 | + return apply_filters('give_iran_states', $states); |
|
1443 | 1443 | } |
1444 | 1444 | |
1445 | 1445 | /** |
@@ -1451,35 +1451,35 @@ discard block |
||
1451 | 1451 | function give_get_ireland_states_list() { |
1452 | 1452 | $states = array( |
1453 | 1453 | '' => '', |
1454 | - 'CE' => __( 'Clare', 'give' ), |
|
1455 | - 'CK' => __( 'Cork', 'give' ), |
|
1456 | - 'CN' => __( 'Cavan', 'give' ), |
|
1457 | - 'CW' => __( 'Carlow', 'give' ), |
|
1458 | - 'DL' => __( 'Donegal', 'give' ), |
|
1459 | - 'DN' => __( 'Dublin', 'give' ), |
|
1460 | - 'GY' => __( 'Galway', 'give' ), |
|
1461 | - 'KE' => __( 'Kildare', 'give' ), |
|
1462 | - 'KK' => __( 'Kilkenny', 'give' ), |
|
1463 | - 'KY' => __( 'Kerry', 'give' ), |
|
1464 | - 'LD' => __( 'Longford', 'give' ), |
|
1465 | - 'LH' => __( 'Louth', 'give' ), |
|
1466 | - 'LK' => __( 'Limerick', 'give' ), |
|
1467 | - 'LM' => __( 'Leitrim', 'give' ), |
|
1468 | - 'LS' => __( 'Laois', 'give' ), |
|
1469 | - 'MH' => __( 'Meath', 'give' ), |
|
1470 | - 'MN' => __( 'Monaghan', 'give' ), |
|
1471 | - 'MO' => __( 'Mayo', 'give' ), |
|
1472 | - 'OY' => __( 'Offaly', 'give' ), |
|
1473 | - 'RN' => __( 'Roscommon', 'give' ), |
|
1474 | - 'SO' => __( 'Sligo', 'give' ), |
|
1475 | - 'TY' => __( 'Tipperary', 'give' ), |
|
1476 | - 'WD' => __( 'Waterford', 'give' ), |
|
1477 | - 'WH' => __( 'Westmeath', 'give' ), |
|
1478 | - 'WW' => __( 'Wicklow', 'give' ), |
|
1479 | - 'WX' => __( 'Wexford', 'give' ), |
|
1454 | + 'CE' => __('Clare', 'give'), |
|
1455 | + 'CK' => __('Cork', 'give'), |
|
1456 | + 'CN' => __('Cavan', 'give'), |
|
1457 | + 'CW' => __('Carlow', 'give'), |
|
1458 | + 'DL' => __('Donegal', 'give'), |
|
1459 | + 'DN' => __('Dublin', 'give'), |
|
1460 | + 'GY' => __('Galway', 'give'), |
|
1461 | + 'KE' => __('Kildare', 'give'), |
|
1462 | + 'KK' => __('Kilkenny', 'give'), |
|
1463 | + 'KY' => __('Kerry', 'give'), |
|
1464 | + 'LD' => __('Longford', 'give'), |
|
1465 | + 'LH' => __('Louth', 'give'), |
|
1466 | + 'LK' => __('Limerick', 'give'), |
|
1467 | + 'LM' => __('Leitrim', 'give'), |
|
1468 | + 'LS' => __('Laois', 'give'), |
|
1469 | + 'MH' => __('Meath', 'give'), |
|
1470 | + 'MN' => __('Monaghan', 'give'), |
|
1471 | + 'MO' => __('Mayo', 'give'), |
|
1472 | + 'OY' => __('Offaly', 'give'), |
|
1473 | + 'RN' => __('Roscommon', 'give'), |
|
1474 | + 'SO' => __('Sligo', 'give'), |
|
1475 | + 'TY' => __('Tipperary', 'give'), |
|
1476 | + 'WD' => __('Waterford', 'give'), |
|
1477 | + 'WH' => __('Westmeath', 'give'), |
|
1478 | + 'WW' => __('Wicklow', 'give'), |
|
1479 | + 'WX' => __('Wexford', 'give'), |
|
1480 | 1480 | ); |
1481 | 1481 | |
1482 | - return apply_filters( 'give_ireland_states', $states ); |
|
1482 | + return apply_filters('give_ireland_states', $states); |
|
1483 | 1483 | } |
1484 | 1484 | |
1485 | 1485 | /** |
@@ -1491,22 +1491,22 @@ discard block |
||
1491 | 1491 | function give_get_greek_states_list() { |
1492 | 1492 | $states = array( |
1493 | 1493 | '' => '', |
1494 | - 'I' => __( 'Αττική', 'give' ), |
|
1495 | - 'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ), |
|
1496 | - 'B' => __( 'Κεντρική Μακεδονία', 'give' ), |
|
1497 | - 'C' => __( 'Δυτική Μακεδονία', 'give' ), |
|
1498 | - 'D' => __( 'Ήπειρος', 'give' ), |
|
1499 | - 'E' => __( 'Θεσσαλία', 'give' ), |
|
1500 | - 'F' => __( 'Ιόνιοι Νήσοι', 'give' ), |
|
1501 | - 'G' => __( 'Δυτική Ελλάδα', 'give' ), |
|
1502 | - 'H' => __( 'Στερεά Ελλάδα', 'give' ), |
|
1503 | - 'J' => __( 'Πελοπόννησος', 'give' ), |
|
1504 | - 'K' => __( 'Βόρειο Αιγαίο', 'give' ), |
|
1505 | - 'L' => __( 'Νότιο Αιγαίο', 'give' ), |
|
1506 | - 'M' => __( 'Κρήτη', 'give' ), |
|
1494 | + 'I' => __('Αττική', 'give'), |
|
1495 | + 'A' => __('Ανατολική Μακεδονία και Θράκη', 'give'), |
|
1496 | + 'B' => __('Κεντρική Μακεδονία', 'give'), |
|
1497 | + 'C' => __('Δυτική Μακεδονία', 'give'), |
|
1498 | + 'D' => __('Ήπειρος', 'give'), |
|
1499 | + 'E' => __('Θεσσαλία', 'give'), |
|
1500 | + 'F' => __('Ιόνιοι Νήσοι', 'give'), |
|
1501 | + 'G' => __('Δυτική Ελλάδα', 'give'), |
|
1502 | + 'H' => __('Στερεά Ελλάδα', 'give'), |
|
1503 | + 'J' => __('Πελοπόννησος', 'give'), |
|
1504 | + 'K' => __('Βόρειο Αιγαίο', 'give'), |
|
1505 | + 'L' => __('Νότιο Αιγαίο', 'give'), |
|
1506 | + 'M' => __('Κρήτη', 'give'), |
|
1507 | 1507 | ); |
1508 | 1508 | |
1509 | - return apply_filters( 'give_greek_states', $states ); |
|
1509 | + return apply_filters('give_greek_states', $states); |
|
1510 | 1510 | } |
1511 | 1511 | |
1512 | 1512 | /** |
@@ -1518,18 +1518,18 @@ discard block |
||
1518 | 1518 | function give_get_bolivian_states_list() { |
1519 | 1519 | $states = array( |
1520 | 1520 | '' => '', |
1521 | - 'B' => __( 'Chuquisaca', 'give' ), |
|
1522 | - 'H' => __( 'Beni', 'give' ), |
|
1523 | - 'C' => __( 'Cochabamba', 'give' ), |
|
1524 | - 'L' => __( 'La Paz', 'give' ), |
|
1525 | - 'O' => __( 'Oruro', 'give' ), |
|
1526 | - 'N' => __( 'Pando', 'give' ), |
|
1527 | - 'P' => __( 'Potosí', 'give' ), |
|
1528 | - 'S' => __( 'Santa Cruz', 'give' ), |
|
1529 | - 'T' => __( 'Tarija', 'give' ), |
|
1521 | + 'B' => __('Chuquisaca', 'give'), |
|
1522 | + 'H' => __('Beni', 'give'), |
|
1523 | + 'C' => __('Cochabamba', 'give'), |
|
1524 | + 'L' => __('La Paz', 'give'), |
|
1525 | + 'O' => __('Oruro', 'give'), |
|
1526 | + 'N' => __('Pando', 'give'), |
|
1527 | + 'P' => __('Potosí', 'give'), |
|
1528 | + 'S' => __('Santa Cruz', 'give'), |
|
1529 | + 'T' => __('Tarija', 'give'), |
|
1530 | 1530 | ); |
1531 | 1531 | |
1532 | - return apply_filters( 'give_bolivian_states', $states ); |
|
1532 | + return apply_filters('give_bolivian_states', $states); |
|
1533 | 1533 | } |
1534 | 1534 | |
1535 | 1535 | /** |
@@ -1541,37 +1541,37 @@ discard block |
||
1541 | 1541 | function give_get_bulgarian_states_list() { |
1542 | 1542 | $states = array( |
1543 | 1543 | '' => '', |
1544 | - 'BG-01' => __( 'Blagoevgrad', 'give' ), |
|
1545 | - 'BG-02' => __( 'Burgas', 'give' ), |
|
1546 | - 'BG-08' => __( 'Dobrich', 'give' ), |
|
1547 | - 'BG-07' => __( 'Gabrovo', 'give' ), |
|
1548 | - 'BG-26' => __( 'Haskovo', 'give' ), |
|
1549 | - 'BG-09' => __( 'Kardzhali', 'give' ), |
|
1550 | - 'BG-10' => __( 'Kyustendil', 'give' ), |
|
1551 | - 'BG-11' => __( 'Lovech', 'give' ), |
|
1552 | - 'BG-12' => __( 'Montana', 'give' ), |
|
1553 | - 'BG-13' => __( 'Pazardzhik', 'give' ), |
|
1554 | - 'BG-14' => __( 'Pernik', 'give' ), |
|
1555 | - 'BG-15' => __( 'Pleven', 'give' ), |
|
1556 | - 'BG-16' => __( 'Plovdiv', 'give' ), |
|
1557 | - 'BG-17' => __( 'Razgrad', 'give' ), |
|
1558 | - 'BG-18' => __( 'Ruse', 'give' ), |
|
1559 | - 'BG-27' => __( 'Shumen', 'give' ), |
|
1560 | - 'BG-19' => __( 'Silistra', 'give' ), |
|
1561 | - 'BG-20' => __( 'Sliven', 'give' ), |
|
1562 | - 'BG-21' => __( 'Smolyan', 'give' ), |
|
1563 | - 'BG-23' => __( 'Sofia', 'give' ), |
|
1564 | - 'BG-22' => __( 'Sofia-Grad', 'give' ), |
|
1565 | - 'BG-24' => __( 'Stara Zagora', 'give' ), |
|
1566 | - 'BG-25' => __( 'Targovishte', 'give' ), |
|
1567 | - 'BG-03' => __( 'Varna', 'give' ), |
|
1568 | - 'BG-04' => __( 'Veliko Tarnovo', 'give' ), |
|
1569 | - 'BG-05' => __( 'Vidin', 'give' ), |
|
1570 | - 'BG-06' => __( 'Vratsa', 'give' ), |
|
1571 | - 'BG-28' => __( 'Yambol', 'give' ), |
|
1544 | + 'BG-01' => __('Blagoevgrad', 'give'), |
|
1545 | + 'BG-02' => __('Burgas', 'give'), |
|
1546 | + 'BG-08' => __('Dobrich', 'give'), |
|
1547 | + 'BG-07' => __('Gabrovo', 'give'), |
|
1548 | + 'BG-26' => __('Haskovo', 'give'), |
|
1549 | + 'BG-09' => __('Kardzhali', 'give'), |
|
1550 | + 'BG-10' => __('Kyustendil', 'give'), |
|
1551 | + 'BG-11' => __('Lovech', 'give'), |
|
1552 | + 'BG-12' => __('Montana', 'give'), |
|
1553 | + 'BG-13' => __('Pazardzhik', 'give'), |
|
1554 | + 'BG-14' => __('Pernik', 'give'), |
|
1555 | + 'BG-15' => __('Pleven', 'give'), |
|
1556 | + 'BG-16' => __('Plovdiv', 'give'), |
|
1557 | + 'BG-17' => __('Razgrad', 'give'), |
|
1558 | + 'BG-18' => __('Ruse', 'give'), |
|
1559 | + 'BG-27' => __('Shumen', 'give'), |
|
1560 | + 'BG-19' => __('Silistra', 'give'), |
|
1561 | + 'BG-20' => __('Sliven', 'give'), |
|
1562 | + 'BG-21' => __('Smolyan', 'give'), |
|
1563 | + 'BG-23' => __('Sofia', 'give'), |
|
1564 | + 'BG-22' => __('Sofia-Grad', 'give'), |
|
1565 | + 'BG-24' => __('Stara Zagora', 'give'), |
|
1566 | + 'BG-25' => __('Targovishte', 'give'), |
|
1567 | + 'BG-03' => __('Varna', 'give'), |
|
1568 | + 'BG-04' => __('Veliko Tarnovo', 'give'), |
|
1569 | + 'BG-05' => __('Vidin', 'give'), |
|
1570 | + 'BG-06' => __('Vratsa', 'give'), |
|
1571 | + 'BG-28' => __('Yambol', 'give'), |
|
1572 | 1572 | ); |
1573 | 1573 | |
1574 | - return apply_filters( 'give_bulgarian_states', $states ); |
|
1574 | + return apply_filters('give_bulgarian_states', $states); |
|
1575 | 1575 | } |
1576 | 1576 | |
1577 | 1577 | /** |
@@ -1583,73 +1583,73 @@ discard block |
||
1583 | 1583 | function give_get_bangladeshi_states_list() { |
1584 | 1584 | $states = array( |
1585 | 1585 | '' => '', |
1586 | - 'BAG' => __( 'Bagerhat', 'give' ), |
|
1587 | - 'BAN' => __( 'Bandarban', 'give' ), |
|
1588 | - 'BAR' => __( 'Barguna', 'give' ), |
|
1589 | - 'BARI' => __( 'Barisal', 'give' ), |
|
1590 | - 'BHO' => __( 'Bhola', 'give' ), |
|
1591 | - 'BOG' => __( 'Bogra', 'give' ), |
|
1592 | - 'BRA' => __( 'Brahmanbaria', 'give' ), |
|
1593 | - 'CHA' => __( 'Chandpur', 'give' ), |
|
1594 | - 'CHI' => __( 'Chittagong', 'give' ), |
|
1595 | - 'CHU' => __( 'Chuadanga', 'give' ), |
|
1596 | - 'COM' => __( 'Comilla', 'give' ), |
|
1597 | - 'COX' => __( "Cox's Bazar", 'give' ), |
|
1598 | - 'DHA' => __( 'Dhaka', 'give' ), |
|
1599 | - 'DIN' => __( 'Dinajpur', 'give' ), |
|
1600 | - 'FAR' => __( 'Faridpur ', 'give' ), |
|
1601 | - 'FEN' => __( 'Feni', 'give' ), |
|
1602 | - 'GAI' => __( 'Gaibandha', 'give' ), |
|
1603 | - 'GAZI' => __( 'Gazipur', 'give' ), |
|
1604 | - 'GOP' => __( 'Gopalganj', 'give' ), |
|
1605 | - 'HAB' => __( 'Habiganj', 'give' ), |
|
1606 | - 'JAM' => __( 'Jamalpur', 'give' ), |
|
1607 | - 'JES' => __( 'Jessore', 'give' ), |
|
1608 | - 'JHA' => __( 'Jhalokati', 'give' ), |
|
1609 | - 'JHE' => __( 'Jhenaidah', 'give' ), |
|
1610 | - 'JOY' => __( 'Joypurhat', 'give' ), |
|
1611 | - 'KHA' => __( 'Khagrachhari', 'give' ), |
|
1612 | - 'KHU' => __( 'Khulna', 'give' ), |
|
1613 | - 'KIS' => __( 'Kishoreganj', 'give' ), |
|
1614 | - 'KUR' => __( 'Kurigram', 'give' ), |
|
1615 | - 'KUS' => __( 'Kushtia', 'give' ), |
|
1616 | - 'LAK' => __( 'Lakshmipur', 'give' ), |
|
1617 | - 'LAL' => __( 'Lalmonirhat', 'give' ), |
|
1618 | - 'MAD' => __( 'Madaripur', 'give' ), |
|
1619 | - 'MAG' => __( 'Magura', 'give' ), |
|
1620 | - 'MAN' => __( 'Manikganj ', 'give' ), |
|
1621 | - 'MEH' => __( 'Meherpur', 'give' ), |
|
1622 | - 'MOU' => __( 'Moulvibazar', 'give' ), |
|
1623 | - 'MUN' => __( 'Munshiganj', 'give' ), |
|
1624 | - 'MYM' => __( 'Mymensingh', 'give' ), |
|
1625 | - 'NAO' => __( 'Naogaon', 'give' ), |
|
1626 | - 'NAR' => __( 'Narail', 'give' ), |
|
1627 | - 'NARG' => __( 'Narayanganj', 'give' ), |
|
1628 | - 'NARD' => __( 'Narsingdi', 'give' ), |
|
1629 | - 'NAT' => __( 'Natore', 'give' ), |
|
1630 | - 'NAW' => __( 'Nawabganj', 'give' ), |
|
1631 | - 'NET' => __( 'Netrakona', 'give' ), |
|
1632 | - 'NIL' => __( 'Nilphamari', 'give' ), |
|
1633 | - 'NOA' => __( 'Noakhali', 'give' ), |
|
1634 | - 'PAB' => __( 'Pabna', 'give' ), |
|
1635 | - 'PAN' => __( 'Panchagarh', 'give' ), |
|
1636 | - 'PAT' => __( 'Patuakhali', 'give' ), |
|
1637 | - 'PIR' => __( 'Pirojpur', 'give' ), |
|
1638 | - 'RAJB' => __( 'Rajbari', 'give' ), |
|
1639 | - 'RAJ' => __( 'Rajshahi', 'give' ), |
|
1640 | - 'RAN' => __( 'Rangamati', 'give' ), |
|
1641 | - 'RANP' => __( 'Rangpur', 'give' ), |
|
1642 | - 'SAT' => __( 'Satkhira', 'give' ), |
|
1643 | - 'SHA' => __( 'Shariatpur', 'give' ), |
|
1644 | - 'SHE' => __( 'Sherpur', 'give' ), |
|
1645 | - 'SIR' => __( 'Sirajganj', 'give' ), |
|
1646 | - 'SUN' => __( 'Sunamganj', 'give' ), |
|
1647 | - 'SYL' => __( 'Sylhet', 'give' ), |
|
1648 | - 'TAN' => __( 'Tangail', 'give' ), |
|
1649 | - 'THA' => __( 'Thakurgaon', 'give' ), |
|
1586 | + 'BAG' => __('Bagerhat', 'give'), |
|
1587 | + 'BAN' => __('Bandarban', 'give'), |
|
1588 | + 'BAR' => __('Barguna', 'give'), |
|
1589 | + 'BARI' => __('Barisal', 'give'), |
|
1590 | + 'BHO' => __('Bhola', 'give'), |
|
1591 | + 'BOG' => __('Bogra', 'give'), |
|
1592 | + 'BRA' => __('Brahmanbaria', 'give'), |
|
1593 | + 'CHA' => __('Chandpur', 'give'), |
|
1594 | + 'CHI' => __('Chittagong', 'give'), |
|
1595 | + 'CHU' => __('Chuadanga', 'give'), |
|
1596 | + 'COM' => __('Comilla', 'give'), |
|
1597 | + 'COX' => __("Cox's Bazar", 'give'), |
|
1598 | + 'DHA' => __('Dhaka', 'give'), |
|
1599 | + 'DIN' => __('Dinajpur', 'give'), |
|
1600 | + 'FAR' => __('Faridpur ', 'give'), |
|
1601 | + 'FEN' => __('Feni', 'give'), |
|
1602 | + 'GAI' => __('Gaibandha', 'give'), |
|
1603 | + 'GAZI' => __('Gazipur', 'give'), |
|
1604 | + 'GOP' => __('Gopalganj', 'give'), |
|
1605 | + 'HAB' => __('Habiganj', 'give'), |
|
1606 | + 'JAM' => __('Jamalpur', 'give'), |
|
1607 | + 'JES' => __('Jessore', 'give'), |
|
1608 | + 'JHA' => __('Jhalokati', 'give'), |
|
1609 | + 'JHE' => __('Jhenaidah', 'give'), |
|
1610 | + 'JOY' => __('Joypurhat', 'give'), |
|
1611 | + 'KHA' => __('Khagrachhari', 'give'), |
|
1612 | + 'KHU' => __('Khulna', 'give'), |
|
1613 | + 'KIS' => __('Kishoreganj', 'give'), |
|
1614 | + 'KUR' => __('Kurigram', 'give'), |
|
1615 | + 'KUS' => __('Kushtia', 'give'), |
|
1616 | + 'LAK' => __('Lakshmipur', 'give'), |
|
1617 | + 'LAL' => __('Lalmonirhat', 'give'), |
|
1618 | + 'MAD' => __('Madaripur', 'give'), |
|
1619 | + 'MAG' => __('Magura', 'give'), |
|
1620 | + 'MAN' => __('Manikganj ', 'give'), |
|
1621 | + 'MEH' => __('Meherpur', 'give'), |
|
1622 | + 'MOU' => __('Moulvibazar', 'give'), |
|
1623 | + 'MUN' => __('Munshiganj', 'give'), |
|
1624 | + 'MYM' => __('Mymensingh', 'give'), |
|
1625 | + 'NAO' => __('Naogaon', 'give'), |
|
1626 | + 'NAR' => __('Narail', 'give'), |
|
1627 | + 'NARG' => __('Narayanganj', 'give'), |
|
1628 | + 'NARD' => __('Narsingdi', 'give'), |
|
1629 | + 'NAT' => __('Natore', 'give'), |
|
1630 | + 'NAW' => __('Nawabganj', 'give'), |
|
1631 | + 'NET' => __('Netrakona', 'give'), |
|
1632 | + 'NIL' => __('Nilphamari', 'give'), |
|
1633 | + 'NOA' => __('Noakhali', 'give'), |
|
1634 | + 'PAB' => __('Pabna', 'give'), |
|
1635 | + 'PAN' => __('Panchagarh', 'give'), |
|
1636 | + 'PAT' => __('Patuakhali', 'give'), |
|
1637 | + 'PIR' => __('Pirojpur', 'give'), |
|
1638 | + 'RAJB' => __('Rajbari', 'give'), |
|
1639 | + 'RAJ' => __('Rajshahi', 'give'), |
|
1640 | + 'RAN' => __('Rangamati', 'give'), |
|
1641 | + 'RANP' => __('Rangpur', 'give'), |
|
1642 | + 'SAT' => __('Satkhira', 'give'), |
|
1643 | + 'SHA' => __('Shariatpur', 'give'), |
|
1644 | + 'SHE' => __('Sherpur', 'give'), |
|
1645 | + 'SIR' => __('Sirajganj', 'give'), |
|
1646 | + 'SUN' => __('Sunamganj', 'give'), |
|
1647 | + 'SYL' => __('Sylhet', 'give'), |
|
1648 | + 'TAN' => __('Tangail', 'give'), |
|
1649 | + 'THA' => __('Thakurgaon', 'give'), |
|
1650 | 1650 | ); |
1651 | 1651 | |
1652 | - return apply_filters( 'give_bangladeshi_states', $states ); |
|
1652 | + return apply_filters('give_bangladeshi_states', $states); |
|
1653 | 1653 | } |
1654 | 1654 | |
1655 | 1655 | /** |
@@ -1661,33 +1661,33 @@ discard block |
||
1661 | 1661 | function give_get_argentina_states_list() { |
1662 | 1662 | $states = array( |
1663 | 1663 | '' => '', |
1664 | - 'C' => __( 'Ciudad Autónoma de Buenos Aires', 'give' ), |
|
1665 | - 'B' => __( 'Buenos Aires', 'give' ), |
|
1666 | - 'K' => __( 'Catamarca', 'give' ), |
|
1667 | - 'H' => __( 'Chaco', 'give' ), |
|
1668 | - 'U' => __( 'Chubut', 'give' ), |
|
1669 | - 'X' => __( 'Córdoba', 'give' ), |
|
1670 | - 'W' => __( 'Corrientes', 'give' ), |
|
1671 | - 'E' => __( 'Entre Ríos', 'give' ), |
|
1672 | - 'P' => __( 'Formosa', 'give' ), |
|
1673 | - 'Y' => __( 'Jujuy', 'give' ), |
|
1674 | - 'L' => __( 'La Pampa', 'give' ), |
|
1675 | - 'F' => __( 'La Rioja', 'give' ), |
|
1676 | - 'M' => __( 'Mendoza', 'give' ), |
|
1677 | - 'N' => __( 'Misiones', 'give' ), |
|
1678 | - 'Q' => __( 'Neuquén', 'give' ), |
|
1679 | - 'R' => __( 'Río Negro', 'give' ), |
|
1680 | - 'A' => __( 'Salta', 'give' ), |
|
1681 | - 'J' => __( 'San Juan', 'give' ), |
|
1682 | - 'D' => __( 'San Luis', 'give' ), |
|
1683 | - 'Z' => __( 'Santa Cruz', 'give' ), |
|
1684 | - 'S' => __( 'Santa Fe', 'give' ), |
|
1685 | - 'G' => __( 'Santiago del Estero', 'give' ), |
|
1686 | - 'V' => __( 'Tierra del Fuego', 'give' ), |
|
1687 | - 'T' => __( 'Tucumán', 'give' ), |
|
1664 | + 'C' => __('Ciudad Autónoma de Buenos Aires', 'give'), |
|
1665 | + 'B' => __('Buenos Aires', 'give'), |
|
1666 | + 'K' => __('Catamarca', 'give'), |
|
1667 | + 'H' => __('Chaco', 'give'), |
|
1668 | + 'U' => __('Chubut', 'give'), |
|
1669 | + 'X' => __('Córdoba', 'give'), |
|
1670 | + 'W' => __('Corrientes', 'give'), |
|
1671 | + 'E' => __('Entre Ríos', 'give'), |
|
1672 | + 'P' => __('Formosa', 'give'), |
|
1673 | + 'Y' => __('Jujuy', 'give'), |
|
1674 | + 'L' => __('La Pampa', 'give'), |
|
1675 | + 'F' => __('La Rioja', 'give'), |
|
1676 | + 'M' => __('Mendoza', 'give'), |
|
1677 | + 'N' => __('Misiones', 'give'), |
|
1678 | + 'Q' => __('Neuquén', 'give'), |
|
1679 | + 'R' => __('Río Negro', 'give'), |
|
1680 | + 'A' => __('Salta', 'give'), |
|
1681 | + 'J' => __('San Juan', 'give'), |
|
1682 | + 'D' => __('San Luis', 'give'), |
|
1683 | + 'Z' => __('Santa Cruz', 'give'), |
|
1684 | + 'S' => __('Santa Fe', 'give'), |
|
1685 | + 'G' => __('Santiago del Estero', 'give'), |
|
1686 | + 'V' => __('Tierra del Fuego', 'give'), |
|
1687 | + 'T' => __('Tucumán', 'give'), |
|
1688 | 1688 | ); |
1689 | 1689 | |
1690 | - return apply_filters( 'give_argentina_states', $states ); |
|
1690 | + return apply_filters('give_argentina_states', $states); |
|
1691 | 1691 | } |
1692 | 1692 | |
1693 | 1693 | /** |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | 'AP' => 'Armed Forces - Pacific' |
1769 | 1769 | ); |
1770 | 1770 | |
1771 | - return apply_filters( 'give_us_states', $states ); |
|
1771 | + return apply_filters('give_us_states', $states); |
|
1772 | 1772 | } |
1773 | 1773 | |
1774 | 1774 | /** |
@@ -1781,22 +1781,22 @@ discard block |
||
1781 | 1781 | function give_get_provinces_list() { |
1782 | 1782 | $provinces = array( |
1783 | 1783 | '' => '', |
1784 | - 'AB' => esc_html__( 'Alberta', 'give' ), |
|
1785 | - 'BC' => esc_html__( 'British Columbia', 'give' ), |
|
1786 | - 'MB' => esc_html__( 'Manitoba', 'give' ), |
|
1787 | - 'NB' => esc_html__( 'New Brunswick', 'give' ), |
|
1788 | - 'NL' => esc_html__( 'Newfoundland and Labrador', 'give' ), |
|
1789 | - 'NS' => esc_html__( 'Nova Scotia', 'give' ), |
|
1790 | - 'NT' => esc_html__( 'Northwest Territories', 'give' ), |
|
1791 | - 'NU' => esc_html__( 'Nunavut', 'give' ), |
|
1792 | - 'ON' => esc_html__( 'Ontario', 'give' ), |
|
1793 | - 'PE' => esc_html__( 'Prince Edward Island', 'give' ), |
|
1794 | - 'QC' => esc_html__( 'Quebec', 'give' ), |
|
1795 | - 'SK' => esc_html__( 'Saskatchewan', 'give' ), |
|
1796 | - 'YT' => esc_html__( 'Yukon', 'give' ) |
|
1784 | + 'AB' => esc_html__('Alberta', 'give'), |
|
1785 | + 'BC' => esc_html__('British Columbia', 'give'), |
|
1786 | + 'MB' => esc_html__('Manitoba', 'give'), |
|
1787 | + 'NB' => esc_html__('New Brunswick', 'give'), |
|
1788 | + 'NL' => esc_html__('Newfoundland and Labrador', 'give'), |
|
1789 | + 'NS' => esc_html__('Nova Scotia', 'give'), |
|
1790 | + 'NT' => esc_html__('Northwest Territories', 'give'), |
|
1791 | + 'NU' => esc_html__('Nunavut', 'give'), |
|
1792 | + 'ON' => esc_html__('Ontario', 'give'), |
|
1793 | + 'PE' => esc_html__('Prince Edward Island', 'give'), |
|
1794 | + 'QC' => esc_html__('Quebec', 'give'), |
|
1795 | + 'SK' => esc_html__('Saskatchewan', 'give'), |
|
1796 | + 'YT' => esc_html__('Yukon', 'give') |
|
1797 | 1797 | ); |
1798 | 1798 | |
1799 | - return apply_filters( 'give_canada_provinces', $provinces ); |
|
1799 | + return apply_filters('give_canada_provinces', $provinces); |
|
1800 | 1800 | } |
1801 | 1801 | |
1802 | 1802 | /** |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | 'WA' => 'Western Australia' |
1819 | 1819 | ); |
1820 | 1820 | |
1821 | - return apply_filters( 'give_australian_states', $states ); |
|
1821 | + return apply_filters('give_australian_states', $states); |
|
1822 | 1822 | } |
1823 | 1823 | |
1824 | 1824 | /** |
@@ -1859,7 +1859,7 @@ discard block |
||
1859 | 1859 | 'TO' => 'Tocantins' |
1860 | 1860 | ); |
1861 | 1861 | |
1862 | - return apply_filters( 'give_brazil_states', $states ); |
|
1862 | + return apply_filters('give_brazil_states', $states); |
|
1863 | 1863 | } |
1864 | 1864 | |
1865 | 1865 | /** |
@@ -1876,7 +1876,7 @@ discard block |
||
1876 | 1876 | 'NEW TERRITORIES' => 'New Territories' |
1877 | 1877 | ); |
1878 | 1878 | |
1879 | - return apply_filters( 'give_hong_kong_states', $states ); |
|
1879 | + return apply_filters('give_hong_kong_states', $states); |
|
1880 | 1880 | } |
1881 | 1881 | |
1882 | 1882 | /** |
@@ -1910,7 +1910,7 @@ discard block |
||
1910 | 1910 | 'ZA' => 'Zala' |
1911 | 1911 | ); |
1912 | 1912 | |
1913 | - return apply_filters( 'give_hungary_states', $states ); |
|
1913 | + return apply_filters('give_hungary_states', $states); |
|
1914 | 1914 | } |
1915 | 1915 | |
1916 | 1916 | /** |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | 'CN32' => 'Xinjiang / 新疆' |
1957 | 1957 | ); |
1958 | 1958 | |
1959 | - return apply_filters( 'give_chinese_states', $states ); |
|
1959 | + return apply_filters('give_chinese_states', $states); |
|
1960 | 1960 | } |
1961 | 1961 | |
1962 | 1962 | /** |
@@ -1985,7 +1985,7 @@ discard block |
||
1985 | 1985 | 'WC' => 'West Coast' |
1986 | 1986 | ); |
1987 | 1987 | |
1988 | - return apply_filters( 'give_new_zealand_states', $states ); |
|
1988 | + return apply_filters('give_new_zealand_states', $states); |
|
1989 | 1989 | } |
1990 | 1990 | |
1991 | 1991 | /** |
@@ -2033,7 +2033,7 @@ discard block |
||
2033 | 2033 | 'PB' => 'Papua Barat' |
2034 | 2034 | ); |
2035 | 2035 | |
2036 | - return apply_filters( 'give_indonesia_states', $states ); |
|
2036 | + return apply_filters('give_indonesia_states', $states); |
|
2037 | 2037 | } |
2038 | 2038 | |
2039 | 2039 | /** |
@@ -2083,7 +2083,7 @@ discard block |
||
2083 | 2083 | 'PY' => 'Pondicherry (Puducherry)' |
2084 | 2084 | ); |
2085 | 2085 | |
2086 | - return apply_filters( 'give_indian_states', $states ); |
|
2086 | + return apply_filters('give_indian_states', $states); |
|
2087 | 2087 | } |
2088 | 2088 | |
2089 | 2089 | /** |
@@ -2113,7 +2113,7 @@ discard block |
||
2113 | 2113 | 'PJY' => 'W.P. Putrajaya' |
2114 | 2114 | ); |
2115 | 2115 | |
2116 | - return apply_filters( 'give_malaysian_states', $states ); |
|
2116 | + return apply_filters('give_malaysian_states', $states); |
|
2117 | 2117 | } |
2118 | 2118 | |
2119 | 2119 | /** |
@@ -2136,7 +2136,7 @@ discard block |
||
2136 | 2136 | 'WC' => 'Western Cape' |
2137 | 2137 | ); |
2138 | 2138 | |
2139 | - return apply_filters( 'give_south_african_states', $states ); |
|
2139 | + return apply_filters('give_south_african_states', $states); |
|
2140 | 2140 | } |
2141 | 2141 | |
2142 | 2142 | /** |
@@ -2227,7 +2227,7 @@ discard block |
||
2227 | 2227 | 'TH-35' => 'Yasothon (ยโสธร)' |
2228 | 2228 | ); |
2229 | 2229 | |
2230 | - return apply_filters( 'give_thailand_states', $states ); |
|
2230 | + return apply_filters('give_thailand_states', $states); |
|
2231 | 2231 | } |
2232 | 2232 | |
2233 | 2233 | /** |
@@ -2239,59 +2239,59 @@ discard block |
||
2239 | 2239 | function give_get_spain_states_list() { |
2240 | 2240 | $states = array( |
2241 | 2241 | '' => '', |
2242 | - 'C' => esc_html__( 'A Coruña', 'give' ), |
|
2243 | - 'VI' => esc_html__( 'Álava', 'give' ), |
|
2244 | - 'AB' => esc_html__( 'Albacete', 'give' ), |
|
2245 | - 'A' => esc_html__( 'Alicante', 'give' ), |
|
2246 | - 'AL' => esc_html__( 'Almería', 'give' ), |
|
2247 | - 'O' => esc_html__( 'Asturias', 'give' ), |
|
2248 | - 'AV' => esc_html__( 'Ávila', 'give' ), |
|
2249 | - 'BA' => esc_html__( 'Badajoz', 'give' ), |
|
2250 | - 'PM' => esc_html__( 'Baleares', 'give' ), |
|
2251 | - 'B' => esc_html__( 'Barcelona', 'give' ), |
|
2252 | - 'BU' => esc_html__( 'Burgos', 'give' ), |
|
2253 | - 'CC' => esc_html__( 'Cáceres', 'give' ), |
|
2254 | - 'CA' => esc_html__( 'Cádiz', 'give' ), |
|
2255 | - 'S' => esc_html__( 'Cantabria', 'give' ), |
|
2256 | - 'CS' => esc_html__( 'Castellón', 'give' ), |
|
2257 | - 'CE' => esc_html__( 'Ceuta', 'give' ), |
|
2258 | - 'CR' => esc_html__( 'Ciudad Real', 'give' ), |
|
2259 | - 'CO' => esc_html__( 'Córdoba', 'give' ), |
|
2260 | - 'CU' => esc_html__( 'Cuenca', 'give' ), |
|
2261 | - 'GI' => esc_html__( 'Girona', 'give' ), |
|
2262 | - 'GR' => esc_html__( 'Granada', 'give' ), |
|
2263 | - 'GU' => esc_html__( 'Guadalajara', 'give' ), |
|
2264 | - 'SS' => esc_html__( 'Gipuzkoa', 'give' ), |
|
2265 | - 'H' => esc_html__( 'Huelva', 'give' ), |
|
2266 | - 'HU' => esc_html__( 'Huesca', 'give' ), |
|
2267 | - 'J' => esc_html__( 'Jaén', 'give' ), |
|
2268 | - 'LO' => esc_html__( 'La Rioja', 'give' ), |
|
2269 | - 'GC' => esc_html__( 'Las Palmas', 'give' ), |
|
2270 | - 'LE' => esc_html__( 'León', 'give' ), |
|
2271 | - 'L' => esc_html__( 'Lleida', 'give' ), |
|
2272 | - 'LU' => esc_html__( 'Lugo', 'give' ), |
|
2273 | - 'M' => esc_html__( 'Madrid', 'give' ), |
|
2274 | - 'MA' => esc_html__( 'Málaga', 'give' ), |
|
2275 | - 'ML' => esc_html__( 'Melilla', 'give' ), |
|
2276 | - 'MU' => esc_html__( 'Murcia', 'give' ), |
|
2277 | - 'NA' => esc_html__( 'Navarra', 'give' ), |
|
2278 | - 'OR' => esc_html__( 'Ourense', 'give' ), |
|
2279 | - 'P' => esc_html__( 'Palencia', 'give' ), |
|
2280 | - 'PO' => esc_html__( 'Pontevedra', 'give' ), |
|
2281 | - 'SA' => esc_html__( 'Salamanca', 'give' ), |
|
2282 | - 'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ), |
|
2283 | - 'SG' => esc_html__( 'Segovia', 'give' ), |
|
2284 | - 'SE' => esc_html__( 'Sevilla', 'give' ), |
|
2285 | - 'SO' => esc_html__( 'Soria', 'give' ), |
|
2286 | - 'T' => esc_html__( 'Tarragona', 'give' ), |
|
2287 | - 'TE' => esc_html__( 'Teruel', 'give' ), |
|
2288 | - 'TO' => esc_html__( 'Toledo', 'give' ), |
|
2289 | - 'V' => esc_html__( 'Valencia', 'give' ), |
|
2290 | - 'VA' => esc_html__( 'Valladolid', 'give' ), |
|
2291 | - 'BI' => esc_html__( 'Bizkaia', 'give' ), |
|
2292 | - 'ZA' => esc_html__( 'Zamora', 'give' ), |
|
2293 | - 'Z' => esc_html__( 'Zaragoza', 'give' ) |
|
2242 | + 'C' => esc_html__('A Coruña', 'give'), |
|
2243 | + 'VI' => esc_html__('Álava', 'give'), |
|
2244 | + 'AB' => esc_html__('Albacete', 'give'), |
|
2245 | + 'A' => esc_html__('Alicante', 'give'), |
|
2246 | + 'AL' => esc_html__('Almería', 'give'), |
|
2247 | + 'O' => esc_html__('Asturias', 'give'), |
|
2248 | + 'AV' => esc_html__('Ávila', 'give'), |
|
2249 | + 'BA' => esc_html__('Badajoz', 'give'), |
|
2250 | + 'PM' => esc_html__('Baleares', 'give'), |
|
2251 | + 'B' => esc_html__('Barcelona', 'give'), |
|
2252 | + 'BU' => esc_html__('Burgos', 'give'), |
|
2253 | + 'CC' => esc_html__('Cáceres', 'give'), |
|
2254 | + 'CA' => esc_html__('Cádiz', 'give'), |
|
2255 | + 'S' => esc_html__('Cantabria', 'give'), |
|
2256 | + 'CS' => esc_html__('Castellón', 'give'), |
|
2257 | + 'CE' => esc_html__('Ceuta', 'give'), |
|
2258 | + 'CR' => esc_html__('Ciudad Real', 'give'), |
|
2259 | + 'CO' => esc_html__('Córdoba', 'give'), |
|
2260 | + 'CU' => esc_html__('Cuenca', 'give'), |
|
2261 | + 'GI' => esc_html__('Girona', 'give'), |
|
2262 | + 'GR' => esc_html__('Granada', 'give'), |
|
2263 | + 'GU' => esc_html__('Guadalajara', 'give'), |
|
2264 | + 'SS' => esc_html__('Gipuzkoa', 'give'), |
|
2265 | + 'H' => esc_html__('Huelva', 'give'), |
|
2266 | + 'HU' => esc_html__('Huesca', 'give'), |
|
2267 | + 'J' => esc_html__('Jaén', 'give'), |
|
2268 | + 'LO' => esc_html__('La Rioja', 'give'), |
|
2269 | + 'GC' => esc_html__('Las Palmas', 'give'), |
|
2270 | + 'LE' => esc_html__('León', 'give'), |
|
2271 | + 'L' => esc_html__('Lleida', 'give'), |
|
2272 | + 'LU' => esc_html__('Lugo', 'give'), |
|
2273 | + 'M' => esc_html__('Madrid', 'give'), |
|
2274 | + 'MA' => esc_html__('Málaga', 'give'), |
|
2275 | + 'ML' => esc_html__('Melilla', 'give'), |
|
2276 | + 'MU' => esc_html__('Murcia', 'give'), |
|
2277 | + 'NA' => esc_html__('Navarra', 'give'), |
|
2278 | + 'OR' => esc_html__('Ourense', 'give'), |
|
2279 | + 'P' => esc_html__('Palencia', 'give'), |
|
2280 | + 'PO' => esc_html__('Pontevedra', 'give'), |
|
2281 | + 'SA' => esc_html__('Salamanca', 'give'), |
|
2282 | + 'TF' => esc_html__('Santa Cruz de Tenerife', 'give'), |
|
2283 | + 'SG' => esc_html__('Segovia', 'give'), |
|
2284 | + 'SE' => esc_html__('Sevilla', 'give'), |
|
2285 | + 'SO' => esc_html__('Soria', 'give'), |
|
2286 | + 'T' => esc_html__('Tarragona', 'give'), |
|
2287 | + 'TE' => esc_html__('Teruel', 'give'), |
|
2288 | + 'TO' => esc_html__('Toledo', 'give'), |
|
2289 | + 'V' => esc_html__('Valencia', 'give'), |
|
2290 | + 'VA' => esc_html__('Valladolid', 'give'), |
|
2291 | + 'BI' => esc_html__('Bizkaia', 'give'), |
|
2292 | + 'ZA' => esc_html__('Zamora', 'give'), |
|
2293 | + 'Z' => esc_html__('Zaragoza', 'give') |
|
2294 | 2294 | ); |
2295 | 2295 | |
2296 | - return apply_filters( 'give_spain_states', $states ); |
|
2296 | + return apply_filters('give_spain_states', $states); |
|
2297 | 2297 | } |
@@ -1036,7 +1036,7 @@ |
||
1036 | 1036 | <label for="card_state" class="give-label"> |
1037 | 1037 | <?php echo $label; ?> |
1038 | 1038 | <?php if ( give_field_is_required( 'card_state', $form_id ) ) : |
1039 | - ?> |
|
1039 | + ?> |
|
1040 | 1040 | <span class="give-required-indicator <?php echo ( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span> |
1041 | 1041 | <?php endif; ?> |
1042 | 1042 | <span class="give-tooltip give-icon give-icon-question" |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,50 +23,50 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return string Donation form. |
25 | 25 | */ |
26 | -function give_get_donation_form( $args = array() ) { |
|
26 | +function give_get_donation_form($args = array()) { |
|
27 | 27 | |
28 | 28 | global $post; |
29 | 29 | |
30 | - $form_id = is_object( $post ) ? $post->ID : 0; |
|
30 | + $form_id = is_object($post) ? $post->ID : 0; |
|
31 | 31 | |
32 | - if ( isset( $args['id'] ) ) { |
|
32 | + if (isset($args['id'])) { |
|
33 | 33 | $form_id = $args['id']; |
34 | 34 | } |
35 | 35 | |
36 | - $defaults = apply_filters( 'give_form_args_defaults', array( |
|
36 | + $defaults = apply_filters('give_form_args_defaults', array( |
|
37 | 37 | 'form_id' => $form_id, |
38 | - ) ); |
|
38 | + )); |
|
39 | 39 | |
40 | - $args = wp_parse_args( $args, $defaults ); |
|
40 | + $args = wp_parse_args($args, $defaults); |
|
41 | 41 | |
42 | - $form = new Give_Donate_Form( $args['form_id'] ); |
|
42 | + $form = new Give_Donate_Form($args['form_id']); |
|
43 | 43 | |
44 | 44 | //bail if no form ID. |
45 | - if ( empty( $form->ID ) ) { |
|
45 | + if (empty($form->ID)) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | - $payment_mode = give_get_chosen_gateway( $form->ID ); |
|
49 | + $payment_mode = give_get_chosen_gateway($form->ID); |
|
50 | 50 | |
51 | - $form_action = add_query_arg( apply_filters( 'give_form_action_args', array( |
|
51 | + $form_action = add_query_arg(apply_filters('give_form_action_args', array( |
|
52 | 52 | 'payment-mode' => $payment_mode, |
53 | - ) ), |
|
53 | + )), |
|
54 | 54 | give_get_current_page_url() |
55 | 55 | ); |
56 | 56 | |
57 | 57 | //Sanity Check: Donation form not published or user doesn't have permission to view drafts. |
58 | 58 | if ( |
59 | - ( 'publish' !== $form->post_status && ! current_user_can( 'edit_give_forms', $form->ID ) ) |
|
60 | - || ( 'trash' === $form->post_status ) |
|
59 | + ('publish' !== $form->post_status && ! current_user_can('edit_give_forms', $form->ID)) |
|
60 | + || ('trash' === $form->post_status) |
|
61 | 61 | ) { |
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | |
65 | 65 | //Get the form wrap CSS classes. |
66 | - $form_wrap_classes = $form->get_form_wrap_classes( $args ); |
|
66 | + $form_wrap_classes = $form->get_form_wrap_classes($args); |
|
67 | 67 | |
68 | 68 | //Get the <form> tag wrap CSS classes. |
69 | - $form_classes = $form->get_form_classes( $args ); |
|
69 | + $form_classes = $form->get_form_classes($args); |
|
70 | 70 | |
71 | 71 | ob_start(); |
72 | 72 | |
@@ -78,19 +78,19 @@ discard block |
||
78 | 78 | * @param int $form_id The form ID. |
79 | 79 | * @param array $args An array of form arguments. |
80 | 80 | */ |
81 | - do_action( 'give_pre_form_output', $form->ID, $args ); |
|
81 | + do_action('give_pre_form_output', $form->ID, $args); |
|
82 | 82 | |
83 | 83 | ?> |
84 | 84 | <div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_wrap_classes; ?>"> |
85 | 85 | |
86 | - <?php if ( $form->is_close_donation_form() ) { |
|
86 | + <?php if ($form->is_close_donation_form()) { |
|
87 | 87 | |
88 | 88 | // Get Goal thank you message. |
89 | - $goal_achieved_message = give_get_meta( $form->ID, '_give_form_goal_achieved_message', true ); |
|
90 | - $goal_achieved_message = ! empty( $goal_achieved_message ) ? apply_filters( 'the_content', $goal_achieved_message ) : ''; |
|
89 | + $goal_achieved_message = give_get_meta($form->ID, '_give_form_goal_achieved_message', true); |
|
90 | + $goal_achieved_message = ! empty($goal_achieved_message) ? apply_filters('the_content', $goal_achieved_message) : ''; |
|
91 | 91 | |
92 | 92 | // Print thank you message. |
93 | - echo apply_filters( 'give_goal_closed_output', $goal_achieved_message, $form->ID ); |
|
93 | + echo apply_filters('give_goal_closed_output', $goal_achieved_message, $form->ID); |
|
94 | 94 | |
95 | 95 | } else { |
96 | 96 | /** |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | * 1. if show_title params set to true |
99 | 99 | * 2. if admin set form display_style to button |
100 | 100 | */ |
101 | - $form_title = apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $form_id ) . '</h2>' ); |
|
101 | + $form_title = apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($form_id).'</h2>'); |
|
102 | 102 | if ( |
103 | - ( isset( $args['show_title'] ) && $args['show_title'] == true ) |
|
104 | - && ! doing_action( 'give_single_form_summary' ) |
|
103 | + (isset($args['show_title']) && $args['show_title'] == true) |
|
104 | + && ! doing_action('give_single_form_summary') |
|
105 | 105 | ) { |
106 | 106 | echo $form_title; |
107 | 107 | } |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | * @param int $form_id The form ID. |
115 | 115 | * @param array $args An array of form arguments. |
116 | 116 | */ |
117 | - do_action( 'give_pre_form', $form->ID, $args ); |
|
117 | + do_action('give_pre_form', $form->ID, $args); |
|
118 | 118 | ?> |
119 | 119 | |
120 | 120 | <form id="give-form-<?php echo $form_id; ?>" class="<?php echo $form_classes; ?>" |
121 | - action="<?php echo esc_url_raw( $form_action ); ?>" method="post"> |
|
121 | + action="<?php echo esc_url_raw($form_action); ?>" method="post"> |
|
122 | 122 | <input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/> |
123 | - <input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/> |
|
123 | + <input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/> |
|
124 | 124 | <input type="hidden" name="give-current-url" |
125 | - value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
125 | + value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
126 | 126 | <input type="hidden" name="give-form-url" |
127 | - value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
127 | + value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
128 | 128 | <input type="hidden" name="give-form-minimum" |
129 | - value="<?php echo give_format_amount( give_get_form_minimum_price( $form->ID ), array( 'sanitize' => false ) ); ?>"/> |
|
129 | + value="<?php echo give_format_amount(give_get_form_minimum_price($form->ID), array('sanitize' => false)); ?>"/> |
|
130 | 130 | |
131 | 131 | <!-- The following field is for robots only, invisible to humans: --> |
132 | 132 | <span class="give-hidden" style="display: none !important;"> |
@@ -138,13 +138,13 @@ discard block |
||
138 | 138 | <?php |
139 | 139 | |
140 | 140 | // Price ID hidden field for variable (multi-level) donation forms. |
141 | - if ( give_has_variable_prices( $form_id ) ) { |
|
141 | + if (give_has_variable_prices($form_id)) { |
|
142 | 142 | // Get default selected price ID. |
143 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
143 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
144 | 144 | $price_id = 0; |
145 | 145 | //loop through prices. |
146 | - foreach ( $prices as $price ) { |
|
147 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
146 | + foreach ($prices as $price) { |
|
147 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
148 | 148 | $price_id = $price['_give_id']['level_id']; |
149 | 149 | }; |
150 | 150 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param int $form_id The form ID. |
161 | 161 | * @param array $args An array of form arguments. |
162 | 162 | */ |
163 | - do_action( 'give_donation_form_top', $form->ID, $args ); |
|
163 | + do_action('give_donation_form_top', $form->ID, $args); |
|
164 | 164 | |
165 | 165 | /** |
166 | 166 | * Fires while outputting donation form, for payment gateway fields. |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @param int $form_id The form ID. |
171 | 171 | * @param array $args An array of form arguments. |
172 | 172 | */ |
173 | - do_action( 'give_payment_mode_select', $form->ID, $args ); |
|
173 | + do_action('give_payment_mode_select', $form->ID, $args); |
|
174 | 174 | |
175 | 175 | /** |
176 | 176 | * Fires while outputting donation form, after all other fields. |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @param int $form_id The form ID. |
181 | 181 | * @param array $args An array of form arguments. |
182 | 182 | */ |
183 | - do_action( 'give_donation_form_bottom', $form->ID, $args ); |
|
183 | + do_action('give_donation_form_bottom', $form->ID, $args); |
|
184 | 184 | |
185 | 185 | ?> |
186 | 186 | </form> |
@@ -194,12 +194,12 @@ discard block |
||
194 | 194 | * @param int $form_id The form ID. |
195 | 195 | * @param array $args An array of form arguments. |
196 | 196 | */ |
197 | - do_action( 'give_post_form', $form->ID, $args ); |
|
197 | + do_action('give_post_form', $form->ID, $args); |
|
198 | 198 | |
199 | 199 | } |
200 | 200 | ?> |
201 | 201 | |
202 | - </div><!--end #give-form-<?php echo absint( $form->ID ); ?>--> |
|
202 | + </div><!--end #give-form-<?php echo absint($form->ID); ?>--> |
|
203 | 203 | <?php |
204 | 204 | |
205 | 205 | /** |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | * @param int $form_id The form ID. |
211 | 211 | * @param array $args An array of form arguments. |
212 | 212 | */ |
213 | - do_action( 'give_post_form_output', $form->ID, $args ); |
|
213 | + do_action('give_post_form_output', $form->ID, $args); |
|
214 | 214 | |
215 | 215 | $final_output = ob_get_clean(); |
216 | 216 | |
217 | - echo apply_filters( 'give_donate_form', $final_output, $args ); |
|
217 | + echo apply_filters('give_donate_form', $final_output, $args); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @return string |
233 | 233 | */ |
234 | -function give_show_purchase_form( $form_id ) { |
|
234 | +function give_show_purchase_form($form_id) { |
|
235 | 235 | |
236 | - $payment_mode = give_get_chosen_gateway( $form_id ); |
|
236 | + $payment_mode = give_get_chosen_gateway($form_id); |
|
237 | 237 | |
238 | - if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) { |
|
238 | + if ( ! isset($form_id) && isset($_POST['give_form_id'])) { |
|
239 | 239 | $form_id = $_POST['give_form_id']; |
240 | 240 | } |
241 | 241 | |
@@ -244,33 +244,33 @@ discard block |
||
244 | 244 | * |
245 | 245 | * @since 1.7 |
246 | 246 | */ |
247 | - do_action( 'give_payment_fields_top', $form_id ); |
|
247 | + do_action('give_payment_fields_top', $form_id); |
|
248 | 248 | |
249 | - if ( give_can_checkout() && isset( $form_id ) ) { |
|
249 | + if (give_can_checkout() && isset($form_id)) { |
|
250 | 250 | |
251 | 251 | /** |
252 | 252 | * Fires while displaying donation form, before registration login. |
253 | 253 | * |
254 | 254 | * @since 1.7 |
255 | 255 | */ |
256 | - do_action( 'give_donation_form_before_register_login', $form_id ); |
|
256 | + do_action('give_donation_form_before_register_login', $form_id); |
|
257 | 257 | |
258 | 258 | /** |
259 | 259 | * Fire when register/login form fields render. |
260 | 260 | * |
261 | 261 | * @since 1.7 |
262 | 262 | */ |
263 | - do_action( 'give_donation_form_register_login_fields', $form_id ); |
|
263 | + do_action('give_donation_form_register_login_fields', $form_id); |
|
264 | 264 | |
265 | 265 | /** |
266 | 266 | * Fire when credit card form fields render. |
267 | 267 | * |
268 | 268 | * @since 1.7 |
269 | 269 | */ |
270 | - do_action( 'give_donation_form_before_cc_form', $form_id ); |
|
270 | + do_action('give_donation_form_before_cc_form', $form_id); |
|
271 | 271 | |
272 | 272 | // Load the credit card form and allow gateways to load their own if they wish. |
273 | - if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) { |
|
273 | + if (has_action('give_'.$payment_mode.'_cc_form')) { |
|
274 | 274 | /** |
275 | 275 | * Fires while displaying donation form, credit card form fields for a given gateway. |
276 | 276 | * |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * |
279 | 279 | * @param int $form_id The form ID. |
280 | 280 | */ |
281 | - do_action( "give_{$payment_mode}_cc_form", $form_id ); |
|
281 | + do_action("give_{$payment_mode}_cc_form", $form_id); |
|
282 | 282 | } else { |
283 | 283 | /** |
284 | 284 | * Fires while displaying donation form, credit card form fields. |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * |
288 | 288 | * @param int $form_id The form ID. |
289 | 289 | */ |
290 | - do_action( 'give_cc_form', $form_id ); |
|
290 | + do_action('give_cc_form', $form_id); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * |
296 | 296 | * @since 1.7 |
297 | 297 | */ |
298 | - do_action( 'give_donation_form_after_cc_form', $form_id ); |
|
298 | + do_action('give_donation_form_after_cc_form', $form_id); |
|
299 | 299 | |
300 | 300 | } else { |
301 | 301 | /** |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @since 1.7 |
305 | 305 | */ |
306 | - do_action( 'give_donation_form_no_access', $form_id ); |
|
306 | + do_action('give_donation_form_no_access', $form_id); |
|
307 | 307 | |
308 | 308 | } |
309 | 309 | |
@@ -312,10 +312,10 @@ discard block |
||
312 | 312 | * |
313 | 313 | * @since 1.7 |
314 | 314 | */ |
315 | - do_action( 'give_payment_fields_bottom', $form_id ); |
|
315 | + do_action('give_payment_fields_bottom', $form_id); |
|
316 | 316 | } |
317 | 317 | |
318 | -add_action( 'give_donation_form', 'give_show_purchase_form' ); |
|
318 | +add_action('give_donation_form', 'give_show_purchase_form'); |
|
319 | 319 | |
320 | 320 | /** |
321 | 321 | * Give Show Login/Register Form Fields. |
@@ -326,11 +326,11 @@ discard block |
||
326 | 326 | * |
327 | 327 | * @return void |
328 | 328 | */ |
329 | -function give_show_register_login_fields( $form_id ) { |
|
329 | +function give_show_register_login_fields($form_id) { |
|
330 | 330 | |
331 | - $show_register_form = give_show_login_register_option( $form_id ); |
|
331 | + $show_register_form = give_show_login_register_option($form_id); |
|
332 | 332 | |
333 | - if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : |
|
333 | + if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) : |
|
334 | 334 | ?> |
335 | 335 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
336 | 336 | <?php |
@@ -339,11 +339,11 @@ discard block |
||
339 | 339 | * |
340 | 340 | * @since 1.7 |
341 | 341 | */ |
342 | - do_action( 'give_donation_form_register_fields', $form_id ); |
|
342 | + do_action('give_donation_form_register_fields', $form_id); |
|
343 | 343 | ?> |
344 | 344 | </div> |
345 | 345 | <?php |
346 | - elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : |
|
346 | + elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) : |
|
347 | 347 | ?> |
348 | 348 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
349 | 349 | <?php |
@@ -352,23 +352,23 @@ discard block |
||
352 | 352 | * |
353 | 353 | * @since 1.7 |
354 | 354 | */ |
355 | - do_action( 'give_donation_form_login_fields', $form_id ); |
|
355 | + do_action('give_donation_form_login_fields', $form_id); |
|
356 | 356 | ?> |
357 | 357 | </div> |
358 | 358 | <?php |
359 | 359 | endif; |
360 | 360 | |
361 | - if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) { |
|
361 | + if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) { |
|
362 | 362 | /** |
363 | 363 | * Fire when user info render. |
364 | 364 | * |
365 | 365 | * @since 1.7 |
366 | 366 | */ |
367 | - do_action( 'give_donation_form_after_user_info', $form_id ); |
|
367 | + do_action('give_donation_form_after_user_info', $form_id); |
|
368 | 368 | } |
369 | 369 | } |
370 | 370 | |
371 | -add_action( 'give_donation_form_register_login_fields', 'give_show_register_login_fields' ); |
|
371 | +add_action('give_donation_form_register_login_fields', 'give_show_register_login_fields'); |
|
372 | 372 | |
373 | 373 | /** |
374 | 374 | * Donation Amount Field. |
@@ -383,16 +383,16 @@ discard block |
||
383 | 383 | * |
384 | 384 | * @return void |
385 | 385 | */ |
386 | -function give_output_donation_amount_top( $form_id = 0, $args = array() ) { |
|
386 | +function give_output_donation_amount_top($form_id = 0, $args = array()) { |
|
387 | 387 | |
388 | 388 | $give_options = give_get_settings(); |
389 | - $variable_pricing = give_has_variable_prices( $form_id ); |
|
390 | - $allow_custom_amount = give_get_meta( $form_id, '_give_custom_amount', true ); |
|
391 | - $currency_position = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before'; |
|
392 | - $symbol = give_currency_symbol( give_get_currency() ); |
|
393 | - $currency_output = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>'; |
|
394 | - $default_amount = give_format_amount( give_get_default_form_amount( $form_id ), array( 'sanitize' => false ) ); |
|
395 | - $custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true ); |
|
389 | + $variable_pricing = give_has_variable_prices($form_id); |
|
390 | + $allow_custom_amount = give_get_meta($form_id, '_give_custom_amount', true); |
|
391 | + $currency_position = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before'; |
|
392 | + $symbol = give_currency_symbol(give_get_currency()); |
|
393 | + $currency_output = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>'; |
|
394 | + $default_amount = give_format_amount(give_get_default_form_amount($form_id), array('sanitize' => false)); |
|
395 | + $custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true); |
|
396 | 396 | |
397 | 397 | /** |
398 | 398 | * Fires while displaying donation form, before donation level fields. |
@@ -402,20 +402,20 @@ discard block |
||
402 | 402 | * @param int $form_id The form ID. |
403 | 403 | * @param array $args An array of form arguments. |
404 | 404 | */ |
405 | - do_action( 'give_before_donation_levels', $form_id, $args ); |
|
405 | + do_action('give_before_donation_levels', $form_id, $args); |
|
406 | 406 | |
407 | 407 | //Set Price, No Custom Amount Allowed means hidden price field |
408 | - if ( ! give_is_setting_enabled( $allow_custom_amount ) ) { |
|
408 | + if ( ! give_is_setting_enabled($allow_custom_amount)) { |
|
409 | 409 | ?> |
410 | - <label class="give-hidden" for="give-amount-hidden"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label> |
|
410 | + <label class="give-hidden" for="give-amount-hidden"><?php esc_html_e('Donation Amount:', 'give'); ?></label> |
|
411 | 411 | <input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount" |
412 | 412 | value="<?php echo $default_amount; ?>" required aria-required="true"/> |
413 | 413 | <div class="set-price give-donation-amount form-row-wide"> |
414 | - <?php if ( $currency_position == 'before' ) { |
|
414 | + <?php if ($currency_position == 'before') { |
|
415 | 415 | echo $currency_output; |
416 | 416 | } ?> |
417 | 417 | <span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span> |
418 | - <?php if ( $currency_position == 'after' ) { |
|
418 | + <?php if ($currency_position == 'after') { |
|
419 | 419 | echo $currency_output; |
420 | 420 | } ?> |
421 | 421 | </div> |
@@ -425,13 +425,13 @@ discard block |
||
425 | 425 | ?> |
426 | 426 | <div class="give-total-wrap"> |
427 | 427 | <div class="give-donation-amount form-row-wide"> |
428 | - <?php if ( $currency_position == 'before' ) { |
|
428 | + <?php if ($currency_position == 'before') { |
|
429 | 429 | echo $currency_output; |
430 | 430 | } ?> |
431 | - <label class="give-hidden" for="give-amount"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label> |
|
431 | + <label class="give-hidden" for="give-amount"><?php esc_html_e('Donation Amount:', 'give'); ?></label> |
|
432 | 432 | <input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel" |
433 | 433 | placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off"> |
434 | - <?php if ( $currency_position == 'after' ) { |
|
434 | + <?php if ($currency_position == 'after') { |
|
435 | 435 | echo $currency_output; |
436 | 436 | } ?> |
437 | 437 | </div> |
@@ -446,16 +446,16 @@ discard block |
||
446 | 446 | * @param int $form_id The form ID. |
447 | 447 | * @param array $args An array of form arguments. |
448 | 448 | */ |
449 | - do_action( 'give_after_donation_amount', $form_id, $args ); |
|
449 | + do_action('give_after_donation_amount', $form_id, $args); |
|
450 | 450 | |
451 | 451 | //Custom Amount Text |
452 | - if ( ! $variable_pricing && give_is_setting_enabled( $allow_custom_amount ) && ! empty( $custom_amount_text ) ) { ?> |
|
452 | + if ( ! $variable_pricing && give_is_setting_enabled($allow_custom_amount) && ! empty($custom_amount_text)) { ?> |
|
453 | 453 | <p class="give-custom-amount-text"><?php echo $custom_amount_text; ?></p> |
454 | 454 | <?php } |
455 | 455 | |
456 | 456 | //Output Variable Pricing Levels. |
457 | - if ( $variable_pricing ) { |
|
458 | - give_output_levels( $form_id ); |
|
457 | + if ($variable_pricing) { |
|
458 | + give_output_levels($form_id); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | /** |
@@ -466,10 +466,10 @@ discard block |
||
466 | 466 | * @param int $form_id The form ID. |
467 | 467 | * @param array $args An array of form arguments. |
468 | 468 | */ |
469 | - do_action( 'give_after_donation_levels', $form_id, $args ); |
|
469 | + do_action('give_after_donation_levels', $form_id, $args); |
|
470 | 470 | } |
471 | 471 | |
472 | -add_action( 'give_donation_form_top', 'give_output_donation_amount_top', 10, 2 ); |
|
472 | +add_action('give_donation_form_top', 'give_output_donation_amount_top', 10, 2); |
|
473 | 473 | |
474 | 474 | /** |
475 | 475 | * Outputs the Donation Levels in various formats such as dropdown, radios, and buttons. |
@@ -480,30 +480,30 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @return string Donation levels. |
482 | 482 | */ |
483 | -function give_output_levels( $form_id ) { |
|
483 | +function give_output_levels($form_id) { |
|
484 | 484 | |
485 | 485 | //Get variable pricing. |
486 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
487 | - $display_style = give_get_meta( $form_id, '_give_display_style', true ); |
|
488 | - $custom_amount = give_get_meta( $form_id, '_give_custom_amount', true ); |
|
489 | - $custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true ); |
|
490 | - if ( empty( $custom_amount_text ) ) { |
|
491 | - $custom_amount_text = esc_html__( 'Give a Custom Amount', 'give' ); |
|
486 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
487 | + $display_style = give_get_meta($form_id, '_give_display_style', true); |
|
488 | + $custom_amount = give_get_meta($form_id, '_give_custom_amount', true); |
|
489 | + $custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true); |
|
490 | + if (empty($custom_amount_text)) { |
|
491 | + $custom_amount_text = esc_html__('Give a Custom Amount', 'give'); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | $output = ''; |
495 | 495 | |
496 | - switch ( $display_style ) { |
|
496 | + switch ($display_style) { |
|
497 | 497 | case 'buttons': |
498 | 498 | |
499 | 499 | $output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">'; |
500 | 500 | |
501 | - foreach ( $prices as $price ) { |
|
502 | - $level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price ); |
|
503 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $price['_give_id']['level_id'] . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price ); |
|
501 | + foreach ($prices as $price) { |
|
502 | + $level_text = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price); |
|
503 | + $level_classes = apply_filters('give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-'.$price['_give_id']['level_id'].' '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'give-default-level' : ''), $form_id, $price); |
|
504 | 504 | |
505 | 505 | $output .= '<li>'; |
506 | - $output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">'; |
|
506 | + $output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">'; |
|
507 | 507 | $output .= $level_text; |
508 | 508 | $output .= '</button>'; |
509 | 509 | $output .= '</li>'; |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | } |
512 | 512 | |
513 | 513 | //Custom Amount. |
514 | - if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) { |
|
514 | + if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) { |
|
515 | 515 | $output .= '<li>'; |
516 | 516 | $output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">'; |
517 | 517 | $output .= $custom_amount_text; |
@@ -527,22 +527,22 @@ discard block |
||
527 | 527 | |
528 | 528 | $output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">'; |
529 | 529 | |
530 | - foreach ( $prices as $price ) { |
|
531 | - $level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price ); |
|
532 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price ); |
|
530 | + foreach ($prices as $price) { |
|
531 | + $level_text = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price); |
|
532 | + $level_classes = apply_filters('give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-'.$price['_give_id']['level_id'].((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price); |
|
533 | 533 | |
534 | 534 | $output .= '<li>'; |
535 | - $output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $price['_give_id']['level_id'] . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">'; |
|
536 | - $output .= '<label for="give-radio-level-' . $price['_give_id']['level_id'] . '">' . $level_text . '</label>'; |
|
535 | + $output .= '<input type="radio" data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" name="give-radio-donation-level" id="give-radio-level-'.$price['_give_id']['level_id'].'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'checked="checked"' : '').' value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">'; |
|
536 | + $output .= '<label for="give-radio-level-'.$price['_give_id']['level_id'].'">'.$level_text.'</label>'; |
|
537 | 537 | $output .= '</li>'; |
538 | 538 | |
539 | 539 | } |
540 | 540 | |
541 | 541 | //Custom Amount. |
542 | - if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) { |
|
542 | + if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) { |
|
543 | 543 | $output .= '<li>'; |
544 | 544 | $output .= '<input type="radio" data-price-id="custom" class="give-radio-input give-radio-input-level give-radio-level-custom" name="give-radio-donation-level" id="give-radio-level-custom" value="custom">'; |
545 | - $output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>'; |
|
545 | + $output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>'; |
|
546 | 546 | $output .= '</li>'; |
547 | 547 | } |
548 | 548 | |
@@ -552,23 +552,23 @@ discard block |
||
552 | 552 | |
553 | 553 | case 'dropdown': |
554 | 554 | |
555 | - $output .= '<label for="give-donation-level-select-' . $form_id . '" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>'; |
|
556 | - $output .= '<select id="give-donation-level-select-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">'; |
|
555 | + $output .= '<label for="give-donation-level-select-'.$form_id.'" class="give-hidden">'.esc_html__('Choose Your Donation Amount', 'give').':</label>'; |
|
556 | + $output .= '<select id="give-donation-level-select-'.$form_id.'" class="give-select give-select-level give-donation-levels-wrap">'; |
|
557 | 557 | |
558 | 558 | //first loop through prices. |
559 | - foreach ( $prices as $price ) { |
|
560 | - $level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price ); |
|
561 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price ); |
|
559 | + foreach ($prices as $price) { |
|
560 | + $level_text = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price); |
|
561 | + $level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$price['_give_id']['level_id'].((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price); |
|
562 | 562 | |
563 | - $output .= '<option data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'selected="selected"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">'; |
|
563 | + $output .= '<option data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'selected="selected"' : '').' value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">'; |
|
564 | 564 | $output .= $level_text; |
565 | 565 | $output .= '</option>'; |
566 | 566 | |
567 | 567 | } |
568 | 568 | |
569 | 569 | //Custom Amount. |
570 | - if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) { |
|
571 | - $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>'; |
|
570 | + if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) { |
|
571 | + $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>'; |
|
572 | 572 | } |
573 | 573 | |
574 | 574 | $output .= '</select>'; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | break; |
577 | 577 | } |
578 | 578 | |
579 | - echo apply_filters( 'give_form_level_output', $output, $form_id ); |
|
579 | + echo apply_filters('give_form_level_output', $output, $form_id); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
@@ -591,27 +591,27 @@ discard block |
||
591 | 591 | * |
592 | 592 | * @return string Checkout button. |
593 | 593 | */ |
594 | -function give_display_checkout_button( $form_id, $args ) { |
|
594 | +function give_display_checkout_button($form_id, $args) { |
|
595 | 595 | |
596 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
596 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
597 | 597 | ? $args['display_style'] |
598 | - : give_get_meta( $form_id, '_give_payment_display', true ); |
|
598 | + : give_get_meta($form_id, '_give_payment_display', true); |
|
599 | 599 | |
600 | - if ( 'button' === $display_option ) { |
|
600 | + if ('button' === $display_option) { |
|
601 | 601 | $display_option = 'modal'; |
602 | - } elseif ( $display_option === 'onpage' ) { |
|
602 | + } elseif ($display_option === 'onpage') { |
|
603 | 603 | return ''; |
604 | 604 | } |
605 | 605 | |
606 | - $display_label_field = give_get_meta( $form_id, '_give_reveal_label', true ); |
|
607 | - $display_label = ! empty( $args['continue_button_title'] ) ? $args['continue_button_title'] : ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) ); |
|
606 | + $display_label_field = give_get_meta($form_id, '_give_reveal_label', true); |
|
607 | + $display_label = ! empty($args['continue_button_title']) ? $args['continue_button_title'] : ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give')); |
|
608 | 608 | |
609 | - $output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>'; |
|
609 | + $output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>'; |
|
610 | 610 | |
611 | - echo apply_filters( 'give_display_checkout_button', $output ); |
|
611 | + echo apply_filters('give_display_checkout_button', $output); |
|
612 | 612 | } |
613 | 613 | |
614 | -add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 ); |
|
614 | +add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2); |
|
615 | 615 | |
616 | 616 | /** |
617 | 617 | * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided. |
@@ -622,57 +622,57 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @return void |
624 | 624 | */ |
625 | -function give_user_info_fields( $form_id ) { |
|
625 | +function give_user_info_fields($form_id) { |
|
626 | 626 | // Get user info. |
627 | - $give_user_info = _give_get_prefill_form_field_values( $form_id ); |
|
627 | + $give_user_info = _give_get_prefill_form_field_values($form_id); |
|
628 | 628 | |
629 | 629 | /** |
630 | 630 | * Fire before user personal information fields |
631 | 631 | * |
632 | 632 | * @since 1.7 |
633 | 633 | */ |
634 | - do_action( 'give_donation_form_before_personal_info', $form_id ); |
|
634 | + do_action('give_donation_form_before_personal_info', $form_id); |
|
635 | 635 | ?> |
636 | 636 | <fieldset id="give_checkout_user_info"> |
637 | - <legend><?php echo apply_filters( 'give_checkout_personal_info_text', esc_html__( 'Personal Info', 'give' ) ); ?></legend> |
|
637 | + <legend><?php echo apply_filters('give_checkout_personal_info_text', esc_html__('Personal Info', 'give')); ?></legend> |
|
638 | 638 | <p id="give-first-name-wrap" class="form-row form-row-first form-row-responsive"> |
639 | 639 | <label class="give-label" for="give-first"> |
640 | - <?php esc_html_e( 'First Name', 'give' ); ?> |
|
641 | - <?php if ( give_field_is_required( 'give_first', $form_id ) ) : ?> |
|
640 | + <?php esc_html_e('First Name', 'give'); ?> |
|
641 | + <?php if (give_field_is_required('give_first', $form_id)) : ?> |
|
642 | 642 | <span class="give-required-indicator">*</span> |
643 | 643 | <?php endif ?> |
644 | 644 | <span class="give-tooltip give-icon give-icon-question" |
645 | - data-tooltip="<?php esc_attr_e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span> |
|
645 | + data-tooltip="<?php esc_attr_e('We will use this to personalize your account experience.', 'give'); ?>"></span> |
|
646 | 646 | </label> |
647 | 647 | <input |
648 | 648 | class="give-input required" |
649 | 649 | type="text" |
650 | 650 | name="give_first" |
651 | - placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>" |
|
651 | + placeholder="<?php esc_attr_e('First Name', 'give'); ?>" |
|
652 | 652 | id="give-first" |
653 | - value="<?php echo isset( $give_user_info['give_first'] ) ? $give_user_info['give_first'] : ''; ?>" |
|
654 | - <?php echo( give_field_is_required( 'give_first', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
653 | + value="<?php echo isset($give_user_info['give_first']) ? $give_user_info['give_first'] : ''; ?>" |
|
654 | + <?php echo(give_field_is_required('give_first', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
655 | 655 | /> |
656 | 656 | </p> |
657 | 657 | |
658 | 658 | <p id="give-last-name-wrap" class="form-row form-row-last form-row-responsive"> |
659 | 659 | <label class="give-label" for="give-last"> |
660 | - <?php esc_html_e( 'Last Name', 'give' ); ?> |
|
661 | - <?php if ( give_field_is_required( 'give_last', $form_id ) ) : ?> |
|
660 | + <?php esc_html_e('Last Name', 'give'); ?> |
|
661 | + <?php if (give_field_is_required('give_last', $form_id)) : ?> |
|
662 | 662 | <span class="give-required-indicator">*</span> |
663 | 663 | <?php endif ?> |
664 | 664 | <span class="give-tooltip give-icon give-icon-question" |
665 | - data-tooltip="<?php esc_attr_e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span> |
|
665 | + data-tooltip="<?php esc_attr_e('We will use this as well to personalize your account experience.', 'give'); ?>"></span> |
|
666 | 666 | </label> |
667 | 667 | |
668 | 668 | <input |
669 | - class="give-input<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required' : '' ); ?>" |
|
669 | + class="give-input<?php echo(give_field_is_required('give_last', $form_id) ? ' required' : ''); ?>" |
|
670 | 670 | type="text" |
671 | 671 | name="give_last" |
672 | 672 | id="give-last" |
673 | - placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>" |
|
674 | - value="<?php echo isset( $give_user_info['give_last'] ) ? $give_user_info['give_last'] : ''; ?>" |
|
675 | - <?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
673 | + placeholder="<?php esc_attr_e('Last Name', 'give'); ?>" |
|
674 | + value="<?php echo isset($give_user_info['give_last']) ? $give_user_info['give_last'] : ''; ?>" |
|
675 | + <?php echo(give_field_is_required('give_last', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
676 | 676 | /> |
677 | 677 | </p> |
678 | 678 | |
@@ -682,26 +682,26 @@ discard block |
||
682 | 682 | * |
683 | 683 | * @since 1.7 |
684 | 684 | */ |
685 | - do_action( 'give_donation_form_before_email', $form_id ); |
|
685 | + do_action('give_donation_form_before_email', $form_id); |
|
686 | 686 | ?> |
687 | 687 | <p id="give-email-wrap" class="form-row form-row-wide"> |
688 | 688 | <label class="give-label" for="give-email"> |
689 | - <?php esc_html_e( 'Email Address', 'give' ); ?> |
|
690 | - <?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?> |
|
689 | + <?php esc_html_e('Email Address', 'give'); ?> |
|
690 | + <?php if (give_field_is_required('give_email', $form_id)) { ?> |
|
691 | 691 | <span class="give-required-indicator">*</span> |
692 | 692 | <?php } ?> |
693 | 693 | <span class="give-tooltip give-icon give-icon-question" |
694 | - data-tooltip="<?php esc_attr_e( 'We will send the donation receipt to this address.', 'give' ); ?>"></span> |
|
694 | + data-tooltip="<?php esc_attr_e('We will send the donation receipt to this address.', 'give'); ?>"></span> |
|
695 | 695 | </label> |
696 | 696 | |
697 | 697 | <input |
698 | 698 | class="give-input required" |
699 | 699 | type="email" |
700 | 700 | name="give_email" |
701 | - placeholder="<?php esc_attr_e( 'Email Address', 'give' ); ?>" |
|
701 | + placeholder="<?php esc_attr_e('Email Address', 'give'); ?>" |
|
702 | 702 | id="give-email" |
703 | - value="<?php echo isset( $give_user_info['give_email'] ) ? $give_user_info['give_email'] : ''; ?>" |
|
704 | - <?php echo( give_field_is_required( 'give_email', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
703 | + value="<?php echo isset($give_user_info['give_email']) ? $give_user_info['give_email'] : ''; ?>" |
|
704 | + <?php echo(give_field_is_required('give_email', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
705 | 705 | /> |
706 | 706 | |
707 | 707 | </p> |
@@ -711,14 +711,14 @@ discard block |
||
711 | 711 | * |
712 | 712 | * @since 1.7 |
713 | 713 | */ |
714 | - do_action( 'give_donation_form_after_email', $form_id ); |
|
714 | + do_action('give_donation_form_after_email', $form_id); |
|
715 | 715 | |
716 | 716 | /** |
717 | 717 | * Fire after personal email field |
718 | 718 | * |
719 | 719 | * @since 1.7 |
720 | 720 | */ |
721 | - do_action( 'give_donation_form_user_info', $form_id ); |
|
721 | + do_action('give_donation_form_user_info', $form_id); |
|
722 | 722 | ?> |
723 | 723 | </fieldset> |
724 | 724 | <?php |
@@ -727,11 +727,11 @@ discard block |
||
727 | 727 | * |
728 | 728 | * @since 1.7 |
729 | 729 | */ |
730 | - do_action( 'give_donation_form_after_personal_info', $form_id ); |
|
730 | + do_action('give_donation_form_after_personal_info', $form_id); |
|
731 | 731 | } |
732 | 732 | |
733 | -add_action( 'give_donation_form_after_user_info', 'give_user_info_fields' ); |
|
734 | -add_action( 'give_register_fields_before', 'give_user_info_fields' ); |
|
733 | +add_action('give_donation_form_after_user_info', 'give_user_info_fields'); |
|
734 | +add_action('give_register_fields_before', 'give_user_info_fields'); |
|
735 | 735 | |
736 | 736 | /** |
737 | 737 | * Renders the credit card info form. |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | * |
743 | 743 | * @return void |
744 | 744 | */ |
745 | -function give_get_cc_form( $form_id ) { |
|
745 | +function give_get_cc_form($form_id) { |
|
746 | 746 | |
747 | 747 | ob_start(); |
748 | 748 | |
@@ -753,53 +753,53 @@ discard block |
||
753 | 753 | * |
754 | 754 | * @param int $form_id The form ID. |
755 | 755 | */ |
756 | - do_action( 'give_before_cc_fields', $form_id ); |
|
756 | + do_action('give_before_cc_fields', $form_id); |
|
757 | 757 | ?> |
758 | 758 | <fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate"> |
759 | - <legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend> |
|
760 | - <?php if ( is_ssl() ) : ?> |
|
759 | + <legend><?php echo apply_filters('give_credit_card_fieldset_heading', esc_html__('Credit Card Info', 'give')); ?></legend> |
|
760 | + <?php if (is_ssl()) : ?> |
|
761 | 761 | <div id="give_secure_site_wrapper-<?php echo $form_id ?>"> |
762 | 762 | <span class="give-icon padlock"></span> |
763 | - <span><?php esc_html_e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span> |
|
763 | + <span><?php esc_html_e('This is a secure SSL encrypted payment.', 'give'); ?></span> |
|
764 | 764 | </div> |
765 | 765 | <?php endif; ?> |
766 | 766 | <p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive"> |
767 | 767 | <label for="card_number-<?php echo $form_id ?>" class="give-label"> |
768 | - <?php esc_html_e( 'Card Number', 'give' ); ?> |
|
768 | + <?php esc_html_e('Card Number', 'give'); ?> |
|
769 | 769 | <span class="give-required-indicator">*</span> |
770 | 770 | <span class="give-tooltip give-icon give-icon-question" |
771 | - data-tooltip="<?php esc_attr_e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span> |
|
771 | + data-tooltip="<?php esc_attr_e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span> |
|
772 | 772 | <span class="card-type"></span> |
773 | 773 | </label> |
774 | 774 | |
775 | 775 | <input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" |
776 | - class="card-number give-input required" placeholder="<?php esc_attr_e( 'Card number', 'give' ); ?>" |
|
776 | + class="card-number give-input required" placeholder="<?php esc_attr_e('Card number', 'give'); ?>" |
|
777 | 777 | required aria-required="true"/> |
778 | 778 | </p> |
779 | 779 | |
780 | 780 | <p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third form-row-responsive"> |
781 | 781 | <label for="card_cvc-<?php echo $form_id ?>" class="give-label"> |
782 | - <?php esc_html_e( 'CVC', 'give' ); ?> |
|
782 | + <?php esc_html_e('CVC', 'give'); ?> |
|
783 | 783 | <span class="give-required-indicator">*</span> |
784 | 784 | <span class="give-tooltip give-icon give-icon-question" |
785 | - data-tooltip="<?php esc_attr_e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span> |
|
785 | + data-tooltip="<?php esc_attr_e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span> |
|
786 | 786 | </label> |
787 | 787 | |
788 | 788 | <input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>" |
789 | - class="card-cvc give-input required" placeholder="<?php esc_attr_e( 'Security code', 'give' ); ?>" |
|
789 | + class="card-cvc give-input required" placeholder="<?php esc_attr_e('Security code', 'give'); ?>" |
|
790 | 790 | required aria-required="true"/> |
791 | 791 | </p> |
792 | 792 | |
793 | 793 | <p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive"> |
794 | 794 | <label for="card_name-<?php echo $form_id ?>" class="give-label"> |
795 | - <?php esc_html_e( 'Name on the Card', 'give' ); ?> |
|
795 | + <?php esc_html_e('Name on the Card', 'give'); ?> |
|
796 | 796 | <span class="give-required-indicator">*</span> |
797 | 797 | <span class="give-tooltip give-icon give-icon-question" |
798 | - data-tooltip="<?php esc_attr_e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span> |
|
798 | + data-tooltip="<?php esc_attr_e('The name printed on the front of your credit card.', 'give'); ?>"></span> |
|
799 | 799 | </label> |
800 | 800 | |
801 | 801 | <input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" |
802 | - class="card-name give-input required" placeholder="<?php esc_attr_e( 'Card name', 'give' ); ?>" |
|
802 | + class="card-name give-input required" placeholder="<?php esc_attr_e('Card name', 'give'); ?>" |
|
803 | 803 | required aria-required="true"/> |
804 | 804 | </p> |
805 | 805 | <?php |
@@ -810,14 +810,14 @@ discard block |
||
810 | 810 | * |
811 | 811 | * @param int $form_id The form ID. |
812 | 812 | */ |
813 | - do_action( 'give_before_cc_expiration' ); |
|
813 | + do_action('give_before_cc_expiration'); |
|
814 | 814 | ?> |
815 | 815 | <p class="card-expiration form-row form-row-one-third form-row-responsive"> |
816 | 816 | <label for="card_expiry-<?php echo $form_id ?>" class="give-label"> |
817 | - <?php esc_html_e( 'Expiration', 'give' ); ?> |
|
817 | + <?php esc_html_e('Expiration', 'give'); ?> |
|
818 | 818 | <span class="give-required-indicator">*</span> |
819 | 819 | <span class="give-tooltip give-icon give-icon-question" |
820 | - data-tooltip="<?php esc_attr_e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span> |
|
820 | + data-tooltip="<?php esc_attr_e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span> |
|
821 | 821 | </label> |
822 | 822 | |
823 | 823 | <input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month" |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | class="card-expiry-year"/> |
827 | 827 | |
828 | 828 | <input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" |
829 | - class="card-expiry give-input required" placeholder="<?php esc_attr_e( 'MM / YY', 'give' ); ?>" |
|
829 | + class="card-expiry give-input required" placeholder="<?php esc_attr_e('MM / YY', 'give'); ?>" |
|
830 | 830 | required aria-required="true"/> |
831 | 831 | </p> |
832 | 832 | <?php |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | * |
838 | 838 | * @param int $form_id The form ID. |
839 | 839 | */ |
840 | - do_action( 'give_after_cc_expiration', $form_id ); |
|
840 | + do_action('give_after_cc_expiration', $form_id); |
|
841 | 841 | ?> |
842 | 842 | </fieldset> |
843 | 843 | <?php |
@@ -848,12 +848,12 @@ discard block |
||
848 | 848 | * |
849 | 849 | * @param int $form_id The form ID. |
850 | 850 | */ |
851 | - do_action( 'give_after_cc_fields', $form_id ); |
|
851 | + do_action('give_after_cc_fields', $form_id); |
|
852 | 852 | |
853 | 853 | echo ob_get_clean(); |
854 | 854 | } |
855 | 855 | |
856 | -add_action( 'give_cc_form', 'give_get_cc_form' ); |
|
856 | +add_action('give_cc_form', 'give_get_cc_form'); |
|
857 | 857 | |
858 | 858 | /** |
859 | 859 | * Outputs the default credit card address fields. |
@@ -864,24 +864,24 @@ discard block |
||
864 | 864 | * |
865 | 865 | * @return void |
866 | 866 | */ |
867 | -function give_default_cc_address_fields( $form_id ) { |
|
867 | +function give_default_cc_address_fields($form_id) { |
|
868 | 868 | // Get user info. |
869 | - $give_user_info = _give_get_prefill_form_field_values( $form_id ); |
|
869 | + $give_user_info = _give_get_prefill_form_field_values($form_id); |
|
870 | 870 | |
871 | 871 | $logged_in = is_user_logged_in(); |
872 | 872 | |
873 | - if ( $logged_in ) { |
|
874 | - $user_address = get_user_meta( get_current_user_id(), '_give_user_address', true ); |
|
873 | + if ($logged_in) { |
|
874 | + $user_address = get_user_meta(get_current_user_id(), '_give_user_address', true); |
|
875 | 875 | } |
876 | - $line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : ''; |
|
877 | - $line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : ''; |
|
878 | - $city = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : ''; |
|
879 | - $zip = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : ''; |
|
876 | + $line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : ''; |
|
877 | + $line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : ''; |
|
878 | + $city = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : ''; |
|
879 | + $zip = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : ''; |
|
880 | 880 | |
881 | 881 | ob_start(); |
882 | 882 | ?> |
883 | 883 | <fieldset id="give_cc_address" class="cc-address"> |
884 | - <legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend> |
|
884 | + <legend><?php echo apply_filters('give_billing_details_fieldset_heading', esc_html__('Billing Details', 'give')); ?></legend> |
|
885 | 885 | <?php |
886 | 886 | /** |
887 | 887 | * Fires while rendering credit card billing form, before address fields. |
@@ -890,79 +890,79 @@ discard block |
||
890 | 890 | * |
891 | 891 | * @param int $form_id The form ID. |
892 | 892 | */ |
893 | - do_action( 'give_cc_billing_top' ); |
|
893 | + do_action('give_cc_billing_top'); |
|
894 | 894 | ?> |
895 | 895 | <p id="give-card-address-wrap" class="form-row form-row-wide"> |
896 | 896 | <label for="card_address" class="give-label"> |
897 | - <?php esc_html_e( 'Address 1', 'give' ); ?> |
|
897 | + <?php esc_html_e('Address 1', 'give'); ?> |
|
898 | 898 | <?php |
899 | - if ( give_field_is_required( 'card_address', $form_id ) ) : ?> |
|
899 | + if (give_field_is_required('card_address', $form_id)) : ?> |
|
900 | 900 | <span class="give-required-indicator">*</span> |
901 | 901 | <?php endif; ?> |
902 | 902 | <span class="give-tooltip give-icon give-icon-question" |
903 | - data-tooltip="<?php esc_attr_e( 'The primary billing address for your credit card.', 'give' ); ?>"></span> |
|
903 | + data-tooltip="<?php esc_attr_e('The primary billing address for your credit card.', 'give'); ?>"></span> |
|
904 | 904 | </label> |
905 | 905 | |
906 | 906 | <input |
907 | 907 | type="text" |
908 | 908 | id="card_address" |
909 | 909 | name="card_address" |
910 | - class="card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>" |
|
911 | - placeholder="<?php esc_attr_e( 'Address line 1', 'give' ); ?>" |
|
912 | - value="<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>" |
|
913 | - <?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
910 | + class="card-address give-input<?php echo(give_field_is_required('card_address', $form_id) ? ' required' : ''); ?>" |
|
911 | + placeholder="<?php esc_attr_e('Address line 1', 'give'); ?>" |
|
912 | + value="<?php echo isset($give_user_info['card_address']) ? $give_user_info['card_address'] : ''; ?>" |
|
913 | + <?php echo(give_field_is_required('card_address', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
914 | 914 | /> |
915 | 915 | </p> |
916 | 916 | |
917 | 917 | <p id="give-card-address-2-wrap" class="form-row form-row-wide"> |
918 | 918 | <label for="card_address_2" class="give-label"> |
919 | - <?php esc_html_e( 'Address 2', 'give' ); ?> |
|
920 | - <?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?> |
|
919 | + <?php esc_html_e('Address 2', 'give'); ?> |
|
920 | + <?php if (give_field_is_required('card_address_2', $form_id)) : ?> |
|
921 | 921 | <span class="give-required-indicator">*</span> |
922 | 922 | <?php endif; ?> |
923 | 923 | <span class="give-tooltip give-icon give-icon-question" |
924 | - data-tooltip="<?php esc_attr_e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span> |
|
924 | + data-tooltip="<?php esc_attr_e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span> |
|
925 | 925 | </label> |
926 | 926 | |
927 | 927 | <input |
928 | 928 | type="text" |
929 | 929 | id="card_address_2" |
930 | 930 | name="card_address_2" |
931 | - class="card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>" |
|
932 | - placeholder="<?php esc_attr_e( 'Address line 2', 'give' ); ?>" |
|
933 | - value="<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>" |
|
934 | - <?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
931 | + class="card-address-2 give-input<?php echo(give_field_is_required('card_address_2', $form_id) ? ' required' : ''); ?>" |
|
932 | + placeholder="<?php esc_attr_e('Address line 2', 'give'); ?>" |
|
933 | + value="<?php echo isset($give_user_info['card_address_2']) ? $give_user_info['card_address_2'] : ''; ?>" |
|
934 | + <?php echo(give_field_is_required('card_address_2', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
935 | 935 | /> |
936 | 936 | </p> |
937 | 937 | |
938 | 938 | <p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive"> |
939 | 939 | <label for="card_city" class="give-label"> |
940 | - <?php esc_html_e( 'City', 'give' ); ?> |
|
941 | - <?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?> |
|
940 | + <?php esc_html_e('City', 'give'); ?> |
|
941 | + <?php if (give_field_is_required('card_city', $form_id)) : ?> |
|
942 | 942 | <span class="give-required-indicator">*</span> |
943 | 943 | <?php endif; ?> |
944 | 944 | <span class="give-tooltip give-icon give-icon-question" |
945 | - data-tooltip="<?php esc_attr_e( 'The city for your billing address.', 'give' ); ?>"></span> |
|
945 | + data-tooltip="<?php esc_attr_e('The city for your billing address.', 'give'); ?>"></span> |
|
946 | 946 | </label> |
947 | 947 | <input |
948 | 948 | type="text" |
949 | 949 | id="card_city" |
950 | 950 | name="card_city" |
951 | - class="card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>" |
|
952 | - placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" |
|
953 | - value="<?php echo isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : ''; ?>" |
|
954 | - <?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
951 | + class="card-city give-input<?php echo(give_field_is_required('card_city', $form_id) ? ' required' : ''); ?>" |
|
952 | + placeholder="<?php esc_attr_e('City', 'give'); ?>" |
|
953 | + value="<?php echo isset($give_user_info['card_city']) ? $give_user_info['card_city'] : ''; ?>" |
|
954 | + <?php echo(give_field_is_required('card_city', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
955 | 955 | /> |
956 | 956 | </p> |
957 | 957 | |
958 | 958 | <p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive"> |
959 | 959 | <label for="card_zip" class="give-label"> |
960 | - <?php esc_html_e( 'Zip / Postal Code', 'give' ); ?> |
|
961 | - <?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?> |
|
960 | + <?php esc_html_e('Zip / Postal Code', 'give'); ?> |
|
961 | + <?php if (give_field_is_required('card_zip', $form_id)) : ?> |
|
962 | 962 | <span class="give-required-indicator">*</span> |
963 | 963 | <?php endif; ?> |
964 | 964 | <span class="give-tooltip give-icon give-icon-question" |
965 | - data-tooltip="<?php esc_attr_e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span> |
|
965 | + data-tooltip="<?php esc_attr_e('The zip or postal code for your billing address.', 'give'); ?>"></span> |
|
966 | 966 | </label> |
967 | 967 | |
968 | 968 | <input |
@@ -970,40 +970,40 @@ discard block |
||
970 | 970 | size="4" |
971 | 971 | id="card_zip" |
972 | 972 | name="card_zip" |
973 | - class="card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>" |
|
974 | - placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" |
|
975 | - value="<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>" |
|
976 | - <?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
973 | + class="card-zip give-input<?php echo(give_field_is_required('card_zip', $form_id) ? ' required' : ''); ?>" |
|
974 | + placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" |
|
975 | + value="<?php echo isset($give_user_info['card_zip']) ? $give_user_info['card_zip'] : ''; ?>" |
|
976 | + <?php echo(give_field_is_required('card_zip', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
977 | 977 | /> |
978 | 978 | </p> |
979 | 979 | |
980 | 980 | <p id="give-card-country-wrap" class="form-row form-row-first form-row-responsive"> |
981 | 981 | <label for="billing_country" class="give-label"> |
982 | - <?php esc_html_e( 'Country', 'give' ); ?> |
|
983 | - <?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?> |
|
982 | + <?php esc_html_e('Country', 'give'); ?> |
|
983 | + <?php if (give_field_is_required('billing_country', $form_id)) : ?> |
|
984 | 984 | <span class="give-required-indicator">*</span> |
985 | 985 | <?php endif; ?> |
986 | 986 | <span class="give-tooltip give-icon give-icon-question" |
987 | - data-tooltip="<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>"></span> |
|
987 | + data-tooltip="<?php esc_attr_e('The country for your billing address.', 'give'); ?>"></span> |
|
988 | 988 | </label> |
989 | 989 | |
990 | 990 | <select |
991 | 991 | name="billing_country" |
992 | 992 | id="billing_country" |
993 | - class="billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>" |
|
994 | - <?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required="true" ' : '' ); ?> |
|
993 | + class="billing-country billing_country give-select<?php echo(give_field_is_required('billing_country', $form_id) ? ' required' : ''); ?>" |
|
994 | + <?php echo(give_field_is_required('billing_country', $form_id) ? ' required aria-required="true" ' : ''); ?> |
|
995 | 995 | > |
996 | 996 | <?php |
997 | 997 | |
998 | 998 | $selected_country = give_get_country(); |
999 | 999 | |
1000 | - if ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) { |
|
1000 | + if ( ! empty($give_user_info['billing_country']) && '*' !== $give_user_info['billing_country']) { |
|
1001 | 1001 | $selected_country = $give_user_info['billing_country']; |
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | $countries = give_get_country_list(); |
1005 | - foreach ( $countries as $country_code => $country ) { |
|
1006 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
1005 | + foreach ($countries as $country_code => $country) { |
|
1006 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
1007 | 1007 | } |
1008 | 1008 | ?> |
1009 | 1009 | </select> |
@@ -1013,46 +1013,46 @@ discard block |
||
1013 | 1013 | <?php |
1014 | 1014 | $selected_state = give_get_state(); |
1015 | 1015 | |
1016 | - $label = __( 'State', 'give' ); |
|
1016 | + $label = __('State', 'give'); |
|
1017 | 1017 | $states_label = give_get_states_label(); |
1018 | 1018 | // Check if $country code exists in the array key for states label. |
1019 | - if ( array_key_exists( $selected_country, $states_label ) ) { |
|
1020 | - $label = $states_label[ $selected_country ]; |
|
1019 | + if (array_key_exists($selected_country, $states_label)) { |
|
1020 | + $label = $states_label[$selected_country]; |
|
1021 | 1021 | } |
1022 | 1022 | |
1023 | - $states = give_get_states( $selected_country ); |
|
1023 | + $states = give_get_states($selected_country); |
|
1024 | 1024 | |
1025 | 1025 | // Get the country list that does not have any states init. |
1026 | 1026 | $no_states_country = give_no_states_country_list(); |
1027 | 1027 | |
1028 | - if ( ! empty( $give_user_info['card_state'] ) ) { |
|
1028 | + if ( ! empty($give_user_info['card_state'])) { |
|
1029 | 1029 | $selected_state = $give_user_info['card_state']; |
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | // Get the country list that does not require states. |
1033 | 1033 | $states_not_required_country_list = give_states_not_required_country_list(); |
1034 | 1034 | ?> |
1035 | - <p id="give-card-state-wrap" class="form-row form-row-last form-row-responsive <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ) ? 'give-hidden' : ''; ?> "> |
|
1035 | + <p id="give-card-state-wrap" class="form-row form-row-last form-row-responsive <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country)) ? 'give-hidden' : ''; ?> "> |
|
1036 | 1036 | <label for="card_state" class="give-label"> |
1037 | 1037 | <?php echo $label; ?> |
1038 | - <?php if ( give_field_is_required( 'card_state', $form_id ) ) : |
|
1038 | + <?php if (give_field_is_required('card_state', $form_id)) : |
|
1039 | 1039 | ?> |
1040 | - <span class="give-required-indicator <?php echo ( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span> |
|
1040 | + <span class="give-required-indicator <?php echo (array_key_exists($selected_country, $states_not_required_country_list) ? 'give-hidden' : '') ?> ">*</span> |
|
1041 | 1041 | <?php endif; ?> |
1042 | 1042 | <span class="give-tooltip give-icon give-icon-question" |
1043 | - data-tooltip="<?php esc_attr_e( 'The state or province for your billing address.', 'give' ); ?>"></span> |
|
1043 | + data-tooltip="<?php esc_attr_e('The state or province for your billing address.', 'give'); ?>"></span> |
|
1044 | 1044 | </label> |
1045 | 1045 | <?php |
1046 | 1046 | |
1047 | - if ( ! empty( $states ) ) : ?> |
|
1047 | + if ( ! empty($states)) : ?> |
|
1048 | 1048 | <select |
1049 | 1049 | name="card_state" |
1050 | 1050 | id="card_state" |
1051 | - class="card_state give-select<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required' : '' ); ?>" |
|
1052 | - <?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required aria-required="true" ' : '' ); ?>> |
|
1051 | + class="card_state give-select<?php echo(give_field_is_required('card_state', $form_id) ? ' required' : ''); ?>" |
|
1052 | + <?php echo(give_field_is_required('card_state', $form_id) ? ' required aria-required="true" ' : ''); ?>> |
|
1053 | 1053 | <?php |
1054 | - foreach ( $states as $state_code => $state ) { |
|
1055 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
1054 | + foreach ($states as $state_code => $state) { |
|
1055 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
1056 | 1056 | } |
1057 | 1057 | ?> |
1058 | 1058 | </select> |
@@ -1069,14 +1069,14 @@ discard block |
||
1069 | 1069 | * |
1070 | 1070 | * @param int $form_id The form ID. |
1071 | 1071 | */ |
1072 | - do_action( 'give_cc_billing_bottom' ); |
|
1072 | + do_action('give_cc_billing_bottom'); |
|
1073 | 1073 | ?> |
1074 | 1074 | </fieldset> |
1075 | 1075 | <?php |
1076 | 1076 | echo ob_get_clean(); |
1077 | 1077 | } |
1078 | 1078 | |
1079 | -add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' ); |
|
1079 | +add_action('give_after_cc_fields', 'give_default_cc_address_fields'); |
|
1080 | 1080 | |
1081 | 1081 | |
1082 | 1082 | /** |
@@ -1089,24 +1089,24 @@ discard block |
||
1089 | 1089 | * |
1090 | 1090 | * @return string |
1091 | 1091 | */ |
1092 | -function give_get_register_fields( $form_id ) { |
|
1092 | +function give_get_register_fields($form_id) { |
|
1093 | 1093 | |
1094 | 1094 | global $user_ID; |
1095 | 1095 | |
1096 | - if ( is_user_logged_in() ) { |
|
1097 | - $user_data = get_userdata( $user_ID ); |
|
1096 | + if (is_user_logged_in()) { |
|
1097 | + $user_data = get_userdata($user_ID); |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | - $show_register_form = give_show_login_register_option( $form_id ); |
|
1100 | + $show_register_form = give_show_login_register_option($form_id); |
|
1101 | 1101 | |
1102 | 1102 | ob_start(); ?> |
1103 | 1103 | <fieldset id="give-register-fields-<?php echo $form_id; ?>"> |
1104 | 1104 | |
1105 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
1105 | + <?php if ($show_register_form == 'both') { ?> |
|
1106 | 1106 | <div class="give-login-account-wrap"> |
1107 | - <p class="give-login-message"><?php esc_html_e( 'Already have an account?', 'give' ); ?> |
|
1108 | - <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login" |
|
1109 | - data-action="give_checkout_login"><?php esc_html_e( 'Login', 'give' ); ?></a> |
|
1107 | + <p class="give-login-message"><?php esc_html_e('Already have an account?', 'give'); ?> |
|
1108 | + <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login" |
|
1109 | + data-action="give_checkout_login"><?php esc_html_e('Login', 'give'); ?></a> |
|
1110 | 1110 | </p> |
1111 | 1111 | <p class="give-loading-text"> |
1112 | 1112 | <span class="give-loading-animation"></span> |
@@ -1122,15 +1122,15 @@ discard block |
||
1122 | 1122 | * |
1123 | 1123 | * @param int $form_id The form ID. |
1124 | 1124 | */ |
1125 | - do_action( 'give_register_fields_before', $form_id ); |
|
1125 | + do_action('give_register_fields_before', $form_id); |
|
1126 | 1126 | ?> |
1127 | 1127 | |
1128 | 1128 | <fieldset id="give-register-account-fields-<?php echo $form_id; ?>"> |
1129 | 1129 | <legend> |
1130 | 1130 | <?php |
1131 | - echo apply_filters( 'give_create_account_fieldset_heading', esc_html__( 'Create an account', 'give' ) ); |
|
1132 | - if ( ! give_logged_in_only( $form_id ) ) { |
|
1133 | - echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>'; |
|
1131 | + echo apply_filters('give_create_account_fieldset_heading', esc_html__('Create an account', 'give')); |
|
1132 | + if ( ! give_logged_in_only($form_id)) { |
|
1133 | + echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>'; |
|
1134 | 1134 | } |
1135 | 1135 | ?> |
1136 | 1136 | </legend> |
@@ -1142,54 +1142,54 @@ discard block |
||
1142 | 1142 | * |
1143 | 1143 | * @param int $form_id The form ID. |
1144 | 1144 | */ |
1145 | - do_action( 'give_register_account_fields_before', $form_id ); |
|
1145 | + do_action('give_register_account_fields_before', $form_id); |
|
1146 | 1146 | ?> |
1147 | 1147 | <div id="give-user-login-wrap-<?php echo $form_id; ?>" |
1148 | 1148 | class="form-row form-row-one-third form-row-first form-row-responsive"> |
1149 | 1149 | <label for="give-user-login-<?php echo $form_id; ?>"> |
1150 | - <?php esc_html_e( 'Username', 'give' ); ?> |
|
1151 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
1150 | + <?php esc_html_e('Username', 'give'); ?> |
|
1151 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
1152 | 1152 | <span class="give-required-indicator">*</span> |
1153 | 1153 | <?php } ?> |
1154 | 1154 | <span class="give-tooltip give-icon give-icon-question" |
1155 | - data-tooltip="<?php esc_attr_e( 'The username you will use to log into your account.', 'give' ); ?>"></span> |
|
1155 | + data-tooltip="<?php esc_attr_e('The username you will use to log into your account.', 'give'); ?>"></span> |
|
1156 | 1156 | </label> |
1157 | 1157 | |
1158 | 1158 | <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="give-input" |
1159 | 1159 | type="text" |
1160 | - placeholder="<?php esc_attr_e( 'Username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/> |
|
1160 | + placeholder="<?php esc_attr_e('Username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/> |
|
1161 | 1161 | </div> |
1162 | 1162 | |
1163 | 1163 | <div id="give-user-pass-wrap-<?php echo $form_id; ?>" |
1164 | 1164 | class="form-row form-row-one-third form-row-responsive"> |
1165 | 1165 | <label for="give-user-pass-<?php echo $form_id; ?>"> |
1166 | - <?php esc_html_e( 'Password', 'give' ); ?> |
|
1167 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
1166 | + <?php esc_html_e('Password', 'give'); ?> |
|
1167 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
1168 | 1168 | <span class="give-required-indicator">*</span> |
1169 | 1169 | <?php } ?> |
1170 | 1170 | <span class="give-tooltip give-icon give-icon-question" |
1171 | - data-tooltip="<?php esc_attr_e( 'The password used to access your account.', 'give' ); ?>"></span> |
|
1171 | + data-tooltip="<?php esc_attr_e('The password used to access your account.', 'give'); ?>"></span> |
|
1172 | 1172 | </label> |
1173 | 1173 | |
1174 | 1174 | <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="give-input" |
1175 | - placeholder="<?php esc_attr_e( 'Password', 'give' ); ?>" |
|
1176 | - type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/> |
|
1175 | + placeholder="<?php esc_attr_e('Password', 'give'); ?>" |
|
1176 | + type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/> |
|
1177 | 1177 | </div> |
1178 | 1178 | |
1179 | 1179 | <div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" |
1180 | 1180 | class="give-register-password form-row form-row-one-third form-row-responsive"> |
1181 | 1181 | <label for="give-user-pass-confirm-<?php echo $form_id; ?>"> |
1182 | - <?php esc_html_e( 'Confirm PW', 'give' ); ?> |
|
1183 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
1182 | + <?php esc_html_e('Confirm PW', 'give'); ?> |
|
1183 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
1184 | 1184 | <span class="give-required-indicator">*</span> |
1185 | 1185 | <?php } ?> |
1186 | 1186 | <span class="give-tooltip give-icon give-icon-question" |
1187 | - data-tooltip="<?php esc_attr_e( 'Please retype your password to confirm.', 'give' ); ?>"></span> |
|
1187 | + data-tooltip="<?php esc_attr_e('Please retype your password to confirm.', 'give'); ?>"></span> |
|
1188 | 1188 | </label> |
1189 | 1189 | |
1190 | 1190 | <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" |
1191 | - class="give-input" placeholder="<?php esc_attr_e( 'Confirm password', 'give' ); ?>" |
|
1192 | - type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/> |
|
1191 | + class="give-input" placeholder="<?php esc_attr_e('Confirm password', 'give'); ?>" |
|
1192 | + type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/> |
|
1193 | 1193 | </div> |
1194 | 1194 | <?php |
1195 | 1195 | /** |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | * |
1200 | 1200 | * @param int $form_id The form ID. |
1201 | 1201 | */ |
1202 | - do_action( 'give_register_account_fields_after', $form_id ); |
|
1202 | + do_action('give_register_account_fields_after', $form_id); |
|
1203 | 1203 | ?> |
1204 | 1204 | </fieldset> |
1205 | 1205 | |
@@ -1211,7 +1211,7 @@ discard block |
||
1211 | 1211 | * |
1212 | 1212 | * @param int $form_id The form ID. |
1213 | 1213 | */ |
1214 | - do_action( 'give_register_fields_after', $form_id ); |
|
1214 | + do_action('give_register_fields_after', $form_id); |
|
1215 | 1215 | ?> |
1216 | 1216 | |
1217 | 1217 | <input type="hidden" name="give-purchase-var" value="needs-to-register"/> |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | * |
1223 | 1223 | * @since 1.7 |
1224 | 1224 | */ |
1225 | - do_action( 'give_donation_form_user_info', $form_id ); |
|
1225 | + do_action('give_donation_form_user_info', $form_id); |
|
1226 | 1226 | ?> |
1227 | 1227 | |
1228 | 1228 | </fieldset> |
@@ -1230,7 +1230,7 @@ discard block |
||
1230 | 1230 | echo ob_get_clean(); |
1231 | 1231 | } |
1232 | 1232 | |
1233 | -add_action( 'give_donation_form_register_fields', 'give_get_register_fields' ); |
|
1233 | +add_action('give_donation_form_register_fields', 'give_get_register_fields'); |
|
1234 | 1234 | |
1235 | 1235 | /** |
1236 | 1236 | * Gets the login fields for the login form on the checkout. This function hooks |
@@ -1243,27 +1243,27 @@ discard block |
||
1243 | 1243 | * |
1244 | 1244 | * @return string |
1245 | 1245 | */ |
1246 | -function give_get_login_fields( $form_id ) { |
|
1246 | +function give_get_login_fields($form_id) { |
|
1247 | 1247 | |
1248 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id; |
|
1249 | - $show_register_form = give_show_login_register_option( $form_id ); |
|
1248 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id; |
|
1249 | + $show_register_form = give_show_login_register_option($form_id); |
|
1250 | 1250 | |
1251 | 1251 | ob_start(); |
1252 | 1252 | ?> |
1253 | 1253 | <fieldset id="give-login-fields-<?php echo $form_id; ?>"> |
1254 | - <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', esc_html__( 'Login to Your Account', 'give' ) ); |
|
1255 | - if ( ! give_logged_in_only( $form_id ) ) { |
|
1256 | - echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>'; |
|
1254 | + <legend><?php echo apply_filters('give_account_login_fieldset_heading', esc_html__('Login to Your Account', 'give')); |
|
1255 | + if ( ! give_logged_in_only($form_id)) { |
|
1256 | + echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>'; |
|
1257 | 1257 | } ?> |
1258 | 1258 | </legend> |
1259 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
1259 | + <?php if ($show_register_form == 'both') { ?> |
|
1260 | 1260 | <p class="give-new-account-link"> |
1261 | - <?php esc_html_e( 'Need to create an account?', 'give' ); ?> |
|
1262 | - <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel" |
|
1261 | + <?php esc_html_e('Need to create an account?', 'give'); ?> |
|
1262 | + <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel" |
|
1263 | 1263 | data-action="give_checkout_register"> |
1264 | - <?php esc_html_e( 'Register', 'give' ); |
|
1265 | - if ( ! give_logged_in_only( $form_id ) ) { |
|
1266 | - echo ' ' . esc_html__( 'and donate as a guest »', 'give' ); |
|
1264 | + <?php esc_html_e('Register', 'give'); |
|
1265 | + if ( ! give_logged_in_only($form_id)) { |
|
1266 | + echo ' '.esc_html__('and donate as a guest »', 'give'); |
|
1267 | 1267 | } ?> |
1268 | 1268 | </a> |
1269 | 1269 | </p> |
@@ -1279,49 +1279,49 @@ discard block |
||
1279 | 1279 | * |
1280 | 1280 | * @param int $form_id The form ID. |
1281 | 1281 | */ |
1282 | - do_action( 'give_checkout_login_fields_before', $form_id ); |
|
1282 | + do_action('give_checkout_login_fields_before', $form_id); |
|
1283 | 1283 | ?> |
1284 | 1284 | <div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive"> |
1285 | 1285 | <label class="give-label" for="give-user-login-<?php echo $form_id; ?>"> |
1286 | - <?php esc_html_e( 'Username', 'give' ); ?> |
|
1287 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
1286 | + <?php esc_html_e('Username', 'give'); ?> |
|
1287 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
1288 | 1288 | <span class="give-required-indicator">*</span> |
1289 | 1289 | <?php } ?> |
1290 | 1290 | </label> |
1291 | 1291 | |
1292 | - <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text" |
|
1292 | + <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>" type="text" |
|
1293 | 1293 | name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" |
1294 | - placeholder="<?php esc_attr_e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/> |
|
1294 | + placeholder="<?php esc_attr_e('Your username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/> |
|
1295 | 1295 | </div> |
1296 | 1296 | |
1297 | 1297 | <div id="give-user-pass-wrap-<?php echo $form_id; ?>" |
1298 | 1298 | class="give_login_password form-row form-row-last form-row-responsive"> |
1299 | 1299 | <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>"> |
1300 | - <?php esc_html_e( 'Password', 'give' ); ?> |
|
1301 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
1300 | + <?php esc_html_e('Password', 'give'); ?> |
|
1301 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
1302 | 1302 | <span class="give-required-indicator">*</span> |
1303 | 1303 | <?php } ?> |
1304 | 1304 | </label> |
1305 | - <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" |
|
1305 | + <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>" |
|
1306 | 1306 | type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" |
1307 | - placeholder="<?php esc_attr_e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/> |
|
1307 | + placeholder="<?php esc_attr_e('Your password', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/> |
|
1308 | 1308 | <input type="hidden" name="give-purchase-var" value="needs-to-login"/> |
1309 | 1309 | </div> |
1310 | 1310 | |
1311 | 1311 | <div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password"> |
1312 | 1312 | <span class="give-forgot-password "> |
1313 | 1313 | <a href="<?php echo wp_lostpassword_url() ?>" |
1314 | - target="_blank"><?php esc_html_e( 'Reset Password', 'give' ) ?></a> |
|
1314 | + target="_blank"><?php esc_html_e('Reset Password', 'give') ?></a> |
|
1315 | 1315 | </span> |
1316 | 1316 | </div> |
1317 | 1317 | |
1318 | 1318 | <div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix"> |
1319 | 1319 | <input type="submit" class="give-submit give-btn button" name="give_login_submit" |
1320 | - value="<?php esc_attr_e( 'Login', 'give' ); ?>"/> |
|
1321 | - <?php if ( $show_register_form !== 'login' ) { ?> |
|
1320 | + value="<?php esc_attr_e('Login', 'give'); ?>"/> |
|
1321 | + <?php if ($show_register_form !== 'login') { ?> |
|
1322 | 1322 | <input type="button" data-action="give_cancel_login" |
1323 | 1323 | class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel" |
1324 | - value="<?php esc_attr_e( 'Cancel', 'give' ); ?>"/> |
|
1324 | + value="<?php esc_attr_e('Cancel', 'give'); ?>"/> |
|
1325 | 1325 | <?php } ?> |
1326 | 1326 | <span class="give-loading-animation"></span> |
1327 | 1327 | </div> |
@@ -1333,14 +1333,14 @@ discard block |
||
1333 | 1333 | * |
1334 | 1334 | * @param int $form_id The form ID. |
1335 | 1335 | */ |
1336 | - do_action( 'give_checkout_login_fields_after', $form_id ); |
|
1336 | + do_action('give_checkout_login_fields_after', $form_id); |
|
1337 | 1337 | ?> |
1338 | 1338 | </fieldset><!--end #give-login-fields--> |
1339 | 1339 | <?php |
1340 | 1340 | echo ob_get_clean(); |
1341 | 1341 | } |
1342 | 1342 | |
1343 | -add_action( 'give_donation_form_login_fields', 'give_get_login_fields', 10, 1 ); |
|
1343 | +add_action('give_donation_form_login_fields', 'give_get_login_fields', 10, 1); |
|
1344 | 1344 | |
1345 | 1345 | /** |
1346 | 1346 | * Payment Mode Select. |
@@ -1356,9 +1356,9 @@ discard block |
||
1356 | 1356 | * |
1357 | 1357 | * @return void |
1358 | 1358 | */ |
1359 | -function give_payment_mode_select( $form_id ) { |
|
1359 | +function give_payment_mode_select($form_id) { |
|
1360 | 1360 | |
1361 | - $gateways = give_get_enabled_payment_gateways( $form_id ); |
|
1361 | + $gateways = give_get_enabled_payment_gateways($form_id); |
|
1362 | 1362 | |
1363 | 1363 | /** |
1364 | 1364 | * Fires while selecting payment gateways, before the fields. |
@@ -1367,10 +1367,10 @@ discard block |
||
1367 | 1367 | * |
1368 | 1368 | * @param int $form_id The form ID. |
1369 | 1369 | */ |
1370 | - do_action( 'give_payment_mode_top', $form_id ); |
|
1370 | + do_action('give_payment_mode_top', $form_id); |
|
1371 | 1371 | ?> |
1372 | 1372 | |
1373 | - <fieldset id="give-payment-mode-select" <?php if ( count( $gateways ) <= 1 ) { |
|
1373 | + <fieldset id="give-payment-mode-select" <?php if (count($gateways) <= 1) { |
|
1374 | 1374 | echo 'style="display: none;"'; |
1375 | 1375 | } ?>> |
1376 | 1376 | <?php |
@@ -1381,10 +1381,10 @@ discard block |
||
1381 | 1381 | * |
1382 | 1382 | * @param int $form_id The form ID. |
1383 | 1383 | */ |
1384 | - do_action( 'give_payment_mode_before_gateways_wrap' ); |
|
1384 | + do_action('give_payment_mode_before_gateways_wrap'); |
|
1385 | 1385 | ?> |
1386 | 1386 | <legend |
1387 | - class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', esc_html__( 'Select Payment Method', 'give' ) ); ?> |
|
1387 | + class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', esc_html__('Select Payment Method', 'give')); ?> |
|
1388 | 1388 | <span class="give-loading-text"><span |
1389 | 1389 | class="give-loading-animation"></span> |
1390 | 1390 | </span> |
@@ -1397,26 +1397,26 @@ discard block |
||
1397 | 1397 | * |
1398 | 1398 | * @since 1.7 |
1399 | 1399 | */ |
1400 | - do_action( 'give_payment_mode_before_gateways' ) |
|
1400 | + do_action('give_payment_mode_before_gateways') |
|
1401 | 1401 | ?> |
1402 | 1402 | <ul id="give-gateway-radio-list"> |
1403 | 1403 | <?php |
1404 | 1404 | /** |
1405 | 1405 | * Loop through the active payment gateways. |
1406 | 1406 | */ |
1407 | - $selected_gateway = give_get_chosen_gateway( $form_id ); |
|
1407 | + $selected_gateway = give_get_chosen_gateway($form_id); |
|
1408 | 1408 | |
1409 | - foreach ( $gateways as $gateway_id => $gateway ) : |
|
1409 | + foreach ($gateways as $gateway_id => $gateway) : |
|
1410 | 1410 | //Determine the default gateway. |
1411 | - $checked = checked( $gateway_id, $selected_gateway, false ); |
|
1411 | + $checked = checked($gateway_id, $selected_gateway, false); |
|
1412 | 1412 | $checked_class = $checked ? ' class="give-gateway-option-selected"' : ''; ?> |
1413 | 1413 | <li<?php echo $checked_class ?>> |
1414 | 1414 | <input type="radio" name="payment-mode" class="give-gateway" |
1415 | - id="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>" |
|
1416 | - value="<?php echo esc_attr( $gateway_id ); ?>"<?php echo $checked; ?>> |
|
1417 | - <label for="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>" |
|
1415 | + id="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>" |
|
1416 | + value="<?php echo esc_attr($gateway_id); ?>"<?php echo $checked; ?>> |
|
1417 | + <label for="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>" |
|
1418 | 1418 | class="give-gateway-option" |
1419 | - id="give-gateway-option-<?php echo esc_attr( $gateway_id ); ?>"> <?php echo esc_html( $gateway['checkout_label'] ); ?></label> |
|
1419 | + id="give-gateway-option-<?php echo esc_attr($gateway_id); ?>"> <?php echo esc_html($gateway['checkout_label']); ?></label> |
|
1420 | 1420 | </li> |
1421 | 1421 | <?php |
1422 | 1422 | endforeach; |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | * |
1429 | 1429 | * @since 1.7 |
1430 | 1430 | */ |
1431 | - do_action( 'give_payment_mode_after_gateways' ); |
|
1431 | + do_action('give_payment_mode_after_gateways'); |
|
1432 | 1432 | ?> |
1433 | 1433 | </div> |
1434 | 1434 | <?php |
@@ -1439,7 +1439,7 @@ discard block |
||
1439 | 1439 | * |
1440 | 1440 | * @param int $form_id The form ID. |
1441 | 1441 | */ |
1442 | - do_action( 'give_payment_mode_after_gateways_wrap' ); |
|
1442 | + do_action('give_payment_mode_after_gateways_wrap'); |
|
1443 | 1443 | ?> |
1444 | 1444 | </fieldset> |
1445 | 1445 | |
@@ -1451,7 +1451,7 @@ discard block |
||
1451 | 1451 | * |
1452 | 1452 | * @param int $form_id The form ID. |
1453 | 1453 | */ |
1454 | - do_action( 'give_payment_mode_bottom', $form_id ); |
|
1454 | + do_action('give_payment_mode_bottom', $form_id); |
|
1455 | 1455 | ?> |
1456 | 1456 | |
1457 | 1457 | <div id="give_purchase_form_wrap"> |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | * |
1463 | 1463 | * @since 1.7 |
1464 | 1464 | */ |
1465 | - do_action( 'give_donation_form', $form_id ); |
|
1465 | + do_action('give_donation_form', $form_id); |
|
1466 | 1466 | ?> |
1467 | 1467 | |
1468 | 1468 | </div> |
@@ -1473,10 +1473,10 @@ discard block |
||
1473 | 1473 | * |
1474 | 1474 | * @since 1.7 |
1475 | 1475 | */ |
1476 | - do_action( 'give_donation_form_wrap_bottom', $form_id ); |
|
1476 | + do_action('give_donation_form_wrap_bottom', $form_id); |
|
1477 | 1477 | } |
1478 | 1478 | |
1479 | -add_action( 'give_payment_mode_select', 'give_payment_mode_select' ); |
|
1479 | +add_action('give_payment_mode_select', 'give_payment_mode_select'); |
|
1480 | 1480 | |
1481 | 1481 | /** |
1482 | 1482 | * Renders the Checkout Agree to Terms, this displays a checkbox for users to |
@@ -1489,31 +1489,31 @@ discard block |
||
1489 | 1489 | * |
1490 | 1490 | * @return bool |
1491 | 1491 | */ |
1492 | -function give_terms_agreement( $form_id ) { |
|
1493 | - $form_option = give_get_meta( $form_id, '_give_terms_option', true ); |
|
1492 | +function give_terms_agreement($form_id) { |
|
1493 | + $form_option = give_get_meta($form_id, '_give_terms_option', true); |
|
1494 | 1494 | |
1495 | 1495 | // Bailout if per form and global term and conditions is not setup. |
1496 | 1496 | if ( |
1497 | - give_is_setting_enabled( $form_option, 'global' ) |
|
1498 | - && give_is_setting_enabled( give_get_option( 'terms' ) ) |
|
1497 | + give_is_setting_enabled($form_option, 'global') |
|
1498 | + && give_is_setting_enabled(give_get_option('terms')) |
|
1499 | 1499 | ) { |
1500 | - $label = give_get_option( 'agree_to_terms_label', esc_html__( 'Agree to Terms?', 'give' ) ); |
|
1501 | - $terms = $terms = give_get_option( 'agreement_text', '' ); |
|
1502 | - $edit_term_url = admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=display§ion=term-and-conditions' ); |
|
1500 | + $label = give_get_option('agree_to_terms_label', esc_html__('Agree to Terms?', 'give')); |
|
1501 | + $terms = $terms = give_get_option('agreement_text', ''); |
|
1502 | + $edit_term_url = admin_url('edit.php?post_type=give_forms&page=give-settings&tab=display§ion=term-and-conditions'); |
|
1503 | 1503 | |
1504 | - } elseif ( give_is_setting_enabled( $form_option ) ) { |
|
1505 | - $label = ( $label = give_get_meta( $form_id, '_give_agree_label', true ) ) ? stripslashes( $label ) : esc_html__( 'Agree to Terms?', 'give' ); |
|
1506 | - $terms = give_get_meta( $form_id, '_give_agree_text', true ); |
|
1507 | - $edit_term_url = admin_url( 'post.php?post=' . $form_id . '&action=edit#form_terms_options' ); |
|
1504 | + } elseif (give_is_setting_enabled($form_option)) { |
|
1505 | + $label = ($label = give_get_meta($form_id, '_give_agree_label', true)) ? stripslashes($label) : esc_html__('Agree to Terms?', 'give'); |
|
1506 | + $terms = give_get_meta($form_id, '_give_agree_text', true); |
|
1507 | + $edit_term_url = admin_url('post.php?post='.$form_id.'&action=edit#form_terms_options'); |
|
1508 | 1508 | |
1509 | 1509 | } else { |
1510 | 1510 | return false; |
1511 | 1511 | } |
1512 | 1512 | |
1513 | 1513 | // Bailout: Check if term and conditions text is empty or not. |
1514 | - if ( empty( $terms ) ) { |
|
1515 | - if ( is_user_logged_in() && current_user_can( 'edit_give_forms' ) ) { |
|
1516 | - echo sprintf( __( 'Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give' ), $edit_term_url ); |
|
1514 | + if (empty($terms)) { |
|
1515 | + if (is_user_logged_in() && current_user_can('edit_give_forms')) { |
|
1516 | + echo sprintf(__('Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give'), $edit_term_url); |
|
1517 | 1517 | } |
1518 | 1518 | |
1519 | 1519 | return false; |
@@ -1521,7 +1521,7 @@ discard block |
||
1521 | 1521 | |
1522 | 1522 | ?> |
1523 | 1523 | <fieldset id="give_terms_agreement"> |
1524 | - <legend><?php echo apply_filters( 'give_terms_agreement_text', esc_html__( 'Terms', 'give' ) ); ?></legend> |
|
1524 | + <legend><?php echo apply_filters('give_terms_agreement_text', esc_html__('Terms', 'give')); ?></legend> |
|
1525 | 1525 | <div id="give_terms" class="give_terms-<?php echo $form_id; ?>" style="display:none;"> |
1526 | 1526 | <?php |
1527 | 1527 | /** |
@@ -1529,22 +1529,22 @@ discard block |
||
1529 | 1529 | * |
1530 | 1530 | * @since 1.0 |
1531 | 1531 | */ |
1532 | - do_action( 'give_before_terms' ); |
|
1532 | + do_action('give_before_terms'); |
|
1533 | 1533 | |
1534 | - echo wpautop( stripslashes( $terms ) ); |
|
1534 | + echo wpautop(stripslashes($terms)); |
|
1535 | 1535 | /** |
1536 | 1536 | * Fires while rendering terms of agreement, after the fields. |
1537 | 1537 | * |
1538 | 1538 | * @since 1.0 |
1539 | 1539 | */ |
1540 | - do_action( 'give_after_terms' ); |
|
1540 | + do_action('give_after_terms'); |
|
1541 | 1541 | ?> |
1542 | 1542 | </div> |
1543 | 1543 | <div id="give_show_terms"> |
1544 | 1544 | <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button" |
1545 | - aria-controls="give_terms"><?php esc_html_e( 'Show Terms', 'give' ); ?></a> |
|
1545 | + aria-controls="give_terms"><?php esc_html_e('Show Terms', 'give'); ?></a> |
|
1546 | 1546 | <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button" |
1547 | - aria-controls="give_terms" style="display:none;"><?php esc_html_e( 'Hide Terms', 'give' ); ?></a> |
|
1547 | + aria-controls="give_terms" style="display:none;"><?php esc_html_e('Hide Terms', 'give'); ?></a> |
|
1548 | 1548 | </div> |
1549 | 1549 | |
1550 | 1550 | <input name="give_agree_to_terms" class="required" type="checkbox" |
@@ -1555,7 +1555,7 @@ discard block |
||
1555 | 1555 | <?php |
1556 | 1556 | } |
1557 | 1557 | |
1558 | -add_action( 'give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1 ); |
|
1558 | +add_action('give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1); |
|
1559 | 1559 | |
1560 | 1560 | /** |
1561 | 1561 | * Checkout Final Total. |
@@ -1568,30 +1568,29 @@ discard block |
||
1568 | 1568 | * |
1569 | 1569 | * @return void |
1570 | 1570 | */ |
1571 | -function give_checkout_final_total( $form_id ) { |
|
1571 | +function give_checkout_final_total($form_id) { |
|
1572 | 1572 | |
1573 | - $total = isset( $_POST['give_total'] ) ? |
|
1574 | - apply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give_total'] ) ) : |
|
1575 | - give_get_default_form_amount( $form_id ); |
|
1573 | + $total = isset($_POST['give_total']) ? |
|
1574 | + apply_filters('give_donation_total', give_maybe_sanitize_amount($_POST['give_total'])) : give_get_default_form_amount($form_id); |
|
1576 | 1575 | |
1577 | 1576 | |
1578 | 1577 | //Only proceed if give_total available. |
1579 | - if ( empty( $total ) ) { |
|
1578 | + if (empty($total)) { |
|
1580 | 1579 | return; |
1581 | 1580 | } |
1582 | 1581 | ?> |
1583 | 1582 | <p id="give-final-total-wrap" class="form-wrap "> |
1584 | 1583 | <span class="give-donation-total-label"> |
1585 | - <?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?> |
|
1584 | + <?php echo apply_filters('give_donation_total_label', esc_html__('Donation Total:', 'give')); ?> |
|
1586 | 1585 | </span> |
1587 | - <span class="give-final-total-amount" data-total="<?php echo give_format_amount( $total, array( 'sanitize' => false ) ); ?>"> |
|
1588 | - <?php echo give_currency_filter( give_format_amount( $total , array( 'sanitize' => false ) ) ); ?> |
|
1586 | + <span class="give-final-total-amount" data-total="<?php echo give_format_amount($total, array('sanitize' => false)); ?>"> |
|
1587 | + <?php echo give_currency_filter(give_format_amount($total, array('sanitize' => false))); ?> |
|
1589 | 1588 | </span> |
1590 | 1589 | </p> |
1591 | 1590 | <?php |
1592 | 1591 | } |
1593 | 1592 | |
1594 | -add_action( 'give_donation_form_before_submit', 'give_checkout_final_total', 999 ); |
|
1593 | +add_action('give_donation_form_before_submit', 'give_checkout_final_total', 999); |
|
1595 | 1594 | |
1596 | 1595 | /** |
1597 | 1596 | * Renders the Checkout Submit section. |
@@ -1602,7 +1601,7 @@ discard block |
||
1602 | 1601 | * |
1603 | 1602 | * @return void |
1604 | 1603 | */ |
1605 | -function give_checkout_submit( $form_id ) { |
|
1604 | +function give_checkout_submit($form_id) { |
|
1606 | 1605 | ?> |
1607 | 1606 | <fieldset id="give_purchase_submit"> |
1608 | 1607 | <?php |
@@ -1611,24 +1610,24 @@ discard block |
||
1611 | 1610 | * |
1612 | 1611 | * @since 1.7 |
1613 | 1612 | */ |
1614 | - do_action( 'give_donation_form_before_submit', $form_id ); |
|
1613 | + do_action('give_donation_form_before_submit', $form_id); |
|
1615 | 1614 | |
1616 | - give_checkout_hidden_fields( $form_id ); |
|
1615 | + give_checkout_hidden_fields($form_id); |
|
1617 | 1616 | |
1618 | - echo give_get_donation_form_submit_button( $form_id ); |
|
1617 | + echo give_get_donation_form_submit_button($form_id); |
|
1619 | 1618 | |
1620 | 1619 | /** |
1621 | 1620 | * Fire after donation form submit. |
1622 | 1621 | * |
1623 | 1622 | * @since 1.7 |
1624 | 1623 | */ |
1625 | - do_action( 'give_donation_form_after_submit', $form_id ); |
|
1624 | + do_action('give_donation_form_after_submit', $form_id); |
|
1626 | 1625 | ?> |
1627 | 1626 | </fieldset> |
1628 | 1627 | <?php |
1629 | 1628 | } |
1630 | 1629 | |
1631 | -add_action( 'give_donation_form_after_cc_form', 'give_checkout_submit', 9999 ); |
|
1630 | +add_action('give_donation_form_after_cc_form', 'give_checkout_submit', 9999); |
|
1632 | 1631 | |
1633 | 1632 | /** |
1634 | 1633 | * Give Donation form submit button. |
@@ -1639,10 +1638,10 @@ discard block |
||
1639 | 1638 | * |
1640 | 1639 | * @return string |
1641 | 1640 | */ |
1642 | -function give_get_donation_form_submit_button( $form_id ) { |
|
1641 | +function give_get_donation_form_submit_button($form_id) { |
|
1643 | 1642 | |
1644 | - $display_label_field = give_get_meta( $form_id, '_give_checkout_label', true ); |
|
1645 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) ); |
|
1643 | + $display_label_field = give_get_meta($form_id, '_give_checkout_label', true); |
|
1644 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give')); |
|
1646 | 1645 | ob_start(); |
1647 | 1646 | ?> |
1648 | 1647 | <div class="give-submit-button-wrap give-clearfix"> |
@@ -1650,7 +1649,7 @@ discard block |
||
1650 | 1649 | <span class="give-loading-animation"></span> |
1651 | 1650 | </div> |
1652 | 1651 | <?php |
1653 | - return apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id ); |
|
1652 | + return apply_filters('give_donation_form_submit_button', ob_get_clean(), $form_id); |
|
1654 | 1653 | } |
1655 | 1654 | |
1656 | 1655 | /** |
@@ -1665,17 +1664,17 @@ discard block |
||
1665 | 1664 | * |
1666 | 1665 | * @return mixed |
1667 | 1666 | */ |
1668 | -function give_show_goal_progress( $form_id, $args ) { |
|
1667 | +function give_show_goal_progress($form_id, $args) { |
|
1669 | 1668 | |
1670 | 1669 | ob_start(); |
1671 | - give_get_template( 'shortcode-goal', array( 'form_id' => $form_id, 'args' => $args ) ); |
|
1670 | + give_get_template('shortcode-goal', array('form_id' => $form_id, 'args' => $args)); |
|
1672 | 1671 | |
1673 | - echo apply_filters( 'give_goal_output', ob_get_clean() ); |
|
1672 | + echo apply_filters('give_goal_output', ob_get_clean()); |
|
1674 | 1673 | |
1675 | 1674 | return true; |
1676 | 1675 | } |
1677 | 1676 | |
1678 | -add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 ); |
|
1677 | +add_action('give_pre_form', 'give_show_goal_progress', 10, 2); |
|
1679 | 1678 | |
1680 | 1679 | |
1681 | 1680 | /** |
@@ -1688,10 +1687,10 @@ discard block |
||
1688 | 1687 | * |
1689 | 1688 | * @return mixed|string |
1690 | 1689 | */ |
1691 | -function give_get_form_content_placement( $form_id, $args ) { |
|
1690 | +function give_get_form_content_placement($form_id, $args) { |
|
1692 | 1691 | $show_content = ''; |
1693 | 1692 | |
1694 | - if ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) { |
|
1693 | + if (isset($args['show_content']) && ! empty($args['show_content'])) { |
|
1695 | 1694 | // Content positions. |
1696 | 1695 | $content_placement = array( |
1697 | 1696 | 'above' => 'give_pre_form', |
@@ -1699,18 +1698,18 @@ discard block |
||
1699 | 1698 | ); |
1700 | 1699 | |
1701 | 1700 | // Check if content position already decoded. |
1702 | - if ( in_array( $args['show_content'], $content_placement ) ) { |
|
1701 | + if (in_array($args['show_content'], $content_placement)) { |
|
1703 | 1702 | return $args['show_content']; |
1704 | 1703 | } |
1705 | 1704 | |
1706 | - $show_content = ( 'none' !== $args['show_content'] ? $content_placement[ $args['show_content'] ] : '' ); |
|
1705 | + $show_content = ('none' !== $args['show_content'] ? $content_placement[$args['show_content']] : ''); |
|
1707 | 1706 | |
1708 | - } elseif ( give_is_setting_enabled( give_get_meta( $form_id, '_give_display_content', true ) ) ) { |
|
1709 | - $show_content = give_get_meta( $form_id, '_give_content_placement', true ); |
|
1707 | + } elseif (give_is_setting_enabled(give_get_meta($form_id, '_give_display_content', true))) { |
|
1708 | + $show_content = give_get_meta($form_id, '_give_content_placement', true); |
|
1710 | 1709 | |
1711 | - } elseif ( 'none' !== give_get_meta( $form_id, '_give_content_option', true ) ) { |
|
1710 | + } elseif ('none' !== give_get_meta($form_id, '_give_content_option', true)) { |
|
1712 | 1711 | // Backward compatibility for _give_content_option for v18. |
1713 | - $show_content = give_get_meta( $form_id, '_give_content_option', true ); |
|
1712 | + $show_content = give_get_meta($form_id, '_give_content_option', true); |
|
1714 | 1713 | } |
1715 | 1714 | |
1716 | 1715 | return $show_content; |
@@ -1726,20 +1725,20 @@ discard block |
||
1726 | 1725 | * |
1727 | 1726 | * @return void|bool |
1728 | 1727 | */ |
1729 | -function give_form_content( $form_id, $args ) { |
|
1728 | +function give_form_content($form_id, $args) { |
|
1730 | 1729 | |
1731 | - $show_content = give_get_form_content_placement( $form_id, $args ); |
|
1730 | + $show_content = give_get_form_content_placement($form_id, $args); |
|
1732 | 1731 | |
1733 | 1732 | // Bailout. |
1734 | - if ( empty( $show_content ) ) { |
|
1733 | + if (empty($show_content)) { |
|
1735 | 1734 | return false; |
1736 | 1735 | } |
1737 | 1736 | |
1738 | 1737 | // Add action according to value. |
1739 | - add_action( $show_content, 'give_form_display_content', 10, 2 ); |
|
1738 | + add_action($show_content, 'give_form_display_content', 10, 2); |
|
1740 | 1739 | } |
1741 | 1740 | |
1742 | -add_action( 'give_pre_form_output', 'give_form_content', 10, 2 ); |
|
1741 | +add_action('give_pre_form_output', 'give_form_content', 10, 2); |
|
1743 | 1742 | |
1744 | 1743 | /** |
1745 | 1744 | * Renders Post Form Content. |
@@ -1753,22 +1752,22 @@ discard block |
||
1753 | 1752 | * |
1754 | 1753 | * @return void |
1755 | 1754 | */ |
1756 | -function give_form_display_content( $form_id, $args ) { |
|
1755 | +function give_form_display_content($form_id, $args) { |
|
1757 | 1756 | |
1758 | - $content = wpautop( give_get_meta( $form_id, '_give_form_content', true ) ); |
|
1759 | - $show_content = give_get_form_content_placement( $form_id, $args ); |
|
1757 | + $content = wpautop(give_get_meta($form_id, '_give_form_content', true)); |
|
1758 | + $show_content = give_get_form_content_placement($form_id, $args); |
|
1760 | 1759 | |
1761 | - if ( give_is_setting_enabled( give_get_option( 'the_content_filter' ) ) ) { |
|
1762 | - $content = apply_filters( 'the_content', $content ); |
|
1760 | + if (give_is_setting_enabled(give_get_option('the_content_filter'))) { |
|
1761 | + $content = apply_filters('the_content', $content); |
|
1763 | 1762 | } |
1764 | 1763 | |
1765 | - $output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap ' . $show_content . '-content">' . $content . '</div>'; |
|
1764 | + $output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap '.$show_content.'-content">'.$content.'</div>'; |
|
1766 | 1765 | |
1767 | - echo apply_filters( 'give_form_content_output', $output ); |
|
1766 | + echo apply_filters('give_form_content_output', $output); |
|
1768 | 1767 | |
1769 | 1768 | //remove action to prevent content output on addition forms on page. |
1770 | 1769 | //@see: https://github.com/WordImpress/Give/issues/634. |
1771 | - remove_action( $show_content, 'give_form_display_content' ); |
|
1770 | + remove_action($show_content, 'give_form_display_content'); |
|
1772 | 1771 | } |
1773 | 1772 | |
1774 | 1773 | /** |
@@ -1780,7 +1779,7 @@ discard block |
||
1780 | 1779 | * |
1781 | 1780 | * @return void |
1782 | 1781 | */ |
1783 | -function give_checkout_hidden_fields( $form_id ) { |
|
1782 | +function give_checkout_hidden_fields($form_id) { |
|
1784 | 1783 | |
1785 | 1784 | /** |
1786 | 1785 | * Fires while rendering hidden checkout fields, before the fields. |
@@ -1789,13 +1788,13 @@ discard block |
||
1789 | 1788 | * |
1790 | 1789 | * @param int $form_id The form ID. |
1791 | 1790 | */ |
1792 | - do_action( 'give_hidden_fields_before', $form_id ); |
|
1791 | + do_action('give_hidden_fields_before', $form_id); |
|
1793 | 1792 | |
1794 | - if ( is_user_logged_in() ) { ?> |
|
1793 | + if (is_user_logged_in()) { ?> |
|
1795 | 1794 | <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/> |
1796 | 1795 | <?php } ?> |
1797 | 1796 | <input type="hidden" name="give_action" value="purchase"/> |
1798 | - <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/> |
|
1797 | + <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/> |
|
1799 | 1798 | <?php |
1800 | 1799 | /** |
1801 | 1800 | * Fires while rendering hidden checkout fields, after the fields. |
@@ -1804,7 +1803,7 @@ discard block |
||
1804 | 1803 | * |
1805 | 1804 | * @param int $form_id The form ID. |
1806 | 1805 | */ |
1807 | - do_action( 'give_hidden_fields_after', $form_id ); |
|
1806 | + do_action('give_hidden_fields_after', $form_id); |
|
1808 | 1807 | |
1809 | 1808 | } |
1810 | 1809 | |
@@ -1819,20 +1818,20 @@ discard block |
||
1819 | 1818 | * |
1820 | 1819 | * @return string $content Filtered content. |
1821 | 1820 | */ |
1822 | -function give_filter_success_page_content( $content ) { |
|
1821 | +function give_filter_success_page_content($content) { |
|
1823 | 1822 | |
1824 | 1823 | $give_options = give_get_settings(); |
1825 | 1824 | |
1826 | - if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) { |
|
1827 | - if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) { |
|
1828 | - $content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content ); |
|
1825 | + if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) { |
|
1826 | + if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) { |
|
1827 | + $content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content); |
|
1829 | 1828 | } |
1830 | 1829 | } |
1831 | 1830 | |
1832 | 1831 | return $content; |
1833 | 1832 | } |
1834 | 1833 | |
1835 | -add_filter( 'the_content', 'give_filter_success_page_content' ); |
|
1834 | +add_filter('the_content', 'give_filter_success_page_content'); |
|
1836 | 1835 | |
1837 | 1836 | /** |
1838 | 1837 | * Test Mode Frontend Warning. |
@@ -1843,12 +1842,12 @@ discard block |
||
1843 | 1842 | */ |
1844 | 1843 | function give_test_mode_frontend_warning() { |
1845 | 1844 | |
1846 | - if ( give_is_test_mode() ) { |
|
1847 | - echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . esc_html__( 'Notice:', 'give' ) . '</strong> ' . esc_html__( 'Test mode is enabled. While in test mode no live donations are processed.', 'give' ) . '</p></div>'; |
|
1845 | + if (give_is_test_mode()) { |
|
1846 | + echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>'.esc_html__('Notice:', 'give').'</strong> '.esc_html__('Test mode is enabled. While in test mode no live donations are processed.', 'give').'</p></div>'; |
|
1848 | 1847 | } |
1849 | 1848 | } |
1850 | 1849 | |
1851 | -add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 ); |
|
1850 | +add_action('give_pre_form', 'give_test_mode_frontend_warning', 10); |
|
1852 | 1851 | |
1853 | 1852 | /** |
1854 | 1853 | * Members-only Form. |
@@ -1862,21 +1861,21 @@ discard block |
||
1862 | 1861 | * |
1863 | 1862 | * @return string |
1864 | 1863 | */ |
1865 | -function give_members_only_form( $final_output, $args ) { |
|
1864 | +function give_members_only_form($final_output, $args) { |
|
1866 | 1865 | |
1867 | - $form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0; |
|
1866 | + $form_id = isset($args['form_id']) ? $args['form_id'] : 0; |
|
1868 | 1867 | |
1869 | 1868 | //Sanity Check: Must have form_id & not be logged in. |
1870 | - if ( empty( $form_id ) || is_user_logged_in() ) { |
|
1869 | + if (empty($form_id) || is_user_logged_in()) { |
|
1871 | 1870 | return $final_output; |
1872 | 1871 | } |
1873 | 1872 | |
1874 | 1873 | //Logged in only and Register / Login set to none. |
1875 | - if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) { |
|
1874 | + if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') { |
|
1876 | 1875 | |
1877 | - $final_output = Give()->notices->print_frontend_notice( esc_html__( 'Please log in in order to complete your donation.', 'give' ), false ); |
|
1876 | + $final_output = Give()->notices->print_frontend_notice(esc_html__('Please log in in order to complete your donation.', 'give'), false); |
|
1878 | 1877 | |
1879 | - return apply_filters( 'give_members_only_output', $final_output, $form_id ); |
|
1878 | + return apply_filters('give_members_only_output', $final_output, $form_id); |
|
1880 | 1879 | |
1881 | 1880 | } |
1882 | 1881 | |
@@ -1884,4 +1883,4 @@ discard block |
||
1884 | 1883 | |
1885 | 1884 | } |
1886 | 1885 | |
1887 | -add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 ); |
|
1886 | +add_filter('give_donate_form', 'give_members_only_form', 10, 2); |
@@ -1056,9 +1056,12 @@ |
||
1056 | 1056 | } |
1057 | 1057 | ?> |
1058 | 1058 | </select> |
1059 | - <?php else : ?> |
|
1059 | + <?php else { |
|
1060 | + : ?> |
|
1060 | 1061 | <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" |
1061 | - placeholder="<?php echo $label; ?>"/> |
|
1062 | + placeholder="<?php echo $label; |
|
1063 | +} |
|
1064 | +?>"/> |
|
1062 | 1065 | <?php endif; ?> |
1063 | 1066 | </p> |
1064 | 1067 | <?php |
@@ -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 | |
@@ -30,54 +30,54 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @return bool|array List of all user donations. |
32 | 32 | */ |
33 | -function give_get_users_donations( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) { |
|
33 | +function give_get_users_donations($user = 0, $number = 20, $pagination = false, $status = 'complete') { |
|
34 | 34 | |
35 | - if ( empty( $user ) ) { |
|
35 | + if (empty($user)) { |
|
36 | 36 | $user = get_current_user_id(); |
37 | 37 | } |
38 | 38 | |
39 | - if ( 0 === $user && ! Give()->email_access->token_exists ) { |
|
39 | + if (0 === $user && ! Give()->email_access->token_exists) { |
|
40 | 40 | return false; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $status = $status === 'complete' ? 'publish' : $status; |
44 | 44 | $paged = 1; |
45 | 45 | |
46 | - if ( $pagination ) { |
|
47 | - if ( get_query_var( 'paged' ) ) { |
|
48 | - $paged = get_query_var( 'paged' ); |
|
49 | - } elseif ( get_query_var( 'page' ) ) { |
|
50 | - $paged = get_query_var( 'page' ); |
|
46 | + if ($pagination) { |
|
47 | + if (get_query_var('paged')) { |
|
48 | + $paged = get_query_var('paged'); |
|
49 | + } elseif (get_query_var('page')) { |
|
50 | + $paged = get_query_var('page'); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - $args = apply_filters( 'give_get_users_donations_args', array( |
|
54 | + $args = apply_filters('give_get_users_donations_args', array( |
|
55 | 55 | 'user' => $user, |
56 | 56 | 'number' => $number, |
57 | 57 | 'status' => $status, |
58 | 58 | 'orderby' => 'date', |
59 | - ) ); |
|
59 | + )); |
|
60 | 60 | |
61 | - if ( $pagination ) { |
|
61 | + if ($pagination) { |
|
62 | 62 | $args['page'] = $paged; |
63 | 63 | } else { |
64 | 64 | $args['nopaging'] = true; |
65 | 65 | } |
66 | 66 | |
67 | - $by_user_id = is_numeric( $user ) ? true : false; |
|
68 | - $donor = new Give_Donor( $user, $by_user_id ); |
|
67 | + $by_user_id = is_numeric($user) ? true : false; |
|
68 | + $donor = new Give_Donor($user, $by_user_id); |
|
69 | 69 | |
70 | - if ( ! empty( $donor->payment_ids ) ) { |
|
70 | + if ( ! empty($donor->payment_ids)) { |
|
71 | 71 | |
72 | - unset( $args['user'] ); |
|
73 | - $args['post__in'] = array_map( 'absint', explode( ',', $donor->payment_ids ) ); |
|
72 | + unset($args['user']); |
|
73 | + $args['post__in'] = array_map('absint', explode(',', $donor->payment_ids)); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 | |
77 | - $donations = give_get_payments( apply_filters( 'give_get_users_donations_args', $args ) ); |
|
77 | + $donations = give_get_payments(apply_filters('give_get_users_donations_args', $args)); |
|
78 | 78 | |
79 | 79 | // No donations |
80 | - if ( ! $donations ) { |
|
80 | + if ( ! $donations) { |
|
81 | 81 | return false; |
82 | 82 | } |
83 | 83 | |
@@ -96,65 +96,65 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return bool|object List of unique forms donated by user |
98 | 98 | */ |
99 | -function give_get_users_completed_donations( $user = 0, $status = 'complete' ) { |
|
100 | - if ( empty( $user ) ) { |
|
99 | +function give_get_users_completed_donations($user = 0, $status = 'complete') { |
|
100 | + if (empty($user)) { |
|
101 | 101 | $user = get_current_user_id(); |
102 | 102 | } |
103 | 103 | |
104 | - if ( empty( $user ) ) { |
|
104 | + if (empty($user)) { |
|
105 | 105 | return false; |
106 | 106 | } |
107 | 107 | |
108 | - $by_user_id = is_numeric( $user ) ? true : false; |
|
108 | + $by_user_id = is_numeric($user) ? true : false; |
|
109 | 109 | |
110 | - $donor = new Give_Donor( $user, $by_user_id ); |
|
110 | + $donor = new Give_Donor($user, $by_user_id); |
|
111 | 111 | |
112 | - if ( empty( $donor->payment_ids ) ) { |
|
112 | + if (empty($donor->payment_ids)) { |
|
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | |
116 | 116 | // Get all the items donated. |
117 | - $payment_ids = array_reverse( explode( ',', $donor->payment_ids ) ); |
|
118 | - $limit_payments = apply_filters( 'give_users_completed_donations_payments', 50 ); |
|
119 | - if ( ! empty( $limit_payments ) ) { |
|
120 | - $payment_ids = array_slice( $payment_ids, 0, $limit_payments ); |
|
117 | + $payment_ids = array_reverse(explode(',', $donor->payment_ids)); |
|
118 | + $limit_payments = apply_filters('give_users_completed_donations_payments', 50); |
|
119 | + if ( ! empty($limit_payments)) { |
|
120 | + $payment_ids = array_slice($payment_ids, 0, $limit_payments); |
|
121 | 121 | } |
122 | 122 | $donation_data = array(); |
123 | - foreach ( $payment_ids as $payment_id ) { |
|
124 | - $donation_data[] = give_get_payment_meta( $payment_id ); |
|
123 | + foreach ($payment_ids as $payment_id) { |
|
124 | + $donation_data[] = give_get_payment_meta($payment_id); |
|
125 | 125 | } |
126 | 126 | |
127 | - if ( empty( $donation_data ) ) { |
|
127 | + if (empty($donation_data)) { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
131 | 131 | // Grab only the post ids "form_id" of the forms donated on this order |
132 | 132 | $completed_donations_ids = array(); |
133 | - foreach ( $donation_data as $donation_meta ) { |
|
134 | - $completed_donations_ids[] = isset( $donation_meta['form_id'] ) ? $donation_meta['form_id'] : ''; |
|
133 | + foreach ($donation_data as $donation_meta) { |
|
134 | + $completed_donations_ids[] = isset($donation_meta['form_id']) ? $donation_meta['form_id'] : ''; |
|
135 | 135 | } |
136 | 136 | |
137 | - if ( empty( $completed_donations_ids ) ) { |
|
137 | + if (empty($completed_donations_ids)) { |
|
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | |
141 | 141 | // Only include each donation once |
142 | - $form_ids = array_unique( $completed_donations_ids ); |
|
142 | + $form_ids = array_unique($completed_donations_ids); |
|
143 | 143 | |
144 | 144 | // Make sure we still have some products and a first item |
145 | - if ( empty( $form_ids ) || ! isset( $form_ids[0] ) ) { |
|
145 | + if (empty($form_ids) || ! isset($form_ids[0])) { |
|
146 | 146 | return false; |
147 | 147 | } |
148 | 148 | |
149 | - $post_type = get_post_type( $form_ids[0] ); |
|
149 | + $post_type = get_post_type($form_ids[0]); |
|
150 | 150 | |
151 | - $args = apply_filters( 'give_get_users_completed_donations_args', array( |
|
151 | + $args = apply_filters('give_get_users_completed_donations_args', array( |
|
152 | 152 | 'include' => $form_ids, |
153 | 153 | 'post_type' => $post_type, |
154 | - 'posts_per_page' => - 1, |
|
155 | - ) ); |
|
154 | + 'posts_per_page' => -1, |
|
155 | + )); |
|
156 | 156 | |
157 | - return apply_filters( 'give_users_completed_donations_list', get_posts( $args ) ); |
|
157 | + return apply_filters('give_users_completed_donations_list', get_posts($args)); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @return bool True if has donated, false other wise. |
172 | 172 | */ |
173 | -function give_has_donations( $user_id = null ) { |
|
174 | - if ( empty( $user_id ) ) { |
|
173 | +function give_has_donations($user_id = null) { |
|
174 | + if (empty($user_id)) { |
|
175 | 175 | $user_id = get_current_user_id(); |
176 | 176 | } |
177 | 177 | |
178 | - if ( give_get_users_donations( $user_id, 1 ) ) { |
|
178 | + if (give_get_users_donations($user_id, 1)) { |
|
179 | 179 | return true; // User has at least one donation. |
180 | 180 | } |
181 | 181 | |
@@ -196,23 +196,23 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @return array |
198 | 198 | */ |
199 | -function give_get_donation_stats_by_user( $user = '' ) { |
|
199 | +function give_get_donation_stats_by_user($user = '') { |
|
200 | 200 | |
201 | 201 | $field = ''; |
202 | 202 | |
203 | - if ( is_email( $user ) ) { |
|
203 | + if (is_email($user)) { |
|
204 | 204 | $field = 'email'; |
205 | - } elseif ( is_numeric( $user ) ) { |
|
205 | + } elseif (is_numeric($user)) { |
|
206 | 206 | $field = 'user_id'; |
207 | 207 | } |
208 | 208 | |
209 | - $stats = array(); |
|
210 | - $donor = Give()->donors->get_donor_by( $field, $user ); |
|
209 | + $stats = array(); |
|
210 | + $donor = Give()->donors->get_donor_by($field, $user); |
|
211 | 211 | |
212 | - if ( $donor ) { |
|
213 | - $donor = new Give_Donor( $donor->id ); |
|
214 | - $stats['purchases'] = absint( $donor->purchase_count ); |
|
215 | - $stats['total_spent'] = give_maybe_sanitize_amount( $donor->purchase_value ); |
|
212 | + if ($donor) { |
|
213 | + $donor = new Give_Donor($donor->id); |
|
214 | + $stats['purchases'] = absint($donor->purchase_count); |
|
215 | + $stats['total_spent'] = give_maybe_sanitize_amount($donor->purchase_value); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * |
221 | 221 | * @since 1.7 |
222 | 222 | */ |
223 | - $stats = (array) apply_filters( 'give_donation_stats_by_user', $stats, $user ); |
|
223 | + $stats = (array) apply_filters('give_donation_stats_by_user', $stats, $user); |
|
224 | 224 | |
225 | 225 | return $stats; |
226 | 226 | } |
@@ -238,21 +238,21 @@ discard block |
||
238 | 238 | * |
239 | 239 | * @return int The total number of donations. |
240 | 240 | */ |
241 | -function give_count_donations_of_donor( $user = null ) { |
|
241 | +function give_count_donations_of_donor($user = null) { |
|
242 | 242 | |
243 | 243 | // Logged in? |
244 | - if ( empty( $user ) ) { |
|
244 | + if (empty($user)) { |
|
245 | 245 | $user = get_current_user_id(); |
246 | 246 | } |
247 | 247 | |
248 | 248 | // Email access? |
249 | - if ( empty( $user ) && Give()->email_access->token_email ) { |
|
249 | + if (empty($user) && Give()->email_access->token_email) { |
|
250 | 250 | $user = Give()->email_access->token_email; |
251 | 251 | } |
252 | 252 | |
253 | - $stats = ! empty( $user ) ? give_get_donation_stats_by_user( $user ) : false; |
|
253 | + $stats = ! empty($user) ? give_get_donation_stats_by_user($user) : false; |
|
254 | 254 | |
255 | - return isset( $stats['purchases'] ) ? $stats['purchases'] : 0; |
|
255 | + return isset($stats['purchases']) ? $stats['purchases'] : 0; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -265,9 +265,9 @@ discard block |
||
265 | 265 | * |
266 | 266 | * @return float The total amount the user has spent |
267 | 267 | */ |
268 | -function give_donation_total_of_user( $user = null ) { |
|
268 | +function give_donation_total_of_user($user = null) { |
|
269 | 269 | |
270 | - $stats = give_get_donation_stats_by_user( $user ); |
|
270 | + $stats = give_get_donation_stats_by_user($user); |
|
271 | 271 | |
272 | 272 | return $stats['total_spent']; |
273 | 273 | } |
@@ -283,40 +283,40 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @return bool |
285 | 285 | */ |
286 | -function give_validate_username( $username, $form_id = 0 ) { |
|
286 | +function give_validate_username($username, $form_id = 0) { |
|
287 | 287 | $valid = true; |
288 | 288 | |
289 | 289 | // Validate username. |
290 | - if ( ! empty( $username ) ) { |
|
290 | + if ( ! empty($username)) { |
|
291 | 291 | |
292 | 292 | // Sanitize username. |
293 | - $sanitized_user_name = sanitize_user( $username, false ); |
|
293 | + $sanitized_user_name = sanitize_user($username, false); |
|
294 | 294 | |
295 | 295 | // We have an user name, check if it already exists. |
296 | - if ( username_exists( $username ) ) { |
|
296 | + if (username_exists($username)) { |
|
297 | 297 | // Username already registered. |
298 | - give_set_error( 'username_unavailable', __( 'Username already taken.', 'give' ) ); |
|
298 | + give_set_error('username_unavailable', __('Username already taken.', 'give')); |
|
299 | 299 | $valid = false; |
300 | 300 | |
301 | 301 | // Check if it's valid. |
302 | - } elseif ( $sanitized_user_name !== $username ) { |
|
302 | + } elseif ($sanitized_user_name !== $username) { |
|
303 | 303 | // Invalid username. |
304 | - if ( is_multisite() ) { |
|
305 | - give_set_error( 'username_invalid', __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ) ); |
|
304 | + if (is_multisite()) { |
|
305 | + give_set_error('username_invalid', __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give')); |
|
306 | 306 | $valid = false; |
307 | 307 | } else { |
308 | - give_set_error( 'username_invalid', __( 'Invalid username.', 'give' ) ); |
|
308 | + give_set_error('username_invalid', __('Invalid username.', 'give')); |
|
309 | 309 | $valid = false; |
310 | 310 | } |
311 | 311 | } |
312 | 312 | } else { |
313 | 313 | // Username is empty. |
314 | - give_set_error( 'username_empty', __( 'Enter a username.', 'give' ) ); |
|
314 | + give_set_error('username_empty', __('Enter a username.', 'give')); |
|
315 | 315 | $valid = false; |
316 | 316 | |
317 | 317 | // Check if guest checkout is disable for form. |
318 | - if ( $form_id && give_logged_in_only( $form_id ) ) { |
|
319 | - give_set_error( 'registration_required', __( 'You must register or login to complete your donation.', 'give' ) ); |
|
318 | + if ($form_id && give_logged_in_only($form_id)) { |
|
319 | + give_set_error('registration_required', __('You must register or login to complete your donation.', 'give')); |
|
320 | 320 | $valid = false; |
321 | 321 | } |
322 | 322 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * @param string $username |
331 | 331 | * @param bool $form_id |
332 | 332 | */ |
333 | - $valid = (bool) apply_filters( 'give_validate_username', $valid, $username, $form_id ); |
|
333 | + $valid = (bool) apply_filters('give_validate_username', $valid, $username, $form_id); |
|
334 | 334 | |
335 | 335 | return $valid; |
336 | 336 | } |
@@ -346,22 +346,22 @@ discard block |
||
346 | 346 | * |
347 | 347 | * @return bool |
348 | 348 | */ |
349 | -function give_validate_user_email( $email, $registering_new_user = false ) { |
|
349 | +function give_validate_user_email($email, $registering_new_user = false) { |
|
350 | 350 | $valid = true; |
351 | 351 | |
352 | - if ( empty( $email ) ) { |
|
352 | + if (empty($email)) { |
|
353 | 353 | // No email. |
354 | - give_set_error( 'email_empty', __( 'Enter an email.', 'give' ) ); |
|
354 | + give_set_error('email_empty', __('Enter an email.', 'give')); |
|
355 | 355 | $valid = false; |
356 | 356 | |
357 | - } elseif ( ! is_email( $email ) ) { |
|
357 | + } elseif ( ! is_email($email)) { |
|
358 | 358 | // Validate email. |
359 | - give_set_error( 'email_invalid', __( 'Invalid email.', 'give' ) ); |
|
359 | + give_set_error('email_invalid', __('Invalid email.', 'give')); |
|
360 | 360 | $valid = false; |
361 | 361 | |
362 | - } elseif ( $registering_new_user && ( give_donor_email_exists( $email ) || email_exists( $email ) ) ) { |
|
362 | + } elseif ($registering_new_user && (give_donor_email_exists($email) || email_exists($email))) { |
|
363 | 363 | // Check if email exists. |
364 | - give_set_error( 'email_used', __( 'The email address provided is already active for another user.', 'give' ) ); |
|
364 | + give_set_error('email_used', __('The email address provided is already active for another user.', 'give')); |
|
365 | 365 | $valid = false; |
366 | 366 | } |
367 | 367 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | * @param string $email |
375 | 375 | * @param bool $registering_new_user |
376 | 376 | */ |
377 | - $valid = (bool) apply_filters( 'give_validate_user_email', $valid, $email, $registering_new_user ); |
|
377 | + $valid = (bool) apply_filters('give_validate_user_email', $valid, $email, $registering_new_user); |
|
378 | 378 | |
379 | 379 | return $valid; |
380 | 380 | } |
@@ -390,34 +390,34 @@ discard block |
||
390 | 390 | * |
391 | 391 | * @return bool |
392 | 392 | */ |
393 | -function give_validate_user_password( $password = '', $confirm_password = '', $registering_new_user = false ) { |
|
393 | +function give_validate_user_password($password = '', $confirm_password = '', $registering_new_user = false) { |
|
394 | 394 | $valid = true; |
395 | 395 | |
396 | 396 | // Passwords Validation For New Donors Only |
397 | - if ( $registering_new_user ) { |
|
397 | + if ($registering_new_user) { |
|
398 | 398 | // Password or confirmation missing. |
399 | - if ( ! $password ) { |
|
399 | + if ( ! $password) { |
|
400 | 400 | // The password is invalid. |
401 | - give_set_error( 'password_empty', __( 'Enter a password.', 'give' ) ); |
|
401 | + give_set_error('password_empty', __('Enter a password.', 'give')); |
|
402 | 402 | $valid = false; |
403 | - } elseif ( ! $confirm_password ) { |
|
403 | + } elseif ( ! $confirm_password) { |
|
404 | 404 | // Confirmation password is invalid. |
405 | - give_set_error( 'confirmation_empty', __( 'Enter the password confirmation.', 'give' ) ); |
|
405 | + give_set_error('confirmation_empty', __('Enter the password confirmation.', 'give')); |
|
406 | 406 | $valid = false; |
407 | 407 | } |
408 | 408 | } |
409 | 409 | // Passwords Validation For New Donors as well as Existing Donors |
410 | - if( $password || $confirm_password ) { |
|
411 | - if ( strlen( $password ) < 6 || strlen( $confirm_password ) < 6 ) { |
|
410 | + if ($password || $confirm_password) { |
|
411 | + if (strlen($password) < 6 || strlen($confirm_password) < 6) { |
|
412 | 412 | // Seems Weak Password |
413 | - give_set_error( 'password_weak', __( 'Passwords should have atleast 6 characters.', 'give' ) ); |
|
413 | + give_set_error('password_weak', __('Passwords should have atleast 6 characters.', 'give')); |
|
414 | 414 | $valid = false; |
415 | 415 | } |
416 | - if ( $password && $confirm_password ) { |
|
416 | + if ($password && $confirm_password) { |
|
417 | 417 | // Verify confirmation matches. |
418 | - if ( $password != $confirm_password ) { |
|
418 | + if ($password != $confirm_password) { |
|
419 | 419 | // Passwords do not match |
420 | - give_set_error( 'password_mismatch', __( 'Passwords you entered do not match. Please try again.', 'give' ) ); |
|
420 | + give_set_error('password_mismatch', __('Passwords you entered do not match. Please try again.', 'give')); |
|
421 | 421 | $valid = false; |
422 | 422 | } |
423 | 423 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | * @param string $confirm_password |
434 | 434 | * @param bool $registering_new_user |
435 | 435 | */ |
436 | - $valid = (bool) apply_filters( 'give_validate_user_email', $valid, $password, $confirm_password, $registering_new_user ); |
|
436 | + $valid = (bool) apply_filters('give_validate_user_email', $valid, $password, $confirm_password, $registering_new_user); |
|
437 | 437 | |
438 | 438 | return $valid; |
439 | 439 | } |
@@ -451,33 +451,33 @@ discard block |
||
451 | 451 | * |
452 | 452 | * @return void |
453 | 453 | */ |
454 | -function give_add_past_donations_to_new_user( $user_id ) { |
|
454 | +function give_add_past_donations_to_new_user($user_id) { |
|
455 | 455 | |
456 | - $email = get_the_author_meta( 'user_email', $user_id ); |
|
456 | + $email = get_the_author_meta('user_email', $user_id); |
|
457 | 457 | |
458 | - $payments = give_get_payments( array( |
|
458 | + $payments = give_get_payments(array( |
|
459 | 459 | 's' => $email, |
460 | - ) ); |
|
460 | + )); |
|
461 | 461 | |
462 | - if ( $payments ) { |
|
463 | - foreach ( $payments as $payment ) { |
|
464 | - if ( intval( give_get_payment_user_id( $payment->ID ) ) > 0 ) { |
|
462 | + if ($payments) { |
|
463 | + foreach ($payments as $payment) { |
|
464 | + if (intval(give_get_payment_user_id($payment->ID)) > 0) { |
|
465 | 465 | continue; |
466 | 466 | } // End if(). |
467 | 467 | |
468 | - $meta = give_get_payment_meta( $payment->ID ); |
|
469 | - $meta['user_info'] = maybe_unserialize( $meta['user_info'] ); |
|
468 | + $meta = give_get_payment_meta($payment->ID); |
|
469 | + $meta['user_info'] = maybe_unserialize($meta['user_info']); |
|
470 | 470 | $meta['user_info']['id'] = $user_id; |
471 | 471 | |
472 | 472 | // Store the updated user ID in the payment meta. |
473 | - give_update_payment_meta( $payment->ID, '_give_payment_meta', $meta ); |
|
474 | - give_update_payment_meta( $payment->ID, '_give_payment_user_id', $user_id ); |
|
473 | + give_update_payment_meta($payment->ID, '_give_payment_meta', $meta); |
|
474 | + give_update_payment_meta($payment->ID, '_give_payment_user_id', $user_id); |
|
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
478 | 478 | } |
479 | 479 | |
480 | -add_action( 'user_register', 'give_add_past_donations_to_new_user' ); |
|
480 | +add_action('user_register', 'give_add_past_donations_to_new_user'); |
|
481 | 481 | |
482 | 482 | |
483 | 483 | /** |
@@ -503,34 +503,34 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @return array The donor's address, if any |
505 | 505 | */ |
506 | -function give_get_donor_address( $user_id = 0 ) { |
|
507 | - if ( empty( $user_id ) ) { |
|
506 | +function give_get_donor_address($user_id = 0) { |
|
507 | + if (empty($user_id)) { |
|
508 | 508 | $user_id = get_current_user_id(); |
509 | 509 | } |
510 | 510 | |
511 | - $address = get_user_meta( $user_id, '_give_user_address', true ); |
|
511 | + $address = get_user_meta($user_id, '_give_user_address', true); |
|
512 | 512 | |
513 | - if ( ! isset( $address['line1'] ) ) { |
|
513 | + if ( ! isset($address['line1'])) { |
|
514 | 514 | $address['line1'] = ''; |
515 | 515 | } |
516 | 516 | |
517 | - if ( ! isset( $address['line2'] ) ) { |
|
517 | + if ( ! isset($address['line2'])) { |
|
518 | 518 | $address['line2'] = ''; |
519 | 519 | } |
520 | 520 | |
521 | - if ( ! isset( $address['city'] ) ) { |
|
521 | + if ( ! isset($address['city'])) { |
|
522 | 522 | $address['city'] = ''; |
523 | 523 | } |
524 | 524 | |
525 | - if ( ! isset( $address['zip'] ) ) { |
|
525 | + if ( ! isset($address['zip'])) { |
|
526 | 526 | $address['zip'] = ''; |
527 | 527 | } |
528 | 528 | |
529 | - if ( ! isset( $address['country'] ) ) { |
|
529 | + if ( ! isset($address['country'])) { |
|
530 | 530 | $address['country'] = ''; |
531 | 531 | } |
532 | 532 | |
533 | - if ( ! isset( $address['state'] ) ) { |
|
533 | + if ( ! isset($address['state'])) { |
|
534 | 534 | $address['state'] = ''; |
535 | 535 | } |
536 | 536 | |
@@ -550,32 +550,32 @@ discard block |
||
550 | 550 | * |
551 | 551 | * @return void |
552 | 552 | */ |
553 | -function give_new_user_notification( $user_id = 0, $user_data = array() ) { |
|
553 | +function give_new_user_notification($user_id = 0, $user_data = array()) { |
|
554 | 554 | |
555 | - if ( empty( $user_id ) || empty( $user_data ) ) { |
|
555 | + if (empty($user_id) || empty($user_data)) { |
|
556 | 556 | return; |
557 | 557 | } |
558 | - $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); |
|
558 | + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); |
|
559 | 559 | |
560 | 560 | |
561 | 561 | // New User Registration: Email sends to the site admin. |
562 | 562 | $emails = Give()->emails; |
563 | - $emails->__set( 'heading', esc_html__( 'New User Registration', 'give' ) ); |
|
563 | + $emails->__set('heading', esc_html__('New User Registration', 'give')); |
|
564 | 564 | |
565 | 565 | /* translators: %s: site name */ |
566 | - $message = sprintf( esc_attr__( 'A new user has registered on %s:', 'give' ), $blogname ) . "\r\n\r\n"; |
|
566 | + $message = sprintf(esc_attr__('A new user has registered on %s:', 'give'), $blogname)."\r\n\r\n"; |
|
567 | 567 | /* translators: %s: user login */ |
568 | - $message .= '<strong>' . esc_attr__( 'Username:', 'give' ) . '</strong> ' . $user_data['user_login'] . "\r\n"; |
|
568 | + $message .= '<strong>'.esc_attr__('Username:', 'give').'</strong> '.$user_data['user_login']."\r\n"; |
|
569 | 569 | /* translators: %s: user email */ |
570 | - $message .= '<strong>' . esc_attr__( 'E-mail:', 'give' ) . '</strong> ' . $user_data['user_email'] . "\r\n\r\n"; |
|
570 | + $message .= '<strong>'.esc_attr__('E-mail:', 'give').'</strong> '.$user_data['user_email']."\r\n\r\n"; |
|
571 | 571 | |
572 | - $message .= '<a href="' . admin_url('user-edit.php?user_id=' . $user_id) . '" target="_blank"> ' . esc_attr__( 'Click here to view »', 'give' ) . '</a>' . "\r\n"; |
|
572 | + $message .= '<a href="'.admin_url('user-edit.php?user_id='.$user_id).'" target="_blank"> '.esc_attr__('Click here to view »', 'give').'</a>'."\r\n"; |
|
573 | 573 | |
574 | 574 | $emails->send( |
575 | - get_option( 'admin_email' ), |
|
575 | + get_option('admin_email'), |
|
576 | 576 | sprintf( |
577 | 577 | /* translators: %s: site name */ |
578 | - esc_attr__( '[%s] New User Registration', 'give' ), |
|
578 | + esc_attr__('[%s] New User Registration', 'give'), |
|
579 | 579 | $blogname |
580 | 580 | ), |
581 | 581 | $message |
@@ -583,22 +583,22 @@ discard block |
||
583 | 583 | |
584 | 584 | |
585 | 585 | // Account Information: Email sends to donor who registered. |
586 | - $emails->__set( 'heading', esc_html__( 'Account Information', 'give' ) ); |
|
586 | + $emails->__set('heading', esc_html__('Account Information', 'give')); |
|
587 | 587 | |
588 | - $message = sprintf( esc_attr__( 'The following email contains your account information for %s:', 'give' ), $blogname ) . "\r\n\r\n"; |
|
588 | + $message = sprintf(esc_attr__('The following email contains your account information for %s:', 'give'), $blogname)."\r\n\r\n"; |
|
589 | 589 | |
590 | 590 | /* translators: %s: user login */ |
591 | - $message .= '<strong>' . esc_attr__( 'Username:', 'give' ) . '</strong> ' . $user_data['user_login'] . "\r\n"; |
|
591 | + $message .= '<strong>'.esc_attr__('Username:', 'give').'</strong> '.$user_data['user_login']."\r\n"; |
|
592 | 592 | /* translators: %s: password */ |
593 | - $message .= '<strong>' . esc_attr__( 'Password:', 'give' ) . '</strong> ' . esc_attr__( '[Password entered during donation]', 'give' ) . "\r\n\r\n"; |
|
593 | + $message .= '<strong>'.esc_attr__('Password:', 'give').'</strong> '.esc_attr__('[Password entered during donation]', 'give')."\r\n\r\n"; |
|
594 | 594 | |
595 | - $message .= '<a href="' . wp_login_url() . '" target="_blank"> ' . esc_attr__( 'Click here to login »', 'give' ) . '</a>' . "\r\n"; |
|
595 | + $message .= '<a href="'.wp_login_url().'" target="_blank"> '.esc_attr__('Click here to login »', 'give').'</a>'."\r\n"; |
|
596 | 596 | |
597 | 597 | $emails->send( |
598 | 598 | $user_data['user_email'], |
599 | 599 | sprintf( |
600 | 600 | /* translators: %s: site name */ |
601 | - esc_attr__( '[%s] Your username and password', 'give' ), |
|
601 | + esc_attr__('[%s] Your username and password', 'give'), |
|
602 | 602 | $blogname |
603 | 603 | ), |
604 | 604 | $message |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | |
607 | 607 | } |
608 | 608 | |
609 | -add_action( 'give_insert_user', 'give_new_user_notification', 10, 2 ); |
|
609 | +add_action('give_insert_user', 'give_new_user_notification', 10, 2); |
|
610 | 610 | |
611 | 611 | |
612 | 612 | /** |
@@ -622,34 +622,34 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @return string |
624 | 624 | */ |
625 | -function give_get_donor_name_by( $id = 0, $from = 'donation' ) { |
|
625 | +function give_get_donor_name_by($id = 0, $from = 'donation') { |
|
626 | 626 | |
627 | 627 | // ID shouldn't be empty |
628 | - if ( empty( $id ) ) { |
|
628 | + if (empty($id)) { |
|
629 | 629 | return; |
630 | 630 | } |
631 | 631 | |
632 | 632 | $name = ''; |
633 | 633 | |
634 | - switch ( $from ) { |
|
634 | + switch ($from) { |
|
635 | 635 | |
636 | 636 | case 'donation': |
637 | 637 | |
638 | - $user_info = give_get_payment_meta_user_info( $id ); |
|
639 | - $name = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
638 | + $user_info = give_get_payment_meta_user_info($id); |
|
639 | + $name = $user_info['first_name'].' '.$user_info['last_name']; |
|
640 | 640 | |
641 | 641 | break; |
642 | 642 | |
643 | 643 | case 'donor': |
644 | 644 | |
645 | - $donor = new Give_Donor( $id ); |
|
645 | + $donor = new Give_Donor($id); |
|
646 | 646 | $name = $donor->name; |
647 | 647 | |
648 | 648 | break; |
649 | 649 | |
650 | 650 | } |
651 | 651 | |
652 | - return trim( $name ); |
|
652 | + return trim($name); |
|
653 | 653 | |
654 | 654 | } |
655 | 655 | |
@@ -661,8 +661,8 @@ discard block |
||
661 | 661 | * @param string $email Donor Email. |
662 | 662 | * @return boolean The user's ID on success, and false on failure. |
663 | 663 | */ |
664 | -function give_donor_email_exists( $email ) { |
|
665 | - if ( Give()->donors->get_donor_by( 'email', $email ) ) { |
|
664 | +function give_donor_email_exists($email) { |
|
665 | + if (Give()->donors->get_donor_by('email', $email)) { |
|
666 | 666 | return true; |
667 | 667 | } |
668 | 668 | return false; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | // Exit if accessed directly. |
26 | -if ( ! defined( 'ABSPATH' ) ) { |
|
26 | +if ( ! defined('ABSPATH')) { |
|
27 | 27 | exit; |
28 | 28 | } |
29 | 29 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | * @param string $description Email tag description text |
56 | 56 | * @param callable $func Hook to run when email tag is found |
57 | 57 | */ |
58 | - public function add( $tag, $description, $func ) { |
|
59 | - if ( is_callable( $func ) ) { |
|
60 | - $this->tags[ $tag ] = array( |
|
58 | + public function add($tag, $description, $func) { |
|
59 | + if (is_callable($func)) { |
|
60 | + $this->tags[$tag] = array( |
|
61 | 61 | 'tag' => $tag, |
62 | 62 | 'description' => $description, |
63 | 63 | 'func' => $func |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param string $tag Email tag to remove hook from |
74 | 74 | */ |
75 | - public function remove( $tag ) { |
|
76 | - unset( $this->tags[ $tag ] ); |
|
75 | + public function remove($tag) { |
|
76 | + unset($this->tags[$tag]); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return bool |
87 | 87 | */ |
88 | - public function email_tag_exists( $tag ) { |
|
89 | - return array_key_exists( $tag, $this->tags ); |
|
88 | + public function email_tag_exists($tag) { |
|
89 | + return array_key_exists($tag, $this->tags); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return string Content with email tags filtered out. |
112 | 112 | */ |
113 | - public function do_tags( $content, $payment_id ) { |
|
113 | + public function do_tags($content, $payment_id) { |
|
114 | 114 | |
115 | 115 | // Check if there is at least one tag added. |
116 | - if ( empty( $this->tags ) || ! is_array( $this->tags ) ) { |
|
116 | + if (empty($this->tags) || ! is_array($this->tags)) { |
|
117 | 117 | return $content; |
118 | 118 | } |
119 | 119 | |
120 | 120 | $this->payment_id = $payment_id; |
121 | 121 | |
122 | - $new_content = preg_replace_callback( "/{([A-z0-9\-\_]+)}/s", array( $this, 'do_tag' ), $content ); |
|
122 | + $new_content = preg_replace_callback("/{([A-z0-9\-\_]+)}/s", array($this, 'do_tag'), $content); |
|
123 | 123 | |
124 | 124 | $this->payment_id = null; |
125 | 125 | |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return mixed |
137 | 137 | */ |
138 | - public function do_tag( $m ) { |
|
138 | + public function do_tag($m) { |
|
139 | 139 | |
140 | 140 | // Get tag |
141 | 141 | $tag = $m[1]; |
142 | 142 | |
143 | 143 | // Return tag if tag not set |
144 | - if ( ! $this->email_tag_exists( $tag ) ) { |
|
144 | + if ( ! $this->email_tag_exists($tag)) { |
|
145 | 145 | return $m[0]; |
146 | 146 | } |
147 | 147 | |
148 | - return call_user_func( $this->tags[ $tag ]['func'], $this->payment_id, $tag ); |
|
148 | + return call_user_func($this->tags[$tag]['func'], $this->payment_id, $tag); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | } |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | * @param string $description Description of the email tag added |
160 | 160 | * @param callable $func Hook to run when email tag is found |
161 | 161 | */ |
162 | -function give_add_email_tag( $tag, $description, $func ) { |
|
163 | - Give()->email_tags->add( $tag, $description, $func ); |
|
162 | +function give_add_email_tag($tag, $description, $func) { |
|
163 | + Give()->email_tags->add($tag, $description, $func); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @param string $tag Email tag to remove hook from |
172 | 172 | */ |
173 | -function give_remove_email_tag( $tag ) { |
|
174 | - Give()->email_tags->remove( $tag ); |
|
173 | +function give_remove_email_tag($tag) { |
|
174 | + Give()->email_tags->remove($tag); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return bool |
185 | 185 | */ |
186 | -function give_email_tag_exists( $tag ) { |
|
187 | - return Give()->email_tags->email_tag_exists( $tag ); |
|
186 | +function give_email_tag_exists($tag) { |
|
187 | + return Give()->email_tags->email_tag_exists($tag); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | $email_tags = give_get_email_tags(); |
212 | 212 | |
213 | 213 | ob_start(); |
214 | - if ( count( $email_tags ) > 0 ) : ?> |
|
214 | + if (count($email_tags) > 0) : ?> |
|
215 | 215 | <div class="give-email-tags-wrap"> |
216 | - <?php foreach ( $email_tags as $email_tag ) : ?> |
|
216 | + <?php foreach ($email_tags as $email_tag) : ?> |
|
217 | 217 | <span class="give_<?php echo $email_tag['tag']; ?>_tag"> |
218 | 218 | <code>{<?php echo $email_tag['tag']; ?>}</code> - <?php echo $email_tag['description']; ?> |
219 | 219 | </span> |
@@ -235,12 +235,12 @@ discard block |
||
235 | 235 | * |
236 | 236 | * @return string Content with email tags filtered out. |
237 | 237 | */ |
238 | -function give_do_email_tags( $content, $payment_id ) { |
|
238 | +function give_do_email_tags($content, $payment_id) { |
|
239 | 239 | |
240 | 240 | // Replace all tags |
241 | - $content = Give()->email_tags->do_tags( $content, $payment_id ); |
|
241 | + $content = Give()->email_tags->do_tags($content, $payment_id); |
|
242 | 242 | |
243 | - $content = apply_filters( 'give_email_template_tags', $content, give_get_payment_meta( $payment_id ), $payment_id ); |
|
243 | + $content = apply_filters('give_email_template_tags', $content, give_get_payment_meta($payment_id), $payment_id); |
|
244 | 244 | |
245 | 245 | // Return content |
246 | 246 | return $content; |
@@ -259,9 +259,9 @@ discard block |
||
259 | 259 | * |
260 | 260 | * @since 1.0 |
261 | 261 | */ |
262 | - do_action( 'give_add_email_tags' ); |
|
262 | + do_action('give_add_email_tags'); |
|
263 | 263 | } |
264 | -add_action( 'init', 'give_load_email_tags', - 999 ); |
|
264 | +add_action('init', 'give_load_email_tags', - 999); |
|
265 | 265 | |
266 | 266 | |
267 | 267 | /** |
@@ -275,97 +275,97 @@ discard block |
||
275 | 275 | $email_tags = array( |
276 | 276 | array( |
277 | 277 | 'tag' => 'donation', |
278 | - 'description' => __( 'The donation form name, and the donation level (if applicable).', 'give' ), |
|
278 | + 'description' => __('The donation form name, and the donation level (if applicable).', 'give'), |
|
279 | 279 | 'function' => 'give_email_tag_donation' |
280 | 280 | ), |
281 | 281 | array( |
282 | 282 | 'tag' => 'form_title', |
283 | - 'description' => __( 'The donation form name.', 'give' ), |
|
283 | + 'description' => __('The donation form name.', 'give'), |
|
284 | 284 | 'function' => 'give_email_tag_form_title' |
285 | 285 | ), |
286 | 286 | array( |
287 | 287 | 'tag' => 'amount', |
288 | - 'description' => __( 'The total donation amount with currency sign.', 'give' ), |
|
288 | + 'description' => __('The total donation amount with currency sign.', 'give'), |
|
289 | 289 | 'function' => 'give_email_tag_amount' |
290 | 290 | ), |
291 | 291 | array( |
292 | 292 | 'tag' => 'price', |
293 | - 'description' => __( 'The total donation amount with currency sign.', 'give' ), |
|
293 | + 'description' => __('The total donation amount with currency sign.', 'give'), |
|
294 | 294 | 'function' => 'give_email_tag_price' |
295 | 295 | ), |
296 | 296 | array( |
297 | 297 | 'tag' => 'name', |
298 | - 'description' => __( 'The donor\'s first name.', 'give' ), |
|
298 | + 'description' => __('The donor\'s first name.', 'give'), |
|
299 | 299 | 'function' => 'give_email_tag_first_name' |
300 | 300 | ), |
301 | 301 | array( |
302 | 302 | 'tag' => 'fullname', |
303 | - 'description' => __( 'The donor\'s full name, first and last.', 'give' ), |
|
303 | + 'description' => __('The donor\'s full name, first and last.', 'give'), |
|
304 | 304 | 'function' => 'give_email_tag_fullname' |
305 | 305 | ), |
306 | 306 | array( |
307 | 307 | 'tag' => 'username', |
308 | - 'description' => __( 'The donor\'s user name on the site, if they registered an account.', 'give' ), |
|
308 | + 'description' => __('The donor\'s user name on the site, if they registered an account.', 'give'), |
|
309 | 309 | 'function' => 'give_email_tag_username' |
310 | 310 | ), |
311 | 311 | array( |
312 | 312 | 'tag' => 'user_email', |
313 | - 'description' => __( 'The donor\'s email address.', 'give' ), |
|
313 | + 'description' => __('The donor\'s email address.', 'give'), |
|
314 | 314 | 'function' => 'give_email_tag_user_email' |
315 | 315 | ), |
316 | 316 | array( |
317 | 317 | 'tag' => 'billing_address', |
318 | - 'description' => __( 'The donor\'s billing address.', 'give' ), |
|
318 | + 'description' => __('The donor\'s billing address.', 'give'), |
|
319 | 319 | 'function' => 'give_email_tag_billing_address' |
320 | 320 | ), |
321 | 321 | array( |
322 | 322 | 'tag' => 'date', |
323 | - 'description' => __( 'The date of the donation.', 'give' ), |
|
323 | + 'description' => __('The date of the donation.', 'give'), |
|
324 | 324 | 'function' => 'give_email_tag_date' |
325 | 325 | ), |
326 | 326 | array( |
327 | 327 | 'tag' => 'payment_id', |
328 | - 'description' => __( 'The unique ID number for this donation.', 'give' ), |
|
328 | + 'description' => __('The unique ID number for this donation.', 'give'), |
|
329 | 329 | 'function' => 'give_email_tag_payment_id' |
330 | 330 | ), |
331 | 331 | array( |
332 | 332 | 'tag' => 'receipt_id', |
333 | - 'description' => __( 'The unique ID number for this donation receipt.', 'give' ), |
|
333 | + 'description' => __('The unique ID number for this donation receipt.', 'give'), |
|
334 | 334 | 'function' => 'give_email_tag_receipt_id' |
335 | 335 | ), |
336 | 336 | array( |
337 | 337 | 'tag' => 'payment_method', |
338 | - 'description' => __( 'The method of payment used for this donation.', 'give' ), |
|
338 | + 'description' => __('The method of payment used for this donation.', 'give'), |
|
339 | 339 | 'function' => 'give_email_tag_payment_method' |
340 | 340 | ), |
341 | 341 | array( |
342 | 342 | 'tag' => 'sitename', |
343 | - 'description' => __( 'The name of your site.', 'give' ), |
|
343 | + 'description' => __('The name of your site.', 'give'), |
|
344 | 344 | 'function' => 'give_email_tag_sitename' |
345 | 345 | ), |
346 | 346 | array( |
347 | 347 | 'tag' => 'receipt_link', |
348 | - 'description' => __( 'The donation receipt direct link, to view the receipt on the website.', 'give' ), |
|
348 | + 'description' => __('The donation receipt direct link, to view the receipt on the website.', 'give'), |
|
349 | 349 | 'function' => 'give_email_tag_receipt_link' |
350 | 350 | ), |
351 | 351 | array( |
352 | 352 | 'tag' => 'receipt_link_url', |
353 | - 'description' => __( 'The donation receipt direct URL, to view the receipt on the website.', 'give' ), |
|
353 | + 'description' => __('The donation receipt direct URL, to view the receipt on the website.', 'give'), |
|
354 | 354 | 'function' => 'give_email_tag_receipt_link_url' |
355 | 355 | ), |
356 | 356 | ); |
357 | 357 | |
358 | 358 | // Apply give_email_tags filter |
359 | - $email_tags = apply_filters( 'give_email_tags', $email_tags ); |
|
359 | + $email_tags = apply_filters('give_email_tags', $email_tags); |
|
360 | 360 | |
361 | 361 | // Add email tags |
362 | - foreach ( $email_tags as $email_tag ) { |
|
363 | - give_add_email_tag( $email_tag['tag'], $email_tag['description'], $email_tag['function'] ); |
|
362 | + foreach ($email_tags as $email_tag) { |
|
363 | + give_add_email_tag($email_tag['tag'], $email_tag['description'], $email_tag['function']); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | } |
367 | 367 | |
368 | -add_action( 'give_add_email_tags', 'give_setup_email_tags' ); |
|
368 | +add_action('give_add_email_tags', 'give_setup_email_tags'); |
|
369 | 369 | |
370 | 370 | |
371 | 371 | /** |
@@ -377,15 +377,15 @@ discard block |
||
377 | 377 | * |
378 | 378 | * @return string name |
379 | 379 | */ |
380 | -function give_email_tag_first_name( $payment_id ) { |
|
381 | - $payment = new Give_Payment( $payment_id ); |
|
380 | +function give_email_tag_first_name($payment_id) { |
|
381 | + $payment = new Give_Payment($payment_id); |
|
382 | 382 | $user_info = $payment->user_info; |
383 | 383 | |
384 | - if ( empty( $user_info ) ) { |
|
384 | + if (empty($user_info)) { |
|
385 | 385 | return ''; |
386 | 386 | } |
387 | 387 | |
388 | - $email_name = give_get_email_names( $user_info ); |
|
388 | + $email_name = give_get_email_names($user_info); |
|
389 | 389 | |
390 | 390 | return $email_name['name']; |
391 | 391 | } |
@@ -399,15 +399,15 @@ discard block |
||
399 | 399 | * |
400 | 400 | * @return string fullname |
401 | 401 | */ |
402 | -function give_email_tag_fullname( $payment_id ) { |
|
403 | - $payment = new Give_Payment( $payment_id ); |
|
402 | +function give_email_tag_fullname($payment_id) { |
|
403 | + $payment = new Give_Payment($payment_id); |
|
404 | 404 | $user_info = $payment->user_info; |
405 | 405 | |
406 | - if ( empty( $user_info ) ) { |
|
406 | + if (empty($user_info)) { |
|
407 | 407 | return ''; |
408 | 408 | } |
409 | 409 | |
410 | - $email_name = give_get_email_names( $user_info ); |
|
410 | + $email_name = give_get_email_names($user_info); |
|
411 | 411 | |
412 | 412 | return $email_name['fullname']; |
413 | 413 | } |
@@ -421,15 +421,15 @@ discard block |
||
421 | 421 | * |
422 | 422 | * @return string username. |
423 | 423 | */ |
424 | -function give_email_tag_username( $payment_id ) { |
|
425 | - $payment = new Give_Payment( $payment_id ); |
|
424 | +function give_email_tag_username($payment_id) { |
|
425 | + $payment = new Give_Payment($payment_id); |
|
426 | 426 | $user_info = $payment->user_info; |
427 | 427 | |
428 | - if ( empty( $user_info ) ) { |
|
428 | + if (empty($user_info)) { |
|
429 | 429 | return ''; |
430 | 430 | } |
431 | 431 | |
432 | - $email_name = give_get_email_names( $user_info ); |
|
432 | + $email_name = give_get_email_names($user_info); |
|
433 | 433 | |
434 | 434 | return $email_name['username']; |
435 | 435 | } |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | * |
444 | 444 | * @return string user_email |
445 | 445 | */ |
446 | -function give_email_tag_user_email( $payment_id ) { |
|
447 | - $payment = new Give_Payment( $payment_id ); |
|
446 | +function give_email_tag_user_email($payment_id) { |
|
447 | + $payment = new Give_Payment($payment_id); |
|
448 | 448 | |
449 | 449 | return $payment->email; |
450 | 450 | } |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | * |
459 | 459 | * @return string billing_address |
460 | 460 | */ |
461 | -function give_email_tag_billing_address( $payment_id ) { |
|
462 | - $user_info = give_get_payment_meta_user_info( $payment_id ); |
|
463 | - $user_address = ! empty( $user_info['address'] ) ? $user_info['address'] : array( |
|
461 | +function give_email_tag_billing_address($payment_id) { |
|
462 | + $user_info = give_get_payment_meta_user_info($payment_id); |
|
463 | + $user_address = ! empty($user_info['address']) ? $user_info['address'] : array( |
|
464 | 464 | 'line1' => '', |
465 | 465 | 'line2' => '', |
466 | 466 | 'city' => '', |
@@ -469,11 +469,11 @@ discard block |
||
469 | 469 | 'zip' => '' |
470 | 470 | ); |
471 | 471 | |
472 | - $return = $user_address['line1'] . "\n"; |
|
473 | - if ( ! empty( $user_address['line2'] ) ) { |
|
474 | - $return .= $user_address['line2'] . "\n"; |
|
472 | + $return = $user_address['line1']."\n"; |
|
473 | + if ( ! empty($user_address['line2'])) { |
|
474 | + $return .= $user_address['line2']."\n"; |
|
475 | 475 | } |
476 | - $return .= $user_address['city'] . ' ' . $user_address['zip'] . ' ' . $user_address['state'] . "\n"; |
|
476 | + $return .= $user_address['city'].' '.$user_address['zip'].' '.$user_address['state']."\n"; |
|
477 | 477 | $return .= $user_address['country']; |
478 | 478 | |
479 | 479 | return $return; |
@@ -488,10 +488,10 @@ discard block |
||
488 | 488 | * |
489 | 489 | * @return string date |
490 | 490 | */ |
491 | -function give_email_tag_date( $payment_id ) { |
|
492 | - $payment = new Give_Payment( $payment_id ); |
|
491 | +function give_email_tag_date($payment_id) { |
|
492 | + $payment = new Give_Payment($payment_id); |
|
493 | 493 | |
494 | - return date_i18n( give_date_format(), strtotime( $payment->date ) ); |
|
494 | + return date_i18n(give_date_format(), strtotime($payment->date)); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | /** |
@@ -503,11 +503,11 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @return string amount |
505 | 505 | */ |
506 | -function give_email_tag_amount( $payment_id ) { |
|
507 | - $payment = new Give_Payment( $payment_id ); |
|
508 | - $give_amount = give_currency_filter( give_format_amount( $payment->total, array( 'sanitize' => false ) ), $payment->currency ); |
|
506 | +function give_email_tag_amount($payment_id) { |
|
507 | + $payment = new Give_Payment($payment_id); |
|
508 | + $give_amount = give_currency_filter(give_format_amount($payment->total, array('sanitize' => false)), $payment->currency); |
|
509 | 509 | |
510 | - return html_entity_decode( $give_amount, ENT_COMPAT, 'UTF-8' ); |
|
510 | + return html_entity_decode($give_amount, ENT_COMPAT, 'UTF-8'); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | * |
520 | 520 | * @return string price |
521 | 521 | */ |
522 | -function give_email_tag_price( $payment_id ) { |
|
523 | - return give_email_tag_amount( $payment_id ); |
|
522 | +function give_email_tag_price($payment_id) { |
|
523 | + return give_email_tag_amount($payment_id); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | /** |
@@ -532,8 +532,8 @@ discard block |
||
532 | 532 | * |
533 | 533 | * @return int payment_id |
534 | 534 | */ |
535 | -function give_email_tag_payment_id( $payment_id ) { |
|
536 | - $payment = new Give_Payment( $payment_id ); |
|
535 | +function give_email_tag_payment_id($payment_id) { |
|
536 | + $payment = new Give_Payment($payment_id); |
|
537 | 537 | |
538 | 538 | return $payment->number; |
539 | 539 | } |
@@ -547,8 +547,8 @@ discard block |
||
547 | 547 | * |
548 | 548 | * @return string receipt_id |
549 | 549 | */ |
550 | -function give_email_tag_receipt_id( $payment_id ) { |
|
551 | - $payment = new Give_Payment( $payment_id ); |
|
550 | +function give_email_tag_receipt_id($payment_id) { |
|
551 | + $payment = new Give_Payment($payment_id); |
|
552 | 552 | |
553 | 553 | return $payment->key; |
554 | 554 | } |
@@ -562,14 +562,14 @@ discard block |
||
562 | 562 | * |
563 | 563 | * @return string $form_title |
564 | 564 | */ |
565 | -function give_email_tag_donation( $payment_id ) { |
|
566 | - $payment = new Give_Payment( $payment_id ); |
|
565 | +function give_email_tag_donation($payment_id) { |
|
566 | + $payment = new Give_Payment($payment_id); |
|
567 | 567 | $payment_meta = $payment->payment_meta; |
568 | - $level_title = give_has_variable_prices( $payment->form_id ); |
|
568 | + $level_title = give_has_variable_prices($payment->form_id); |
|
569 | 569 | $separator = $level_title ? '-' : ''; |
570 | - $form_title = strip_tags( give_get_payment_form_title( $payment_meta, false, $separator ) ); |
|
570 | + $form_title = strip_tags(give_get_payment_form_title($payment_meta, false, $separator)); |
|
571 | 571 | |
572 | - return ! empty( $form_title ) ? $form_title : ''; |
|
572 | + return ! empty($form_title) ? $form_title : ''; |
|
573 | 573 | |
574 | 574 | } |
575 | 575 | |
@@ -582,11 +582,11 @@ discard block |
||
582 | 582 | * |
583 | 583 | * @return string $form_title |
584 | 584 | */ |
585 | -function give_email_tag_form_title( $payment_id ) { |
|
586 | - $payment = new Give_Payment( $payment_id ); |
|
585 | +function give_email_tag_form_title($payment_id) { |
|
586 | + $payment = new Give_Payment($payment_id); |
|
587 | 587 | $payment_meta = $payment->payment_meta; |
588 | 588 | |
589 | - return isset( $payment_meta['form_title'] ) ? strip_tags( $payment_meta['form_title'] ) : ''; |
|
589 | + return isset($payment_meta['form_title']) ? strip_tags($payment_meta['form_title']) : ''; |
|
590 | 590 | |
591 | 591 | } |
592 | 592 | |
@@ -599,10 +599,10 @@ discard block |
||
599 | 599 | * |
600 | 600 | * @return string gateway |
601 | 601 | */ |
602 | -function give_email_tag_payment_method( $payment_id ) { |
|
603 | - $payment = new Give_Payment( $payment_id ); |
|
602 | +function give_email_tag_payment_method($payment_id) { |
|
603 | + $payment = new Give_Payment($payment_id); |
|
604 | 604 | |
605 | - return give_get_gateway_checkout_label( $payment->gateway ); |
|
605 | + return give_get_gateway_checkout_label($payment->gateway); |
|
606 | 606 | } |
607 | 607 | |
608 | 608 | /** |
@@ -614,8 +614,8 @@ discard block |
||
614 | 614 | * |
615 | 615 | * @return string sitename |
616 | 616 | */ |
617 | -function give_email_tag_sitename( $payment_id ) { |
|
618 | - return wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); |
|
617 | +function give_email_tag_sitename($payment_id) { |
|
618 | + return wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES); |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | /** |
@@ -627,19 +627,19 @@ discard block |
||
627 | 627 | * |
628 | 628 | * @return string receipt_link |
629 | 629 | */ |
630 | -function give_email_tag_receipt_link( $payment_id ) { |
|
630 | +function give_email_tag_receipt_link($payment_id) { |
|
631 | 631 | |
632 | - $receipt_url = esc_url( add_query_arg( array( |
|
633 | - 'payment_key' => give_get_payment_key( $payment_id ), |
|
632 | + $receipt_url = esc_url(add_query_arg(array( |
|
633 | + 'payment_key' => give_get_payment_key($payment_id), |
|
634 | 634 | 'give_action' => 'view_receipt' |
635 | - ), home_url() ) ); |
|
636 | - $formatted = sprintf( |
|
635 | + ), home_url())); |
|
636 | + $formatted = sprintf( |
|
637 | 637 | '<a href="%1$s">%2$s</a>', |
638 | 638 | $receipt_url, |
639 | - esc_html__( 'View it in your browser', 'give' ) |
|
639 | + esc_html__('View it in your browser', 'give') |
|
640 | 640 | ); |
641 | 641 | |
642 | - if ( give_get_option( 'email_template' ) !== 'none' ) { |
|
642 | + if (give_get_option('email_template') !== 'none') { |
|
643 | 643 | return $formatted; |
644 | 644 | } else { |
645 | 645 | return $receipt_url; |
@@ -658,12 +658,12 @@ discard block |
||
658 | 658 | * |
659 | 659 | * @return string receipt_url |
660 | 660 | */ |
661 | -function give_email_tag_receipt_link_url( $payment_id ) { |
|
661 | +function give_email_tag_receipt_link_url($payment_id) { |
|
662 | 662 | |
663 | - $receipt_url = esc_url( add_query_arg( array( |
|
664 | - 'payment_key' => give_get_payment_key( $payment_id ), |
|
663 | + $receipt_url = esc_url(add_query_arg(array( |
|
664 | + 'payment_key' => give_get_payment_key($payment_id), |
|
665 | 665 | 'give_action' => 'view_receipt' |
666 | - ), home_url() ) ); |
|
666 | + ), home_url())); |
|
667 | 667 | |
668 | 668 | return $receipt_url; |
669 | 669 |
@@ -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 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @return string $message Fully formatted message |
43 | 43 | */ |
44 | -function give_email_template_tags( $message, $payment_data, $payment_id, $admin_notice = false ) { |
|
45 | - return give_do_email_tags( $message, $payment_id ); |
|
44 | +function give_email_template_tags($message, $payment_data, $payment_id, $admin_notice = false) { |
|
45 | + return give_do_email_tags($message, $payment_id); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -56,42 +56,42 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return string $message Fully formatted message |
58 | 58 | */ |
59 | -function give_email_preview_template_tags( $message ) { |
|
59 | +function give_email_preview_template_tags($message) { |
|
60 | 60 | |
61 | - $price = give_currency_filter( give_format_amount( 10.50, array( 'sanitize' => false ) ) ); |
|
61 | + $price = give_currency_filter(give_format_amount(10.50, array('sanitize' => false))); |
|
62 | 62 | |
63 | 63 | $gateway = 'PayPal'; |
64 | 64 | |
65 | - $receipt_id = strtolower( md5( uniqid() ) ); |
|
65 | + $receipt_id = strtolower(md5(uniqid())); |
|
66 | 66 | |
67 | - $payment_id = rand( 1, 100 ); |
|
67 | + $payment_id = rand(1, 100); |
|
68 | 68 | |
69 | - $receipt_link_url = esc_url( add_query_arg( array( 'payment_key' => $receipt_id, 'give_action' => 'view_receipt' ), home_url() ) ); |
|
69 | + $receipt_link_url = esc_url(add_query_arg(array('payment_key' => $receipt_id, 'give_action' => 'view_receipt'), home_url())); |
|
70 | 70 | $receipt_link = sprintf( |
71 | 71 | '<a href="%1$s">%2$s</a>', |
72 | 72 | $receipt_link_url, |
73 | - esc_html__( 'View the receipt in your browser »', 'give' ) |
|
73 | + esc_html__('View the receipt in your browser »', 'give') |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | $user = wp_get_current_user(); |
77 | 77 | |
78 | - $message = str_replace( '{name}', $user->display_name, $message ); |
|
79 | - $message = str_replace( '{fullname}', $user->display_name, $message ); |
|
80 | - $message = str_replace( '{username}', $user->user_login, $message ); |
|
81 | - $message = str_replace( '{date}', date( give_date_format(), current_time( 'timestamp' ) ), $message ); |
|
82 | - $message = str_replace( '{amount}', $price, $message ); |
|
83 | - $message = str_replace( '{price}', $price, $message ); |
|
84 | - $message = str_replace( '{donation}', esc_html__( 'Sample Donation Form Title', 'give' ), $message ); |
|
85 | - $message = str_replace( '{form_title}', esc_html__( 'Sample Donation Form Title - Sample Donation Level', 'give' ), $message ); |
|
86 | - $message = str_replace( '{receipt_id}', $receipt_id, $message ); |
|
87 | - $message = str_replace( '{payment_method}', $gateway, $message ); |
|
88 | - $message = str_replace( '{sitename}', get_bloginfo( 'name' ), $message ); |
|
89 | - $message = str_replace( '{payment_id}', $payment_id, $message ); |
|
90 | - $message = str_replace( '{receipt_link}', $receipt_link, $message ); |
|
91 | - $message = str_replace( '{receipt_link_url}', $receipt_link_url, $message ); |
|
92 | - $message = str_replace( '{pdf_receipt}', '<a href="#">Download Receipt</a>', $message ); |
|
93 | - |
|
94 | - return wpautop( apply_filters( 'give_email_preview_template_tags', $message ) ); |
|
78 | + $message = str_replace('{name}', $user->display_name, $message); |
|
79 | + $message = str_replace('{fullname}', $user->display_name, $message); |
|
80 | + $message = str_replace('{username}', $user->user_login, $message); |
|
81 | + $message = str_replace('{date}', date(give_date_format(), current_time('timestamp')), $message); |
|
82 | + $message = str_replace('{amount}', $price, $message); |
|
83 | + $message = str_replace('{price}', $price, $message); |
|
84 | + $message = str_replace('{donation}', esc_html__('Sample Donation Form Title', 'give'), $message); |
|
85 | + $message = str_replace('{form_title}', esc_html__('Sample Donation Form Title - Sample Donation Level', 'give'), $message); |
|
86 | + $message = str_replace('{receipt_id}', $receipt_id, $message); |
|
87 | + $message = str_replace('{payment_method}', $gateway, $message); |
|
88 | + $message = str_replace('{sitename}', get_bloginfo('name'), $message); |
|
89 | + $message = str_replace('{payment_id}', $payment_id, $message); |
|
90 | + $message = str_replace('{receipt_link}', $receipt_link, $message); |
|
91 | + $message = str_replace('{receipt_link_url}', $receipt_link_url, $message); |
|
92 | + $message = str_replace('{pdf_receipt}', '<a href="#">Download Receipt</a>', $message); |
|
93 | + |
|
94 | + return wpautop(apply_filters('give_email_preview_template_tags', $message)); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -103,23 +103,23 @@ discard block |
||
103 | 103 | * @since 1.0 |
104 | 104 | * @return array|bool |
105 | 105 | */ |
106 | -function give_email_template_preview( $array ) { |
|
106 | +function give_email_template_preview($array) { |
|
107 | 107 | |
108 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
108 | + if ( ! current_user_can('manage_give_settings')) { |
|
109 | 109 | return false; |
110 | 110 | } |
111 | 111 | $custom_field = array( |
112 | - 'name' => esc_html__( 'Preview Email', 'give' ), |
|
113 | - 'desc' => esc_html__( 'Click the buttons to preview or send test emails.', 'give' ), |
|
112 | + 'name' => esc_html__('Preview Email', 'give'), |
|
113 | + 'desc' => esc_html__('Click the buttons to preview or send test emails.', 'give'), |
|
114 | 114 | 'id' => 'give_email_preview_buttons', |
115 | 115 | 'type' => 'email_preview_buttons' |
116 | 116 | ); |
117 | 117 | |
118 | - return give_settings_array_insert( $array, 'donation_subject', array( $custom_field ) ); |
|
118 | + return give_settings_array_insert($array, 'donation_subject', array($custom_field)); |
|
119 | 119 | |
120 | 120 | } |
121 | 121 | |
122 | -add_filter( 'give_settings_emails', 'give_email_template_preview' ); |
|
122 | +add_filter('give_settings_emails', 'give_email_template_preview'); |
|
123 | 123 | |
124 | 124 | /** |
125 | 125 | * Output Email Template Preview Buttons. |
@@ -131,12 +131,12 @@ discard block |
||
131 | 131 | function give_email_preview_buttons_callback() { |
132 | 132 | ob_start(); |
133 | 133 | ?> |
134 | - <a href="<?php echo esc_url( add_query_arg( array( 'give_action' => 'preview_email' ), home_url() ) ); ?>" class="button-secondary" target="_blank"><?php esc_html_e( 'Preview Donation Receipt', 'give' ); ?></a> |
|
135 | - <a href="<?php echo wp_nonce_url( add_query_arg( array( |
|
134 | + <a href="<?php echo esc_url(add_query_arg(array('give_action' => 'preview_email'), home_url())); ?>" class="button-secondary" target="_blank"><?php esc_html_e('Preview Donation Receipt', 'give'); ?></a> |
|
135 | + <a href="<?php echo wp_nonce_url(add_query_arg(array( |
|
136 | 136 | 'give_action' => 'send_test_email', |
137 | 137 | 'give-message' => 'sent-test-email', |
138 | 138 | 'tag' => 'emails' |
139 | - ) ), 'give-test-email' ); ?>" aria-label="<?php esc_attr_e( 'Send demo donation receipt to the emails listed below.', 'give' ); ?>" class="button-secondary"><?php esc_html_e( 'Send Test Email', 'give' ); ?></a> |
|
139 | + )), 'give-test-email'); ?>" aria-label="<?php esc_attr_e('Send demo donation receipt to the emails listed below.', 'give'); ?>" class="button-secondary"><?php esc_html_e('Send Test Email', 'give'); ?></a> |
|
140 | 140 | <?php |
141 | 141 | echo ob_get_clean(); |
142 | 142 | } |
@@ -149,46 +149,46 @@ discard block |
||
149 | 149 | */ |
150 | 150 | function give_display_email_template_preview() { |
151 | 151 | |
152 | - if ( empty( $_GET['give_action'] ) ) { |
|
152 | + if (empty($_GET['give_action'])) { |
|
153 | 153 | return; |
154 | 154 | } |
155 | 155 | |
156 | - if ( 'preview_email' !== $_GET['give_action'] ) { |
|
156 | + if ('preview_email' !== $_GET['give_action']) { |
|
157 | 157 | return; |
158 | 158 | } |
159 | 159 | |
160 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
160 | + if ( ! current_user_can('manage_give_settings')) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
164 | 164 | |
165 | - Give()->emails->heading = esc_html__( 'Donation Receipt', 'give' ); |
|
165 | + Give()->emails->heading = esc_html__('Donation Receipt', 'give'); |
|
166 | 166 | |
167 | - $payment_id = (int) isset( $_GET['preview_id'] ) ? $_GET['preview_id'] : ''; |
|
167 | + $payment_id = (int) isset($_GET['preview_id']) ? $_GET['preview_id'] : ''; |
|
168 | 168 | |
169 | 169 | echo give_get_preview_email_header(); |
170 | 170 | |
171 | 171 | //Are we previewing an actual payment? |
172 | - if ( ! empty( $payment_id ) ) { |
|
172 | + if ( ! empty($payment_id)) { |
|
173 | 173 | |
174 | - $content = give_get_email_body_content( $payment_id ); |
|
174 | + $content = give_get_email_body_content($payment_id); |
|
175 | 175 | |
176 | - $preview_content = give_do_email_tags( $content, $payment_id ); |
|
176 | + $preview_content = give_do_email_tags($content, $payment_id); |
|
177 | 177 | |
178 | 178 | } else { |
179 | 179 | |
180 | 180 | //No payment ID, use sample preview content |
181 | - $preview_content = give_email_preview_template_tags( give_get_email_body_content( 0, array() ) ); |
|
181 | + $preview_content = give_email_preview_template_tags(give_get_email_body_content(0, array())); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
185 | - echo Give()->emails->build_email( $preview_content ); |
|
185 | + echo Give()->emails->build_email($preview_content); |
|
186 | 186 | |
187 | 187 | exit; |
188 | 188 | |
189 | 189 | } |
190 | 190 | |
191 | -add_action( 'init', 'give_display_email_template_preview' ); |
|
191 | +add_action('init', 'give_display_email_template_preview'); |
|
192 | 192 | |
193 | 193 | /** |
194 | 194 | * Email Template Body. |
@@ -200,18 +200,18 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @return string $email_body Body of the email |
202 | 202 | */ |
203 | -function give_get_email_body_content( $payment_id = 0, $payment_data = array() ) { |
|
203 | +function give_get_email_body_content($payment_id = 0, $payment_data = array()) { |
|
204 | 204 | |
205 | 205 | $default_email_body = give_get_default_donation_receipt_email(); |
206 | 206 | |
207 | - $email_content = give_get_option( 'donation_receipt' ); |
|
208 | - $email_content = ( $email_content ) ? stripslashes( $email_content ) : $default_email_body; |
|
207 | + $email_content = give_get_option('donation_receipt'); |
|
208 | + $email_content = ($email_content) ? stripslashes($email_content) : $default_email_body; |
|
209 | 209 | |
210 | - $email_body = wpautop( $email_content ); |
|
210 | + $email_body = wpautop($email_content); |
|
211 | 211 | |
212 | - $email_body = apply_filters( 'give_donation_receipt_' . Give()->emails->get_template(), $email_body, $payment_id, $payment_data ); |
|
212 | + $email_body = apply_filters('give_donation_receipt_'.Give()->emails->get_template(), $email_body, $payment_id, $payment_data); |
|
213 | 213 | |
214 | - return apply_filters( 'give_donation_receipt', $email_body, $payment_id, $payment_data ); |
|
214 | + return apply_filters('give_donation_receipt', $email_body, $payment_id, $payment_data); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -224,36 +224,36 @@ discard block |
||
224 | 224 | * |
225 | 225 | * @return string $email_body Body of the email |
226 | 226 | */ |
227 | -function give_get_donation_notification_body_content( $payment_id = 0, $payment_data = array() ) { |
|
227 | +function give_get_donation_notification_body_content($payment_id = 0, $payment_data = array()) { |
|
228 | 228 | |
229 | - $user_info = maybe_unserialize( $payment_data['user_info'] ); |
|
230 | - $email = give_get_payment_user_email( $payment_id ); |
|
229 | + $user_info = maybe_unserialize($payment_data['user_info']); |
|
230 | + $email = give_get_payment_user_email($payment_id); |
|
231 | 231 | |
232 | - if ( isset( $user_info['id'] ) && $user_info['id'] > 0 ) { |
|
233 | - $user_data = get_userdata( $user_info['id'] ); |
|
232 | + if (isset($user_info['id']) && $user_info['id'] > 0) { |
|
233 | + $user_data = get_userdata($user_info['id']); |
|
234 | 234 | $name = $user_data->display_name; |
235 | - } elseif ( isset( $user_info['first_name'] ) && isset( $user_info['last_name'] ) ) { |
|
236 | - $name = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
235 | + } elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) { |
|
236 | + $name = $user_info['first_name'].' '.$user_info['last_name']; |
|
237 | 237 | } else { |
238 | 238 | $name = $email; |
239 | 239 | } |
240 | 240 | |
241 | - $gateway = give_get_gateway_admin_label( give_get_meta( $payment_id, '_give_payment_gateway', true ) ); |
|
241 | + $gateway = give_get_gateway_admin_label(give_get_meta($payment_id, '_give_payment_gateway', true)); |
|
242 | 242 | |
243 | - $default_email_body = esc_html__( 'Hello', 'give' ) . "\n\n"; |
|
244 | - $default_email_body .= esc_html__( 'A donation has been made.', 'give' ) . "\n\n"; |
|
245 | - $default_email_body .= esc_html__( 'Donation:', 'give' ) . "\n\n"; |
|
246 | - $default_email_body .= esc_html__( 'Donor:', 'give' ) . ' ' . html_entity_decode( $name, ENT_COMPAT, 'UTF-8' ) . "\n"; |
|
247 | - $default_email_body .= esc_html__( 'Amount:', 'give' ) . ' ' . html_entity_decode( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ), array( 'sanitize' => false ) ) ), ENT_COMPAT, 'UTF-8' ) . "\n"; |
|
248 | - $default_email_body .= esc_html__( 'Payment Method:', 'give' ) . ' ' . $gateway . "\n\n"; |
|
249 | - $default_email_body .= esc_html__( 'Thank you', 'give' ); |
|
243 | + $default_email_body = esc_html__('Hello', 'give')."\n\n"; |
|
244 | + $default_email_body .= esc_html__('A donation has been made.', 'give')."\n\n"; |
|
245 | + $default_email_body .= esc_html__('Donation:', 'give')."\n\n"; |
|
246 | + $default_email_body .= esc_html__('Donor:', 'give').' '.html_entity_decode($name, ENT_COMPAT, 'UTF-8')."\n"; |
|
247 | + $default_email_body .= esc_html__('Amount:', 'give').' '.html_entity_decode(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id), array('sanitize' => false))), ENT_COMPAT, 'UTF-8')."\n"; |
|
248 | + $default_email_body .= esc_html__('Payment Method:', 'give').' '.$gateway."\n\n"; |
|
249 | + $default_email_body .= esc_html__('Thank you', 'give'); |
|
250 | 250 | |
251 | - $email = give_get_option( 'donation_notification' ); |
|
252 | - $email = isset( $email ) ? stripslashes( $email ) : $default_email_body; |
|
251 | + $email = give_get_option('donation_notification'); |
|
252 | + $email = isset($email) ? stripslashes($email) : $default_email_body; |
|
253 | 253 | |
254 | - $email_body = give_do_email_tags( $email, $payment_id ); |
|
254 | + $email_body = give_do_email_tags($email, $payment_id); |
|
255 | 255 | |
256 | - return apply_filters( 'give_donation_notification', wpautop( $email_body ), $payment_id, $payment_data ); |
|
256 | + return apply_filters('give_donation_notification', wpautop($email_body), $payment_id, $payment_data); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -266,19 +266,19 @@ discard block |
||
266 | 266 | * @since 1.0 |
267 | 267 | */ |
268 | 268 | function give_render_receipt_in_browser() { |
269 | - if ( ! isset( $_GET['payment_key'] ) ) { |
|
270 | - wp_die( esc_html__( 'Missing donation payment key.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
269 | + if ( ! isset($_GET['payment_key'])) { |
|
270 | + wp_die(esc_html__('Missing donation payment key.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
271 | 271 | } |
272 | 272 | |
273 | - $key = urlencode( $_GET['payment_key'] ); |
|
273 | + $key = urlencode($_GET['payment_key']); |
|
274 | 274 | |
275 | 275 | ob_start(); |
276 | 276 | //Disallows caching of the page |
277 | - header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" ); |
|
278 | - header( "Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1 |
|
279 | - header( "Cache-Control: post-check=0, pre-check=0", false ); |
|
280 | - header( "Pragma: no-cache" ); // HTTP/1.0 |
|
281 | - header( "Expires: Sat, 23 Oct 1977 05:00:00 PST" ); // Date in the past |
|
277 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
278 | + header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 |
|
279 | + header("Cache-Control: post-check=0, pre-check=0", false); |
|
280 | + header("Pragma: no-cache"); // HTTP/1.0 |
|
281 | + header("Expires: Sat, 23 Oct 1977 05:00:00 PST"); // Date in the past |
|
282 | 282 | ?> |
283 | 283 | <!DOCTYPE html> |
284 | 284 | <html lang="en"> |
@@ -289,10 +289,10 @@ discard block |
||
289 | 289 | * |
290 | 290 | * @since 1.0 |
291 | 291 | */ |
292 | - do_action( 'give_receipt_head' ); |
|
292 | + do_action('give_receipt_head'); |
|
293 | 293 | ?> |
294 | 294 | </head> |
295 | - <body class="<?php echo apply_filters( 'give_receipt_page_body_class', 'give_receipt_page' ); ?>"> |
|
295 | + <body class="<?php echo apply_filters('give_receipt_page_body_class', 'give_receipt_page'); ?>"> |
|
296 | 296 | |
297 | 297 | <div id="give_receipt_wrapper"> |
298 | 298 | <?php |
@@ -301,16 +301,16 @@ discard block |
||
301 | 301 | * |
302 | 302 | * @since 1.0 |
303 | 303 | */ |
304 | - do_action( 'give_render_receipt_in_browser_before' ); |
|
304 | + do_action('give_render_receipt_in_browser_before'); |
|
305 | 305 | |
306 | - echo do_shortcode( '[give_receipt payment_key=' . $key . ']' ); |
|
306 | + echo do_shortcode('[give_receipt payment_key='.$key.']'); |
|
307 | 307 | |
308 | 308 | /** |
309 | 309 | * Fires in the receipt template after the content. |
310 | 310 | * |
311 | 311 | * @since 1.0 |
312 | 312 | */ |
313 | - do_action( 'give_render_receipt_in_browser_after' ); |
|
313 | + do_action('give_render_receipt_in_browser_after'); |
|
314 | 314 | ?> |
315 | 315 | </div> |
316 | 316 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * |
321 | 321 | * @since 1.0 |
322 | 322 | */ |
323 | - do_action( 'give_receipt_footer' ); |
|
323 | + do_action('give_receipt_footer'); |
|
324 | 324 | ?> |
325 | 325 | </body> |
326 | 326 | </html> |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | die(); |
330 | 330 | } |
331 | 331 | |
332 | -add_action( 'give_view_receipt', 'give_render_receipt_in_browser' ); |
|
332 | +add_action('give_view_receipt', 'give_render_receipt_in_browser'); |
|
333 | 333 | |
334 | 334 | |
335 | 335 | /** |
@@ -344,29 +344,29 @@ discard block |
||
344 | 344 | |
345 | 345 | //Payment receipt switcher |
346 | 346 | $payment_count = give_count_payments()->publish; |
347 | - $payment_id = (int) isset( $_GET['preview_id'] ) ? $_GET['preview_id'] : ''; |
|
347 | + $payment_id = (int) isset($_GET['preview_id']) ? $_GET['preview_id'] : ''; |
|
348 | 348 | |
349 | - if ( $payment_count <= 0 ) { |
|
349 | + if ($payment_count <= 0) { |
|
350 | 350 | return false; |
351 | 351 | } |
352 | 352 | |
353 | 353 | //Get payments. |
354 | - $payments = new Give_Payments_Query( array( |
|
354 | + $payments = new Give_Payments_Query(array( |
|
355 | 355 | 'number' => 100 |
356 | - ) ); |
|
356 | + )); |
|
357 | 357 | $payments = $payments->get_payments(); |
358 | 358 | $options = array(); |
359 | 359 | |
360 | 360 | //Provide nice human readable options. |
361 | - if ( $payments ) { |
|
362 | - $options[0] = esc_html__( '- Select a donation -', 'give' ); |
|
363 | - foreach ( $payments as $payment ) { |
|
361 | + if ($payments) { |
|
362 | + $options[0] = esc_html__('- Select a donation -', 'give'); |
|
363 | + foreach ($payments as $payment) { |
|
364 | 364 | |
365 | - $options[ $payment->ID ] = esc_html( '#' . $payment->ID . ' - ' . $payment->email . ' - ' . $payment->form_title ); |
|
365 | + $options[$payment->ID] = esc_html('#'.$payment->ID.' - '.$payment->email.' - '.$payment->form_title); |
|
366 | 366 | |
367 | 367 | } |
368 | 368 | } else { |
369 | - $options[0] = esc_html__( 'No donations found.', 'give' ); |
|
369 | + $options[0] = esc_html__('No donations found.', 'give'); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | //Start constructing HTML output. |
@@ -379,16 +379,16 @@ discard block |
||
379 | 379 | var selected_trans = transactions.options[transactions.selectedIndex]; |
380 | 380 | console.log(selected_trans); |
381 | 381 | if (selected_trans){ |
382 | - var url_string = "' . get_bloginfo( 'url' ) . '?give_action=preview_email&preview_id=" + selected_trans.value; |
|
382 | + var url_string = "' . get_bloginfo('url').'?give_action=preview_email&preview_id=" + selected_trans.value; |
|
383 | 383 | window.location = url_string; |
384 | 384 | } |
385 | 385 | } |
386 | 386 | </script>'; |
387 | 387 | |
388 | - $transaction_header .= '<label for="give_preview_email_payment_id" style="font-size:12px;color:#333;margin:0 4px 0 0;">' . esc_html__( 'Preview email with a donation:', 'give' ) . '</label>'; |
|
388 | + $transaction_header .= '<label for="give_preview_email_payment_id" style="font-size:12px;color:#333;margin:0 4px 0 0;">'.esc_html__('Preview email with a donation:', 'give').'</label>'; |
|
389 | 389 | |
390 | 390 | //The select field with 100 latest transactions |
391 | - $transaction_header .= Give()->html->select( array( |
|
391 | + $transaction_header .= Give()->html->select(array( |
|
392 | 392 | 'name' => 'preview_email_payment_id', |
393 | 393 | 'selected' => $payment_id, |
394 | 394 | 'id' => 'give_preview_email_payment_id', |
@@ -398,12 +398,12 @@ discard block |
||
398 | 398 | 'select_atts' => 'onchange="change_preview()">', |
399 | 399 | 'show_option_all' => false, |
400 | 400 | 'show_option_none' => false |
401 | - ) ); |
|
401 | + )); |
|
402 | 402 | |
403 | 403 | //Closing tag |
404 | 404 | $transaction_header .= '</div>'; |
405 | 405 | |
406 | - return apply_filters( 'give_preview_email_receipt_header', $transaction_header ); |
|
406 | + return apply_filters('give_preview_email_receipt_header', $transaction_header); |
|
407 | 407 | |
408 | 408 | } |
409 | 409 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | function give_receipt_head_content() { |
418 | 418 | |
419 | 419 | //Title. |
420 | - $output = '<title>' . esc_html__( 'Donation Receipt', 'give' ) . '</title>'; |
|
420 | + $output = '<title>'.esc_html__('Donation Receipt', 'give').'</title>'; |
|
421 | 421 | |
422 | 422 | //Meta. |
423 | 423 | $output .= '<meta charset="utf-8"/> |
@@ -431,10 +431,10 @@ discard block |
||
431 | 431 | <meta name="robots" content="noindex, nofollow"/>'; |
432 | 432 | |
433 | 433 | //CSS |
434 | - $output .= '<link rel="stylesheet" href="' . give_get_stylesheet_uri() . '?ver=' . GIVE_VERSION . '">'; |
|
434 | + $output .= '<link rel="stylesheet" href="'.give_get_stylesheet_uri().'?ver='.GIVE_VERSION.'">'; |
|
435 | 435 | |
436 | - echo apply_filters( 'give_receipt_head_content', $output ); |
|
436 | + echo apply_filters('give_receipt_head_content', $output); |
|
437 | 437 | |
438 | 438 | } |
439 | 439 | |
440 | -add_action( 'give_receipt_head', 'give_receipt_head_content' ); |
|
441 | 440 | \ No newline at end of file |
441 | +add_action('give_receipt_head', 'give_receipt_head_content'); |
|
442 | 442 | \ No newline at end of file |