Test Failed
Pull Request — master (#2077)
by
unknown
05:53
created
includes/admin/tools/class-settings-import.php 1 patch
Spacing   +159 added lines, -159 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Import' ) ) {
16
+if ( ! class_exists('Give_Settings_Import')) {
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Import.
@@ -56,37 +56,37 @@  discard block
 block discarded – undo
56 56
 		 */
57 57
 		public function __construct() {
58 58
 			$this->id    = 'import';
59
-			$this->label = __( 'Import Donations', 'give' );
59
+			$this->label = __('Import Donations', 'give');
60 60
 
61 61
 			// Add Import tab in submenu.
62
-			add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 );
62
+			add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20);
63 63
 			// Will display html of the import donation.
64
-			add_action( 'give_admin_field_tools_import', array( $this, 'render_import_field' ), 10, 2 );
64
+			add_action('give_admin_field_tools_import', array($this, 'render_import_field'), 10, 2);
65 65
 			// Will call the function that genetrated the hook called 'give_admin_field_tools_import'.
66
-			add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) );
66
+			add_action("give-tools_settings_{$this->id}_page", array($this, 'output'));
67 67
 			// Do not use main form for this tab.
68
-			if ( give_get_current_setting_tab() === $this->id ) {
69
-				add_action( "give-tools_open_form", '__return_empty_string' );
70
-				add_action( "give-tools_close_form", '__return_empty_string' );
68
+			if (give_get_current_setting_tab() === $this->id) {
69
+				add_action("give-tools_open_form", '__return_empty_string');
70
+				add_action("give-tools_close_form", '__return_empty_string');
71 71
 			}
72 72
 			// Run when form submit.
73
-			add_action( 'give-tools_save_import', array( $this, 'save' ) );
74
-			add_action( 'give-tools_update_notices', array( $this, 'update_notices' ), 11, 1 );
73
+			add_action('give-tools_save_import', array($this, 'save'));
74
+			add_action('give-tools_update_notices', array($this, 'update_notices'), 11, 1);
75 75
 
76 76
 
77 77
 			// Will add the progress of the import
78
-			add_action( 'give_tools_import_form_before_start', array( 'Give_Settings_Import', 'progress' ), 10 );
78
+			add_action('give_tools_import_form_before_start', array('Give_Settings_Import', 'progress'), 10);
79 79
 			// Print the HTML.
80
-			add_action( 'give_tools_import_form_start', array( 'Give_Settings_Import', 'html' ), 10 );
80
+			add_action('give_tools_import_form_start', array('Give_Settings_Import', 'html'), 10);
81 81
 			// Used to add submit button.
82
-			add_action( 'give_tools_import_form_end', array( 'Give_Settings_Import', 'submit' ), 10 );
82
+			add_action('give_tools_import_form_end', array('Give_Settings_Import', 'submit'), 10);
83 83
 			// Print the html for CSV file upload.
84
-			add_action( 'give_admin_field_media_csv', array( $this, 'render_media_csv' ), 10, 2 );
84
+			add_action('give_admin_field_media_csv', array($this, 'render_media_csv'), 10, 2);
85 85
 		}
86 86
 
87
-		static function update_notices( $messages ) {
88
-			if ( ! empty( $_GET['tab'] ) && 'import' === give_clean( $_GET['tab'] ) ) {
89
-				unset( $messages['give-setting-updated'] );
87
+		static function update_notices($messages) {
88
+			if ( ! empty($_GET['tab']) && 'import' === give_clean($_GET['tab'])) {
89
+				unset($messages['give-setting-updated']);
90 90
 			}
91 91
 
92 92
 			return $messages;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		 * @since 1.8.13
99 99
 		 */
100 100
 		static function submit() {
101
-			wp_nonce_field( 'give-save-settings', '_give-save-settings' );
101
+			wp_nonce_field('give-save-settings', '_give-save-settings');
102 102
 			?>
103 103
 			<input type="hidden" class="import-step" id="import-step" name="step"
104 104
 			       value="<?php echo Give_Settings_Import::get_step(); ?>"/>
@@ -114,33 +114,33 @@  discard block
 block discarded – undo
114 114
 			$step = Give_Settings_Import::get_step();
115 115
 			?>
116 116
 			<section>
117
-				<table class="widefat export-options-table give-table <?php echo 'step-' . $step; ?>"
118
-				       id="<?php echo 'step-' . $step; ?>">
117
+				<table class="widefat export-options-table give-table <?php echo 'step-'.$step; ?>"
118
+				       id="<?php echo 'step-'.$step; ?>">
119 119
 					<tbody>
120 120
 					<?php
121
-					if ( 1 === $step ) {
121
+					if (1 === $step) {
122 122
 						// Get the html of CSV file upload.
123 123
 						Give_Settings_Import::render_media_csv();
124
-					} elseif ( 2 === $step ) {
124
+					} elseif (2 === $step) {
125 125
 						Give_Settings_Import::render_dropdown();
126
-					} elseif ( 3 === $step ) {
126
+					} elseif (3 === $step) {
127 127
 						// Drop down for importer files.
128 128
 						Give_Settings_Import::start_import();
129
-					} elseif ( 4 === $step ) {
129
+					} elseif (4 === $step) {
130 130
 						// Successful or fail message.
131 131
 						Give_Settings_Import::import_success();
132 132
 					}
133 133
 
134
-					if ( self::check_for_dropdown_or_import() == false ) {
134
+					if (self::check_for_dropdown_or_import() == false) {
135 135
 						$step = Give_Settings_Import::get_step();
136 136
 						?>
137 137
 						<tr valign="top">
138 138
 							<th></th>
139 139
 							<th>
140 140
 								<input type="submit"
141
-								       class="button button-primary button-large button-secondary <?php echo 'step-' . $step; ?>"
141
+								       class="button button-primary button-large button-secondary <?php echo 'step-'.$step; ?>"
142 142
 								       id="recount-stats-submit"
143
-								       value="<?php esc_attr_e( 'Submit', 'give' ); ?>"/>
143
+								       value="<?php esc_attr_e('Submit', 'give'); ?>"/>
144 144
 							</th>
145 145
 						</tr>
146 146
 						<?php
@@ -154,38 +154,38 @@  discard block
 block discarded – undo
154 154
 
155 155
 		static function import_success() {
156 156
 
157
-			$delete_csv = ( ! empty( $_GET['delete_csv'] ) ? absint( $_GET['delete_csv'] ) : false );
158
-			$csv        = ( ! empty( $_GET['csv'] ) ? absint( $_GET['csv'] ) : false );
159
-			if ( ! empty( $delete_csv ) && ! empty( $csv ) ) {
160
-				wp_delete_attachment( $csv, true );
157
+			$delete_csv = ( ! empty($_GET['delete_csv']) ? absint($_GET['delete_csv']) : false);
158
+			$csv        = ( ! empty($_GET['csv']) ? absint($_GET['csv']) : false);
159
+			if ( ! empty($delete_csv) && ! empty($csv)) {
160
+				wp_delete_attachment($csv, true);
161 161
 			}
162 162
 
163 163
 			$report      = give_import_donation_report();
164 164
 			$report_html = array(
165 165
 				'duplicate_donor'    => array(
166
-					__( '%s duplicate %s detected', 'give' ),
167
-					__( 'donor', 'give' ),
168
-					__( 'donors', 'give' ),
166
+					__('%s duplicate %s detected', 'give'),
167
+					__('donor', 'give'),
168
+					__('donors', 'give'),
169 169
 				),
170 170
 				'create_donor'       => array(
171
-					__( '%s %s created', 'give' ),
172
-					__( 'donor', 'give' ),
173
-					__( 'donors', 'give' ),
171
+					__('%s %s created', 'give'),
172
+					__('donor', 'give'),
173
+					__('donors', 'give'),
174 174
 				),
175 175
 				'create_form'        => array(
176
-					__( '%s donation %s created', 'give' ),
177
-					__( 'form', 'give' ),
178
-					__( 'forms', 'give' ),
176
+					__('%s donation %s created', 'give'),
177
+					__('form', 'give'),
178
+					__('forms', 'give'),
179 179
 				),
180 180
 				'duplicate_donation' => array(
181
-					__( '%s duplicate %s detected', 'give' ),
182
-					__( 'donation', 'give' ),
183
-					__( 'donations', 'give' ),
181
+					__('%s duplicate %s detected', 'give'),
182
+					__('donation', 'give'),
183
+					__('donations', 'give'),
184 184
 				),
185 185
 				'create_donation'    => array(
186
-					__( '%s %s imported', 'give' ),
187
-					__( 'donation', 'give' ),
188
-					__( 'donations', 'give' ),
186
+					__('%s %s imported', 'give'),
187
+					__('donation', 'give'),
188
+					__('donations', 'give'),
189 189
 				),
190 190
 			);
191 191
 			$total       = (int) $_GET['total'];
@@ -196,34 +196,34 @@  discard block
 block discarded – undo
196 196
 				<th colspan="2">
197 197
 					<h2>
198 198
 						<?php
199
-						if ( $success ) {
200
-							echo sprintf( __( 'Import complete! %s donations processed', 'give' ), "<strong>{$total}</strong>" );
199
+						if ($success) {
200
+							echo sprintf(__('Import complete! %s donations processed', 'give'), "<strong>{$total}</strong>");
201 201
 						} else {
202
-							echo sprintf( __( 'Failed to import %s donations', 'give' ), "<strong>{$total}</strong>" );
202
+							echo sprintf(__('Failed to import %s donations', 'give'), "<strong>{$total}</strong>");
203 203
 						}
204 204
 						?>
205 205
 					</h2>
206 206
 
207 207
 					<?php
208
-					$text      = __( 'Import Donation', 'give' );
208
+					$text      = __('Import Donation', 'give');
209 209
 					$query_arg = array(
210 210
 						'post_type' => 'give_forms',
211 211
 						'page'      => 'give-tools',
212 212
 						'tab'       => 'import',
213 213
 					);
214
-					if ( $success ) {
214
+					if ($success) {
215 215
 						$query_arg = array(
216 216
 							'post_type' => 'give_forms',
217 217
 							'page'      => 'give-payment-history',
218 218
 						);
219
-						$text      = __( 'View Donations', 'give' );
219
+						$text = __('View Donations', 'give');
220 220
 					}
221 221
 
222
-					foreach ( $report as $key => $value ) {
223
-						if ( array_key_exists( $key, $report_html ) && ! empty( $value ) ) {
222
+					foreach ($report as $key => $value) {
223
+						if (array_key_exists($key, $report_html) && ! empty($value)) {
224 224
 							?>
225 225
 							<p>
226
-								<?php echo esc_html( wp_sprintf( $report_html[ $key ][0], $value, _n( $report_html[ $key ][1], $report_html[ $key ][2], $value, 'give' ) ) ); ?>
226
+								<?php echo esc_html(wp_sprintf($report_html[$key][0], $value, _n($report_html[$key][1], $report_html[$key][2], $value, 'give'))); ?>
227 227
 							</p>
228 228
 							<?php
229 229
 						}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 					?>
232 232
 
233 233
 					<p>
234
-						<a class="button button-large button-secondary" href="<?php echo add_query_arg( $query_arg, admin_url( 'edit.php' ) ); ?>"><?php echo $text; ?></a>
234
+						<a class="button button-large button-secondary" href="<?php echo add_query_arg($query_arg, admin_url('edit.php')); ?>"><?php echo $text; ?></a>
235 235
 					</p>
236 236
 				</th>
237 237
 			</tr>
@@ -249,22 +249,22 @@  discard block
 block discarded – undo
249 249
 			$index_start = 1;
250 250
 			$index_end   = 1;
251 251
 			$next        = true;
252
-			$total       = self::get_csv_total( $csv );
253
-			if ( self::$per_page < $total ) {
254
-				$total_ajax = ceil( $total / self::$per_page );
252
+			$total       = self::get_csv_total($csv);
253
+			if (self::$per_page < $total) {
254
+				$total_ajax = ceil($total / self::$per_page);
255 255
 				$index_end  = self::$per_page;
256 256
 			} else {
257 257
 				$total_ajax = 1;
258 258
 				$index_end  = $total;
259 259
 				$next       = false;
260 260
 			}
261
-			$current_percentage = 100 / ( $total_ajax + 1 );
261
+			$current_percentage = 100 / ($total_ajax + 1);
262 262
 
263 263
 			?>
264 264
 			<tr valign="top" class="give-import-dropdown">
265 265
 				<th colspan="2">
266
-					<h2 id="give-import-title"><?php esc_html_e( 'Importing', 'give' ) ?></h2>
267
-					<p class="give-field-description"><?php esc_html_e( 'Your donations are now being imported...', 'give' ) ?></p>
266
+					<h2 id="give-import-title"><?php esc_html_e('Importing', 'give') ?></h2>
267
+					<p class="give-field-description"><?php esc_html_e('Your donations are now being imported...', 'give') ?></p>
268 268
 				</th>
269 269
 			</tr>
270 270
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 						<div style="width: <?php echo $current_percentage; ?>%"></div>
284 284
 					</div>
285 285
 					<input type="hidden" value="3" name="step">
286
-					<input type="hidden" value='<?php echo maybe_serialize( $_REQUEST['mapto'] ); ?>' name="mapto"
286
+					<input type="hidden" value='<?php echo maybe_serialize($_REQUEST['mapto']); ?>' name="mapto"
287 287
 					       class="mapto">
288 288
 					<input type="hidden" value="<?php echo $_REQUEST['csv']; ?>" name="csv" class="csv">
289 289
 					<input type="hidden" value="<?php echo $_REQUEST['mode']; ?>" name="mode" class="mode">
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 					<input type="hidden" value="<?php echo $_REQUEST['delete_csv']; ?>" name="delete_csv"
293 293
 					       class="delete_csv">
294 294
 					<input type="hidden" value="<?php echo $_REQUEST['delimiter']; ?>" name="delimiter">
295
-					<input type="hidden" value='<?php echo maybe_serialize( self::get_importer( $csv ) ); ?>'
295
+					<input type="hidden" value='<?php echo maybe_serialize(self::get_importer($csv)); ?>'
296 296
 					       name="main_key"
297 297
 					       class="main_key">
298 298
 				</th>
@@ -313,20 +313,20 @@  discard block
 block discarded – undo
313 313
 		 */
314 314
 		static function check_for_dropdown_or_import() {
315 315
 			$return = true;
316
-			if ( isset( $_REQUEST['mapto'] ) ) {
316
+			if (isset($_REQUEST['mapto'])) {
317 317
 				$mapto = (array) $_REQUEST['mapto'];
318
-				if ( false === in_array( 'form_title', $mapto ) && false === in_array( 'form_id', $mapto ) ) {
319
-					Give_Admin_Settings::add_error( 'give-import-csv-form', __( 'Please select Form ID or Form Name options from the dropdown.', 'give' ) );
318
+				if (false === in_array('form_title', $mapto) && false === in_array('form_id', $mapto)) {
319
+					Give_Admin_Settings::add_error('give-import-csv-form', __('Please select Form ID or Form Name options from the dropdown.', 'give'));
320 320
 					$return = false;
321 321
 				}
322 322
 
323
-				if ( false === in_array( 'amount', $mapto ) ) {
324
-					Give_Admin_Settings::add_error( 'give-import-csv-amount', __( 'Please select Amount option from the dropdown.', 'give' ) );
323
+				if (false === in_array('amount', $mapto)) {
324
+					Give_Admin_Settings::add_error('give-import-csv-amount', __('Please select Amount option from the dropdown.', 'give'));
325 325
 					$return = false;
326 326
 				}
327 327
 
328
-				if ( false === in_array( 'email', $mapto ) && false === in_array( 'donor_id', $mapto ) ) {
329
-					Give_Admin_Settings::add_error( 'give-import-csv-donor', __( 'Please select Email id or Customer ID options from the dropdown.', 'give' ) );
328
+				if (false === in_array('email', $mapto) && false === in_array('donor_id', $mapto)) {
329
+					Give_Admin_Settings::add_error('give-import-csv-donor', __('Please select Email id or Customer ID options from the dropdown.', 'give'));
330 330
 					$return = false;
331 331
 				}
332 332
 			} else {
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
 			$csv = (int) $_GET['csv'];
346 346
 
347 347
 			// TO check if the CSV files that is being add is valid or not if not then redirect to first step again
348
-			$has_error = self::csv_check( $csv );
349
-			if ( $has_error ) {
348
+			$has_error = self::csv_check($csv);
349
+			if ($has_error) {
350 350
 				$url = give_import_page_url();
351 351
 				?>
352 352
 				<script type="text/javascript">
@@ -357,29 +357,29 @@  discard block
 block discarded – undo
357 357
 				?>
358 358
 				<tr valign="top" class="give-import-dropdown">
359 359
 					<th colspan="2">
360
-						<h2 id="give-import-title"><?php esc_html_e( 'Map CSV fields to donations', 'give' ) ?></h2>
361
-						<p class="give-field-description"><?php esc_html_e( 'Select fields from your CSV file to map against donations fields or to ignore during import.', 'give' ) ?></p>
360
+						<h2 id="give-import-title"><?php esc_html_e('Map CSV fields to donations', 'give') ?></h2>
361
+						<p class="give-field-description"><?php esc_html_e('Select fields from your CSV file to map against donations fields or to ignore during import.', 'give') ?></p>
362 362
 					</th>
363 363
 				</tr>
364 364
 
365 365
 				<tr valign="top" class="give-import-dropdown">
366
-					<th><b><?php esc_html_e( 'Column name', 'give' ); ?></b></th>
367
-					<th><b><?php esc_html_e( 'Map to field', 'give' ); ?></b></th>
366
+					<th><b><?php esc_html_e('Column name', 'give'); ?></b></th>
367
+					<th><b><?php esc_html_e('Map to field', 'give'); ?></b></th>
368 368
 				</tr>
369 369
 
370 370
 				<?php
371
-				$raw_key   = self::get_importer( $csv );
371
+				$raw_key   = self::get_importer($csv);
372 372
 				$donations = give_import_donations_options();
373 373
 				$donors    = give_import_donor_options();
374 374
 				$forms     = give_import_donation_form_options();
375 375
 
376
-				foreach ( $raw_key as $index => $value ) {
376
+				foreach ($raw_key as $index => $value) {
377 377
 					?>
378 378
 					<tr valign="top" class="give-import-option">
379 379
 						<th><?php echo $value; ?></th>
380 380
 						<th>
381 381
 							<?php
382
-							self::get_columns( $index, $donations, $donors, $forms, $value );
382
+							self::get_columns($index, $donations, $donors, $forms, $value);
383 383
 							?>
384 384
 						</th>
385 385
 					</tr>
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
 			}
389 389
 		}
390 390
 
391
-		static function selected( $option_value, $value ) {
391
+		static function selected($option_value, $value) {
392 392
 			$selected = '';
393
-			if ( stristr( $value, $option_value ) ) {
393
+			if (stristr($value, $option_value)) {
394 394
 				$selected = 'selected';
395
-			} elseif ( strrpos( $value, '_' ) && stristr( $option_value, 'Import as Meta' ) ) {
395
+			} elseif (strrpos($value, '_') && stristr($option_value, 'Import as Meta')) {
396 396
 				$selected = 'selected';
397 397
 			}
398 398
 
@@ -404,13 +404,13 @@  discard block
 block discarded – undo
404 404
 		 *
405 405
 		 * @since 1.8.13
406 406
 		 */
407
-		static function get_columns( $index, $donations, $donors, $forms, $value = false ) {
407
+		static function get_columns($index, $donations, $donors, $forms, $value = false) {
408 408
 			$default = give_import_default_options();
409 409
 			?>
410 410
 			<select name="mapto[<?php echo $index; ?>]">
411 411
 				<?php
412
-				foreach ( $default as $option => $option_value ) {
413
-					$checked = self::selected( $option_value, $value );
412
+				foreach ($default as $option => $option_value) {
413
+					$checked = self::selected($option_value, $value);
414 414
 					?>
415 415
 					<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
416 416
 					<?php
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 				?>
419 419
 				<optgroup label="Donations">
420 420
 					<?php
421
-					foreach ( $donations as $option => $option_value ) {
422
-						$checked = self::selected( $option_value, $value );
421
+					foreach ($donations as $option => $option_value) {
422
+						$checked = self::selected($option_value, $value);
423 423
 						?>
424 424
 						<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
425 425
 						<?php
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
 
430 430
 				<optgroup label="Donors">
431 431
 					<?php
432
-					foreach ( $donors as $option => $option_value ) {
433
-						$checked = self::selected( $option_value, $value );
432
+					foreach ($donors as $option => $option_value) {
433
+						$checked = self::selected($option_value, $value);
434 434
 						?>
435 435
 						<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
436 436
 						<?php
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 
441 441
 				<optgroup label="Forms">
442 442
 					<?php
443
-					foreach ( $forms as $option => $option_value ) {
444
-						$checked = self::selected( $option_value, $value );
443
+					foreach ($forms as $option => $option_value) {
444
+						$checked = self::selected($option_value, $value);
445 445
 						?>
446 446
 						<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
447 447
 						<?php
@@ -450,19 +450,19 @@  discard block
 block discarded – undo
450 450
 				</optgroup>
451 451
 
452 452
 				<?php
453
-				do_action( 'give_import_dropdown_option', $index, $donations, $donors, $forms, $value );
453
+				do_action('give_import_dropdown_option', $index, $donations, $donors, $forms, $value);
454 454
 				?>
455 455
 			</select>
456 456
 			<?php
457 457
 		}
458 458
 
459
-		static function get_csv_total( $file_id ) {
459
+		static function get_csv_total($file_id) {
460 460
 			$total = false;
461
-			if ( $file_id ) {
462
-				$file_dir = get_attached_file( $file_id );
463
-				if ( $file_dir ) {
464
-					$file = new SplFileObject( $file_dir, 'r' );
465
-					$file->seek( PHP_INT_MAX );
461
+			if ($file_id) {
462
+				$file_dir = get_attached_file($file_id);
463
+				if ($file_dir) {
464
+					$file = new SplFileObject($file_dir, 'r');
465
+					$file->seek(PHP_INT_MAX);
466 466
 					$total = $file->key() + 1;
467 467
 				}
468 468
 			}
@@ -481,15 +481,15 @@  discard block
 block discarded – undo
481 481
 		 *
482 482
 		 * @return array|bool $raw_data title of the CSV file fields
483 483
 		 */
484
-		static function get_importer( $file_id, $index = 0, $delimiter = ',' ) {
484
+		static function get_importer($file_id, $index = 0, $delimiter = ',') {
485 485
 			$raw_data = false;
486
-			$file_dir = get_attached_file( $file_id );
487
-			if ( $file_dir ) {
488
-				if ( false !== ( $handle = fopen( $file_dir, 'r' ) ) ) {
489
-					$raw_data = fgetcsv( $handle, $index, $delimiter );
486
+			$file_dir = get_attached_file($file_id);
487
+			if ($file_dir) {
488
+				if (false !== ($handle = fopen($file_dir, 'r'))) {
489
+					$raw_data = fgetcsv($handle, $index, $delimiter);
490 490
 					// Remove BOM signature from the first item.
491
-					if ( isset( $raw_data[0] ) ) {
492
-						$raw_data[0] = self::remove_utf8_bom( $raw_data[0] );
491
+					if (isset($raw_data[0])) {
492
+						$raw_data[0] = self::remove_utf8_bom($raw_data[0]);
493 493
 					}
494 494
 				}
495 495
 			}
@@ -506,9 +506,9 @@  discard block
 block discarded – undo
506 506
 		 *
507 507
 		 * @return string
508 508
 		 */
509
-		static function remove_utf8_bom( $string ) {
510
-			if ( 'efbbbf' === substr( bin2hex( $string ), 0, 6 ) ) {
511
-				$string = substr( $string, 3 );
509
+		static function remove_utf8_bom($string) {
510
+			if ('efbbbf' === substr(bin2hex($string), 0, 6)) {
511
+				$string = substr($string, 3);
512 512
 			}
513 513
 
514 514
 			return $string;
@@ -524,10 +524,10 @@  discard block
 block discarded – undo
524 524
 			$step = Give_Settings_Import::get_step();
525 525
 			?>
526 526
 			<ol class="give-progress-steps">
527
-				<li class="<?php echo( 1 === $step ? 'active' : '' ); ?>"><?php esc_html_e( 'Upload CSV file', 'give' ); ?></li>
528
-				<li class="<?php echo( 2 === $step ? 'active' : '' ); ?>"><?php esc_html_e( 'Column mapping', 'give' ); ?></li>
529
-				<li class="<?php echo( 3 === $step ? 'active' : '' ); ?>"><?php esc_html_e( 'Import', 'give' ); ?></li>
530
-				<li class="<?php echo( 4 === $step ? 'active' : '' ); ?>"><?php esc_html_e( 'Done!', 'give' ); ?></li>
527
+				<li class="<?php echo(1 === $step ? 'active' : ''); ?>"><?php esc_html_e('Upload CSV file', 'give'); ?></li>
528
+				<li class="<?php echo(2 === $step ? 'active' : ''); ?>"><?php esc_html_e('Column mapping', 'give'); ?></li>
529
+				<li class="<?php echo(3 === $step ? 'active' : ''); ?>"><?php esc_html_e('Import', 'give'); ?></li>
530
+				<li class="<?php echo(4 === $step ? 'active' : ''); ?>"><?php esc_html_e('Done!', 'give'); ?></li>
531 531
 			</ol>
532 532
 			<?php
533 533
 		}
@@ -540,15 +540,15 @@  discard block
 block discarded – undo
540 540
 		 * @return int $step on which step doest the import is on.
541 541
 		 */
542 542
 		static function get_step() {
543
-			$step    = (int) ( isset( $_REQUEST['step'] ) ? give_clean( $_REQUEST['step'] ) : 0 );
543
+			$step    = (int) (isset($_REQUEST['step']) ? give_clean($_REQUEST['step']) : 0);
544 544
 			$on_step = 1;
545
-			if ( empty( $step ) || 1 === $step ) {
545
+			if (empty($step) || 1 === $step) {
546 546
 				$on_step = 1;
547
-			} elseif ( self::check_for_dropdown_or_import() ) {
547
+			} elseif (self::check_for_dropdown_or_import()) {
548 548
 				$on_step = 3;
549
-			} elseif ( 2 === $step ) {
549
+			} elseif (2 === $step) {
550 550
 				$on_step = 2;
551
-			} elseif ( 4 === $step ) {
551
+			} elseif (4 === $step) {
552 552
 				$on_step = 4;
553 553
 			}
554 554
 
@@ -566,56 +566,56 @@  discard block
 block discarded – undo
566 566
 			?>
567 567
 			<tr valign="top">
568 568
 				<th colspan="2">
569
-					<h2 id="give-import-title"><?php esc_html_e( 'Import donations from a CSV file', 'give' ) ?></h2>
570
-					<p class="give-field-description"><?php esc_html_e( 'This tool allows you to import (or merge) donation data to give from a CSV file.', 'give' ) ?></p>
569
+					<h2 id="give-import-title"><?php esc_html_e('Import donations from a CSV file', 'give') ?></h2>
570
+					<p class="give-field-description"><?php esc_html_e('This tool allows you to import (or merge) donation data to give from a CSV file.', 'give') ?></p>
571 571
 				</th>
572 572
 			</tr>
573 573
 			<?php
574
-			$csv         = ( isset( $_REQUEST['csv'] ) ? give_clean( $_POST['csv'] ) : '' );
575
-			$delimiter   = ( isset( $_REQUEST['delimiter'] ) ? give_clean( $_POST['delimiter'] ) : ',' );
576
-			$mode        = ( ! empty( $_REQUEST['mode'] ) ? 'on' : '' );
577
-			$create_user = ( isset( $_REQUEST['create_user'] ) && isset( $_REQUEST['csv'] ) && 1 == absint( $_REQUEST['create_user'] ) ? 'on' : ( isset( $_REQUEST['csv'] ) ? '' : 'on' ) );
578
-			$delete_csv = ( isset( $_REQUEST['delete_csv'] ) && isset( $_REQUEST['csv'] ) && 1 == absint( $_REQUEST['delete_csv'] ) ? 'on' : ( isset( $_REQUEST['csv'] ) ? '' : 'on' ) );
574
+			$csv         = (isset($_REQUEST['csv']) ? give_clean($_POST['csv']) : '');
575
+			$delimiter   = (isset($_REQUEST['delimiter']) ? give_clean($_POST['delimiter']) : ',');
576
+			$mode        = ( ! empty($_REQUEST['mode']) ? 'on' : '');
577
+			$create_user = (isset($_REQUEST['create_user']) && isset($_REQUEST['csv']) && 1 == absint($_REQUEST['create_user']) ? 'on' : (isset($_REQUEST['csv']) ? '' : 'on'));
578
+			$delete_csv = (isset($_REQUEST['delete_csv']) && isset($_REQUEST['csv']) && 1 == absint($_REQUEST['delete_csv']) ? 'on' : (isset($_REQUEST['csv']) ? '' : 'on'));
579 579
 
580 580
 			$settings = array(
581 581
 				array(
582 582
 					'id'         => 'csv',
583
-					'name'       => __( 'Choose a CSV file:', 'give' ),
583
+					'name'       => __('Choose a CSV file:', 'give'),
584 584
 					'type'       => 'file',
585
-					'attributes' => array( 'editing' => 'false', 'library' => 'text' ),
585
+					'attributes' => array('editing' => 'false', 'library' => 'text'),
586 586
 					'fvalue'     => 'id',
587 587
 					'default'    => $csv,
588 588
 				),
589 589
 				array(
590 590
 					'id'         => 'delimiter',
591
-					'name'       => __( 'CSV Delimiter:', 'give' ),
591
+					'name'       => __('CSV Delimiter:', 'give'),
592 592
 					'type'       => 'text',
593
-					'attributes' => array( 'placeholder' => ',', 'size' => '2' ),
593
+					'attributes' => array('placeholder' => ',', 'size' => '2'),
594 594
 					'default'    => $delimiter,
595 595
 				),
596 596
 				array(
597 597
 					'id'      => 'mode',
598
-					'name'    => __( 'Test Mode:', 'give' ),
598
+					'name'    => __('Test Mode:', 'give'),
599 599
 					'type'    => 'checkbox',
600 600
 					'default' => $mode,
601 601
 				),
602 602
 				array(
603 603
 					'id'      => 'create_user',
604
-					'name'    => __( 'Create WP users for new donors:', 'give' ),
604
+					'name'    => __('Create WP users for new donors:', 'give'),
605 605
 					'type'    => 'checkbox',
606 606
 					'default' => $create_user,
607 607
 				),
608 608
 				array(
609 609
 					'id'      => 'delete_csv',
610
-					'name'    => __( 'Delete CSV after import:', 'give' ),
610
+					'name'    => __('Delete CSV after import:', 'give'),
611 611
 					'type'    => 'checkbox',
612 612
 					'default' => $delete_csv,
613 613
 				),
614 614
 			);
615 615
 
616
-			$settings = apply_filters( 'give_import_file_upload_html', $settings );
616
+			$settings = apply_filters('give_import_file_upload_html', $settings);
617 617
 
618
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
618
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
619 619
 		}
620 620
 
621 621
 		/**
@@ -628,21 +628,21 @@  discard block
 block discarded – undo
628 628
 			$step = Give_Settings_Import::get_step();
629 629
 
630 630
 			// Validation for first step.
631
-			if ( 1 === $step ) {
632
-				$csv = absint( $_POST['csv'] );
631
+			if (1 === $step) {
632
+				$csv = absint($_POST['csv']);
633 633
 
634
-				$has_error = self::csv_check( $csv );
634
+				$has_error = self::csv_check($csv);
635 635
 
636
-				if ( false == $has_error ) {
636
+				if (false == $has_error) {
637 637
 
638
-					$url = give_import_page_url( (array) apply_filters( 'give_import_step_two_url', array(
638
+					$url = give_import_page_url((array) apply_filters('give_import_step_two_url', array(
639 639
 						'step'        => '2',
640 640
 						'csv'         => $csv,
641
-						'delimiter'   => ( isset( $_REQUEST['delimiter'] ) ) ? give_clean( $_REQUEST['delimiter'] ) : ',',
642
-						'mode'        => ( isset( $_REQUEST['mode'] ) ) ? give_clean( $_REQUEST['mode'] ) : '0',
643
-						'create_user' => ( isset( $_REQUEST['create_user'] ) ) ? give_clean( $_REQUEST['create_user'] ) : '0',
644
-						'delete_csv'  => ( isset( $_REQUEST['delete_csv'] ) ) ? give_clean( $_REQUEST['delete_csv'] ) : '0',
645
-					) ) );
641
+						'delimiter'   => (isset($_REQUEST['delimiter'])) ? give_clean($_REQUEST['delimiter']) : ',',
642
+						'mode'        => (isset($_REQUEST['mode'])) ? give_clean($_REQUEST['mode']) : '0',
643
+						'create_user' => (isset($_REQUEST['create_user'])) ? give_clean($_REQUEST['create_user']) : '0',
644
+						'delete_csv'  => (isset($_REQUEST['delete_csv'])) ? give_clean($_REQUEST['delete_csv']) : '0',
645
+					)));
646 646
 					?>
647 647
 					<script type="text/javascript">
648 648
 						window.location = "<?php echo $url; ?>"
@@ -661,19 +661,19 @@  discard block
 block discarded – undo
661 661
 		 *
662 662
 		 * return bool $has_error CSV is valid or not.
663 663
 		 */
664
-		static function csv_check( $csv = false ) {
664
+		static function csv_check($csv = false) {
665 665
 			$has_error = false;
666
-			if ( $csv ) {
667
-				if ( ! wp_get_attachment_url( $csv ) ) {
666
+			if ($csv) {
667
+				if ( ! wp_get_attachment_url($csv)) {
668 668
 					$has_error = true;
669
-					Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide the ID to a valid CSV file.', 'give' ) );
670
-				} elseif ( ( $mime_type = get_post_mime_type( $csv ) ) && ! strpos( $mime_type, 'csv' ) ) {
669
+					Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide the ID to a valid CSV file.', 'give'));
670
+				} elseif (($mime_type = get_post_mime_type($csv)) && ! strpos($mime_type, 'csv')) {
671 671
 					$has_error = true;
672
-					Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide the ID to a valid CSV file.', 'give' ) );
672
+					Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide the ID to a valid CSV file.', 'give'));
673 673
 				}
674 674
 			} else {
675 675
 				$has_error = true;
676
-				Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide the ID to a valid CSV file.', 'give' ) );
676
+				Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide the ID to a valid CSV file.', 'give'));
677 677
 			}
678 678
 
679 679
 			return $has_error;
@@ -688,8 +688,8 @@  discard block
 block discarded – undo
688 688
 		 *
689 689
 		 * @return array
690 690
 		 */
691
-		public function add_settings_page( $pages ) {
692
-			$pages[ $this->id ] = $this->label;
691
+		public function add_settings_page($pages) {
692
+			$pages[$this->id] = $this->label;
693 693
 
694 694
 			return $pages;
695 695
 		}
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
 			 * @param  array $settings
713 713
 			 */
714 714
 			$settings = apply_filters(
715
-				'give_get_settings_' . $this->id,
715
+				'give_get_settings_'.$this->id,
716 716
 				array(
717 717
 					array(
718 718
 						'id'   => 'import',
719
-						'name' => __( 'Import Donations', 'give' ),
719
+						'name' => __('Import Donations', 'give'),
720 720
 						'type' => 'tools_import',
721 721
 					),
722 722
 				)
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 		 */
735 735
 		public function output() {
736 736
 			$settings = $this->get_settings();
737
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
737
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
738 738
 		}
739 739
 
740 740
 		/**
@@ -746,8 +746,8 @@  discard block
 block discarded – undo
746 746
 		 * @param $field
747 747
 		 * @param $option_value
748 748
 		 */
749
-		public function render_import_field( $field, $option_value ) {
750
-			include_once( 'views/html-admin-page-imports.php' );
749
+		public function render_import_field($field, $option_value) {
750
+			include_once('views/html-admin-page-imports.php');
751 751
 		}
752 752
 	}
753 753
 }
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-general.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_General' ) ) :
16
+if ( ! class_exists('Give_Settings_General')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_General.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'general';
30
-			$this->label = esc_html__( 'General', 'give' );
30
+			$this->label = esc_html__('General', 'give');
31 31
 
32 32
 			$this->default_tab = 'general-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'access-control':
49 49
 					$settings = array(
50 50
 						// Section 3: Access control.
@@ -54,47 +54,47 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'session_lifetime',
57
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
58
-							'desc'    => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
57
+							'name'    => esc_html__('Session Lifetime', 'give'),
58
+							'desc'    => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => array(
61
-								'86400'  => esc_html__( '24 Hours', 'give' ),
62
-								'172800' => esc_html__( '48 Hours', 'give' ),
63
-								'259200' => esc_html__( '72 Hours', 'give' ),
64
-								'604800' => esc_html__( '1 Week', 'give' ),
61
+								'86400'  => esc_html__('24 Hours', 'give'),
62
+								'172800' => esc_html__('48 Hours', 'give'),
63
+								'259200' => esc_html__('72 Hours', 'give'),
64
+								'604800' => esc_html__('1 Week', 'give'),
65 65
 							)
66 66
 						),
67 67
 						array(
68
-							'name'    => esc_html__( 'Email Access', 'give' ),
69
-							'desc'    => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
68
+							'name'    => esc_html__('Email Access', 'give'),
69
+							'desc'    => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
70 70
 							'id'      => 'email_access',
71 71
 							'type'    => 'radio_inline',
72 72
 							'default' => 'disabled',
73 73
 							'options' => array(
74
-								'enabled'  => __( 'Enabled', 'give' ),
75
-								'disabled' => __( 'Disabled', 'give' ),
74
+								'enabled'  => __('Enabled', 'give'),
75
+								'disabled' => __('Disabled', 'give'),
76 76
 							)
77 77
 						),
78 78
 						array(
79 79
 							'id'      => 'recaptcha_key',
80
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
80
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
81 81
 							/* translators: %s: https://www.google.com/recaptcha/ */
82
-							'desc'    => sprintf( __( 'Please paste your reCAPTCHA site key here. <br />If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ),
82
+							'desc'    => sprintf(__('Please paste your reCAPTCHA site key here. <br />If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('http://docs.givewp.com/recaptcha')),
83 83
 							'default' => '',
84 84
 							'type'    => 'text'
85 85
 						),
86 86
 						array(
87 87
 							'id'      => 'recaptcha_secret',
88
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
89
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give' ),
88
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
89
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give'),
90 90
 							'default' => '',
91 91
 							'type'    => 'text'
92 92
 						),
93 93
 						array(
94
-							'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
94
+							'name'  => esc_html__('Access Control Docs Link', 'give'),
95 95
 							'id'    => 'access_control_docs_link',
96
-							'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
-							'title' => __( 'Access Control', 'give' ),
96
+							'url'   => esc_url('http://docs.givewp.com/settings-access-control'),
97
+							'title' => __('Access Control', 'give'),
98 98
 							'type'  => 'give_docs_link',
99 99
 						),
100 100
 						array(
@@ -112,61 +112,61 @@  discard block
 block discarded – undo
112 112
 							'id'   => 'give_title_general_settings_2'
113 113
 						),
114 114
 						array(
115
-							'name' => esc_html__( 'Currency Settings', 'give' ),
115
+							'name' => esc_html__('Currency Settings', 'give'),
116 116
 							'desc' => '',
117 117
 							'type' => 'give_title',
118 118
 							'id'   => 'give_title_general_settings_2'
119 119
 						),
120 120
 						array(
121
-							'name'    => esc_html__( 'Currency', 'give' ),
122
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
121
+							'name'    => esc_html__('Currency', 'give'),
122
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
123 123
 							'id'      => 'currency',
124 124
 							'type'    => 'select',
125 125
 							'options' => give_get_currencies(),
126 126
 							'default' => 'USD',
127 127
 						),
128 128
 						array(
129
-							'name'    => esc_html__( 'Currency Position', 'give' ),
130
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
129
+							'name'    => esc_html__('Currency Position', 'give'),
130
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
131 131
 							'id'      => 'currency_position',
132 132
 							'type'    => 'select',
133 133
 							'options' => array(
134 134
 								/* translators: %s: currency symbol */
135
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
135
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
136 136
 								/* translators: %s: currency symbol */
137
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
137
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
138 138
 							),
139 139
 							'default' => 'before',
140 140
 						),
141 141
 						array(
142
-							'name'    => esc_html__( 'Thousands Separator', 'give' ),
143
-							'desc'    => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
142
+							'name'    => esc_html__('Thousands Separator', 'give'),
143
+							'desc'    => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
144 144
 							'id'      => 'thousands_separator',
145 145
 							'type'    => 'text',
146 146
 							'default' => ',',
147 147
 							'css'     => 'width:12em;',
148 148
 						),
149 149
 						array(
150
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
151
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
150
+							'name'    => esc_html__('Decimal Separator', 'give'),
151
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
152 152
 							'id'      => 'decimal_separator',
153 153
 							'type'    => 'text',
154 154
 							'default' => '.',
155 155
 							'css'     => 'width:12em;',
156 156
 						),
157 157
 						array(
158
-							'name'    => __( 'Number of Decimals', 'give' ),
159
-							'desc'    => __( 'The number of decimal points displayed in amounts.', 'give' ),
158
+							'name'    => __('Number of Decimals', 'give'),
159
+							'desc'    => __('The number of decimal points displayed in amounts.', 'give'),
160 160
 							'id'      => 'number_decimals',
161 161
 							'type'    => 'text',
162 162
 							'default' => 2,
163 163
 							'css'     => 'width:12em;',
164 164
 						),
165 165
 						array(
166
-							'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
166
+							'name'  => esc_html__('Currency Options Docs Link', 'give'),
167 167
 							'id'    => 'currency_settings_docs_link',
168
-							'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
-							'title' => __( 'Currency Settings', 'give' ),
168
+							'url'   => esc_url('http://docs.givewp.com/settings-currency'),
169
+							'title' => __('Currency Settings', 'give'),
170 170
 							'type'  => 'give_docs_link',
171 171
 						),
172 172
 						array(
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 					$country = give_get_country();
182 182
 
183 183
 					// get the list of the states of which defalut country is selected
184
-					$states = give_get_states( $country );
184
+					$states = give_get_states($country);
185 185
 
186 186
 					// Get the country list that does not have any states init.
187 187
 					$no_states_country = give_no_states_country_list();
@@ -193,46 +193,46 @@  discard block
 block discarded – undo
193 193
 							'id'   => 'give_title_general_settings_1'
194 194
 						),
195 195
 						array(
196
-							'name' => esc_html__( 'General Settings', 'give' ),
196
+							'name' => esc_html__('General Settings', 'give'),
197 197
 							'desc' => '',
198 198
 							'type' => 'give_title',
199 199
 							'id'   => 'give_title_general_settings_1'
200 200
 						),
201 201
 						array(
202
-							'name'    => esc_html__( 'Success Page', 'give' ),
202
+							'name'    => esc_html__('Success Page', 'give'),
203 203
 							/* translators: %s: [give_receipt] */
204
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
204
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
205 205
 							'id'      => 'success_page',
206 206
 							'type'    => 'select',
207
-							'options' => give_cmb2_get_post_options( array(
207
+							'options' => give_cmb2_get_post_options(array(
208 208
 								'post_type'   => 'page',
209
-								'numberposts' => - 1
210
-							) ),
209
+								'numberposts' => -1
210
+							)),
211 211
 						),
212 212
 						array(
213
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
214
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
213
+							'name'    => esc_html__('Failed Donation Page', 'give'),
214
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
215 215
 							'id'      => 'failure_page',
216 216
 							'type'    => 'select',
217
-							'options' => give_cmb2_get_post_options( array(
217
+							'options' => give_cmb2_get_post_options(array(
218 218
 								'post_type'   => 'page',
219
-								'numberposts' => - 1
220
-							) ),
219
+								'numberposts' => -1
220
+							)),
221 221
 						),
222 222
 						array(
223
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
223
+							'name'    => esc_html__('Donation History Page', 'give'),
224 224
 							/* translators: %s: [donation_history] */
225
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
225
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
226 226
 							'id'      => 'history_page',
227 227
 							'type'    => 'select',
228
-							'options' => give_cmb2_get_post_options( array(
228
+							'options' => give_cmb2_get_post_options(array(
229 229
 								'post_type'   => 'page',
230
-								'numberposts' => - 1
231
-							) ),
230
+								'numberposts' => -1
231
+							)),
232 232
 						),
233 233
 						array(
234
-							'name'    => esc_html__( 'Base Country', 'give' ),
235
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
234
+							'name'    => esc_html__('Base Country', 'give'),
235
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
236 236
 							'id'      => 'base_country',
237 237
 							'type'    => 'select',
238 238
 							'options' => give_get_country_list(),
@@ -243,18 +243,18 @@  discard block
 block discarded – undo
243 243
 						 * @since 1.8.14
244 244
 						 */
245 245
 						array(
246
-							'wrapper_class'    => ( array_key_exists( $country, $no_states_country ) ? 'give-hidden' : '' ),
247
-							'name'    => __( 'Base State/Province', 'give' ),
248
-							'desc'    => __( 'The state/province your site operates from.', 'give' ),
246
+							'wrapper_class'    => (array_key_exists($country, $no_states_country) ? 'give-hidden' : ''),
247
+							'name'    => __('Base State/Province', 'give'),
248
+							'desc'    => __('The state/province your site operates from.', 'give'),
249 249
 							'id'      => 'base_state',
250
-							'type'    => ( empty( $states ) ? 'text' : 'select' ),
250
+							'type'    => (empty($states) ? 'text' : 'select'),
251 251
 							'options' => $states,
252 252
 						),
253 253
 						array(
254
-							'name'  => esc_html__( 'General Options Docs Link', 'give' ),
254
+							'name'  => esc_html__('General Options Docs Link', 'give'),
255 255
 							'id'    => 'general_options_docs_link',
256
-							'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
257
-							'title' => __( 'General Options', 'give' ),
256
+							'url'   => esc_url('http://docs.givewp.com/settings-general'),
257
+							'title' => __('General Options', 'give'),
258 258
 							'type'  => 'give_docs_link',
259 259
 						),
260 260
 						array(
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 			 * Filter the general settings.
270 270
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
271 271
 			 */
272
-			$settings = apply_filters( 'give_settings_general', $settings );
272
+			$settings = apply_filters('give_settings_general', $settings);
273 273
 
274 274
 			/**
275 275
 			 * Filter the settings.
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			 *
279 279
 			 * @param  array $settings
280 280
 			 */
281
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
281
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
282 282
 
283 283
 			// Output.
284 284
 			return $settings;
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 		 */
293 293
 		public function get_sections() {
294 294
 			$sections = array(
295
-				'general-settings'  => esc_html__( 'General', 'give' ),
296
-				'currency-settings' => esc_html__( 'Currency', 'give' ),
297
-				'access-control'    => esc_html__( 'Access Control', 'give' )
295
+				'general-settings'  => esc_html__('General', 'give'),
296
+				'currency-settings' => esc_html__('Currency', 'give'),
297
+				'access-control'    => esc_html__('Access Control', 'give')
298 298
 			);
299 299
 
300
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
300
+			return apply_filters('give_get_sections_'.$this->id, $sections);
301 301
 		}
302 302
 	}
303 303
 
Please login to merge, or discard this patch.
includes/forms/template.php 2 patches
Spacing   +402 added lines, -403 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,29 +1013,29 @@  discard block
 block discarded – undo
1013 1013
 		<?php
1014 1014
 		$selected_state = '';
1015 1015
 
1016
-		if ( $selected_country === give_get_country() ) {
1016
+		if ($selected_country === give_get_country()) {
1017 1017
 			// Get defalut selected state by admin.
1018 1018
 			$selected_state = give_get_state();
1019 1019
 		}
1020 1020
 
1021 1021
 		// Get the last payment made by user states.
1022
-		if ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {
1022
+		if ( ! empty($give_user_info['card_state']) && '*' !== $give_user_info['card_state']) {
1023 1023
 			$selected_state = $give_user_info['card_state'];
1024 1024
 		}
1025 1025
 
1026 1026
 		// Get the country code
1027
-		if ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {
1027
+		if ( ! empty($give_user_info['billing_country']) && '*' !== $give_user_info['billing_country']) {
1028 1028
 			$selected_country = $give_user_info['billing_country'];
1029 1029
 		}
1030 1030
 
1031
-		$label        = __( 'State', 'give' );
1031
+		$label        = __('State', 'give');
1032 1032
 		$states_label = give_get_states_label();
1033 1033
 		// Check if $country code exists in the array key for states label.
1034
-		if ( array_key_exists( $selected_country, $states_label ) ) {
1035
-			$label = $states_label[ $selected_country ];
1034
+		if (array_key_exists($selected_country, $states_label)) {
1035
+			$label = $states_label[$selected_country];
1036 1036
 		}
1037 1037
 
1038
-		$states = give_get_states( $selected_country );
1038
+		$states = give_get_states($selected_country);
1039 1039
 
1040 1040
 		// Get the country list that do not have any states init.
1041 1041
 		$no_states_country = give_no_states_country_list();
@@ -1044,27 +1044,27 @@  discard block
 block discarded – undo
1044 1044
 		$states_not_required_country_list = give_states_not_required_country_list();
1045 1045
 		?>
1046 1046
         <p id="give-card-state-wrap"
1047
-           class="form-row form-row-last form-row-responsive <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ) ? 'give-hidden' : ''; ?> ">
1047
+           class="form-row form-row-last form-row-responsive <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country)) ? 'give-hidden' : ''; ?> ">
1048 1048
             <label for="card_state" class="give-label">
1049 1049
                 <span class="state-label-text"><?php echo $label; ?></span>
1050
-				<?php if ( give_field_is_required( 'card_state', $form_id ) ) :
1050
+				<?php if (give_field_is_required('card_state', $form_id)) :
1051 1051
 					?>
1052
-                    <span class="give-required-indicator <?php echo( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span>
1052
+                    <span class="give-required-indicator <?php echo(array_key_exists($selected_country, $states_not_required_country_list) ? 'give-hidden' : '') ?> ">*</span>
1053 1053
 				<?php endif; ?>
1054 1054
                 <span class="give-tooltip give-icon give-icon-question"
1055
-                      data-tooltip="<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>"></span>
1055
+                      data-tooltip="<?php esc_attr_e('The state, province, or county for your billing address.', 'give'); ?>"></span>
1056 1056
             </label>
1057 1057
 			<?php
1058 1058
 
1059
-			if ( ! empty( $states ) ) : ?>
1059
+			if ( ! empty($states)) : ?>
1060 1060
                 <select
1061 1061
                         name="card_state"
1062 1062
                         id="card_state"
1063
-                        class="card_state give-select<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required' : '' ); ?>"
1064
-					<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required aria-required="true" ' : '' ); ?>>
1063
+                        class="card_state give-select<?php echo(give_field_is_required('card_state', $form_id) ? ' required' : ''); ?>"
1064
+					<?php echo(give_field_is_required('card_state', $form_id) ? ' required aria-required="true" ' : ''); ?>>
1065 1065
 					<?php
1066
-					foreach ( $states as $state_code => $state ) {
1067
-						echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
1066
+					foreach ($states as $state_code => $state) {
1067
+						echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
1068 1068
 					}
1069 1069
 					?>
1070 1070
                 </select>
@@ -1081,14 +1081,14 @@  discard block
 block discarded – undo
1081 1081
 		 *
1082 1082
 		 * @param int $form_id The form ID.
1083 1083
 		 */
1084
-		do_action( 'give_cc_billing_bottom' );
1084
+		do_action('give_cc_billing_bottom');
1085 1085
 		?>
1086 1086
     </fieldset>
1087 1087
 	<?php
1088 1088
 	echo ob_get_clean();
1089 1089
 }
1090 1090
 
1091
-add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' );
1091
+add_action('give_after_cc_fields', 'give_default_cc_address_fields');
1092 1092
 
1093 1093
 
1094 1094
 /**
@@ -1101,24 +1101,24 @@  discard block
 block discarded – undo
1101 1101
  *
1102 1102
  * @return string
1103 1103
  */
1104
-function give_get_register_fields( $form_id ) {
1104
+function give_get_register_fields($form_id) {
1105 1105
 
1106 1106
 	global $user_ID;
1107 1107
 
1108
-	if ( is_user_logged_in() ) {
1109
-		$user_data = get_userdata( $user_ID );
1108
+	if (is_user_logged_in()) {
1109
+		$user_data = get_userdata($user_ID);
1110 1110
 	}
1111 1111
 
1112
-	$show_register_form = give_show_login_register_option( $form_id );
1112
+	$show_register_form = give_show_login_register_option($form_id);
1113 1113
 
1114 1114
 	ob_start(); ?>
1115 1115
     <fieldset id="give-register-fields-<?php echo $form_id; ?>">
1116 1116
 
1117
-		<?php if ( $show_register_form == 'both' ) { ?>
1117
+		<?php if ($show_register_form == 'both') { ?>
1118 1118
             <div class="give-login-account-wrap">
1119
-                <p class="give-login-message"><?php esc_html_e( 'Already have an account?', 'give' ); ?>&nbsp;
1120
-                    <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login"
1121
-                       data-action="give_checkout_login"><?php esc_html_e( 'Login', 'give' ); ?></a>
1119
+                <p class="give-login-message"><?php esc_html_e('Already have an account?', 'give'); ?>&nbsp;
1120
+                    <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login"
1121
+                       data-action="give_checkout_login"><?php esc_html_e('Login', 'give'); ?></a>
1122 1122
                 </p>
1123 1123
                 <p class="give-loading-text">
1124 1124
                     <span class="give-loading-animation"></span>
@@ -1134,15 +1134,15 @@  discard block
 block discarded – undo
1134 1134
 		 *
1135 1135
 		 * @param int $form_id The form ID.
1136 1136
 		 */
1137
-		do_action( 'give_register_fields_before', $form_id );
1137
+		do_action('give_register_fields_before', $form_id);
1138 1138
 		?>
1139 1139
 
1140 1140
         <fieldset id="give-register-account-fields-<?php echo $form_id; ?>">
1141 1141
             <legend>
1142 1142
 				<?php
1143
-				echo apply_filters( 'give_create_account_fieldset_heading', esc_html__( 'Create an account', 'give' ) );
1144
-				if ( ! give_logged_in_only( $form_id ) ) {
1145
-					echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1143
+				echo apply_filters('give_create_account_fieldset_heading', esc_html__('Create an account', 'give'));
1144
+				if ( ! give_logged_in_only($form_id)) {
1145
+					echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1146 1146
 				}
1147 1147
 				?>
1148 1148
             </legend>
@@ -1154,54 +1154,54 @@  discard block
 block discarded – undo
1154 1154
 			 *
1155 1155
 			 * @param int $form_id The form ID.
1156 1156
 			 */
1157
-			do_action( 'give_register_account_fields_before', $form_id );
1157
+			do_action('give_register_account_fields_before', $form_id);
1158 1158
 			?>
1159 1159
             <div id="give-user-login-wrap-<?php echo $form_id; ?>"
1160 1160
                  class="form-row form-row-one-third form-row-first form-row-responsive">
1161 1161
                 <label for="give-user-login-<?php echo $form_id; ?>">
1162
-					<?php esc_html_e( 'Username', 'give' ); ?>
1163
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1162
+					<?php esc_html_e('Username', 'give'); ?>
1163
+					<?php if (give_logged_in_only($form_id)) { ?>
1164 1164
                         <span class="give-required-indicator">*</span>
1165 1165
 					<?php } ?>
1166 1166
                     <span class="give-tooltip give-icon give-icon-question"
1167
-                          data-tooltip="<?php esc_attr_e( 'The username you will use to log into your account.', 'give' ); ?>"></span>
1167
+                          data-tooltip="<?php esc_attr_e('The username you will use to log into your account.', 'give'); ?>"></span>
1168 1168
                 </label>
1169 1169
 
1170 1170
                 <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="give-input"
1171 1171
                        type="text"
1172
-                       placeholder="<?php esc_attr_e( 'Username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1172
+                       placeholder="<?php esc_attr_e('Username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1173 1173
             </div>
1174 1174
 
1175 1175
             <div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1176 1176
                  class="form-row form-row-one-third form-row-responsive">
1177 1177
                 <label for="give-user-pass-<?php echo $form_id; ?>">
1178
-					<?php esc_html_e( 'Password', 'give' ); ?>
1179
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1178
+					<?php esc_html_e('Password', 'give'); ?>
1179
+					<?php if (give_logged_in_only($form_id)) { ?>
1180 1180
                         <span class="give-required-indicator">*</span>
1181 1181
 					<?php } ?>
1182 1182
                     <span class="give-tooltip give-icon give-icon-question"
1183
-                          data-tooltip="<?php esc_attr_e( 'The password used to access your account.', 'give' ); ?>"></span>
1183
+                          data-tooltip="<?php esc_attr_e('The password used to access your account.', 'give'); ?>"></span>
1184 1184
                 </label>
1185 1185
 
1186 1186
                 <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="give-input"
1187
-                       placeholder="<?php esc_attr_e( 'Password', 'give' ); ?>"
1188
-                       type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1187
+                       placeholder="<?php esc_attr_e('Password', 'give'); ?>"
1188
+                       type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1189 1189
             </div>
1190 1190
 
1191 1191
             <div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>"
1192 1192
                  class="give-register-password form-row form-row-one-third form-row-responsive">
1193 1193
                 <label for="give-user-pass-confirm-<?php echo $form_id; ?>">
1194
-					<?php esc_html_e( 'Confirm PW', 'give' ); ?>
1195
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1194
+					<?php esc_html_e('Confirm PW', 'give'); ?>
1195
+					<?php if (give_logged_in_only($form_id)) { ?>
1196 1196
                         <span class="give-required-indicator">*</span>
1197 1197
 					<?php } ?>
1198 1198
                     <span class="give-tooltip give-icon give-icon-question"
1199
-                          data-tooltip="<?php esc_attr_e( 'Please retype your password to confirm.', 'give' ); ?>"></span>
1199
+                          data-tooltip="<?php esc_attr_e('Please retype your password to confirm.', 'give'); ?>"></span>
1200 1200
                 </label>
1201 1201
 
1202 1202
                 <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>"
1203
-                       class="give-input" placeholder="<?php esc_attr_e( 'Confirm password', 'give' ); ?>"
1204
-                       type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1203
+                       class="give-input" placeholder="<?php esc_attr_e('Confirm password', 'give'); ?>"
1204
+                       type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1205 1205
             </div>
1206 1206
 			<?php
1207 1207
 			/**
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 			 *
1212 1212
 			 * @param int $form_id The form ID.
1213 1213
 			 */
1214
-			do_action( 'give_register_account_fields_after', $form_id );
1214
+			do_action('give_register_account_fields_after', $form_id);
1215 1215
 			?>
1216 1216
         </fieldset>
1217 1217
 
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 		 *
1224 1224
 		 * @param int $form_id The form ID.
1225 1225
 		 */
1226
-		do_action( 'give_register_fields_after', $form_id );
1226
+		do_action('give_register_fields_after', $form_id);
1227 1227
 		?>
1228 1228
 
1229 1229
         <input type="hidden" name="give-purchase-var" value="needs-to-register"/>
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 		 *
1235 1235
 		 * @since 1.7
1236 1236
 		 */
1237
-		do_action( 'give_donation_form_user_info', $form_id );
1237
+		do_action('give_donation_form_user_info', $form_id);
1238 1238
 		?>
1239 1239
 
1240 1240
     </fieldset>
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 	echo ob_get_clean();
1243 1243
 }
1244 1244
 
1245
-add_action( 'give_donation_form_register_fields', 'give_get_register_fields' );
1245
+add_action('give_donation_form_register_fields', 'give_get_register_fields');
1246 1246
 
1247 1247
 /**
1248 1248
  * Gets the login fields for the login form on the checkout. This function hooks
@@ -1255,27 +1255,27 @@  discard block
 block discarded – undo
1255 1255
  *
1256 1256
  * @return string
1257 1257
  */
1258
-function give_get_login_fields( $form_id ) {
1258
+function give_get_login_fields($form_id) {
1259 1259
 
1260
-	$form_id            = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id;
1261
-	$show_register_form = give_show_login_register_option( $form_id );
1260
+	$form_id            = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id;
1261
+	$show_register_form = give_show_login_register_option($form_id);
1262 1262
 
1263 1263
 	ob_start();
1264 1264
 	?>
1265 1265
     <fieldset id="give-login-fields-<?php echo $form_id; ?>">
1266
-        <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', esc_html__( 'Login to Your Account', 'give' ) );
1267
-			if ( ! give_logged_in_only( $form_id ) ) {
1268
-				echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1266
+        <legend><?php echo apply_filters('give_account_login_fieldset_heading', esc_html__('Login to Your Account', 'give'));
1267
+			if ( ! give_logged_in_only($form_id)) {
1268
+				echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1269 1269
 			} ?>
1270 1270
         </legend>
1271
-		<?php if ( $show_register_form == 'both' ) { ?>
1271
+		<?php if ($show_register_form == 'both') { ?>
1272 1272
             <p class="give-new-account-link">
1273
-				<?php esc_html_e( 'Need to create an account?', 'give' ); ?>&nbsp;
1274
-                <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel"
1273
+				<?php esc_html_e('Need to create an account?', 'give'); ?>&nbsp;
1274
+                <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel"
1275 1275
                    data-action="give_checkout_register">
1276
-					<?php esc_html_e( 'Register', 'give' );
1277
-					if ( ! give_logged_in_only( $form_id ) ) {
1278
-						echo ' ' . esc_html__( 'and donate as a guest &raquo;', 'give' );
1276
+					<?php esc_html_e('Register', 'give');
1277
+					if ( ! give_logged_in_only($form_id)) {
1278
+						echo ' '.esc_html__('and donate as a guest &raquo;', 'give');
1279 1279
 					} ?>
1280 1280
                 </a>
1281 1281
             </p>
@@ -1291,49 +1291,49 @@  discard block
 block discarded – undo
1291 1291
 		 *
1292 1292
 		 * @param int $form_id The form ID.
1293 1293
 		 */
1294
-		do_action( 'give_checkout_login_fields_before', $form_id );
1294
+		do_action('give_checkout_login_fields_before', $form_id);
1295 1295
 		?>
1296 1296
         <div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive">
1297 1297
             <label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
1298
-				<?php esc_html_e( 'Username', 'give' ); ?>
1299
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1298
+				<?php esc_html_e('Username', 'give'); ?>
1299
+				<?php if (give_logged_in_only($form_id)) { ?>
1300 1300
                     <span class="give-required-indicator">*</span>
1301 1301
 				<?php } ?>
1302 1302
             </label>
1303 1303
 
1304
-            <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text"
1304
+            <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>" type="text"
1305 1305
                    name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value=""
1306
-                   placeholder="<?php esc_attr_e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1306
+                   placeholder="<?php esc_attr_e('Your username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1307 1307
         </div>
1308 1308
 
1309 1309
         <div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1310 1310
              class="give_login_password form-row form-row-last form-row-responsive">
1311 1311
             <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
1312
-				<?php esc_html_e( 'Password', 'give' ); ?>
1313
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1312
+				<?php esc_html_e('Password', 'give'); ?>
1313
+				<?php if (give_logged_in_only($form_id)) { ?>
1314 1314
                     <span class="give-required-indicator">*</span>
1315 1315
 				<?php } ?>
1316 1316
             </label>
1317
-            <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>"
1317
+            <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>"
1318 1318
                    type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>"
1319
-                   placeholder="<?php esc_attr_e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1319
+                   placeholder="<?php esc_attr_e('Your password', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1320 1320
             <input type="hidden" name="give-purchase-var" value="needs-to-login"/>
1321 1321
         </div>
1322 1322
 
1323 1323
         <div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
1324 1324
 			 <span class="give-forgot-password ">
1325 1325
 				 <a href="<?php echo wp_lostpassword_url() ?>"
1326
-                    target="_blank"><?php esc_html_e( 'Reset Password', 'give' ) ?></a>
1326
+                    target="_blank"><?php esc_html_e('Reset Password', 'give') ?></a>
1327 1327
 			 </span>
1328 1328
         </div>
1329 1329
 
1330 1330
         <div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
1331 1331
             <input type="submit" class="give-submit give-btn button" name="give_login_submit"
1332
-                   value="<?php esc_attr_e( 'Login', 'give' ); ?>"/>
1333
-			<?php if ( $show_register_form !== 'login' ) { ?>
1332
+                   value="<?php esc_attr_e('Login', 'give'); ?>"/>
1333
+			<?php if ($show_register_form !== 'login') { ?>
1334 1334
                 <input type="button" data-action="give_cancel_login"
1335 1335
                        class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel"
1336
-                       value="<?php esc_attr_e( 'Cancel', 'give' ); ?>"/>
1336
+                       value="<?php esc_attr_e('Cancel', 'give'); ?>"/>
1337 1337
 			<?php } ?>
1338 1338
             <span class="give-loading-animation"></span>
1339 1339
         </div>
@@ -1345,14 +1345,14 @@  discard block
 block discarded – undo
1345 1345
 		 *
1346 1346
 		 * @param int $form_id The form ID.
1347 1347
 		 */
1348
-		do_action( 'give_checkout_login_fields_after', $form_id );
1348
+		do_action('give_checkout_login_fields_after', $form_id);
1349 1349
 		?>
1350 1350
     </fieldset><!--end #give-login-fields-->
1351 1351
 	<?php
1352 1352
 	echo ob_get_clean();
1353 1353
 }
1354 1354
 
1355
-add_action( 'give_donation_form_login_fields', 'give_get_login_fields', 10, 1 );
1355
+add_action('give_donation_form_login_fields', 'give_get_login_fields', 10, 1);
1356 1356
 
1357 1357
 /**
1358 1358
  * Payment Mode Select.
@@ -1368,9 +1368,9 @@  discard block
 block discarded – undo
1368 1368
  *
1369 1369
  * @return void
1370 1370
  */
1371
-function give_payment_mode_select( $form_id ) {
1371
+function give_payment_mode_select($form_id) {
1372 1372
 
1373
-	$gateways = give_get_enabled_payment_gateways( $form_id );
1373
+	$gateways = give_get_enabled_payment_gateways($form_id);
1374 1374
 
1375 1375
 	/**
1376 1376
 	 * Fires while selecting payment gateways, before the fields.
@@ -1379,10 +1379,10 @@  discard block
 block discarded – undo
1379 1379
 	 *
1380 1380
 	 * @param int $form_id The form ID.
1381 1381
 	 */
1382
-	do_action( 'give_payment_mode_top', $form_id );
1382
+	do_action('give_payment_mode_top', $form_id);
1383 1383
 	?>
1384 1384
 
1385
-    <fieldset id="give-payment-mode-select" <?php if ( count( $gateways ) <= 1 ) {
1385
+    <fieldset id="give-payment-mode-select" <?php if (count($gateways) <= 1) {
1386 1386
 		echo 'style="display: none;"';
1387 1387
 	} ?>>
1388 1388
 		<?php
@@ -1393,10 +1393,10 @@  discard block
 block discarded – undo
1393 1393
 		 *
1394 1394
 		 * @param int $form_id The form ID.
1395 1395
 		 */
1396
-		do_action( 'give_payment_mode_before_gateways_wrap' );
1396
+		do_action('give_payment_mode_before_gateways_wrap');
1397 1397
 		?>
1398 1398
         <legend
1399
-                class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', esc_html__( 'Select Payment Method', 'give' ) ); ?>
1399
+                class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', esc_html__('Select Payment Method', 'give')); ?>
1400 1400
             <span class="give-loading-text"><span
1401 1401
                         class="give-loading-animation"></span>
1402 1402
             </span>
@@ -1409,26 +1409,26 @@  discard block
 block discarded – undo
1409 1409
 			 *
1410 1410
 			 * @since 1.7
1411 1411
 			 */
1412
-			do_action( 'give_payment_mode_before_gateways' )
1412
+			do_action('give_payment_mode_before_gateways')
1413 1413
 			?>
1414 1414
             <ul id="give-gateway-radio-list">
1415 1415
 				<?php
1416 1416
 				/**
1417 1417
 				 * Loop through the active payment gateways.
1418 1418
 				 */
1419
-				$selected_gateway  = give_get_chosen_gateway( $form_id );
1419
+				$selected_gateway = give_get_chosen_gateway($form_id);
1420 1420
 
1421
-				foreach ( $gateways as $gateway_id => $gateway ) :
1421
+				foreach ($gateways as $gateway_id => $gateway) :
1422 1422
 					//Determine the default gateway.
1423
-					$checked = checked( $gateway_id, $selected_gateway, false );
1423
+					$checked = checked($gateway_id, $selected_gateway, false);
1424 1424
 					$checked_class = $checked ? ' class="give-gateway-option-selected"' : ''; ?>
1425 1425
                     <li<?php echo $checked_class ?>>
1426 1426
                         <input type="radio" name="payment-mode" class="give-gateway"
1427
-                               id="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1428
-                               value="<?php echo esc_attr( $gateway_id ); ?>"<?php echo $checked; ?>>
1429
-                        <label for="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1427
+                               id="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1428
+                               value="<?php echo esc_attr($gateway_id); ?>"<?php echo $checked; ?>>
1429
+                        <label for="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1430 1430
                                class="give-gateway-option"
1431
-                               id="give-gateway-option-<?php echo esc_attr( $gateway_id ); ?>"> <?php echo esc_html( $gateway['checkout_label'] ); ?></label>
1431
+                               id="give-gateway-option-<?php echo esc_attr($gateway_id); ?>"> <?php echo esc_html($gateway['checkout_label']); ?></label>
1432 1432
                     </li>
1433 1433
 					<?php
1434 1434
 				endforeach;
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 			 *
1441 1441
 			 * @since 1.7
1442 1442
 			 */
1443
-			do_action( 'give_payment_mode_after_gateways' );
1443
+			do_action('give_payment_mode_after_gateways');
1444 1444
 			?>
1445 1445
         </div>
1446 1446
 		<?php
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
 		 *
1452 1452
 		 * @param int $form_id The form ID.
1453 1453
 		 */
1454
-		do_action( 'give_payment_mode_after_gateways_wrap' );
1454
+		do_action('give_payment_mode_after_gateways_wrap');
1455 1455
 		?>
1456 1456
     </fieldset>
1457 1457
 
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 	 *
1464 1464
 	 * @param int $form_id The form ID.
1465 1465
 	 */
1466
-	do_action( 'give_payment_mode_bottom', $form_id );
1466
+	do_action('give_payment_mode_bottom', $form_id);
1467 1467
 	?>
1468 1468
 
1469 1469
     <div id="give_purchase_form_wrap">
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 		 *
1475 1475
 		 * @since 1.7
1476 1476
 		 */
1477
-		do_action( 'give_donation_form', $form_id );
1477
+		do_action('give_donation_form', $form_id);
1478 1478
 		?>
1479 1479
 
1480 1480
     </div>
@@ -1485,10 +1485,10 @@  discard block
 block discarded – undo
1485 1485
 	 *
1486 1486
 	 * @since 1.7
1487 1487
 	 */
1488
-	do_action( 'give_donation_form_wrap_bottom', $form_id );
1488
+	do_action('give_donation_form_wrap_bottom', $form_id);
1489 1489
 }
1490 1490
 
1491
-add_action( 'give_payment_mode_select', 'give_payment_mode_select' );
1491
+add_action('give_payment_mode_select', 'give_payment_mode_select');
1492 1492
 
1493 1493
 /**
1494 1494
  * Renders the Checkout Agree to Terms, this displays a checkbox for users to
@@ -1501,31 +1501,31 @@  discard block
 block discarded – undo
1501 1501
  *
1502 1502
  * @return bool
1503 1503
  */
1504
-function give_terms_agreement( $form_id ) {
1505
-	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
1504
+function give_terms_agreement($form_id) {
1505
+	$form_option = give_get_meta($form_id, '_give_terms_option', true);
1506 1506
 
1507 1507
 	// Bailout if per form and global term and conditions is not setup.
1508 1508
 	if (
1509
-		give_is_setting_enabled( $form_option, 'global' )
1510
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1509
+		give_is_setting_enabled($form_option, 'global')
1510
+		&& give_is_setting_enabled(give_get_option('terms'))
1511 1511
 	) {
1512
-		$label         = give_get_option( 'agree_to_terms_label', esc_html__( 'Agree to Terms?', 'give' ) );
1513
-		$terms         = $terms = give_get_option( 'agreement_text', '' );
1514
-		$edit_term_url = admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions' );
1512
+		$label         = give_get_option('agree_to_terms_label', esc_html__('Agree to Terms?', 'give'));
1513
+		$terms         = $terms = give_get_option('agreement_text', '');
1514
+		$edit_term_url = admin_url('edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions');
1515 1515
 
1516
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1517
-		$label         = ( $label = give_get_meta( $form_id, '_give_agree_label', true ) ) ? stripslashes( $label ) : esc_html__( 'Agree to Terms?', 'give' );
1518
-		$terms         = give_get_meta( $form_id, '_give_agree_text', true );
1519
-		$edit_term_url = admin_url( 'post.php?post=' . $form_id . '&action=edit#form_terms_options' );
1516
+	} elseif (give_is_setting_enabled($form_option)) {
1517
+		$label         = ($label = give_get_meta($form_id, '_give_agree_label', true)) ? stripslashes($label) : esc_html__('Agree to Terms?', 'give');
1518
+		$terms         = give_get_meta($form_id, '_give_agree_text', true);
1519
+		$edit_term_url = admin_url('post.php?post='.$form_id.'&action=edit#form_terms_options');
1520 1520
 
1521 1521
 	} else {
1522 1522
 		return false;
1523 1523
 	}
1524 1524
 
1525 1525
 	// Bailout: Check if term and conditions text is empty or not.
1526
-	if ( empty( $terms ) ) {
1527
-		if ( is_user_logged_in() && current_user_can( 'edit_give_forms' ) ) {
1528
-			echo sprintf( __( 'Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give' ), $edit_term_url );
1526
+	if (empty($terms)) {
1527
+		if (is_user_logged_in() && current_user_can('edit_give_forms')) {
1528
+			echo sprintf(__('Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give'), $edit_term_url);
1529 1529
 		}
1530 1530
 
1531 1531
 		return false;
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
 
1534 1534
 	?>
1535 1535
     <fieldset id="give_terms_agreement">
1536
-        <legend><?php echo apply_filters( 'give_terms_agreement_text', esc_html__( 'Terms', 'give' ) ); ?></legend>
1536
+        <legend><?php echo apply_filters('give_terms_agreement_text', esc_html__('Terms', 'give')); ?></legend>
1537 1537
         <div id="give_terms" class="give_terms-<?php echo $form_id; ?>" style="display:none;">
1538 1538
 			<?php
1539 1539
 			/**
@@ -1541,22 +1541,22 @@  discard block
 block discarded – undo
1541 1541
 			 *
1542 1542
 			 * @since 1.0
1543 1543
 			 */
1544
-			do_action( 'give_before_terms' );
1544
+			do_action('give_before_terms');
1545 1545
 
1546
-			echo wpautop( stripslashes( $terms ) );
1546
+			echo wpautop(stripslashes($terms));
1547 1547
 			/**
1548 1548
 			 * Fires while rendering terms of agreement, after the fields.
1549 1549
 			 *
1550 1550
 			 * @since 1.0
1551 1551
 			 */
1552
-			do_action( 'give_after_terms' );
1552
+			do_action('give_after_terms');
1553 1553
 			?>
1554 1554
         </div>
1555 1555
         <div id="give_show_terms">
1556 1556
             <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1557
-               aria-controls="give_terms"><?php esc_html_e( 'Show Terms', 'give' ); ?></a>
1557
+               aria-controls="give_terms"><?php esc_html_e('Show Terms', 'give'); ?></a>
1558 1558
             <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1559
-               aria-controls="give_terms" style="display:none;"><?php esc_html_e( 'Hide Terms', 'give' ); ?></a>
1559
+               aria-controls="give_terms" style="display:none;"><?php esc_html_e('Hide Terms', 'give'); ?></a>
1560 1560
         </div>
1561 1561
 
1562 1562
         <input name="give_agree_to_terms" class="required" type="checkbox"
@@ -1567,7 +1567,7 @@  discard block
 block discarded – undo
1567 1567
 	<?php
1568 1568
 }
1569 1569
 
1570
-add_action( 'give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1 );
1570
+add_action('give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1);
1571 1571
 
1572 1572
 /**
1573 1573
  * Checkout Final Total.
@@ -1580,31 +1580,30 @@  discard block
 block discarded – undo
1580 1580
  *
1581 1581
  * @return void
1582 1582
  */
1583
-function give_checkout_final_total( $form_id ) {
1583
+function give_checkout_final_total($form_id) {
1584 1584
 
1585
-	$total = isset( $_POST['give_total'] ) ?
1586
-		apply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give_total'] ) ) :
1587
-		give_get_default_form_amount( $form_id );
1585
+	$total = isset($_POST['give_total']) ?
1586
+		apply_filters('give_donation_total', give_maybe_sanitize_amount($_POST['give_total'])) : give_get_default_form_amount($form_id);
1588 1587
 
1589 1588
 
1590 1589
 	//Only proceed if give_total available.
1591
-	if ( empty( $total ) ) {
1590
+	if (empty($total)) {
1592 1591
 		return;
1593 1592
 	}
1594 1593
 	?>
1595 1594
     <p id="give-final-total-wrap" class="form-wrap ">
1596 1595
 		<span class="give-donation-total-label">
1597
-			<?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?>
1596
+			<?php echo apply_filters('give_donation_total_label', esc_html__('Donation Total:', 'give')); ?>
1598 1597
 		</span>
1599 1598
         <span class="give-final-total-amount"
1600
-              data-total="<?php echo give_format_amount( $total, array( 'sanitize' => false ) ); ?>">
1601
-			<?php echo give_currency_filter( give_format_amount( $total, array( 'sanitize' => false ) ) ); ?>
1599
+              data-total="<?php echo give_format_amount($total, array('sanitize' => false)); ?>">
1600
+			<?php echo give_currency_filter(give_format_amount($total, array('sanitize' => false))); ?>
1602 1601
 		</span>
1603 1602
     </p>
1604 1603
 	<?php
1605 1604
 }
1606 1605
 
1607
-add_action( 'give_donation_form_before_submit', 'give_checkout_final_total', 999 );
1606
+add_action('give_donation_form_before_submit', 'give_checkout_final_total', 999);
1608 1607
 
1609 1608
 /**
1610 1609
  * Renders the Checkout Submit section.
@@ -1615,7 +1614,7 @@  discard block
 block discarded – undo
1615 1614
  *
1616 1615
  * @return void
1617 1616
  */
1618
-function give_checkout_submit( $form_id ) {
1617
+function give_checkout_submit($form_id) {
1619 1618
 	?>
1620 1619
     <fieldset id="give_purchase_submit">
1621 1620
 		<?php
@@ -1624,24 +1623,24 @@  discard block
 block discarded – undo
1624 1623
 		 *
1625 1624
 		 * @since 1.7
1626 1625
 		 */
1627
-		do_action( 'give_donation_form_before_submit', $form_id );
1626
+		do_action('give_donation_form_before_submit', $form_id);
1628 1627
 
1629
-		give_checkout_hidden_fields( $form_id );
1628
+		give_checkout_hidden_fields($form_id);
1630 1629
 
1631
-		echo give_get_donation_form_submit_button( $form_id );
1630
+		echo give_get_donation_form_submit_button($form_id);
1632 1631
 
1633 1632
 		/**
1634 1633
 		 * Fire after donation form submit.
1635 1634
 		 *
1636 1635
 		 * @since 1.7
1637 1636
 		 */
1638
-		do_action( 'give_donation_form_after_submit', $form_id );
1637
+		do_action('give_donation_form_after_submit', $form_id);
1639 1638
 		?>
1640 1639
     </fieldset>
1641 1640
 	<?php
1642 1641
 }
1643 1642
 
1644
-add_action( 'give_donation_form_after_cc_form', 'give_checkout_submit', 9999 );
1643
+add_action('give_donation_form_after_cc_form', 'give_checkout_submit', 9999);
1645 1644
 
1646 1645
 /**
1647 1646
  * Give Donation form submit button.
@@ -1652,10 +1651,10 @@  discard block
 block discarded – undo
1652 1651
  *
1653 1652
  * @return string
1654 1653
  */
1655
-function give_get_donation_form_submit_button( $form_id ) {
1654
+function give_get_donation_form_submit_button($form_id) {
1656 1655
 
1657
-	$display_label_field = give_get_meta( $form_id, '_give_checkout_label', true );
1658
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
1656
+	$display_label_field = give_get_meta($form_id, '_give_checkout_label', true);
1657
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
1659 1658
 	ob_start();
1660 1659
 	?>
1661 1660
     <div class="give-submit-button-wrap give-clearfix">
@@ -1664,7 +1663,7 @@  discard block
 block discarded – undo
1664 1663
         <span class="give-loading-animation"></span>
1665 1664
     </div>
1666 1665
 	<?php
1667
-	return apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id );
1666
+	return apply_filters('give_donation_form_submit_button', ob_get_clean(), $form_id);
1668 1667
 }
1669 1668
 
1670 1669
 /**
@@ -1679,17 +1678,17 @@  discard block
 block discarded – undo
1679 1678
  *
1680 1679
  * @return mixed
1681 1680
  */
1682
-function give_show_goal_progress( $form_id, $args ) {
1681
+function give_show_goal_progress($form_id, $args) {
1683 1682
 
1684 1683
 	ob_start();
1685
-	give_get_template( 'shortcode-goal', array( 'form_id' => $form_id, 'args' => $args ) );
1684
+	give_get_template('shortcode-goal', array('form_id' => $form_id, 'args' => $args));
1686 1685
 
1687
-	echo apply_filters( 'give_goal_output', ob_get_clean() );
1686
+	echo apply_filters('give_goal_output', ob_get_clean());
1688 1687
 
1689 1688
 	return true;
1690 1689
 }
1691 1690
 
1692
-add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 );
1691
+add_action('give_pre_form', 'give_show_goal_progress', 10, 2);
1693 1692
 
1694 1693
 
1695 1694
 /**
@@ -1702,10 +1701,10 @@  discard block
 block discarded – undo
1702 1701
  *
1703 1702
  * @return mixed|string
1704 1703
  */
1705
-function give_get_form_content_placement( $form_id, $args ) {
1704
+function give_get_form_content_placement($form_id, $args) {
1706 1705
 	$show_content = '';
1707 1706
 
1708
-	if ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) {
1707
+	if (isset($args['show_content']) && ! empty($args['show_content'])) {
1709 1708
 		// Content positions.
1710 1709
 		$content_placement = array(
1711 1710
 			'above' => 'give_pre_form',
@@ -1713,18 +1712,18 @@  discard block
 block discarded – undo
1713 1712
 		);
1714 1713
 
1715 1714
 		// Check if content position already decoded.
1716
-		if ( in_array( $args['show_content'], $content_placement ) ) {
1715
+		if (in_array($args['show_content'], $content_placement)) {
1717 1716
 			return $args['show_content'];
1718 1717
 		}
1719 1718
 
1720
-		$show_content = ( 'none' !== $args['show_content'] ? $content_placement[ $args['show_content'] ] : '' );
1719
+		$show_content = ('none' !== $args['show_content'] ? $content_placement[$args['show_content']] : '');
1721 1720
 
1722
-	} elseif ( give_is_setting_enabled( give_get_meta( $form_id, '_give_display_content', true ) ) ) {
1723
-		$show_content = give_get_meta( $form_id, '_give_content_placement', true );
1721
+	} elseif (give_is_setting_enabled(give_get_meta($form_id, '_give_display_content', true))) {
1722
+		$show_content = give_get_meta($form_id, '_give_content_placement', true);
1724 1723
 
1725
-	} elseif ( 'none' !== give_get_meta( $form_id, '_give_content_option', true ) ) {
1724
+	} elseif ('none' !== give_get_meta($form_id, '_give_content_option', true)) {
1726 1725
 		// Backward compatibility for _give_content_option for v18.
1727
-		$show_content = give_get_meta( $form_id, '_give_content_option', true );
1726
+		$show_content = give_get_meta($form_id, '_give_content_option', true);
1728 1727
 	}
1729 1728
 
1730 1729
 	return $show_content;
@@ -1740,20 +1739,20 @@  discard block
 block discarded – undo
1740 1739
  *
1741 1740
  * @return void|bool
1742 1741
  */
1743
-function give_form_content( $form_id, $args ) {
1742
+function give_form_content($form_id, $args) {
1744 1743
 
1745
-	$show_content = give_get_form_content_placement( $form_id, $args );
1744
+	$show_content = give_get_form_content_placement($form_id, $args);
1746 1745
 
1747 1746
 	// Bailout.
1748
-	if ( empty( $show_content ) ) {
1747
+	if (empty($show_content)) {
1749 1748
 		return false;
1750 1749
 	}
1751 1750
 
1752 1751
 	// Add action according to value.
1753
-	add_action( $show_content, 'give_form_display_content', 10, 2 );
1752
+	add_action($show_content, 'give_form_display_content', 10, 2);
1754 1753
 }
1755 1754
 
1756
-add_action( 'give_pre_form_output', 'give_form_content', 10, 2 );
1755
+add_action('give_pre_form_output', 'give_form_content', 10, 2);
1757 1756
 
1758 1757
 /**
1759 1758
  * Renders Post Form Content.
@@ -1767,22 +1766,22 @@  discard block
 block discarded – undo
1767 1766
  *
1768 1767
  * @return void
1769 1768
  */
1770
-function give_form_display_content( $form_id, $args ) {
1769
+function give_form_display_content($form_id, $args) {
1771 1770
 
1772
-	$content      = wpautop( give_get_meta( $form_id, '_give_form_content', true ) );
1773
-	$show_content = give_get_form_content_placement( $form_id, $args );
1771
+	$content      = wpautop(give_get_meta($form_id, '_give_form_content', true));
1772
+	$show_content = give_get_form_content_placement($form_id, $args);
1774 1773
 
1775
-	if ( give_is_setting_enabled( give_get_option( 'the_content_filter' ) ) ) {
1776
-		$content = apply_filters( 'the_content', $content );
1774
+	if (give_is_setting_enabled(give_get_option('the_content_filter'))) {
1775
+		$content = apply_filters('the_content', $content);
1777 1776
 	}
1778 1777
 
1779
-	$output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap ' . $show_content . '-content">' . $content . '</div>';
1778
+	$output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap '.$show_content.'-content">'.$content.'</div>';
1780 1779
 
1781
-	echo apply_filters( 'give_form_content_output', $output );
1780
+	echo apply_filters('give_form_content_output', $output);
1782 1781
 
1783 1782
 	//remove action to prevent content output on addition forms on page.
1784 1783
 	//@see: https://github.com/WordImpress/Give/issues/634.
1785
-	remove_action( $show_content, 'give_form_display_content' );
1784
+	remove_action($show_content, 'give_form_display_content');
1786 1785
 }
1787 1786
 
1788 1787
 /**
@@ -1794,7 +1793,7 @@  discard block
 block discarded – undo
1794 1793
  *
1795 1794
  * @return void
1796 1795
  */
1797
-function give_checkout_hidden_fields( $form_id ) {
1796
+function give_checkout_hidden_fields($form_id) {
1798 1797
 
1799 1798
 	/**
1800 1799
 	 * Fires while rendering hidden checkout fields, before the fields.
@@ -1803,13 +1802,13 @@  discard block
 block discarded – undo
1803 1802
 	 *
1804 1803
 	 * @param int $form_id The form ID.
1805 1804
 	 */
1806
-	do_action( 'give_hidden_fields_before', $form_id );
1805
+	do_action('give_hidden_fields_before', $form_id);
1807 1806
 
1808
-	if ( is_user_logged_in() ) { ?>
1807
+	if (is_user_logged_in()) { ?>
1809 1808
         <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/>
1810 1809
 	<?php } ?>
1811 1810
     <input type="hidden" name="give_action" value="purchase"/>
1812
-    <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/>
1811
+    <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/>
1813 1812
 	<?php
1814 1813
 	/**
1815 1814
 	 * Fires while rendering hidden checkout fields, after the fields.
@@ -1818,7 +1817,7 @@  discard block
 block discarded – undo
1818 1817
 	 *
1819 1818
 	 * @param int $form_id The form ID.
1820 1819
 	 */
1821
-	do_action( 'give_hidden_fields_after', $form_id );
1820
+	do_action('give_hidden_fields_after', $form_id);
1822 1821
 
1823 1822
 }
1824 1823
 
@@ -1833,20 +1832,20 @@  discard block
 block discarded – undo
1833 1832
  *
1834 1833
  * @return string $content Filtered content.
1835 1834
  */
1836
-function give_filter_success_page_content( $content ) {
1835
+function give_filter_success_page_content($content) {
1837 1836
 
1838 1837
 	$give_options = give_get_settings();
1839 1838
 
1840
-	if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) {
1841
-		if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) {
1842
-			$content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content );
1839
+	if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) {
1840
+		if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) {
1841
+			$content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content);
1843 1842
 		}
1844 1843
 	}
1845 1844
 
1846 1845
 	return $content;
1847 1846
 }
1848 1847
 
1849
-add_filter( 'the_content', 'give_filter_success_page_content' );
1848
+add_filter('the_content', 'give_filter_success_page_content');
1850 1849
 
1851 1850
 /**
1852 1851
  * Test Mode Frontend Warning.
@@ -1857,12 +1856,12 @@  discard block
 block discarded – undo
1857 1856
  */
1858 1857
 function give_test_mode_frontend_warning() {
1859 1858
 
1860
-	if ( give_is_test_mode() ) {
1861
-		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>';
1859
+	if (give_is_test_mode()) {
1860
+		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>';
1862 1861
 	}
1863 1862
 }
1864 1863
 
1865
-add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 );
1864
+add_action('give_pre_form', 'give_test_mode_frontend_warning', 10);
1866 1865
 
1867 1866
 /**
1868 1867
  * Members-only Form.
@@ -1876,21 +1875,21 @@  discard block
 block discarded – undo
1876 1875
  *
1877 1876
  * @return string
1878 1877
  */
1879
-function give_members_only_form( $final_output, $args ) {
1878
+function give_members_only_form($final_output, $args) {
1880 1879
 
1881
-	$form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0;
1880
+	$form_id = isset($args['form_id']) ? $args['form_id'] : 0;
1882 1881
 
1883 1882
 	//Sanity Check: Must have form_id & not be logged in.
1884
-	if ( empty( $form_id ) || is_user_logged_in() ) {
1883
+	if (empty($form_id) || is_user_logged_in()) {
1885 1884
 		return $final_output;
1886 1885
 	}
1887 1886
 
1888 1887
 	//Logged in only and Register / Login set to none.
1889
-	if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) {
1888
+	if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') {
1890 1889
 
1891
-		$final_output = Give()->notices->print_frontend_notice( esc_html__( 'Please log in in order to complete your donation.', 'give' ), false );
1890
+		$final_output = Give()->notices->print_frontend_notice(esc_html__('Please log in in order to complete your donation.', 'give'), false);
1892 1891
 
1893
-		return apply_filters( 'give_members_only_output', $final_output, $form_id );
1892
+		return apply_filters('give_members_only_output', $final_output, $form_id);
1894 1893
 
1895 1894
 	}
1896 1895
 
@@ -1898,4 +1897,4 @@  discard block
 block discarded – undo
1898 1897
 
1899 1898
 }
1900 1899
 
1901
-add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 );
1900
+add_filter('give_donate_form', 'give_members_only_form', 10, 2);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1068,9 +1068,12 @@
 block discarded – undo
1068 1068
 					}
1069 1069
 					?>
1070 1070
                 </select>
1071
-			<?php else : ?>
1071
+			<?php else {
1072
+	: ?>
1072 1073
                 <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input"
1073
-                       placeholder="<?php echo $label; ?>" value="<?php echo $selected_state; ?>"/>
1074
+                       placeholder="<?php echo $label;
1075
+}
1076
+?>" value="<?php echo $selected_state; ?>"/>
1074 1077
 			<?php endif; ?>
1075 1078
         </p>
1076 1079
 		<?php
Please login to merge, or discard this patch.
includes/country-functions.php 1 patch
Spacing   +1066 added lines, -1066 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
49 49
  *
50 50
  * @return mixed  A list of states for the site's base country.
51 51
  */
52
-function give_get_states( $country = null ) {
52
+function give_get_states($country = null) {
53 53
 	// If Country have no states return empty array.
54 54
 	$states = array();
55 55
 
56 56
 	// Check if Country Code is empty or not.
57
-	if ( empty( $country ) ) {
57
+	if (empty($country)) {
58 58
 		// Get defalut country code that is being set by the admin.
59 59
 		$country = give_get_country();
60 60
 	}
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
440 440
 	 *
441 441
 	 * @param array $country Contain key as there country code & value as there country name.
442 442
 	 */
443
-	return (array) apply_filters( 'give_states_not_required_country_list', $country_list );
443
+	return (array) apply_filters('give_states_not_required_country_list', $country_list);
444 444
 }
445 445
 
446 446
 /**
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
  *
453 453
  * @return string|bool
454 454
  */
455
-function give_get_country_name_by_key( $key ) {
455
+function give_get_country_name_by_key($key) {
456 456
 	$country_list = give_get_country_list();
457 457
 
458
-	if ( array_key_exists( $key, $country_list ) ) {
459
-		return $country_list[ $key ];
458
+	if (array_key_exists($key, $country_list)) {
459
+		return $country_list[$key];
460 460
 	}
461 461
 
462 462
 	return false;
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
  */
472 472
 function give_get_states_label() {
473 473
 	$country_states_label = array();
474
-	$default_label        = __( 'State', 'give' );
474
+	$default_label        = __('State', 'give');
475 475
 	$locale               = give_get_country_locale();
476
-	foreach ( $locale as $key => $value ) {
476
+	foreach ($locale as $key => $value) {
477 477
 		$label = $default_label;
478
-		if ( ! empty( $value['state'] ) && ! empty( $value['state']['label'] ) ) {
478
+		if ( ! empty($value['state']) && ! empty($value['state']['label'])) {
479 479
 			$label = $value['state']['label'];
480 480
 		}
481
-		$country_states_label[ $key ] = $label;
481
+		$country_states_label[$key] = $label;
482 482
 	}
483 483
 
484 484
 	/**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 	 *
489 489
 	 * @param array $country Contain key as there country code & value as there country name.
490 490
 	 */
491
-	return (array) apply_filters( 'give_get_states_label', $country_states_label );
491
+	return (array) apply_filters('give_get_states_label', $country_states_label);
492 492
 }
493 493
 
494 494
 /**
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
  * @return array
500 500
  */
501 501
 function give_get_country_locale() {
502
-	return (array) apply_filters( 'give_get_country_locale', array(
502
+	return (array) apply_filters('give_get_country_locale', array(
503 503
 		'AE' => array(
504 504
 			'state' => array(
505 505
 				'required' => false,
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 		),
520 520
 		'AU' => array(
521 521
 			'state' => array(
522
-				'label' => __( 'State', 'give' ),
522
+				'label' => __('State', 'give'),
523 523
 			),
524 524
 		),
525 525
 		'AX' => array(
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
 		),
530 530
 		'BD' => array(
531 531
 			'state' => array(
532
-				'label' => __( 'District', 'give' ),
532
+				'label' => __('District', 'give'),
533 533
 			),
534 534
 		),
535 535
 		'BE' => array(
536 536
 			'state' => array(
537 537
 				'required' => false,
538
-				'label'    => __( 'Province', 'give' ),
538
+				'label'    => __('Province', 'give'),
539 539
 				'hidden'   => true,
540 540
 			),
541 541
 		),
@@ -546,24 +546,24 @@  discard block
 block discarded – undo
546 546
 		),
547 547
 		'CA' => array(
548 548
 			'state' => array(
549
-				'label' => __( 'Province', 'give' ),
549
+				'label' => __('Province', 'give'),
550 550
 			),
551 551
 		),
552 552
 		'CH' => array(
553 553
 			'state' => array(
554
-				'label'    => __( 'Canton', 'give' ),
554
+				'label'    => __('Canton', 'give'),
555 555
 				'required' => false,
556 556
 				'hidden'   => true,
557 557
 			),
558 558
 		),
559 559
 		'CL' => array(
560 560
 			'state' => array(
561
-				'label' => __( 'Region', 'give' ),
561
+				'label' => __('Region', 'give'),
562 562
 			),
563 563
 		),
564 564
 		'CN' => array(
565 565
 			'state' => array(
566
-				'label' => __( 'Province', 'give' ),
566
+				'label' => __('Province', 'give'),
567 567
 			),
568 568
 		),
569 569
 		'CZ' => array(
@@ -614,23 +614,23 @@  discard block
 block discarded – undo
614 614
 		),
615 615
 		'HK' => array(
616 616
 			'state' => array(
617
-				'label' => __( 'Region', 'give' ),
617
+				'label' => __('Region', 'give'),
618 618
 			),
619 619
 		),
620 620
 		'HU' => array(
621 621
 			'state' => array(
622
-				'label'  => __( 'County', 'give' ),
622
+				'label'  => __('County', 'give'),
623 623
 				'hidden' => true,
624 624
 			),
625 625
 		),
626 626
 		'ID' => array(
627 627
 			'state' => array(
628
-				'label' => __( 'Province', 'give' ),
628
+				'label' => __('Province', 'give'),
629 629
 			),
630 630
 		),
631 631
 		'IE' => array(
632 632
 			'state' => array(
633
-				'label' => __( 'County', 'give' ),
633
+				'label' => __('County', 'give'),
634 634
 			),
635 635
 		),
636 636
 		'IS' => array(
@@ -647,12 +647,12 @@  discard block
 block discarded – undo
647 647
 		'IT' => array(
648 648
 			'state' => array(
649 649
 				'required' => true,
650
-				'label'    => __( 'Province', 'give' ),
650
+				'label'    => __('Province', 'give'),
651 651
 			),
652 652
 		),
653 653
 		'JP' => array(
654 654
 			'state' => array(
655
-				'label' => __( 'Prefecture', 'give' ),
655
+				'label' => __('Prefecture', 'give'),
656 656
 			),
657 657
 		),
658 658
 		'KR' => array(
@@ -678,13 +678,13 @@  discard block
 block discarded – undo
678 678
 		'NL' => array(
679 679
 			'state' => array(
680 680
 				'required' => false,
681
-				'label'    => __( 'Province', 'give' ),
681
+				'label'    => __('Province', 'give'),
682 682
 				'hidden'   => true,
683 683
 			),
684 684
 		),
685 685
 		'NZ' => array(
686 686
 			'state' => array(
687
-				'label'    => __( 'Region', 'give' ),
687
+				'label'    => __('Region', 'give'),
688 688
 			),
689 689
 		),
690 690
 		'NO' => array(
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		),
696 696
 		'NP' => array(
697 697
 			'state' => array(
698
-				'label' => __( 'State / Zone', 'give' ),
698
+				'label' => __('State / Zone', 'give'),
699 699
 			),
700 700
 		),
701 701
 		'PL' => array(
@@ -739,12 +739,12 @@  discard block
 block discarded – undo
739 739
 		),
740 740
 		'ES' => array(
741 741
 			'state' => array(
742
-				'label' => __( 'Province', 'give' ),
742
+				'label' => __('Province', 'give'),
743 743
 			),
744 744
 		),
745 745
 		'LI' => array(
746 746
 			'state' => array(
747
-				'label'    => __( 'Municipality', 'give' ),
747
+				'label'    => __('Municipality', 'give'),
748 748
 				'required' => false,
749 749
 				'hidden'   => true,
750 750
 			),
@@ -762,17 +762,17 @@  discard block
 block discarded – undo
762 762
 		),
763 763
 		'TR' => array(
764 764
 			'state' => array(
765
-				'label' => __( 'Province', 'give' ),
765
+				'label' => __('Province', 'give'),
766 766
 			),
767 767
 		),
768 768
 		'US' => array(
769 769
 			'state' => array(
770
-				'label' => __( 'State', 'give' ),
770
+				'label' => __('State', 'give'),
771 771
 			),
772 772
 		),
773 773
 		'GB' => array(
774 774
 			'state' => array(
775
-				'label'    => __( 'County', 'give' ),
775
+				'label'    => __('County', 'give'),
776 776
 				'required' => false,
777 777
 			),
778 778
 		),
@@ -789,10 +789,10 @@  discard block
 block discarded – undo
789 789
 		),
790 790
 		'ZA' => array(
791 791
 			'state' => array(
792
-				'label' => __( 'Province', 'give' ),
792
+				'label' => __('Province', 'give'),
793 793
 			),
794 794
 		),
795
-	) );
795
+	));
796 796
 }
797 797
 
798 798
 /**
@@ -804,90 +804,90 @@  discard block
 block discarded – undo
804 804
 function give_get_turkey_states_list() {
805 805
 	$states = array(
806 806
 		''     => '',
807
-		'TR01' => __( 'Adana', 'give' ),
808
-		'TR02' => __( 'Ad&#305;yaman', 'give' ),
809
-		'TR03' => __( 'Afyon', 'give' ),
810
-		'TR04' => __( 'A&#287;r&#305;', 'give' ),
811
-		'TR05' => __( 'Amasya', 'give' ),
812
-		'TR06' => __( 'Ankara', 'give' ),
813
-		'TR07' => __( 'Antalya', 'give' ),
814
-		'TR08' => __( 'Artvin', 'give' ),
815
-		'TR09' => __( 'Ayd&#305;n', 'give' ),
816
-		'TR10' => __( 'Bal&#305;kesir', 'give' ),
817
-		'TR11' => __( 'Bilecik', 'give' ),
818
-		'TR12' => __( 'Bing&#246;l', 'give' ),
819
-		'TR13' => __( 'Bitlis', 'give' ),
820
-		'TR14' => __( 'Bolu', 'give' ),
821
-		'TR15' => __( 'Burdur', 'give' ),
822
-		'TR16' => __( 'Bursa', 'give' ),
823
-		'TR17' => __( '&#199;anakkale', 'give' ),
824
-		'TR18' => __( '&#199;ank&#305;r&#305;', 'give' ),
825
-		'TR19' => __( '&#199;orum', 'give' ),
826
-		'TR20' => __( 'Denizli', 'give' ),
827
-		'TR21' => __( 'Diyarbak&#305;r', 'give' ),
828
-		'TR22' => __( 'Edirne', 'give' ),
829
-		'TR23' => __( 'Elaz&#305;&#287;', 'give' ),
830
-		'TR24' => __( 'Erzincan', 'give' ),
831
-		'TR25' => __( 'Erzurum', 'give' ),
832
-		'TR26' => __( 'Eski&#351;ehir', 'give' ),
833
-		'TR27' => __( 'Gaziantep', 'give' ),
834
-		'TR28' => __( 'Giresun', 'give' ),
835
-		'TR29' => __( 'G&#252;m&#252;&#351;hane', 'give' ),
836
-		'TR30' => __( 'Hakkari', 'give' ),
837
-		'TR31' => __( 'Hatay', 'give' ),
838
-		'TR32' => __( 'Isparta', 'give' ),
839
-		'TR33' => __( '&#304;&#231;el', 'give' ),
840
-		'TR34' => __( '&#304;stanbul', 'give' ),
841
-		'TR35' => __( '&#304;zmir', 'give' ),
842
-		'TR36' => __( 'Kars', 'give' ),
843
-		'TR37' => __( 'Kastamonu', 'give' ),
844
-		'TR38' => __( 'Kayseri', 'give' ),
845
-		'TR39' => __( 'K&#305;rklareli', 'give' ),
846
-		'TR40' => __( 'K&#305;r&#351;ehir', 'give' ),
847
-		'TR41' => __( 'Kocaeli', 'give' ),
848
-		'TR42' => __( 'Konya', 'give' ),
849
-		'TR43' => __( 'K&#252;tahya', 'give' ),
850
-		'TR44' => __( 'Malatya', 'give' ),
851
-		'TR45' => __( 'Manisa', 'give' ),
852
-		'TR46' => __( 'Kahramanmara&#351;', 'give' ),
853
-		'TR47' => __( 'Mardin', 'give' ),
854
-		'TR48' => __( 'Mu&#287;la', 'give' ),
855
-		'TR49' => __( 'Mu&#351;', 'give' ),
856
-		'TR50' => __( 'Nev&#351;ehir', 'give' ),
857
-		'TR51' => __( 'Ni&#287;de', 'give' ),
858
-		'TR52' => __( 'Ordu', 'give' ),
859
-		'TR53' => __( 'Rize', 'give' ),
860
-		'TR54' => __( 'Sakarya', 'give' ),
861
-		'TR55' => __( 'Samsun', 'give' ),
862
-		'TR56' => __( 'Siirt', 'give' ),
863
-		'TR57' => __( 'Sinop', 'give' ),
864
-		'TR58' => __( 'Sivas', 'give' ),
865
-		'TR59' => __( 'Tekirda&#287;', 'give' ),
866
-		'TR60' => __( 'Tokat', 'give' ),
867
-		'TR61' => __( 'Trabzon', 'give' ),
868
-		'TR62' => __( 'Tunceli', 'give' ),
869
-		'TR63' => __( '&#350;anl&#305;urfa', 'give' ),
870
-		'TR64' => __( 'U&#351;ak', 'give' ),
871
-		'TR65' => __( 'Van', 'give' ),
872
-		'TR66' => __( 'Yozgat', 'give' ),
873
-		'TR67' => __( 'Zonguldak', 'give' ),
874
-		'TR68' => __( 'Aksaray', 'give' ),
875
-		'TR69' => __( 'Bayburt', 'give' ),
876
-		'TR70' => __( 'Karaman', 'give' ),
877
-		'TR71' => __( 'K&#305;r&#305;kkale', 'give' ),
878
-		'TR72' => __( 'Batman', 'give' ),
879
-		'TR73' => __( '&#350;&#305;rnak', 'give' ),
880
-		'TR74' => __( 'Bart&#305;n', 'give' ),
881
-		'TR75' => __( 'Ardahan', 'give' ),
882
-		'TR76' => __( 'I&#287;d&#305;r', 'give' ),
883
-		'TR77' => __( 'Yalova', 'give' ),
884
-		'TR78' => __( 'Karab&#252;k', 'give' ),
885
-		'TR79' => __( 'Kilis', 'give' ),
886
-		'TR80' => __( 'Osmaniye', 'give' ),
887
-		'TR81' => __( 'D&#252;zce', 'give' ),
807
+		'TR01' => __('Adana', 'give'),
808
+		'TR02' => __('Ad&#305;yaman', 'give'),
809
+		'TR03' => __('Afyon', 'give'),
810
+		'TR04' => __('A&#287;r&#305;', 'give'),
811
+		'TR05' => __('Amasya', 'give'),
812
+		'TR06' => __('Ankara', 'give'),
813
+		'TR07' => __('Antalya', 'give'),
814
+		'TR08' => __('Artvin', 'give'),
815
+		'TR09' => __('Ayd&#305;n', 'give'),
816
+		'TR10' => __('Bal&#305;kesir', 'give'),
817
+		'TR11' => __('Bilecik', 'give'),
818
+		'TR12' => __('Bing&#246;l', 'give'),
819
+		'TR13' => __('Bitlis', 'give'),
820
+		'TR14' => __('Bolu', 'give'),
821
+		'TR15' => __('Burdur', 'give'),
822
+		'TR16' => __('Bursa', 'give'),
823
+		'TR17' => __('&#199;anakkale', 'give'),
824
+		'TR18' => __('&#199;ank&#305;r&#305;', 'give'),
825
+		'TR19' => __('&#199;orum', 'give'),
826
+		'TR20' => __('Denizli', 'give'),
827
+		'TR21' => __('Diyarbak&#305;r', 'give'),
828
+		'TR22' => __('Edirne', 'give'),
829
+		'TR23' => __('Elaz&#305;&#287;', 'give'),
830
+		'TR24' => __('Erzincan', 'give'),
831
+		'TR25' => __('Erzurum', 'give'),
832
+		'TR26' => __('Eski&#351;ehir', 'give'),
833
+		'TR27' => __('Gaziantep', 'give'),
834
+		'TR28' => __('Giresun', 'give'),
835
+		'TR29' => __('G&#252;m&#252;&#351;hane', 'give'),
836
+		'TR30' => __('Hakkari', 'give'),
837
+		'TR31' => __('Hatay', 'give'),
838
+		'TR32' => __('Isparta', 'give'),
839
+		'TR33' => __('&#304;&#231;el', 'give'),
840
+		'TR34' => __('&#304;stanbul', 'give'),
841
+		'TR35' => __('&#304;zmir', 'give'),
842
+		'TR36' => __('Kars', 'give'),
843
+		'TR37' => __('Kastamonu', 'give'),
844
+		'TR38' => __('Kayseri', 'give'),
845
+		'TR39' => __('K&#305;rklareli', 'give'),
846
+		'TR40' => __('K&#305;r&#351;ehir', 'give'),
847
+		'TR41' => __('Kocaeli', 'give'),
848
+		'TR42' => __('Konya', 'give'),
849
+		'TR43' => __('K&#252;tahya', 'give'),
850
+		'TR44' => __('Malatya', 'give'),
851
+		'TR45' => __('Manisa', 'give'),
852
+		'TR46' => __('Kahramanmara&#351;', 'give'),
853
+		'TR47' => __('Mardin', 'give'),
854
+		'TR48' => __('Mu&#287;la', 'give'),
855
+		'TR49' => __('Mu&#351;', 'give'),
856
+		'TR50' => __('Nev&#351;ehir', 'give'),
857
+		'TR51' => __('Ni&#287;de', 'give'),
858
+		'TR52' => __('Ordu', 'give'),
859
+		'TR53' => __('Rize', 'give'),
860
+		'TR54' => __('Sakarya', 'give'),
861
+		'TR55' => __('Samsun', 'give'),
862
+		'TR56' => __('Siirt', 'give'),
863
+		'TR57' => __('Sinop', 'give'),
864
+		'TR58' => __('Sivas', 'give'),
865
+		'TR59' => __('Tekirda&#287;', 'give'),
866
+		'TR60' => __('Tokat', 'give'),
867
+		'TR61' => __('Trabzon', 'give'),
868
+		'TR62' => __('Tunceli', 'give'),
869
+		'TR63' => __('&#350;anl&#305;urfa', 'give'),
870
+		'TR64' => __('U&#351;ak', 'give'),
871
+		'TR65' => __('Van', 'give'),
872
+		'TR66' => __('Yozgat', 'give'),
873
+		'TR67' => __('Zonguldak', 'give'),
874
+		'TR68' => __('Aksaray', 'give'),
875
+		'TR69' => __('Bayburt', 'give'),
876
+		'TR70' => __('Karaman', 'give'),
877
+		'TR71' => __('K&#305;r&#305;kkale', 'give'),
878
+		'TR72' => __('Batman', 'give'),
879
+		'TR73' => __('&#350;&#305;rnak', 'give'),
880
+		'TR74' => __('Bart&#305;n', 'give'),
881
+		'TR75' => __('Ardahan', 'give'),
882
+		'TR76' => __('I&#287;d&#305;r', 'give'),
883
+		'TR77' => __('Yalova', 'give'),
884
+		'TR78' => __('Karab&#252;k', 'give'),
885
+		'TR79' => __('Kilis', 'give'),
886
+		'TR80' => __('Osmaniye', 'give'),
887
+		'TR81' => __('D&#252;zce', 'give'),
888 888
 	);
889 889
 
890
-	return apply_filters( 'give_turkey_states', $states );
890
+	return apply_filters('give_turkey_states', $states);
891 891
 }
892 892
 
893 893
 /**
@@ -899,51 +899,51 @@  discard block
 block discarded – undo
899 899
 function give_get_romania_states_list() {
900 900
 	$states = array(
901 901
 		''   => '',
902
-		'AB' => __( 'Alba', 'give' ),
903
-		'AR' => __( 'Arad', 'give' ),
904
-		'AG' => __( 'Arges', 'give' ),
905
-		'BC' => __( 'Bacau', 'give' ),
906
-		'BH' => __( 'Bihor', 'give' ),
907
-		'BN' => __( 'Bistrita-Nasaud', 'give' ),
908
-		'BT' => __( 'Botosani', 'give' ),
909
-		'BR' => __( 'Braila', 'give' ),
910
-		'BV' => __( 'Brasov', 'give' ),
911
-		'B'  => __( 'Bucuresti', 'give' ),
912
-		'BZ' => __( 'Buzau', 'give' ),
913
-		'CL' => __( 'Calarasi', 'give' ),
914
-		'CS' => __( 'Caras-Severin', 'give' ),
915
-		'CJ' => __( 'Cluj', 'give' ),
916
-		'CT' => __( 'Constanta', 'give' ),
917
-		'CV' => __( 'Covasna', 'give' ),
918
-		'DB' => __( 'Dambovita', 'give' ),
919
-		'DJ' => __( 'Dolj', 'give' ),
920
-		'GL' => __( 'Galati', 'give' ),
921
-		'GR' => __( 'Giurgiu', 'give' ),
922
-		'GJ' => __( 'Gorj', 'give' ),
923
-		'HR' => __( 'Harghita', 'give' ),
924
-		'HD' => __( 'Hunedoara', 'give' ),
925
-		'IL' => __( 'Ialomita', 'give' ),
926
-		'IS' => __( 'Iasi', 'give' ),
927
-		'IF' => __( 'Ilfov', 'give' ),
928
-		'MM' => __( 'Maramures', 'give' ),
929
-		'MH' => __( 'Mehedinti', 'give' ),
930
-		'MS' => __( 'Mures', 'give' ),
931
-		'NT' => __( 'Neamt', 'give' ),
932
-		'OT' => __( 'Olt', 'give' ),
933
-		'PH' => __( 'Prahova', 'give' ),
934
-		'SJ' => __( 'Salaj', 'give' ),
935
-		'SM' => __( 'Satu Mare', 'give' ),
936
-		'SB' => __( 'Sibiu', 'give' ),
937
-		'SV' => __( 'Suceava', 'give' ),
938
-		'TR' => __( 'Teleorman', 'give' ),
939
-		'TM' => __( 'Timis', 'give' ),
940
-		'TL' => __( 'Tulcea', 'give' ),
941
-		'VL' => __( 'Valcea', 'give' ),
942
-		'VS' => __( 'Vaslui', 'give' ),
943
-		'VN' => __( 'Vrancea', 'give' ),
902
+		'AB' => __('Alba', 'give'),
903
+		'AR' => __('Arad', 'give'),
904
+		'AG' => __('Arges', 'give'),
905
+		'BC' => __('Bacau', 'give'),
906
+		'BH' => __('Bihor', 'give'),
907
+		'BN' => __('Bistrita-Nasaud', 'give'),
908
+		'BT' => __('Botosani', 'give'),
909
+		'BR' => __('Braila', 'give'),
910
+		'BV' => __('Brasov', 'give'),
911
+		'B'  => __('Bucuresti', 'give'),
912
+		'BZ' => __('Buzau', 'give'),
913
+		'CL' => __('Calarasi', 'give'),
914
+		'CS' => __('Caras-Severin', 'give'),
915
+		'CJ' => __('Cluj', 'give'),
916
+		'CT' => __('Constanta', 'give'),
917
+		'CV' => __('Covasna', 'give'),
918
+		'DB' => __('Dambovita', 'give'),
919
+		'DJ' => __('Dolj', 'give'),
920
+		'GL' => __('Galati', 'give'),
921
+		'GR' => __('Giurgiu', 'give'),
922
+		'GJ' => __('Gorj', 'give'),
923
+		'HR' => __('Harghita', 'give'),
924
+		'HD' => __('Hunedoara', 'give'),
925
+		'IL' => __('Ialomita', 'give'),
926
+		'IS' => __('Iasi', 'give'),
927
+		'IF' => __('Ilfov', 'give'),
928
+		'MM' => __('Maramures', 'give'),
929
+		'MH' => __('Mehedinti', 'give'),
930
+		'MS' => __('Mures', 'give'),
931
+		'NT' => __('Neamt', 'give'),
932
+		'OT' => __('Olt', 'give'),
933
+		'PH' => __('Prahova', 'give'),
934
+		'SJ' => __('Salaj', 'give'),
935
+		'SM' => __('Satu Mare', 'give'),
936
+		'SB' => __('Sibiu', 'give'),
937
+		'SV' => __('Suceava', 'give'),
938
+		'TR' => __('Teleorman', 'give'),
939
+		'TM' => __('Timis', 'give'),
940
+		'TL' => __('Tulcea', 'give'),
941
+		'VL' => __('Valcea', 'give'),
942
+		'VS' => __('Vaslui', 'give'),
943
+		'VN' => __('Vrancea', 'give'),
944 944
 	);
945 945
 
946
-	return apply_filters( 'give_romania_states', $states );
946
+	return apply_filters('give_romania_states', $states);
947 947
 }
948 948
 
949 949
 /**
@@ -955,17 +955,17 @@  discard block
 block discarded – undo
955 955
 function give_get_pakistan_states_list() {
956 956
 	$states = array(
957 957
 		''   => '',
958
-		'JK' => __( 'Azad Kashmir', 'give' ),
959
-		'BA' => __( 'Balochistan', 'give' ),
960
-		'TA' => __( 'FATA', 'give' ),
961
-		'GB' => __( 'Gilgit Baltistan', 'give' ),
962
-		'IS' => __( 'Islamabad Capital Territory', 'give' ),
963
-		'KP' => __( 'Khyber Pakhtunkhwa', 'give' ),
964
-		'PB' => __( 'Punjab', 'give' ),
965
-		'SD' => __( 'Sindh', 'give' ),
958
+		'JK' => __('Azad Kashmir', 'give'),
959
+		'BA' => __('Balochistan', 'give'),
960
+		'TA' => __('FATA', 'give'),
961
+		'GB' => __('Gilgit Baltistan', 'give'),
962
+		'IS' => __('Islamabad Capital Territory', 'give'),
963
+		'KP' => __('Khyber Pakhtunkhwa', 'give'),
964
+		'PB' => __('Punjab', 'give'),
965
+		'SD' => __('Sindh', 'give'),
966 966
 	);
967 967
 
968
-	return apply_filters( 'give_pakistan_states', $states );
968
+	return apply_filters('give_pakistan_states', $states);
969 969
 }
970 970
 
971 971
 /**
@@ -977,91 +977,91 @@  discard block
 block discarded – undo
977 977
 function give_get_philippines_states_list() {
978 978
 	$states = array(
979 979
 		''    => '',
980
-		'ABR' => __( 'Abra', 'give' ),
981
-		'AGN' => __( 'Agusan del Norte', 'give' ),
982
-		'AGS' => __( 'Agusan del Sur', 'give' ),
983
-		'AKL' => __( 'Aklan', 'give' ),
984
-		'ALB' => __( 'Albay', 'give' ),
985
-		'ANT' => __( 'Antique', 'give' ),
986
-		'APA' => __( 'Apayao', 'give' ),
987
-		'AUR' => __( 'Aurora', 'give' ),
988
-		'BAS' => __( 'Basilan', 'give' ),
989
-		'BAN' => __( 'Bataan', 'give' ),
990
-		'BTN' => __( 'Batanes', 'give' ),
991
-		'BTG' => __( 'Batangas', 'give' ),
992
-		'BEN' => __( 'Benguet', 'give' ),
993
-		'BIL' => __( 'Biliran', 'give' ),
994
-		'BOH' => __( 'Bohol', 'give' ),
995
-		'BUK' => __( 'Bukidnon', 'give' ),
996
-		'BUL' => __( 'Bulacan', 'give' ),
997
-		'CAG' => __( 'Cagayan', 'give' ),
998
-		'CAN' => __( 'Camarines Norte', 'give' ),
999
-		'CAS' => __( 'Camarines Sur', 'give' ),
1000
-		'CAM' => __( 'Camiguin', 'give' ),
1001
-		'CAP' => __( 'Capiz', 'give' ),
1002
-		'CAT' => __( 'Catanduanes', 'give' ),
1003
-		'CAV' => __( 'Cavite', 'give' ),
1004
-		'CEB' => __( 'Cebu', 'give' ),
1005
-		'COM' => __( 'Compostela Valley', 'give' ),
1006
-		'NCO' => __( 'Cotabato', 'give' ),
1007
-		'DAV' => __( 'Davao del Norte', 'give' ),
1008
-		'DAS' => __( 'Davao del Sur', 'give' ),
1009
-		'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned
1010
-		'DAO' => __( 'Davao Oriental', 'give' ),
1011
-		'DIN' => __( 'Dinagat Islands', 'give' ),
1012
-		'EAS' => __( 'Eastern Samar', 'give' ),
1013
-		'GUI' => __( 'Guimaras', 'give' ),
1014
-		'IFU' => __( 'Ifugao', 'give' ),
1015
-		'ILN' => __( 'Ilocos Norte', 'give' ),
1016
-		'ILS' => __( 'Ilocos Sur', 'give' ),
1017
-		'ILI' => __( 'Iloilo', 'give' ),
1018
-		'ISA' => __( 'Isabela', 'give' ),
1019
-		'KAL' => __( 'Kalinga', 'give' ),
1020
-		'LUN' => __( 'La Union', 'give' ),
1021
-		'LAG' => __( 'Laguna', 'give' ),
1022
-		'LAN' => __( 'Lanao del Norte', 'give' ),
1023
-		'LAS' => __( 'Lanao del Sur', 'give' ),
1024
-		'LEY' => __( 'Leyte', 'give' ),
1025
-		'MAG' => __( 'Maguindanao', 'give' ),
1026
-		'MAD' => __( 'Marinduque', 'give' ),
1027
-		'MAS' => __( 'Masbate', 'give' ),
1028
-		'MSC' => __( 'Misamis Occidental', 'give' ),
1029
-		'MSR' => __( 'Misamis Oriental', 'give' ),
1030
-		'MOU' => __( 'Mountain Province', 'give' ),
1031
-		'NEC' => __( 'Negros Occidental', 'give' ),
1032
-		'NER' => __( 'Negros Oriental', 'give' ),
1033
-		'NSA' => __( 'Northern Samar', 'give' ),
1034
-		'NUE' => __( 'Nueva Ecija', 'give' ),
1035
-		'NUV' => __( 'Nueva Vizcaya', 'give' ),
1036
-		'MDC' => __( 'Occidental Mindoro', 'give' ),
1037
-		'MDR' => __( 'Oriental Mindoro', 'give' ),
1038
-		'PLW' => __( 'Palawan', 'give' ),
1039
-		'PAM' => __( 'Pampanga', 'give' ),
1040
-		'PAN' => __( 'Pangasinan', 'give' ),
1041
-		'QUE' => __( 'Quezon', 'give' ),
1042
-		'QUI' => __( 'Quirino', 'give' ),
1043
-		'RIZ' => __( 'Rizal', 'give' ),
1044
-		'ROM' => __( 'Romblon', 'give' ),
1045
-		'WSA' => __( 'Samar', 'give' ),
1046
-		'SAR' => __( 'Sarangani', 'give' ),
1047
-		'SIQ' => __( 'Siquijor', 'give' ),
1048
-		'SOR' => __( 'Sorsogon', 'give' ),
1049
-		'SCO' => __( 'South Cotabato', 'give' ),
1050
-		'SLE' => __( 'Southern Leyte', 'give' ),
1051
-		'SUK' => __( 'Sultan Kudarat', 'give' ),
1052
-		'SLU' => __( 'Sulu', 'give' ),
1053
-		'SUN' => __( 'Surigao del Norte', 'give' ),
1054
-		'SUR' => __( 'Surigao del Sur', 'give' ),
1055
-		'TAR' => __( 'Tarlac', 'give' ),
1056
-		'TAW' => __( 'Tawi-Tawi', 'give' ),
1057
-		'ZMB' => __( 'Zambales', 'give' ),
1058
-		'ZAN' => __( 'Zamboanga del Norte', 'give' ),
1059
-		'ZAS' => __( 'Zamboanga del Sur', 'give' ),
1060
-		'ZSI' => __( 'Zamboanga Sibugay', 'give' ),
1061
-		'00'  => __( 'Metro Manila', 'give' ),
980
+		'ABR' => __('Abra', 'give'),
981
+		'AGN' => __('Agusan del Norte', 'give'),
982
+		'AGS' => __('Agusan del Sur', 'give'),
983
+		'AKL' => __('Aklan', 'give'),
984
+		'ALB' => __('Albay', 'give'),
985
+		'ANT' => __('Antique', 'give'),
986
+		'APA' => __('Apayao', 'give'),
987
+		'AUR' => __('Aurora', 'give'),
988
+		'BAS' => __('Basilan', 'give'),
989
+		'BAN' => __('Bataan', 'give'),
990
+		'BTN' => __('Batanes', 'give'),
991
+		'BTG' => __('Batangas', 'give'),
992
+		'BEN' => __('Benguet', 'give'),
993
+		'BIL' => __('Biliran', 'give'),
994
+		'BOH' => __('Bohol', 'give'),
995
+		'BUK' => __('Bukidnon', 'give'),
996
+		'BUL' => __('Bulacan', 'give'),
997
+		'CAG' => __('Cagayan', 'give'),
998
+		'CAN' => __('Camarines Norte', 'give'),
999
+		'CAS' => __('Camarines Sur', 'give'),
1000
+		'CAM' => __('Camiguin', 'give'),
1001
+		'CAP' => __('Capiz', 'give'),
1002
+		'CAT' => __('Catanduanes', 'give'),
1003
+		'CAV' => __('Cavite', 'give'),
1004
+		'CEB' => __('Cebu', 'give'),
1005
+		'COM' => __('Compostela Valley', 'give'),
1006
+		'NCO' => __('Cotabato', 'give'),
1007
+		'DAV' => __('Davao del Norte', 'give'),
1008
+		'DAS' => __('Davao del Sur', 'give'),
1009
+		'DAC' => __('Davao Occidental', 'give'), // TODO: Needs to be updated when ISO code is assigned
1010
+		'DAO' => __('Davao Oriental', 'give'),
1011
+		'DIN' => __('Dinagat Islands', 'give'),
1012
+		'EAS' => __('Eastern Samar', 'give'),
1013
+		'GUI' => __('Guimaras', 'give'),
1014
+		'IFU' => __('Ifugao', 'give'),
1015
+		'ILN' => __('Ilocos Norte', 'give'),
1016
+		'ILS' => __('Ilocos Sur', 'give'),
1017
+		'ILI' => __('Iloilo', 'give'),
1018
+		'ISA' => __('Isabela', 'give'),
1019
+		'KAL' => __('Kalinga', 'give'),
1020
+		'LUN' => __('La Union', 'give'),
1021
+		'LAG' => __('Laguna', 'give'),
1022
+		'LAN' => __('Lanao del Norte', 'give'),
1023
+		'LAS' => __('Lanao del Sur', 'give'),
1024
+		'LEY' => __('Leyte', 'give'),
1025
+		'MAG' => __('Maguindanao', 'give'),
1026
+		'MAD' => __('Marinduque', 'give'),
1027
+		'MAS' => __('Masbate', 'give'),
1028
+		'MSC' => __('Misamis Occidental', 'give'),
1029
+		'MSR' => __('Misamis Oriental', 'give'),
1030
+		'MOU' => __('Mountain Province', 'give'),
1031
+		'NEC' => __('Negros Occidental', 'give'),
1032
+		'NER' => __('Negros Oriental', 'give'),
1033
+		'NSA' => __('Northern Samar', 'give'),
1034
+		'NUE' => __('Nueva Ecija', 'give'),
1035
+		'NUV' => __('Nueva Vizcaya', 'give'),
1036
+		'MDC' => __('Occidental Mindoro', 'give'),
1037
+		'MDR' => __('Oriental Mindoro', 'give'),
1038
+		'PLW' => __('Palawan', 'give'),
1039
+		'PAM' => __('Pampanga', 'give'),
1040
+		'PAN' => __('Pangasinan', 'give'),
1041
+		'QUE' => __('Quezon', 'give'),
1042
+		'QUI' => __('Quirino', 'give'),
1043
+		'RIZ' => __('Rizal', 'give'),
1044
+		'ROM' => __('Romblon', 'give'),
1045
+		'WSA' => __('Samar', 'give'),
1046
+		'SAR' => __('Sarangani', 'give'),
1047
+		'SIQ' => __('Siquijor', 'give'),
1048
+		'SOR' => __('Sorsogon', 'give'),
1049
+		'SCO' => __('South Cotabato', 'give'),
1050
+		'SLE' => __('Southern Leyte', 'give'),
1051
+		'SUK' => __('Sultan Kudarat', 'give'),
1052
+		'SLU' => __('Sulu', 'give'),
1053
+		'SUN' => __('Surigao del Norte', 'give'),
1054
+		'SUR' => __('Surigao del Sur', 'give'),
1055
+		'TAR' => __('Tarlac', 'give'),
1056
+		'TAW' => __('Tawi-Tawi', 'give'),
1057
+		'ZMB' => __('Zambales', 'give'),
1058
+		'ZAN' => __('Zamboanga del Norte', 'give'),
1059
+		'ZAS' => __('Zamboanga del Sur', 'give'),
1060
+		'ZSI' => __('Zamboanga Sibugay', 'give'),
1061
+		'00'  => __('Metro Manila', 'give'),
1062 1062
 	);
1063 1063
 
1064
-	return apply_filters( 'give_philippines_states', $states );
1064
+	return apply_filters('give_philippines_states', $states);
1065 1065
 }
1066 1066
 
1067 1067
 /**
@@ -1073,35 +1073,35 @@  discard block
 block discarded – undo
1073 1073
 function give_get_peru_states_list() {
1074 1074
 	$states = array(
1075 1075
 		''    => '',
1076
-		'CAL' => __( 'El Callao', 'give' ),
1077
-		'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ),
1078
-		'AMA' => __( 'Amazonas', 'give' ),
1079
-		'ANC' => __( 'Ancash', 'give' ),
1080
-		'APU' => __( 'Apur&iacute;mac', 'give' ),
1081
-		'ARE' => __( 'Arequipa', 'give' ),
1082
-		'AYA' => __( 'Ayacucho', 'give' ),
1083
-		'CAJ' => __( 'Cajamarca', 'give' ),
1084
-		'CUS' => __( 'Cusco', 'give' ),
1085
-		'HUV' => __( 'Huancavelica', 'give' ),
1086
-		'HUC' => __( 'Hu&aacute;nuco', 'give' ),
1087
-		'ICA' => __( 'Ica', 'give' ),
1088
-		'JUN' => __( 'Jun&iacute;n', 'give' ),
1089
-		'LAL' => __( 'La Libertad', 'give' ),
1090
-		'LAM' => __( 'Lambayeque', 'give' ),
1091
-		'LIM' => __( 'Lima', 'give' ),
1092
-		'LOR' => __( 'Loreto', 'give' ),
1093
-		'MDD' => __( 'Madre de Dios', 'give' ),
1094
-		'MOQ' => __( 'Moquegua', 'give' ),
1095
-		'PAS' => __( 'Pasco', 'give' ),
1096
-		'PIU' => __( 'Piura', 'give' ),
1097
-		'PUN' => __( 'Puno', 'give' ),
1098
-		'SAM' => __( 'San Mart&iacute;n', 'give' ),
1099
-		'TAC' => __( 'Tacna', 'give' ),
1100
-		'TUM' => __( 'Tumbes', 'give' ),
1101
-		'UCA' => __( 'Ucayali', 'give' ),
1076
+		'CAL' => __('El Callao', 'give'),
1077
+		'LMA' => __('Municipalidad Metropolitana de Lima', 'give'),
1078
+		'AMA' => __('Amazonas', 'give'),
1079
+		'ANC' => __('Ancash', 'give'),
1080
+		'APU' => __('Apur&iacute;mac', 'give'),
1081
+		'ARE' => __('Arequipa', 'give'),
1082
+		'AYA' => __('Ayacucho', 'give'),
1083
+		'CAJ' => __('Cajamarca', 'give'),
1084
+		'CUS' => __('Cusco', 'give'),
1085
+		'HUV' => __('Huancavelica', 'give'),
1086
+		'HUC' => __('Hu&aacute;nuco', 'give'),
1087
+		'ICA' => __('Ica', 'give'),
1088
+		'JUN' => __('Jun&iacute;n', 'give'),
1089
+		'LAL' => __('La Libertad', 'give'),
1090
+		'LAM' => __('Lambayeque', 'give'),
1091
+		'LIM' => __('Lima', 'give'),
1092
+		'LOR' => __('Loreto', 'give'),
1093
+		'MDD' => __('Madre de Dios', 'give'),
1094
+		'MOQ' => __('Moquegua', 'give'),
1095
+		'PAS' => __('Pasco', 'give'),
1096
+		'PIU' => __('Piura', 'give'),
1097
+		'PUN' => __('Puno', 'give'),
1098
+		'SAM' => __('San Mart&iacute;n', 'give'),
1099
+		'TAC' => __('Tacna', 'give'),
1100
+		'TUM' => __('Tumbes', 'give'),
1101
+		'UCA' => __('Ucayali', 'give'),
1102 1102
 	);
1103 1103
 
1104
-	return apply_filters( 'give_peru_states', $states );
1104
+	return apply_filters('give_peru_states', $states);
1105 1105
 }
1106 1106
 
1107 1107
 /**
@@ -1113,23 +1113,23 @@  discard block
 block discarded – undo
1113 1113
 function give_get_nepal_states_list() {
1114 1114
 	$states = array(
1115 1115
 		''    => '',
1116
-		'BAG' => __( 'Bagmati', 'give' ),
1117
-		'BHE' => __( 'Bheri', 'give' ),
1118
-		'DHA' => __( 'Dhaulagiri', 'give' ),
1119
-		'GAN' => __( 'Gandaki', 'give' ),
1120
-		'JAN' => __( 'Janakpur', 'give' ),
1121
-		'KAR' => __( 'Karnali', 'give' ),
1122
-		'KOS' => __( 'Koshi', 'give' ),
1123
-		'LUM' => __( 'Lumbini', 'give' ),
1124
-		'MAH' => __( 'Mahakali', 'give' ),
1125
-		'MEC' => __( 'Mechi', 'give' ),
1126
-		'NAR' => __( 'Narayani', 'give' ),
1127
-		'RAP' => __( 'Rapti', 'give' ),
1128
-		'SAG' => __( 'Sagarmatha', 'give' ),
1129
-		'SET' => __( 'Seti', 'give' ),
1116
+		'BAG' => __('Bagmati', 'give'),
1117
+		'BHE' => __('Bheri', 'give'),
1118
+		'DHA' => __('Dhaulagiri', 'give'),
1119
+		'GAN' => __('Gandaki', 'give'),
1120
+		'JAN' => __('Janakpur', 'give'),
1121
+		'KAR' => __('Karnali', 'give'),
1122
+		'KOS' => __('Koshi', 'give'),
1123
+		'LUM' => __('Lumbini', 'give'),
1124
+		'MAH' => __('Mahakali', 'give'),
1125
+		'MEC' => __('Mechi', 'give'),
1126
+		'NAR' => __('Narayani', 'give'),
1127
+		'RAP' => __('Rapti', 'give'),
1128
+		'SAG' => __('Sagarmatha', 'give'),
1129
+		'SET' => __('Seti', 'give'),
1130 1130
 	);
1131 1131
 
1132
-	return apply_filters( 'give_nepal_states', $states );
1132
+	return apply_filters('give_nepal_states', $states);
1133 1133
 }
1134 1134
 
1135 1135
 /**
@@ -1141,46 +1141,46 @@  discard block
 block discarded – undo
1141 1141
 function give_get_nigerian_states_list() {
1142 1142
 	$states = array(
1143 1143
 		''   => '',
1144
-		'AB' => __( 'Abia', 'give' ),
1145
-		'FC' => __( 'Abuja', 'give' ),
1146
-		'AD' => __( 'Adamawa', 'give' ),
1147
-		'AK' => __( 'Akwa Ibom', 'give' ),
1148
-		'AN' => __( 'Anambra', 'give' ),
1149
-		'BA' => __( 'Bauchi', 'give' ),
1150
-		'BY' => __( 'Bayelsa', 'give' ),
1151
-		'BE' => __( 'Benue', 'give' ),
1152
-		'BO' => __( 'Borno', 'give' ),
1153
-		'CR' => __( 'Cross River', 'give' ),
1154
-		'DE' => __( 'Delta', 'give' ),
1155
-		'EB' => __( 'Ebonyi', 'give' ),
1156
-		'ED' => __( 'Edo', 'give' ),
1157
-		'EK' => __( 'Ekiti', 'give' ),
1158
-		'EN' => __( 'Enugu', 'give' ),
1159
-		'GO' => __( 'Gombe', 'give' ),
1160
-		'IM' => __( 'Imo', 'give' ),
1161
-		'JI' => __( 'Jigawa', 'give' ),
1162
-		'KD' => __( 'Kaduna', 'give' ),
1163
-		'KN' => __( 'Kano', 'give' ),
1164
-		'KT' => __( 'Katsina', 'give' ),
1165
-		'KE' => __( 'Kebbi', 'give' ),
1166
-		'KO' => __( 'Kogi', 'give' ),
1167
-		'KW' => __( 'Kwara', 'give' ),
1168
-		'LA' => __( 'Lagos', 'give' ),
1169
-		'NA' => __( 'Nasarawa', 'give' ),
1170
-		'NI' => __( 'Niger', 'give' ),
1171
-		'OG' => __( 'Ogun', 'give' ),
1172
-		'ON' => __( 'Ondo', 'give' ),
1173
-		'OS' => __( 'Osun', 'give' ),
1174
-		'OY' => __( 'Oyo', 'give' ),
1175
-		'PL' => __( 'Plateau', 'give' ),
1176
-		'RI' => __( 'Rivers', 'give' ),
1177
-		'SO' => __( 'Sokoto', 'give' ),
1178
-		'TA' => __( 'Taraba', 'give' ),
1179
-		'YO' => __( 'Yobe', 'give' ),
1180
-		'ZA' => __( 'Zamfara', 'give' ),
1144
+		'AB' => __('Abia', 'give'),
1145
+		'FC' => __('Abuja', 'give'),
1146
+		'AD' => __('Adamawa', 'give'),
1147
+		'AK' => __('Akwa Ibom', 'give'),
1148
+		'AN' => __('Anambra', 'give'),
1149
+		'BA' => __('Bauchi', 'give'),
1150
+		'BY' => __('Bayelsa', 'give'),
1151
+		'BE' => __('Benue', 'give'),
1152
+		'BO' => __('Borno', 'give'),
1153
+		'CR' => __('Cross River', 'give'),
1154
+		'DE' => __('Delta', 'give'),
1155
+		'EB' => __('Ebonyi', 'give'),
1156
+		'ED' => __('Edo', 'give'),
1157
+		'EK' => __('Ekiti', 'give'),
1158
+		'EN' => __('Enugu', 'give'),
1159
+		'GO' => __('Gombe', 'give'),
1160
+		'IM' => __('Imo', 'give'),
1161
+		'JI' => __('Jigawa', 'give'),
1162
+		'KD' => __('Kaduna', 'give'),
1163
+		'KN' => __('Kano', 'give'),
1164
+		'KT' => __('Katsina', 'give'),
1165
+		'KE' => __('Kebbi', 'give'),
1166
+		'KO' => __('Kogi', 'give'),
1167
+		'KW' => __('Kwara', 'give'),
1168
+		'LA' => __('Lagos', 'give'),
1169
+		'NA' => __('Nasarawa', 'give'),
1170
+		'NI' => __('Niger', 'give'),
1171
+		'OG' => __('Ogun', 'give'),
1172
+		'ON' => __('Ondo', 'give'),
1173
+		'OS' => __('Osun', 'give'),
1174
+		'OY' => __('Oyo', 'give'),
1175
+		'PL' => __('Plateau', 'give'),
1176
+		'RI' => __('Rivers', 'give'),
1177
+		'SO' => __('Sokoto', 'give'),
1178
+		'TA' => __('Taraba', 'give'),
1179
+		'YO' => __('Yobe', 'give'),
1180
+		'ZA' => __('Zamfara', 'give'),
1181 1181
 	);
1182 1182
 
1183
-	return apply_filters( 'give_nigerian_states', $states );
1183
+	return apply_filters('give_nigerian_states', $states);
1184 1184
 }
1185 1185
 
1186 1186
 /**
@@ -1192,41 +1192,41 @@  discard block
 block discarded – undo
1192 1192
 function give_get_mexico_states_list() {
1193 1193
 	$states = array(
1194 1194
 		''                    => '',
1195
-		'Distrito Federal'    => __( 'Distrito Federal', 'give' ),
1196
-		'Jalisco'             => __( 'Jalisco', 'give' ),
1197
-		'Nuevo Leon'          => __( 'Nuevo León', 'give' ),
1198
-		'Aguascalientes'      => __( 'Aguascalientes', 'give' ),
1199
-		'Baja California'     => __( 'Baja California', 'give' ),
1200
-		'Baja California Sur' => __( 'Baja California Sur', 'give' ),
1201
-		'Campeche'            => __( 'Campeche', 'give' ),
1202
-		'Chiapas'             => __( 'Chiapas', 'give' ),
1203
-		'Chihuahua'           => __( 'Chihuahua', 'give' ),
1204
-		'Coahuila'            => __( 'Coahuila', 'give' ),
1205
-		'Colima'              => __( 'Colima', 'give' ),
1206
-		'Durango'             => __( 'Durango', 'give' ),
1207
-		'Guanajuato'          => __( 'Guanajuato', 'give' ),
1208
-		'Guerrero'            => __( 'Guerrero', 'give' ),
1209
-		'Hidalgo'             => __( 'Hidalgo', 'give' ),
1210
-		'Estado de Mexico'    => __( 'Edo. de México', 'give' ),
1211
-		'Michoacan'           => __( 'Michoacán', 'give' ),
1212
-		'Morelos'             => __( 'Morelos', 'give' ),
1213
-		'Nayarit'             => __( 'Nayarit', 'give' ),
1214
-		'Oaxaca'              => __( 'Oaxaca', 'give' ),
1215
-		'Puebla'              => __( 'Puebla', 'give' ),
1216
-		'Queretaro'           => __( 'Querétaro', 'give' ),
1217
-		'Quintana Roo'        => __( 'Quintana Roo', 'give' ),
1218
-		'San Luis Potosi'     => __( 'San Luis Potosí', 'give' ),
1219
-		'Sinaloa'             => __( 'Sinaloa', 'give' ),
1220
-		'Sonora'              => __( 'Sonora', 'give' ),
1221
-		'Tabasco'             => __( 'Tabasco', 'give' ),
1222
-		'Tamaulipas'          => __( 'Tamaulipas', 'give' ),
1223
-		'Tlaxcala'            => __( 'Tlaxcala', 'give' ),
1224
-		'Veracruz'            => __( 'Veracruz', 'give' ),
1225
-		'Yucatan'             => __( 'Yucatán', 'give' ),
1226
-		'Zacatecas'           => __( 'Zacatecas', 'give' ),
1195
+		'Distrito Federal'    => __('Distrito Federal', 'give'),
1196
+		'Jalisco'             => __('Jalisco', 'give'),
1197
+		'Nuevo Leon'          => __('Nuevo León', 'give'),
1198
+		'Aguascalientes'      => __('Aguascalientes', 'give'),
1199
+		'Baja California'     => __('Baja California', 'give'),
1200
+		'Baja California Sur' => __('Baja California Sur', 'give'),
1201
+		'Campeche'            => __('Campeche', 'give'),
1202
+		'Chiapas'             => __('Chiapas', 'give'),
1203
+		'Chihuahua'           => __('Chihuahua', 'give'),
1204
+		'Coahuila'            => __('Coahuila', 'give'),
1205
+		'Colima'              => __('Colima', 'give'),
1206
+		'Durango'             => __('Durango', 'give'),
1207
+		'Guanajuato'          => __('Guanajuato', 'give'),
1208
+		'Guerrero'            => __('Guerrero', 'give'),
1209
+		'Hidalgo'             => __('Hidalgo', 'give'),
1210
+		'Estado de Mexico'    => __('Edo. de México', 'give'),
1211
+		'Michoacan'           => __('Michoacán', 'give'),
1212
+		'Morelos'             => __('Morelos', 'give'),
1213
+		'Nayarit'             => __('Nayarit', 'give'),
1214
+		'Oaxaca'              => __('Oaxaca', 'give'),
1215
+		'Puebla'              => __('Puebla', 'give'),
1216
+		'Queretaro'           => __('Querétaro', 'give'),
1217
+		'Quintana Roo'        => __('Quintana Roo', 'give'),
1218
+		'San Luis Potosi'     => __('San Luis Potosí', 'give'),
1219
+		'Sinaloa'             => __('Sinaloa', 'give'),
1220
+		'Sonora'              => __('Sonora', 'give'),
1221
+		'Tabasco'             => __('Tabasco', 'give'),
1222
+		'Tamaulipas'          => __('Tamaulipas', 'give'),
1223
+		'Tlaxcala'            => __('Tlaxcala', 'give'),
1224
+		'Veracruz'            => __('Veracruz', 'give'),
1225
+		'Yucatan'             => __('Yucatán', 'give'),
1226
+		'Zacatecas'           => __('Zacatecas', 'give'),
1227 1227
 	);
1228 1228
 
1229
-	return apply_filters( 'give_mexico_states', $states );
1229
+	return apply_filters('give_mexico_states', $states);
1230 1230
 }
1231 1231
 
1232 1232
 /**
@@ -1238,56 +1238,56 @@  discard block
 block discarded – undo
1238 1238
 function give_get_japan_states_list() {
1239 1239
 	$states = array(
1240 1240
 		''     => '',
1241
-		'JP01' => __( 'Hokkaido', 'give' ),
1242
-		'JP02' => __( 'Aomori', 'give' ),
1243
-		'JP03' => __( 'Iwate', 'give' ),
1244
-		'JP04' => __( 'Miyagi', 'give' ),
1245
-		'JP05' => __( 'Akita', 'give' ),
1246
-		'JP06' => __( 'Yamagata', 'give' ),
1247
-		'JP07' => __( 'Fukushima', 'give' ),
1248
-		'JP08' => __( 'Ibaraki', 'give' ),
1249
-		'JP09' => __( 'Tochigi', 'give' ),
1250
-		'JP10' => __( 'Gunma', 'give' ),
1251
-		'JP11' => __( 'Saitama', 'give' ),
1252
-		'JP12' => __( 'Chiba', 'give' ),
1253
-		'JP13' => __( 'Tokyo', 'give' ),
1254
-		'JP14' => __( 'Kanagawa', 'give' ),
1255
-		'JP15' => __( 'Niigata', 'give' ),
1256
-		'JP16' => __( 'Toyama', 'give' ),
1257
-		'JP17' => __( 'Ishikawa', 'give' ),
1258
-		'JP18' => __( 'Fukui', 'give' ),
1259
-		'JP19' => __( 'Yamanashi', 'give' ),
1260
-		'JP20' => __( 'Nagano', 'give' ),
1261
-		'JP21' => __( 'Gifu', 'give' ),
1262
-		'JP22' => __( 'Shizuoka', 'give' ),
1263
-		'JP23' => __( 'Aichi', 'give' ),
1264
-		'JP24' => __( 'Mie', 'give' ),
1265
-		'JP25' => __( 'Shiga', 'give' ),
1266
-		'JP26' => __( 'Kyoto', 'give' ),
1267
-		'JP27' => __( 'Osaka', 'give' ),
1268
-		'JP28' => __( 'Hyogo', 'give' ),
1269
-		'JP29' => __( 'Nara', 'give' ),
1270
-		'JP30' => __( 'Wakayama', 'give' ),
1271
-		'JP31' => __( 'Tottori', 'give' ),
1272
-		'JP32' => __( 'Shimane', 'give' ),
1273
-		'JP33' => __( 'Okayama', 'give' ),
1274
-		'JP34' => __( 'Hiroshima', 'give' ),
1275
-		'JP35' => __( 'Yamaguchi', 'give' ),
1276
-		'JP36' => __( 'Tokushima', 'give' ),
1277
-		'JP37' => __( 'Kagawa', 'give' ),
1278
-		'JP38' => __( 'Ehime', 'give' ),
1279
-		'JP39' => __( 'Kochi', 'give' ),
1280
-		'JP40' => __( 'Fukuoka', 'give' ),
1281
-		'JP41' => __( 'Saga', 'give' ),
1282
-		'JP42' => __( 'Nagasaki', 'give' ),
1283
-		'JP43' => __( 'Kumamoto', 'give' ),
1284
-		'JP44' => __( 'Oita', 'give' ),
1285
-		'JP45' => __( 'Miyazaki', 'give' ),
1286
-		'JP46' => __( 'Kagoshima', 'give' ),
1287
-		'JP47' => __( 'Okinawa', 'give' ),
1241
+		'JP01' => __('Hokkaido', 'give'),
1242
+		'JP02' => __('Aomori', 'give'),
1243
+		'JP03' => __('Iwate', 'give'),
1244
+		'JP04' => __('Miyagi', 'give'),
1245
+		'JP05' => __('Akita', 'give'),
1246
+		'JP06' => __('Yamagata', 'give'),
1247
+		'JP07' => __('Fukushima', 'give'),
1248
+		'JP08' => __('Ibaraki', 'give'),
1249
+		'JP09' => __('Tochigi', 'give'),
1250
+		'JP10' => __('Gunma', 'give'),
1251
+		'JP11' => __('Saitama', 'give'),
1252
+		'JP12' => __('Chiba', 'give'),
1253
+		'JP13' => __('Tokyo', 'give'),
1254
+		'JP14' => __('Kanagawa', 'give'),
1255
+		'JP15' => __('Niigata', 'give'),
1256
+		'JP16' => __('Toyama', 'give'),
1257
+		'JP17' => __('Ishikawa', 'give'),
1258
+		'JP18' => __('Fukui', 'give'),
1259
+		'JP19' => __('Yamanashi', 'give'),
1260
+		'JP20' => __('Nagano', 'give'),
1261
+		'JP21' => __('Gifu', 'give'),
1262
+		'JP22' => __('Shizuoka', 'give'),
1263
+		'JP23' => __('Aichi', 'give'),
1264
+		'JP24' => __('Mie', 'give'),
1265
+		'JP25' => __('Shiga', 'give'),
1266
+		'JP26' => __('Kyoto', 'give'),
1267
+		'JP27' => __('Osaka', 'give'),
1268
+		'JP28' => __('Hyogo', 'give'),
1269
+		'JP29' => __('Nara', 'give'),
1270
+		'JP30' => __('Wakayama', 'give'),
1271
+		'JP31' => __('Tottori', 'give'),
1272
+		'JP32' => __('Shimane', 'give'),
1273
+		'JP33' => __('Okayama', 'give'),
1274
+		'JP34' => __('Hiroshima', 'give'),
1275
+		'JP35' => __('Yamaguchi', 'give'),
1276
+		'JP36' => __('Tokushima', 'give'),
1277
+		'JP37' => __('Kagawa', 'give'),
1278
+		'JP38' => __('Ehime', 'give'),
1279
+		'JP39' => __('Kochi', 'give'),
1280
+		'JP40' => __('Fukuoka', 'give'),
1281
+		'JP41' => __('Saga', 'give'),
1282
+		'JP42' => __('Nagasaki', 'give'),
1283
+		'JP43' => __('Kumamoto', 'give'),
1284
+		'JP44' => __('Oita', 'give'),
1285
+		'JP45' => __('Miyazaki', 'give'),
1286
+		'JP46' => __('Kagoshima', 'give'),
1287
+		'JP47' => __('Okinawa', 'give'),
1288 1288
 	);
1289 1289
 
1290
-	return apply_filters( 'give_japan_states', $states );
1290
+	return apply_filters('give_japan_states', $states);
1291 1291
 }
1292 1292
 
1293 1293
 /**
@@ -1299,119 +1299,119 @@  discard block
 block discarded – undo
1299 1299
 function give_get_italy_states_list() {
1300 1300
 	$states = array(
1301 1301
 		''   => '',
1302
-		'AG' => __( 'Agrigento', 'give' ),
1303
-		'AL' => __( 'Alessandria', 'give' ),
1304
-		'AN' => __( 'Ancona', 'give' ),
1305
-		'AO' => __( 'Aosta', 'give' ),
1306
-		'AR' => __( 'Arezzo', 'give' ),
1307
-		'AP' => __( 'Ascoli Piceno', 'give' ),
1308
-		'AT' => __( 'Asti', 'give' ),
1309
-		'AV' => __( 'Avellino', 'give' ),
1310
-		'BA' => __( 'Bari', 'give' ),
1311
-		'BT' => __( 'Barletta-Andria-Trani', 'give' ),
1312
-		'BL' => __( 'Belluno', 'give' ),
1313
-		'BN' => __( 'Benevento', 'give' ),
1314
-		'BG' => __( 'Bergamo', 'give' ),
1315
-		'BI' => __( 'Biella', 'give' ),
1316
-		'BO' => __( 'Bologna', 'give' ),
1317
-		'BZ' => __( 'Bolzano', 'give' ),
1318
-		'BS' => __( 'Brescia', 'give' ),
1319
-		'BR' => __( 'Brindisi', 'give' ),
1320
-		'CA' => __( 'Cagliari', 'give' ),
1321
-		'CL' => __( 'Caltanissetta', 'give' ),
1322
-		'CB' => __( 'Campobasso', 'give' ),
1323
-		'CI' => __( 'Carbonia-Iglesias', 'give' ),
1324
-		'CE' => __( 'Caserta', 'give' ),
1325
-		'CT' => __( 'Catania', 'give' ),
1326
-		'CZ' => __( 'Catanzaro', 'give' ),
1327
-		'CH' => __( 'Chieti', 'give' ),
1328
-		'CO' => __( 'Como', 'give' ),
1329
-		'CS' => __( 'Cosenza', 'give' ),
1330
-		'CR' => __( 'Cremona', 'give' ),
1331
-		'KR' => __( 'Crotone', 'give' ),
1332
-		'CN' => __( 'Cuneo', 'give' ),
1333
-		'EN' => __( 'Enna', 'give' ),
1334
-		'FM' => __( 'Fermo', 'give' ),
1335
-		'FE' => __( 'Ferrara', 'give' ),
1336
-		'FI' => __( 'Firenze', 'give' ),
1337
-		'FG' => __( 'Foggia', 'give' ),
1338
-		'FC' => __( 'Forlì-Cesena', 'give' ),
1339
-		'FR' => __( 'Frosinone', 'give' ),
1340
-		'GE' => __( 'Genova', 'give' ),
1341
-		'GO' => __( 'Gorizia', 'give' ),
1342
-		'GR' => __( 'Grosseto', 'give' ),
1343
-		'IM' => __( 'Imperia', 'give' ),
1344
-		'IS' => __( 'Isernia', 'give' ),
1345
-		'SP' => __( 'La Spezia', 'give' ),
1346
-		'AQ' => __( "L'Aquila", 'give' ),
1347
-		'LT' => __( 'Latina', 'give' ),
1348
-		'LE' => __( 'Lecce', 'give' ),
1349
-		'LC' => __( 'Lecco', 'give' ),
1350
-		'LI' => __( 'Livorno', 'give' ),
1351
-		'LO' => __( 'Lodi', 'give' ),
1352
-		'LU' => __( 'Lucca', 'give' ),
1353
-		'MC' => __( 'Macerata', 'give' ),
1354
-		'MN' => __( 'Mantova', 'give' ),
1355
-		'MS' => __( 'Massa-Carrara', 'give' ),
1356
-		'MT' => __( 'Matera', 'give' ),
1357
-		'ME' => __( 'Messina', 'give' ),
1358
-		'MI' => __( 'Milano', 'give' ),
1359
-		'MO' => __( 'Modena', 'give' ),
1360
-		'MB' => __( 'Monza e della Brianza', 'give' ),
1361
-		'NA' => __( 'Napoli', 'give' ),
1362
-		'NO' => __( 'Novara', 'give' ),
1363
-		'NU' => __( 'Nuoro', 'give' ),
1364
-		'OT' => __( 'Olbia-Tempio', 'give' ),
1365
-		'OR' => __( 'Oristano', 'give' ),
1366
-		'PD' => __( 'Padova', 'give' ),
1367
-		'PA' => __( 'Palermo', 'give' ),
1368
-		'PR' => __( 'Parma', 'give' ),
1369
-		'PV' => __( 'Pavia', 'give' ),
1370
-		'PG' => __( 'Perugia', 'give' ),
1371
-		'PU' => __( 'Pesaro e Urbino', 'give' ),
1372
-		'PE' => __( 'Pescara', 'give' ),
1373
-		'PC' => __( 'Piacenza', 'give' ),
1374
-		'PI' => __( 'Pisa', 'give' ),
1375
-		'PT' => __( 'Pistoia', 'give' ),
1376
-		'PN' => __( 'Pordenone', 'give' ),
1377
-		'PZ' => __( 'Potenza', 'give' ),
1378
-		'PO' => __( 'Prato', 'give' ),
1379
-		'RG' => __( 'Ragusa', 'give' ),
1380
-		'RA' => __( 'Ravenna', 'give' ),
1381
-		'RC' => __( 'Reggio Calabria', 'give' ),
1382
-		'RE' => __( 'Reggio Emilia', 'give' ),
1383
-		'RI' => __( 'Rieti', 'give' ),
1384
-		'RN' => __( 'Rimini', 'give' ),
1385
-		'RM' => __( 'Roma', 'give' ),
1386
-		'RO' => __( 'Rovigo', 'give' ),
1387
-		'SA' => __( 'Salerno', 'give' ),
1388
-		'VS' => __( 'Medio Campidano', 'give' ),
1389
-		'SS' => __( 'Sassari', 'give' ),
1390
-		'SV' => __( 'Savona', 'give' ),
1391
-		'SI' => __( 'Siena', 'give' ),
1392
-		'SR' => __( 'Siracusa', 'give' ),
1393
-		'SO' => __( 'Sondrio', 'give' ),
1394
-		'TA' => __( 'Taranto', 'give' ),
1395
-		'TE' => __( 'Teramo', 'give' ),
1396
-		'TR' => __( 'Terni', 'give' ),
1397
-		'TO' => __( 'Torino', 'give' ),
1398
-		'OG' => __( 'Ogliastra', 'give' ),
1399
-		'TP' => __( 'Trapani', 'give' ),
1400
-		'TN' => __( 'Trento', 'give' ),
1401
-		'TV' => __( 'Treviso', 'give' ),
1402
-		'TS' => __( 'Trieste', 'give' ),
1403
-		'UD' => __( 'Udine', 'give' ),
1404
-		'VA' => __( 'Varese', 'give' ),
1405
-		'VE' => __( 'Venezia', 'give' ),
1406
-		'VB' => __( 'Verbano-Cusio-Ossola', 'give' ),
1407
-		'VC' => __( 'Vercelli', 'give' ),
1408
-		'VR' => __( 'Verona', 'give' ),
1409
-		'VV' => __( 'Vibo Valentia', 'give' ),
1410
-		'VI' => __( 'Vicenza', 'give' ),
1411
-		'VT' => __( 'Viterbo', 'give' ),
1302
+		'AG' => __('Agrigento', 'give'),
1303
+		'AL' => __('Alessandria', 'give'),
1304
+		'AN' => __('Ancona', 'give'),
1305
+		'AO' => __('Aosta', 'give'),
1306
+		'AR' => __('Arezzo', 'give'),
1307
+		'AP' => __('Ascoli Piceno', 'give'),
1308
+		'AT' => __('Asti', 'give'),
1309
+		'AV' => __('Avellino', 'give'),
1310
+		'BA' => __('Bari', 'give'),
1311
+		'BT' => __('Barletta-Andria-Trani', 'give'),
1312
+		'BL' => __('Belluno', 'give'),
1313
+		'BN' => __('Benevento', 'give'),
1314
+		'BG' => __('Bergamo', 'give'),
1315
+		'BI' => __('Biella', 'give'),
1316
+		'BO' => __('Bologna', 'give'),
1317
+		'BZ' => __('Bolzano', 'give'),
1318
+		'BS' => __('Brescia', 'give'),
1319
+		'BR' => __('Brindisi', 'give'),
1320
+		'CA' => __('Cagliari', 'give'),
1321
+		'CL' => __('Caltanissetta', 'give'),
1322
+		'CB' => __('Campobasso', 'give'),
1323
+		'CI' => __('Carbonia-Iglesias', 'give'),
1324
+		'CE' => __('Caserta', 'give'),
1325
+		'CT' => __('Catania', 'give'),
1326
+		'CZ' => __('Catanzaro', 'give'),
1327
+		'CH' => __('Chieti', 'give'),
1328
+		'CO' => __('Como', 'give'),
1329
+		'CS' => __('Cosenza', 'give'),
1330
+		'CR' => __('Cremona', 'give'),
1331
+		'KR' => __('Crotone', 'give'),
1332
+		'CN' => __('Cuneo', 'give'),
1333
+		'EN' => __('Enna', 'give'),
1334
+		'FM' => __('Fermo', 'give'),
1335
+		'FE' => __('Ferrara', 'give'),
1336
+		'FI' => __('Firenze', 'give'),
1337
+		'FG' => __('Foggia', 'give'),
1338
+		'FC' => __('Forlì-Cesena', 'give'),
1339
+		'FR' => __('Frosinone', 'give'),
1340
+		'GE' => __('Genova', 'give'),
1341
+		'GO' => __('Gorizia', 'give'),
1342
+		'GR' => __('Grosseto', 'give'),
1343
+		'IM' => __('Imperia', 'give'),
1344
+		'IS' => __('Isernia', 'give'),
1345
+		'SP' => __('La Spezia', 'give'),
1346
+		'AQ' => __("L'Aquila", 'give'),
1347
+		'LT' => __('Latina', 'give'),
1348
+		'LE' => __('Lecce', 'give'),
1349
+		'LC' => __('Lecco', 'give'),
1350
+		'LI' => __('Livorno', 'give'),
1351
+		'LO' => __('Lodi', 'give'),
1352
+		'LU' => __('Lucca', 'give'),
1353
+		'MC' => __('Macerata', 'give'),
1354
+		'MN' => __('Mantova', 'give'),
1355
+		'MS' => __('Massa-Carrara', 'give'),
1356
+		'MT' => __('Matera', 'give'),
1357
+		'ME' => __('Messina', 'give'),
1358
+		'MI' => __('Milano', 'give'),
1359
+		'MO' => __('Modena', 'give'),
1360
+		'MB' => __('Monza e della Brianza', 'give'),
1361
+		'NA' => __('Napoli', 'give'),
1362
+		'NO' => __('Novara', 'give'),
1363
+		'NU' => __('Nuoro', 'give'),
1364
+		'OT' => __('Olbia-Tempio', 'give'),
1365
+		'OR' => __('Oristano', 'give'),
1366
+		'PD' => __('Padova', 'give'),
1367
+		'PA' => __('Palermo', 'give'),
1368
+		'PR' => __('Parma', 'give'),
1369
+		'PV' => __('Pavia', 'give'),
1370
+		'PG' => __('Perugia', 'give'),
1371
+		'PU' => __('Pesaro e Urbino', 'give'),
1372
+		'PE' => __('Pescara', 'give'),
1373
+		'PC' => __('Piacenza', 'give'),
1374
+		'PI' => __('Pisa', 'give'),
1375
+		'PT' => __('Pistoia', 'give'),
1376
+		'PN' => __('Pordenone', 'give'),
1377
+		'PZ' => __('Potenza', 'give'),
1378
+		'PO' => __('Prato', 'give'),
1379
+		'RG' => __('Ragusa', 'give'),
1380
+		'RA' => __('Ravenna', 'give'),
1381
+		'RC' => __('Reggio Calabria', 'give'),
1382
+		'RE' => __('Reggio Emilia', 'give'),
1383
+		'RI' => __('Rieti', 'give'),
1384
+		'RN' => __('Rimini', 'give'),
1385
+		'RM' => __('Roma', 'give'),
1386
+		'RO' => __('Rovigo', 'give'),
1387
+		'SA' => __('Salerno', 'give'),
1388
+		'VS' => __('Medio Campidano', 'give'),
1389
+		'SS' => __('Sassari', 'give'),
1390
+		'SV' => __('Savona', 'give'),
1391
+		'SI' => __('Siena', 'give'),
1392
+		'SR' => __('Siracusa', 'give'),
1393
+		'SO' => __('Sondrio', 'give'),
1394
+		'TA' => __('Taranto', 'give'),
1395
+		'TE' => __('Teramo', 'give'),
1396
+		'TR' => __('Terni', 'give'),
1397
+		'TO' => __('Torino', 'give'),
1398
+		'OG' => __('Ogliastra', 'give'),
1399
+		'TP' => __('Trapani', 'give'),
1400
+		'TN' => __('Trento', 'give'),
1401
+		'TV' => __('Treviso', 'give'),
1402
+		'TS' => __('Trieste', 'give'),
1403
+		'UD' => __('Udine', 'give'),
1404
+		'VA' => __('Varese', 'give'),
1405
+		'VE' => __('Venezia', 'give'),
1406
+		'VB' => __('Verbano-Cusio-Ossola', 'give'),
1407
+		'VC' => __('Vercelli', 'give'),
1408
+		'VR' => __('Verona', 'give'),
1409
+		'VV' => __('Vibo Valentia', 'give'),
1410
+		'VI' => __('Vicenza', 'give'),
1411
+		'VT' => __('Viterbo', 'give'),
1412 1412
 	);
1413 1413
 
1414
-	return apply_filters( 'give_italy_states', $states );
1414
+	return apply_filters('give_italy_states', $states);
1415 1415
 }
1416 1416
 
1417 1417
 /**
@@ -1423,40 +1423,40 @@  discard block
 block discarded – undo
1423 1423
 function give_get_iran_states_list() {
1424 1424
 	$states = array(
1425 1425
 		''    => '',
1426
-		'KHZ' => __( 'Khuzestan  (خوزستان)', 'give' ),
1427
-		'THR' => __( 'Tehran  (تهران)', 'give' ),
1428
-		'ILM' => __( 'Ilaam (ایلام)', 'give' ),
1429
-		'BHR' => __( 'Bushehr (بوشهر)', 'give' ),
1430
-		'ADL' => __( 'Ardabil (اردبیل)', 'give' ),
1431
-		'ESF' => __( 'Isfahan (اصفهان)', 'give' ),
1432
-		'YZD' => __( 'Yazd (یزد)', 'give' ),
1433
-		'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ),
1434
-		'KRN' => __( 'Kerman (کرمان)', 'give' ),
1435
-		'HDN' => __( 'Hamadan (همدان)', 'give' ),
1436
-		'GZN' => __( 'Ghazvin (قزوین)', 'give' ),
1437
-		'ZJN' => __( 'Zanjan (زنجان)', 'give' ),
1438
-		'LRS' => __( 'Luristan (لرستان)', 'give' ),
1439
-		'ABZ' => __( 'Alborz (البرز)', 'give' ),
1440
-		'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ),
1441
-		'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ),
1442
-		'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ),
1443
-		'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ),
1444
-		'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ),
1445
-		'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ),
1446
-		'SMN' => __( 'Semnan (سمنان)', 'give' ),
1447
-		'FRS' => __( 'Fars (فارس)', 'give' ),
1448
-		'QHM' => __( 'Qom (قم)', 'give' ),
1449
-		'KRD' => __( 'Kurdistan / کردستان)', 'give' ),
1450
-		'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ),
1451
-		'GLS' => __( 'Golestan (گلستان)', 'give' ),
1452
-		'GIL' => __( 'Gilan (گیلان)', 'give' ),
1453
-		'MZN' => __( 'Mazandaran (مازندران)', 'give' ),
1454
-		'MKZ' => __( 'Markazi (مرکزی)', 'give' ),
1455
-		'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ),
1456
-		'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ),
1426
+		'KHZ' => __('Khuzestan  (خوزستان)', 'give'),
1427
+		'THR' => __('Tehran  (تهران)', 'give'),
1428
+		'ILM' => __('Ilaam (ایلام)', 'give'),
1429
+		'BHR' => __('Bushehr (بوشهر)', 'give'),
1430
+		'ADL' => __('Ardabil (اردبیل)', 'give'),
1431
+		'ESF' => __('Isfahan (اصفهان)', 'give'),
1432
+		'YZD' => __('Yazd (یزد)', 'give'),
1433
+		'KRH' => __('Kermanshah (کرمانشاه)', 'give'),
1434
+		'KRN' => __('Kerman (کرمان)', 'give'),
1435
+		'HDN' => __('Hamadan (همدان)', 'give'),
1436
+		'GZN' => __('Ghazvin (قزوین)', 'give'),
1437
+		'ZJN' => __('Zanjan (زنجان)', 'give'),
1438
+		'LRS' => __('Luristan (لرستان)', 'give'),
1439
+		'ABZ' => __('Alborz (البرز)', 'give'),
1440
+		'EAZ' => __('East Azarbaijan (آذربایجان شرقی)', 'give'),
1441
+		'WAZ' => __('West Azarbaijan (آذربایجان غربی)', 'give'),
1442
+		'CHB' => __('Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give'),
1443
+		'SKH' => __('South Khorasan (خراسان جنوبی)', 'give'),
1444
+		'RKH' => __('Razavi Khorasan (خراسان رضوی)', 'give'),
1445
+		'NKH' => __('North Khorasan (خراسان جنوبی)', 'give'),
1446
+		'SMN' => __('Semnan (سمنان)', 'give'),
1447
+		'FRS' => __('Fars (فارس)', 'give'),
1448
+		'QHM' => __('Qom (قم)', 'give'),
1449
+		'KRD' => __('Kurdistan / کردستان)', 'give'),
1450
+		'KBD' => __('Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give'),
1451
+		'GLS' => __('Golestan (گلستان)', 'give'),
1452
+		'GIL' => __('Gilan (گیلان)', 'give'),
1453
+		'MZN' => __('Mazandaran (مازندران)', 'give'),
1454
+		'MKZ' => __('Markazi (مرکزی)', 'give'),
1455
+		'HRZ' => __('Hormozgan (هرمزگان)', 'give'),
1456
+		'SBN' => __('Sistan and Baluchestan (سیستان و بلوچستان)', 'give'),
1457 1457
 	);
1458 1458
 
1459
-	return apply_filters( 'give_iran_states', $states );
1459
+	return apply_filters('give_iran_states', $states);
1460 1460
 }
1461 1461
 
1462 1462
 /**
@@ -1468,35 +1468,35 @@  discard block
 block discarded – undo
1468 1468
 function give_get_ireland_states_list() {
1469 1469
 	$states = array(
1470 1470
 		''   => '',
1471
-		'CE' => __( 'Clare', 'give' ),
1472
-		'CK' => __( 'Cork', 'give' ),
1473
-		'CN' => __( 'Cavan', 'give' ),
1474
-		'CW' => __( 'Carlow', 'give' ),
1475
-		'DL' => __( 'Donegal', 'give' ),
1476
-		'DN' => __( 'Dublin', 'give' ),
1477
-		'GY' => __( 'Galway', 'give' ),
1478
-		'KE' => __( 'Kildare', 'give' ),
1479
-		'KK' => __( 'Kilkenny', 'give' ),
1480
-		'KY' => __( 'Kerry', 'give' ),
1481
-		'LD' => __( 'Longford', 'give' ),
1482
-		'LH' => __( 'Louth', 'give' ),
1483
-		'LK' => __( 'Limerick', 'give' ),
1484
-		'LM' => __( 'Leitrim', 'give' ),
1485
-		'LS' => __( 'Laois', 'give' ),
1486
-		'MH' => __( 'Meath', 'give' ),
1487
-		'MN' => __( 'Monaghan', 'give' ),
1488
-		'MO' => __( 'Mayo', 'give' ),
1489
-		'OY' => __( 'Offaly', 'give' ),
1490
-		'RN' => __( 'Roscommon', 'give' ),
1491
-		'SO' => __( 'Sligo', 'give' ),
1492
-		'TY' => __( 'Tipperary', 'give' ),
1493
-		'WD' => __( 'Waterford', 'give' ),
1494
-		'WH' => __( 'Westmeath', 'give' ),
1495
-		'WW' => __( 'Wicklow', 'give' ),
1496
-		'WX' => __( 'Wexford', 'give' ),
1471
+		'CE' => __('Clare', 'give'),
1472
+		'CK' => __('Cork', 'give'),
1473
+		'CN' => __('Cavan', 'give'),
1474
+		'CW' => __('Carlow', 'give'),
1475
+		'DL' => __('Donegal', 'give'),
1476
+		'DN' => __('Dublin', 'give'),
1477
+		'GY' => __('Galway', 'give'),
1478
+		'KE' => __('Kildare', 'give'),
1479
+		'KK' => __('Kilkenny', 'give'),
1480
+		'KY' => __('Kerry', 'give'),
1481
+		'LD' => __('Longford', 'give'),
1482
+		'LH' => __('Louth', 'give'),
1483
+		'LK' => __('Limerick', 'give'),
1484
+		'LM' => __('Leitrim', 'give'),
1485
+		'LS' => __('Laois', 'give'),
1486
+		'MH' => __('Meath', 'give'),
1487
+		'MN' => __('Monaghan', 'give'),
1488
+		'MO' => __('Mayo', 'give'),
1489
+		'OY' => __('Offaly', 'give'),
1490
+		'RN' => __('Roscommon', 'give'),
1491
+		'SO' => __('Sligo', 'give'),
1492
+		'TY' => __('Tipperary', 'give'),
1493
+		'WD' => __('Waterford', 'give'),
1494
+		'WH' => __('Westmeath', 'give'),
1495
+		'WW' => __('Wicklow', 'give'),
1496
+		'WX' => __('Wexford', 'give'),
1497 1497
 	);
1498 1498
 
1499
-	return apply_filters( 'give_ireland_states', $states );
1499
+	return apply_filters('give_ireland_states', $states);
1500 1500
 }
1501 1501
 
1502 1502
 /**
@@ -1508,22 +1508,22 @@  discard block
 block discarded – undo
1508 1508
 function give_get_greek_states_list() {
1509 1509
 	$states = array(
1510 1510
 		''  => '',
1511
-		'I' => __( 'Αττική', 'give' ),
1512
-		'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ),
1513
-		'B' => __( 'Κεντρική Μακεδονία', 'give' ),
1514
-		'C' => __( 'Δυτική Μακεδονία', 'give' ),
1515
-		'D' => __( 'Ήπειρος', 'give' ),
1516
-		'E' => __( 'Θεσσαλία', 'give' ),
1517
-		'F' => __( 'Ιόνιοι Νήσοι', 'give' ),
1518
-		'G' => __( 'Δυτική Ελλάδα', 'give' ),
1519
-		'H' => __( 'Στερεά Ελλάδα', 'give' ),
1520
-		'J' => __( 'Πελοπόννησος', 'give' ),
1521
-		'K' => __( 'Βόρειο Αιγαίο', 'give' ),
1522
-		'L' => __( 'Νότιο Αιγαίο', 'give' ),
1523
-		'M' => __( 'Κρήτη', 'give' ),
1511
+		'I' => __('Αττική', 'give'),
1512
+		'A' => __('Ανατολική Μακεδονία και Θράκη', 'give'),
1513
+		'B' => __('Κεντρική Μακεδονία', 'give'),
1514
+		'C' => __('Δυτική Μακεδονία', 'give'),
1515
+		'D' => __('Ήπειρος', 'give'),
1516
+		'E' => __('Θεσσαλία', 'give'),
1517
+		'F' => __('Ιόνιοι Νήσοι', 'give'),
1518
+		'G' => __('Δυτική Ελλάδα', 'give'),
1519
+		'H' => __('Στερεά Ελλάδα', 'give'),
1520
+		'J' => __('Πελοπόννησος', 'give'),
1521
+		'K' => __('Βόρειο Αιγαίο', 'give'),
1522
+		'L' => __('Νότιο Αιγαίο', 'give'),
1523
+		'M' => __('Κρήτη', 'give'),
1524 1524
 	);
1525 1525
 
1526
-	return apply_filters( 'give_greek_states', $states );
1526
+	return apply_filters('give_greek_states', $states);
1527 1527
 }
1528 1528
 
1529 1529
 /**
@@ -1535,18 +1535,18 @@  discard block
 block discarded – undo
1535 1535
 function give_get_bolivian_states_list() {
1536 1536
 	$states = array(
1537 1537
 		''  => '',
1538
-		'B' => __( 'Chuquisaca', 'give' ),
1539
-		'H' => __( 'Beni', 'give' ),
1540
-		'C' => __( 'Cochabamba', 'give' ),
1541
-		'L' => __( 'La Paz', 'give' ),
1542
-		'O' => __( 'Oruro', 'give' ),
1543
-		'N' => __( 'Pando', 'give' ),
1544
-		'P' => __( 'Potosí', 'give' ),
1545
-		'S' => __( 'Santa Cruz', 'give' ),
1546
-		'T' => __( 'Tarija', 'give' ),
1538
+		'B' => __('Chuquisaca', 'give'),
1539
+		'H' => __('Beni', 'give'),
1540
+		'C' => __('Cochabamba', 'give'),
1541
+		'L' => __('La Paz', 'give'),
1542
+		'O' => __('Oruro', 'give'),
1543
+		'N' => __('Pando', 'give'),
1544
+		'P' => __('Potosí', 'give'),
1545
+		'S' => __('Santa Cruz', 'give'),
1546
+		'T' => __('Tarija', 'give'),
1547 1547
 	);
1548 1548
 
1549
-	return apply_filters( 'give_bolivian_states', $states );
1549
+	return apply_filters('give_bolivian_states', $states);
1550 1550
 }
1551 1551
 
1552 1552
 /**
@@ -1558,37 +1558,37 @@  discard block
 block discarded – undo
1558 1558
 function give_get_bulgarian_states_list() {
1559 1559
 	$states = array(
1560 1560
 		''      => '',
1561
-		'BG-01' => __( 'Blagoevgrad', 'give' ),
1562
-		'BG-02' => __( 'Burgas', 'give' ),
1563
-		'BG-08' => __( 'Dobrich', 'give' ),
1564
-		'BG-07' => __( 'Gabrovo', 'give' ),
1565
-		'BG-26' => __( 'Haskovo', 'give' ),
1566
-		'BG-09' => __( 'Kardzhali', 'give' ),
1567
-		'BG-10' => __( 'Kyustendil', 'give' ),
1568
-		'BG-11' => __( 'Lovech', 'give' ),
1569
-		'BG-12' => __( 'Montana', 'give' ),
1570
-		'BG-13' => __( 'Pazardzhik', 'give' ),
1571
-		'BG-14' => __( 'Pernik', 'give' ),
1572
-		'BG-15' => __( 'Pleven', 'give' ),
1573
-		'BG-16' => __( 'Plovdiv', 'give' ),
1574
-		'BG-17' => __( 'Razgrad', 'give' ),
1575
-		'BG-18' => __( 'Ruse', 'give' ),
1576
-		'BG-27' => __( 'Shumen', 'give' ),
1577
-		'BG-19' => __( 'Silistra', 'give' ),
1578
-		'BG-20' => __( 'Sliven', 'give' ),
1579
-		'BG-21' => __( 'Smolyan', 'give' ),
1580
-		'BG-23' => __( 'Sofia', 'give' ),
1581
-		'BG-22' => __( 'Sofia-Grad', 'give' ),
1582
-		'BG-24' => __( 'Stara Zagora', 'give' ),
1583
-		'BG-25' => __( 'Targovishte', 'give' ),
1584
-		'BG-03' => __( 'Varna', 'give' ),
1585
-		'BG-04' => __( 'Veliko Tarnovo', 'give' ),
1586
-		'BG-05' => __( 'Vidin', 'give' ),
1587
-		'BG-06' => __( 'Vratsa', 'give' ),
1588
-		'BG-28' => __( 'Yambol', 'give' ),
1561
+		'BG-01' => __('Blagoevgrad', 'give'),
1562
+		'BG-02' => __('Burgas', 'give'),
1563
+		'BG-08' => __('Dobrich', 'give'),
1564
+		'BG-07' => __('Gabrovo', 'give'),
1565
+		'BG-26' => __('Haskovo', 'give'),
1566
+		'BG-09' => __('Kardzhali', 'give'),
1567
+		'BG-10' => __('Kyustendil', 'give'),
1568
+		'BG-11' => __('Lovech', 'give'),
1569
+		'BG-12' => __('Montana', 'give'),
1570
+		'BG-13' => __('Pazardzhik', 'give'),
1571
+		'BG-14' => __('Pernik', 'give'),
1572
+		'BG-15' => __('Pleven', 'give'),
1573
+		'BG-16' => __('Plovdiv', 'give'),
1574
+		'BG-17' => __('Razgrad', 'give'),
1575
+		'BG-18' => __('Ruse', 'give'),
1576
+		'BG-27' => __('Shumen', 'give'),
1577
+		'BG-19' => __('Silistra', 'give'),
1578
+		'BG-20' => __('Sliven', 'give'),
1579
+		'BG-21' => __('Smolyan', 'give'),
1580
+		'BG-23' => __('Sofia', 'give'),
1581
+		'BG-22' => __('Sofia-Grad', 'give'),
1582
+		'BG-24' => __('Stara Zagora', 'give'),
1583
+		'BG-25' => __('Targovishte', 'give'),
1584
+		'BG-03' => __('Varna', 'give'),
1585
+		'BG-04' => __('Veliko Tarnovo', 'give'),
1586
+		'BG-05' => __('Vidin', 'give'),
1587
+		'BG-06' => __('Vratsa', 'give'),
1588
+		'BG-28' => __('Yambol', 'give'),
1589 1589
 	);
1590 1590
 
1591
-	return apply_filters( 'give_bulgarian_states', $states );
1591
+	return apply_filters('give_bulgarian_states', $states);
1592 1592
 }
1593 1593
 
1594 1594
 /**
@@ -1600,73 +1600,73 @@  discard block
 block discarded – undo
1600 1600
 function give_get_bangladeshi_states_list() {
1601 1601
 	$states = array(
1602 1602
 		''     => '',
1603
-		'BAG'  => __( 'Bagerhat', 'give' ),
1604
-		'BAN'  => __( 'Bandarban', 'give' ),
1605
-		'BAR'  => __( 'Barguna', 'give' ),
1606
-		'BARI' => __( 'Barisal', 'give' ),
1607
-		'BHO'  => __( 'Bhola', 'give' ),
1608
-		'BOG'  => __( 'Bogra', 'give' ),
1609
-		'BRA'  => __( 'Brahmanbaria', 'give' ),
1610
-		'CHA'  => __( 'Chandpur', 'give' ),
1611
-		'CHI'  => __( 'Chittagong', 'give' ),
1612
-		'CHU'  => __( 'Chuadanga', 'give' ),
1613
-		'COM'  => __( 'Comilla', 'give' ),
1614
-		'COX'  => __( "Cox's Bazar", 'give' ),
1615
-		'DHA'  => __( 'Dhaka', 'give' ),
1616
-		'DIN'  => __( 'Dinajpur', 'give' ),
1617
-		'FAR'  => __( 'Faridpur ', 'give' ),
1618
-		'FEN'  => __( 'Feni', 'give' ),
1619
-		'GAI'  => __( 'Gaibandha', 'give' ),
1620
-		'GAZI' => __( 'Gazipur', 'give' ),
1621
-		'GOP'  => __( 'Gopalganj', 'give' ),
1622
-		'HAB'  => __( 'Habiganj', 'give' ),
1623
-		'JAM'  => __( 'Jamalpur', 'give' ),
1624
-		'JES'  => __( 'Jessore', 'give' ),
1625
-		'JHA'  => __( 'Jhalokati', 'give' ),
1626
-		'JHE'  => __( 'Jhenaidah', 'give' ),
1627
-		'JOY'  => __( 'Joypurhat', 'give' ),
1628
-		'KHA'  => __( 'Khagrachhari', 'give' ),
1629
-		'KHU'  => __( 'Khulna', 'give' ),
1630
-		'KIS'  => __( 'Kishoreganj', 'give' ),
1631
-		'KUR'  => __( 'Kurigram', 'give' ),
1632
-		'KUS'  => __( 'Kushtia', 'give' ),
1633
-		'LAK'  => __( 'Lakshmipur', 'give' ),
1634
-		'LAL'  => __( 'Lalmonirhat', 'give' ),
1635
-		'MAD'  => __( 'Madaripur', 'give' ),
1636
-		'MAG'  => __( 'Magura', 'give' ),
1637
-		'MAN'  => __( 'Manikganj ', 'give' ),
1638
-		'MEH'  => __( 'Meherpur', 'give' ),
1639
-		'MOU'  => __( 'Moulvibazar', 'give' ),
1640
-		'MUN'  => __( 'Munshiganj', 'give' ),
1641
-		'MYM'  => __( 'Mymensingh', 'give' ),
1642
-		'NAO'  => __( 'Naogaon', 'give' ),
1643
-		'NAR'  => __( 'Narail', 'give' ),
1644
-		'NARG' => __( 'Narayanganj', 'give' ),
1645
-		'NARD' => __( 'Narsingdi', 'give' ),
1646
-		'NAT'  => __( 'Natore', 'give' ),
1647
-		'NAW'  => __( 'Nawabganj', 'give' ),
1648
-		'NET'  => __( 'Netrakona', 'give' ),
1649
-		'NIL'  => __( 'Nilphamari', 'give' ),
1650
-		'NOA'  => __( 'Noakhali', 'give' ),
1651
-		'PAB'  => __( 'Pabna', 'give' ),
1652
-		'PAN'  => __( 'Panchagarh', 'give' ),
1653
-		'PAT'  => __( 'Patuakhali', 'give' ),
1654
-		'PIR'  => __( 'Pirojpur', 'give' ),
1655
-		'RAJB' => __( 'Rajbari', 'give' ),
1656
-		'RAJ'  => __( 'Rajshahi', 'give' ),
1657
-		'RAN'  => __( 'Rangamati', 'give' ),
1658
-		'RANP' => __( 'Rangpur', 'give' ),
1659
-		'SAT'  => __( 'Satkhira', 'give' ),
1660
-		'SHA'  => __( 'Shariatpur', 'give' ),
1661
-		'SHE'  => __( 'Sherpur', 'give' ),
1662
-		'SIR'  => __( 'Sirajganj', 'give' ),
1663
-		'SUN'  => __( 'Sunamganj', 'give' ),
1664
-		'SYL'  => __( 'Sylhet', 'give' ),
1665
-		'TAN'  => __( 'Tangail', 'give' ),
1666
-		'THA'  => __( 'Thakurgaon', 'give' ),
1603
+		'BAG'  => __('Bagerhat', 'give'),
1604
+		'BAN'  => __('Bandarban', 'give'),
1605
+		'BAR'  => __('Barguna', 'give'),
1606
+		'BARI' => __('Barisal', 'give'),
1607
+		'BHO'  => __('Bhola', 'give'),
1608
+		'BOG'  => __('Bogra', 'give'),
1609
+		'BRA'  => __('Brahmanbaria', 'give'),
1610
+		'CHA'  => __('Chandpur', 'give'),
1611
+		'CHI'  => __('Chittagong', 'give'),
1612
+		'CHU'  => __('Chuadanga', 'give'),
1613
+		'COM'  => __('Comilla', 'give'),
1614
+		'COX'  => __("Cox's Bazar", 'give'),
1615
+		'DHA'  => __('Dhaka', 'give'),
1616
+		'DIN'  => __('Dinajpur', 'give'),
1617
+		'FAR'  => __('Faridpur ', 'give'),
1618
+		'FEN'  => __('Feni', 'give'),
1619
+		'GAI'  => __('Gaibandha', 'give'),
1620
+		'GAZI' => __('Gazipur', 'give'),
1621
+		'GOP'  => __('Gopalganj', 'give'),
1622
+		'HAB'  => __('Habiganj', 'give'),
1623
+		'JAM'  => __('Jamalpur', 'give'),
1624
+		'JES'  => __('Jessore', 'give'),
1625
+		'JHA'  => __('Jhalokati', 'give'),
1626
+		'JHE'  => __('Jhenaidah', 'give'),
1627
+		'JOY'  => __('Joypurhat', 'give'),
1628
+		'KHA'  => __('Khagrachhari', 'give'),
1629
+		'KHU'  => __('Khulna', 'give'),
1630
+		'KIS'  => __('Kishoreganj', 'give'),
1631
+		'KUR'  => __('Kurigram', 'give'),
1632
+		'KUS'  => __('Kushtia', 'give'),
1633
+		'LAK'  => __('Lakshmipur', 'give'),
1634
+		'LAL'  => __('Lalmonirhat', 'give'),
1635
+		'MAD'  => __('Madaripur', 'give'),
1636
+		'MAG'  => __('Magura', 'give'),
1637
+		'MAN'  => __('Manikganj ', 'give'),
1638
+		'MEH'  => __('Meherpur', 'give'),
1639
+		'MOU'  => __('Moulvibazar', 'give'),
1640
+		'MUN'  => __('Munshiganj', 'give'),
1641
+		'MYM'  => __('Mymensingh', 'give'),
1642
+		'NAO'  => __('Naogaon', 'give'),
1643
+		'NAR'  => __('Narail', 'give'),
1644
+		'NARG' => __('Narayanganj', 'give'),
1645
+		'NARD' => __('Narsingdi', 'give'),
1646
+		'NAT'  => __('Natore', 'give'),
1647
+		'NAW'  => __('Nawabganj', 'give'),
1648
+		'NET'  => __('Netrakona', 'give'),
1649
+		'NIL'  => __('Nilphamari', 'give'),
1650
+		'NOA'  => __('Noakhali', 'give'),
1651
+		'PAB'  => __('Pabna', 'give'),
1652
+		'PAN'  => __('Panchagarh', 'give'),
1653
+		'PAT'  => __('Patuakhali', 'give'),
1654
+		'PIR'  => __('Pirojpur', 'give'),
1655
+		'RAJB' => __('Rajbari', 'give'),
1656
+		'RAJ'  => __('Rajshahi', 'give'),
1657
+		'RAN'  => __('Rangamati', 'give'),
1658
+		'RANP' => __('Rangpur', 'give'),
1659
+		'SAT'  => __('Satkhira', 'give'),
1660
+		'SHA'  => __('Shariatpur', 'give'),
1661
+		'SHE'  => __('Sherpur', 'give'),
1662
+		'SIR'  => __('Sirajganj', 'give'),
1663
+		'SUN'  => __('Sunamganj', 'give'),
1664
+		'SYL'  => __('Sylhet', 'give'),
1665
+		'TAN'  => __('Tangail', 'give'),
1666
+		'THA'  => __('Thakurgaon', 'give'),
1667 1667
 	);
1668 1668
 
1669
-	return apply_filters( 'give_bangladeshi_states', $states );
1669
+	return apply_filters('give_bangladeshi_states', $states);
1670 1670
 }
1671 1671
 
1672 1672
 /**
@@ -1678,33 +1678,33 @@  discard block
 block discarded – undo
1678 1678
 function give_get_argentina_states_list() {
1679 1679
 	$states = array(
1680 1680
 		''  => '',
1681
-		'C' => __( 'Ciudad Aut&oacute;noma de Buenos Aires', 'give' ),
1682
-		'B' => __( 'Buenos Aires', 'give' ),
1683
-		'K' => __( 'Catamarca', 'give' ),
1684
-		'H' => __( 'Chaco', 'give' ),
1685
-		'U' => __( 'Chubut', 'give' ),
1686
-		'X' => __( 'C&oacute;rdoba', 'give' ),
1687
-		'W' => __( 'Corrientes', 'give' ),
1688
-		'E' => __( 'Entre R&iacute;os', 'give' ),
1689
-		'P' => __( 'Formosa', 'give' ),
1690
-		'Y' => __( 'Jujuy', 'give' ),
1691
-		'L' => __( 'La Pampa', 'give' ),
1692
-		'F' => __( 'La Rioja', 'give' ),
1693
-		'M' => __( 'Mendoza', 'give' ),
1694
-		'N' => __( 'Misiones', 'give' ),
1695
-		'Q' => __( 'Neuqu&eacute;n', 'give' ),
1696
-		'R' => __( 'R&iacute;o Negro', 'give' ),
1697
-		'A' => __( 'Salta', 'give' ),
1698
-		'J' => __( 'San Juan', 'give' ),
1699
-		'D' => __( 'San Luis', 'give' ),
1700
-		'Z' => __( 'Santa Cruz', 'give' ),
1701
-		'S' => __( 'Santa Fe', 'give' ),
1702
-		'G' => __( 'Santiago del Estero', 'give' ),
1703
-		'V' => __( 'Tierra del Fuego', 'give' ),
1704
-		'T' => __( 'Tucum&aacute;n', 'give' ),
1681
+		'C' => __('Ciudad Aut&oacute;noma de Buenos Aires', 'give'),
1682
+		'B' => __('Buenos Aires', 'give'),
1683
+		'K' => __('Catamarca', 'give'),
1684
+		'H' => __('Chaco', 'give'),
1685
+		'U' => __('Chubut', 'give'),
1686
+		'X' => __('C&oacute;rdoba', 'give'),
1687
+		'W' => __('Corrientes', 'give'),
1688
+		'E' => __('Entre R&iacute;os', 'give'),
1689
+		'P' => __('Formosa', 'give'),
1690
+		'Y' => __('Jujuy', 'give'),
1691
+		'L' => __('La Pampa', 'give'),
1692
+		'F' => __('La Rioja', 'give'),
1693
+		'M' => __('Mendoza', 'give'),
1694
+		'N' => __('Misiones', 'give'),
1695
+		'Q' => __('Neuqu&eacute;n', 'give'),
1696
+		'R' => __('R&iacute;o Negro', 'give'),
1697
+		'A' => __('Salta', 'give'),
1698
+		'J' => __('San Juan', 'give'),
1699
+		'D' => __('San Luis', 'give'),
1700
+		'Z' => __('Santa Cruz', 'give'),
1701
+		'S' => __('Santa Fe', 'give'),
1702
+		'G' => __('Santiago del Estero', 'give'),
1703
+		'V' => __('Tierra del Fuego', 'give'),
1704
+		'T' => __('Tucum&aacute;n', 'give'),
1705 1705
 	);
1706 1706
 
1707
-	return apply_filters( 'give_argentina_states', $states );
1707
+	return apply_filters('give_argentina_states', $states);
1708 1708
 }
1709 1709
 
1710 1710
 /**
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
 		'AP' => 'Armed Forces - Pacific',
1786 1786
 	);
1787 1787
 
1788
-	return apply_filters( 'give_us_states', $states );
1788
+	return apply_filters('give_us_states', $states);
1789 1789
 }
1790 1790
 
1791 1791
 /**
@@ -1798,22 +1798,22 @@  discard block
 block discarded – undo
1798 1798
 function give_get_provinces_list() {
1799 1799
 	$provinces = array(
1800 1800
 		''   => '',
1801
-		'AB' => esc_html__( 'Alberta', 'give' ),
1802
-		'BC' => esc_html__( 'British Columbia', 'give' ),
1803
-		'MB' => esc_html__( 'Manitoba', 'give' ),
1804
-		'NB' => esc_html__( 'New Brunswick', 'give' ),
1805
-		'NL' => esc_html__( 'Newfoundland and Labrador', 'give' ),
1806
-		'NS' => esc_html__( 'Nova Scotia', 'give' ),
1807
-		'NT' => esc_html__( 'Northwest Territories', 'give' ),
1808
-		'NU' => esc_html__( 'Nunavut', 'give' ),
1809
-		'ON' => esc_html__( 'Ontario', 'give' ),
1810
-		'PE' => esc_html__( 'Prince Edward Island', 'give' ),
1811
-		'QC' => esc_html__( 'Quebec', 'give' ),
1812
-		'SK' => esc_html__( 'Saskatchewan', 'give' ),
1813
-		'YT' => esc_html__( 'Yukon', 'give' ),
1801
+		'AB' => esc_html__('Alberta', 'give'),
1802
+		'BC' => esc_html__('British Columbia', 'give'),
1803
+		'MB' => esc_html__('Manitoba', 'give'),
1804
+		'NB' => esc_html__('New Brunswick', 'give'),
1805
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
1806
+		'NS' => esc_html__('Nova Scotia', 'give'),
1807
+		'NT' => esc_html__('Northwest Territories', 'give'),
1808
+		'NU' => esc_html__('Nunavut', 'give'),
1809
+		'ON' => esc_html__('Ontario', 'give'),
1810
+		'PE' => esc_html__('Prince Edward Island', 'give'),
1811
+		'QC' => esc_html__('Quebec', 'give'),
1812
+		'SK' => esc_html__('Saskatchewan', 'give'),
1813
+		'YT' => esc_html__('Yukon', 'give'),
1814 1814
 	);
1815 1815
 
1816
-	return apply_filters( 'give_canada_provinces', $provinces );
1816
+	return apply_filters('give_canada_provinces', $provinces);
1817 1817
 }
1818 1818
 
1819 1819
 /**
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
 		'WA'  => 'Western Australia',
1836 1836
 	);
1837 1837
 
1838
-	return apply_filters( 'give_australian_states', $states );
1838
+	return apply_filters('give_australian_states', $states);
1839 1839
 }
1840 1840
 
1841 1841
 /**
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
 		'TO' => 'Tocantins',
1877 1877
 	);
1878 1878
 
1879
-	return apply_filters( 'give_brazil_states', $states );
1879
+	return apply_filters('give_brazil_states', $states);
1880 1880
 }
1881 1881
 
1882 1882
 /**
@@ -1893,7 +1893,7 @@  discard block
 block discarded – undo
1893 1893
 		'NEW TERRITORIES' => 'New Territories',
1894 1894
 	);
1895 1895
 
1896
-	return apply_filters( 'give_hong_kong_states', $states );
1896
+	return apply_filters('give_hong_kong_states', $states);
1897 1897
 }
1898 1898
 
1899 1899
 /**
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 		'ZA' => 'Zala',
1928 1928
 	);
1929 1929
 
1930
-	return apply_filters( 'give_hungary_states', $states );
1930
+	return apply_filters('give_hungary_states', $states);
1931 1931
 }
1932 1932
 
1933 1933
 /**
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 		'CN32' => 'Xinjiang / &#26032;&#30086;',
1974 1974
 	);
1975 1975
 
1976
-	return apply_filters( 'give_chinese_states', $states );
1976
+	return apply_filters('give_chinese_states', $states);
1977 1977
 }
1978 1978
 
1979 1979
 /**
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 		'WC' => 'West Coast',
2003 2003
 	);
2004 2004
 
2005
-	return apply_filters( 'give_new_zealand_states', $states );
2005
+	return apply_filters('give_new_zealand_states', $states);
2006 2006
 }
2007 2007
 
2008 2008
 /**
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 		'PB' => 'Papua Barat',
2051 2051
 	);
2052 2052
 
2053
-	return apply_filters( 'give_indonesia_states', $states );
2053
+	return apply_filters('give_indonesia_states', $states);
2054 2054
 }
2055 2055
 
2056 2056
 /**
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
 		'PY' => 'Pondicherry (Puducherry)',
2101 2101
 	);
2102 2102
 
2103
-	return apply_filters( 'give_indian_states', $states );
2103
+	return apply_filters('give_indian_states', $states);
2104 2104
 }
2105 2105
 
2106 2106
 /**
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 		'PJY' => 'W.P. Putrajaya',
2131 2131
 	);
2132 2132
 
2133
-	return apply_filters( 'give_malaysian_states', $states );
2133
+	return apply_filters('give_malaysian_states', $states);
2134 2134
 }
2135 2135
 
2136 2136
 /**
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
 		'WC'  => 'Western Cape',
2154 2154
 	);
2155 2155
 
2156
-	return apply_filters( 'give_south_african_states', $states );
2156
+	return apply_filters('give_south_african_states', $states);
2157 2157
 }
2158 2158
 
2159 2159
 /**
@@ -2244,7 +2244,7 @@  discard block
 block discarded – undo
2244 2244
 		'TH-35' => 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)',
2245 2245
 	);
2246 2246
 
2247
-	return apply_filters( 'give_thailand_states', $states );
2247
+	return apply_filters('give_thailand_states', $states);
2248 2248
 }
2249 2249
 
2250 2250
 /**
@@ -2256,59 +2256,59 @@  discard block
 block discarded – undo
2256 2256
 function give_get_spain_states_list() {
2257 2257
 	$states = array(
2258 2258
 		''   => '',
2259
-		'C'  => esc_html__( 'A Coru&ntilde;a', 'give' ),
2260
-		'VI' => esc_html__( 'Álava', 'give' ),
2261
-		'AB' => esc_html__( 'Albacete', 'give' ),
2262
-		'A'  => esc_html__( 'Alicante', 'give' ),
2263
-		'AL' => esc_html__( 'Almer&iacute;a', 'give' ),
2264
-		'O'  => esc_html__( 'Asturias', 'give' ),
2265
-		'AV' => esc_html__( '&Aacute;vila', 'give' ),
2266
-		'BA' => esc_html__( 'Badajoz', 'give' ),
2267
-		'PM' => esc_html__( 'Baleares', 'give' ),
2268
-		'B'  => esc_html__( 'Barcelona', 'give' ),
2269
-		'BU' => esc_html__( 'Burgos', 'give' ),
2270
-		'CC' => esc_html__( 'C&aacute;ceres', 'give' ),
2271
-		'CA' => esc_html__( 'C&aacute;diz', 'give' ),
2272
-		'S'  => esc_html__( 'Cantabria', 'give' ),
2273
-		'CS' => esc_html__( 'Castell&oacute;n', 'give' ),
2274
-		'CE' => esc_html__( 'Ceuta', 'give' ),
2275
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
2276
-		'CO' => esc_html__( 'C&oacute;rdoba', 'give' ),
2277
-		'CU' => esc_html__( 'Cuenca', 'give' ),
2278
-		'GI' => esc_html__( 'Girona', 'give' ),
2279
-		'GR' => esc_html__( 'Granada', 'give' ),
2280
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
2281
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
2282
-		'H'  => esc_html__( 'Huelva', 'give' ),
2283
-		'HU' => esc_html__( 'Huesca', 'give' ),
2284
-		'J'  => esc_html__( 'Ja&eacute;n', 'give' ),
2285
-		'LO' => esc_html__( 'La Rioja', 'give' ),
2286
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
2287
-		'LE' => esc_html__( 'Le&oacute;n', 'give' ),
2288
-		'L'  => esc_html__( 'Lleida', 'give' ),
2289
-		'LU' => esc_html__( 'Lugo', 'give' ),
2290
-		'M'  => esc_html__( 'Madrid', 'give' ),
2291
-		'MA' => esc_html__( 'M&aacute;laga', 'give' ),
2292
-		'ML' => esc_html__( 'Melilla', 'give' ),
2293
-		'MU' => esc_html__( 'Murcia', 'give' ),
2294
-		'NA' => esc_html__( 'Navarra', 'give' ),
2295
-		'OR' => esc_html__( 'Ourense', 'give' ),
2296
-		'P'  => esc_html__( 'Palencia', 'give' ),
2297
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
2298
-		'SA' => esc_html__( 'Salamanca', 'give' ),
2299
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
2300
-		'SG' => esc_html__( 'Segovia', 'give' ),
2301
-		'SE' => esc_html__( 'Sevilla', 'give' ),
2302
-		'SO' => esc_html__( 'Soria', 'give' ),
2303
-		'T'  => esc_html__( 'Tarragona', 'give' ),
2304
-		'TE' => esc_html__( 'Teruel', 'give' ),
2305
-		'TO' => esc_html__( 'Toledo', 'give' ),
2306
-		'V'  => esc_html__( 'Valencia', 'give' ),
2307
-		'VA' => esc_html__( 'Valladolid', 'give' ),
2308
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
2309
-		'ZA' => esc_html__( 'Zamora', 'give' ),
2310
-		'Z'  => esc_html__( 'Zaragoza', 'give' ),
2259
+		'C'  => esc_html__('A Coru&ntilde;a', 'give'),
2260
+		'VI' => esc_html__('Álava', 'give'),
2261
+		'AB' => esc_html__('Albacete', 'give'),
2262
+		'A'  => esc_html__('Alicante', 'give'),
2263
+		'AL' => esc_html__('Almer&iacute;a', 'give'),
2264
+		'O'  => esc_html__('Asturias', 'give'),
2265
+		'AV' => esc_html__('&Aacute;vila', 'give'),
2266
+		'BA' => esc_html__('Badajoz', 'give'),
2267
+		'PM' => esc_html__('Baleares', 'give'),
2268
+		'B'  => esc_html__('Barcelona', 'give'),
2269
+		'BU' => esc_html__('Burgos', 'give'),
2270
+		'CC' => esc_html__('C&aacute;ceres', 'give'),
2271
+		'CA' => esc_html__('C&aacute;diz', 'give'),
2272
+		'S'  => esc_html__('Cantabria', 'give'),
2273
+		'CS' => esc_html__('Castell&oacute;n', 'give'),
2274
+		'CE' => esc_html__('Ceuta', 'give'),
2275
+		'CR' => esc_html__('Ciudad Real', 'give'),
2276
+		'CO' => esc_html__('C&oacute;rdoba', 'give'),
2277
+		'CU' => esc_html__('Cuenca', 'give'),
2278
+		'GI' => esc_html__('Girona', 'give'),
2279
+		'GR' => esc_html__('Granada', 'give'),
2280
+		'GU' => esc_html__('Guadalajara', 'give'),
2281
+		'SS' => esc_html__('Gipuzkoa', 'give'),
2282
+		'H'  => esc_html__('Huelva', 'give'),
2283
+		'HU' => esc_html__('Huesca', 'give'),
2284
+		'J'  => esc_html__('Ja&eacute;n', 'give'),
2285
+		'LO' => esc_html__('La Rioja', 'give'),
2286
+		'GC' => esc_html__('Las Palmas', 'give'),
2287
+		'LE' => esc_html__('Le&oacute;n', 'give'),
2288
+		'L'  => esc_html__('Lleida', 'give'),
2289
+		'LU' => esc_html__('Lugo', 'give'),
2290
+		'M'  => esc_html__('Madrid', 'give'),
2291
+		'MA' => esc_html__('M&aacute;laga', 'give'),
2292
+		'ML' => esc_html__('Melilla', 'give'),
2293
+		'MU' => esc_html__('Murcia', 'give'),
2294
+		'NA' => esc_html__('Navarra', 'give'),
2295
+		'OR' => esc_html__('Ourense', 'give'),
2296
+		'P'  => esc_html__('Palencia', 'give'),
2297
+		'PO' => esc_html__('Pontevedra', 'give'),
2298
+		'SA' => esc_html__('Salamanca', 'give'),
2299
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
2300
+		'SG' => esc_html__('Segovia', 'give'),
2301
+		'SE' => esc_html__('Sevilla', 'give'),
2302
+		'SO' => esc_html__('Soria', 'give'),
2303
+		'T'  => esc_html__('Tarragona', 'give'),
2304
+		'TE' => esc_html__('Teruel', 'give'),
2305
+		'TO' => esc_html__('Toledo', 'give'),
2306
+		'V'  => esc_html__('Valencia', 'give'),
2307
+		'VA' => esc_html__('Valladolid', 'give'),
2308
+		'BI' => esc_html__('Bizkaia', 'give'),
2309
+		'ZA' => esc_html__('Zamora', 'give'),
2310
+		'Z'  => esc_html__('Zaragoza', 'give'),
2311 2311
 	);
2312 2312
 
2313
-	return apply_filters( 'give_spain_states', $states );
2313
+	return apply_filters('give_spain_states', $states);
2314 2314
 }
Please login to merge, or discard this patch.
includes/ajax-functions.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed.
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 		} else {
39 39
 
40
-			if ( 'on' === $airplane->check_status()  ) {
40
+			if ('on' === $airplane->check_status()) {
41 41
 				return true;
42 42
 			}
43 43
 		}
44 44
 	}
45 45
 
46
-	add_filter( 'block_local_requests', '__return_false' );
46
+	add_filter('block_local_requests', '__return_false');
47 47
 
48
-	if ( Give_Cache::get( '_give_ajax_works', true ) ) {
48
+	if (Give_Cache::get('_give_ajax_works', true)) {
49 49
 		return true;
50 50
 	}
51 51
 
@@ -57,35 +57,35 @@  discard block
 block discarded – undo
57 57
 		),
58 58
 	);
59 59
 
60
-	$ajax = wp_remote_post( give_get_ajax_url(), $params );
60
+	$ajax = wp_remote_post(give_get_ajax_url(), $params);
61 61
 
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 	}
86 86
 
87
-	if ( $works ) {
88
-		Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true );
87
+	if ($works) {
88
+		Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true);
89 89
 	}
90 90
 
91 91
 	return $works;
@@ -100,16 +100,16 @@  discard block
 block discarded – undo
100 100
  * @return string
101 101
  */
102 102
 function give_get_ajax_url() {
103
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
103
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
104 104
 
105 105
 	$current_url = give_get_current_page_url();
106
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
106
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
107 107
 
108
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
109
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
108
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
109
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
110 110
 	}
111 111
 
112
-	return apply_filters( 'give_ajax_url', $ajax_url );
112
+	return apply_filters('give_ajax_url', $ajax_url);
113 113
 }
114 114
 
115 115
 /**
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @since 1.7
127 127
 	 */
128
-	do_action( 'give_donation_form_login_fields' );
128
+	do_action('give_donation_form_login_fields');
129 129
 
130 130
 	give_die();
131 131
 }
132 132
 
133
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
133
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
134 134
 
135 135
 /**
136 136
  * Load Checkout Fields
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * @return void
141 141
  */
142 142
 function give_load_checkout_fields() {
143
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
143
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
144 144
 
145 145
 	ob_start();
146 146
 
@@ -149,18 +149,18 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @since 1.7
151 151
 	 */
152
-	do_action( 'give_donation_form_register_login_fields', $form_id );
152
+	do_action('give_donation_form_register_login_fields', $form_id);
153 153
 
154 154
 	$fields = ob_get_clean();
155 155
 
156
-	wp_send_json( array(
157
-		'fields' => wp_json_encode( $fields ),
158
-		'submit' => wp_json_encode( give_get_donation_form_submit_button( $form_id ) ),
159
-	) );
156
+	wp_send_json(array(
157
+		'fields' => wp_json_encode($fields),
158
+		'submit' => wp_json_encode(give_get_donation_form_submit_button($form_id)),
159
+	));
160 160
 }
161 161
 
162
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
163
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
162
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
163
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
164 164
 
165 165
 /**
166 166
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
  * @return void
171 171
  */
172 172
 function give_ajax_get_form_title() {
173
-	if ( isset( $_POST['form_id'] ) ) {
174
-		$title = get_the_title( $_POST['form_id'] );
175
-		if ( $title ) {
173
+	if (isset($_POST['form_id'])) {
174
+		$title = get_the_title($_POST['form_id']);
175
+		if ($title) {
176 176
 			echo $title;
177 177
 		} else {
178 178
 			echo 'fail';
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	give_die();
182 182
 }
183 183
 
184
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
185
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
184
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
185
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
186 186
 
187 187
 /**
188 188
  * Retrieve a states drop down
@@ -196,41 +196,41 @@  discard block
 block discarded – undo
196 196
 	$show_field = true;
197 197
 	$states_require = true;
198 198
 	// Get the Country code from the $_POST.
199
-	$country = sanitize_text_field( $_POST['country'] );
199
+	$country = sanitize_text_field($_POST['country']);
200 200
 
201 201
 	// Get the field name from the $_POST.
202
-	$field_name = sanitize_text_field( $_POST['field_name'] );
202
+	$field_name = sanitize_text_field($_POST['field_name']);
203 203
 
204
-	$label = __( 'State', 'give' );
204
+	$label = __('State', 'give');
205 205
 	$states_label = give_get_states_label();
206 206
 
207 207
 	$default_state = '';
208
-	if ( $country === give_get_country() ) {
208
+	if ($country === give_get_country()) {
209 209
 		$default_state = give_get_state();
210 210
 	}
211 211
 
212 212
 	// Check if $country code exists in the array key for states label.
213
-	if ( array_key_exists( $country, $states_label ) ) {
214
-		$label = $states_label[ $country ];
213
+	if (array_key_exists($country, $states_label)) {
214
+		$label = $states_label[$country];
215 215
 	}
216 216
 
217
-	if ( empty( $country ) ) {
217
+	if (empty($country)) {
218 218
 		$country = give_get_country();
219 219
 	}
220 220
 
221
-	$states = give_get_states( $country );
222
-	if ( ! empty( $states ) ) {
221
+	$states = give_get_states($country);
222
+	if ( ! empty($states)) {
223 223
 		$args = array(
224 224
 			'name'             => $field_name,
225 225
 			'id'               => $field_name,
226
-			'class'            => $field_name . '  give-select',
226
+			'class'            => $field_name.'  give-select',
227 227
 			'options'          => $states,
228 228
 			'show_option_all'  => false,
229 229
 			'show_option_none' => false,
230 230
 			'placeholder'      => $label,
231 231
 			'selected'         => $default_state,
232 232
 		);
233
-		$data = Give()->html->select( $args );
233
+		$data = Give()->html->select($args);
234 234
 		$states_found = true;
235 235
 	} else {
236 236
 		$data = 'nostates';
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$no_states_country = give_no_states_country_list();
240 240
 
241 241
 		// Check if $country code exists in the array key.
242
-		if ( array_key_exists( $country, $no_states_country ) ) {
242
+		if (array_key_exists($country, $no_states_country)) {
243 243
 			$show_field = false;
244 244
 		}
245 245
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		$states_not_required_country_list = give_states_not_required_country_list();
248 248
 
249 249
 		// Check if $country code exists in the array key.
250
-		if ( array_key_exists( $country, $states_not_required_country_list ) ) {
250
+		if (array_key_exists($country, $states_not_required_country_list)) {
251 251
 			$states_require = false;
252 252
 		}
253 253
 	}
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 		'data'           => $data,
261 261
 		'default_state'  => $default_state,
262 262
 	);
263
-	wp_send_json( $response );
263
+	wp_send_json($response);
264 264
 }
265
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
266
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
265
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
266
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
267 267
 
268 268
 /**
269 269
  * Retrieve donation forms via AJAX for chosen dropdown search field.
@@ -275,19 +275,19 @@  discard block
 block discarded – undo
275 275
 function give_ajax_form_search() {
276 276
 	global $wpdb;
277 277
 
278
-	$search   = esc_sql( sanitize_text_field( $_GET['s'] ) );
279
-	$excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() );
278
+	$search   = esc_sql(sanitize_text_field($_GET['s']));
279
+	$excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array());
280 280
 
281 281
 	$results = array();
282
-	if ( current_user_can( 'edit_give_forms' ) ) {
283
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
282
+	if (current_user_can('edit_give_forms')) {
283
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
284 284
 	} else {
285
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" );
285
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50");
286 286
 	}
287 287
 
288
-	if ( $items ) {
288
+	if ($items) {
289 289
 
290
-		foreach ( $items as $item ) {
290
+		foreach ($items as $item) {
291 291
 
292 292
 			$results[] = array(
293 293
 				'id'   => $item->ID,
@@ -298,18 +298,18 @@  discard block
 block discarded – undo
298 298
 
299 299
 		$items[] = array(
300 300
 			'id'   => 0,
301
-			'name' => __( 'No forms found.', 'give' ),
301
+			'name' => __('No forms found.', 'give'),
302 302
 		);
303 303
 
304 304
 	}
305 305
 
306
-	echo json_encode( $results );
306
+	echo json_encode($results);
307 307
 
308 308
 	give_die();
309 309
 }
310 310
 
311
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
312
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
311
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
312
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
313 313
 
314 314
 /**
315 315
  * Search the donors database via Ajax
@@ -321,38 +321,38 @@  discard block
 block discarded – undo
321 321
 function give_ajax_donor_search() {
322 322
 	global $wpdb;
323 323
 
324
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
324
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
325 325
 	$results = array();
326
-	if ( ! current_user_can( 'view_give_reports' ) ) {
326
+	if ( ! current_user_can('view_give_reports')) {
327 327
 		$donors = array();
328 328
 	} else {
329
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
329
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
330 330
 	}
331 331
 
332
-	if ( $donors ) {
332
+	if ($donors) {
333 333
 
334
-		foreach ( $donors as $donor ) {
334
+		foreach ($donors as $donor) {
335 335
 
336 336
 			$results[] = array(
337 337
 				'id'   => $donor->id,
338
-				'name' => $donor->name . ' (' . $donor->email . ')',
338
+				'name' => $donor->name.' ('.$donor->email.')',
339 339
 			);
340 340
 		}
341 341
 	} else {
342 342
 
343 343
 		$donors[] = array(
344 344
 			'id'   => 0,
345
-			'name' => __( 'No donors found.', 'give' ),
345
+			'name' => __('No donors found.', 'give'),
346 346
 		);
347 347
 
348 348
 	}
349 349
 
350
-	echo json_encode( $results );
350
+	echo json_encode($results);
351 351
 
352 352
 	give_die();
353 353
 }
354 354
 
355
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
355
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
356 356
 
357 357
 
358 358
 /**
@@ -364,39 +364,39 @@  discard block
 block discarded – undo
364 364
  */
365 365
 function give_ajax_search_users() {
366 366
 
367
-	if ( current_user_can( 'manage_give_settings' ) ) {
367
+	if (current_user_can('manage_give_settings')) {
368 368
 
369
-		$search   = esc_sql( sanitize_text_field( $_GET['s'] ) );
369
+		$search = esc_sql(sanitize_text_field($_GET['s']));
370 370
 
371 371
 		$get_users_args = array(
372 372
 			'number' => 9999,
373
-			'search' => $search . '*',
373
+			'search' => $search.'*',
374 374
 		);
375 375
 
376
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
376
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
377 377
 
378
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search );
378
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search);
379 379
 		$results     = array();
380 380
 
381
-		if ( $found_users ) {
381
+		if ($found_users) {
382 382
 
383
-			foreach ( $found_users as $user ) {
383
+			foreach ($found_users as $user) {
384 384
 
385 385
 				$results[] = array(
386 386
 					'id'   => $user->ID,
387
-					'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ),
387
+					'name' => esc_html($user->user_login.' ('.$user->user_email.')'),
388 388
 				);
389 389
 			}
390 390
 		} else {
391 391
 
392 392
 			$results[] = array(
393 393
 				'id'   => 0,
394
-				'name' => __( 'No users found.', 'give' ),
394
+				'name' => __('No users found.', 'give'),
395 395
 			);
396 396
 
397 397
 		}
398 398
 
399
-		echo json_encode( $results );
399
+		echo json_encode($results);
400 400
 
401 401
 	}// End if().
402 402
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
 }
406 406
 
407
-add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' );
407
+add_action('wp_ajax_give_user_search', 'give_ajax_search_users');
408 408
 
409 409
 
410 410
 /**
@@ -416,32 +416,32 @@  discard block
 block discarded – undo
416 416
  */
417 417
 function give_check_for_form_price_variations() {
418 418
 
419
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
420
-		die( '-1' );
419
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
420
+		die('-1');
421 421
 	}
422 422
 
423
-	$form_id = intval( $_POST['form_id'] );
424
-	$form    = get_post( $form_id );
423
+	$form_id = intval($_POST['form_id']);
424
+	$form    = get_post($form_id);
425 425
 
426
-	if ( 'give_forms' != $form->post_type ) {
427
-		die( '-2' );
426
+	if ('give_forms' != $form->post_type) {
427
+		die('-2');
428 428
 	}
429 429
 
430
-	if ( give_has_variable_prices( $form_id ) ) {
431
-		$variable_prices = give_get_variable_prices( $form_id );
430
+	if (give_has_variable_prices($form_id)) {
431
+		$variable_prices = give_get_variable_prices($form_id);
432 432
 
433
-		if ( $variable_prices ) {
433
+		if ($variable_prices) {
434 434
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
435 435
 
436
-			if ( isset( $_POST['all_prices'] ) ) {
437
-				$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
436
+			if (isset($_POST['all_prices'])) {
437
+				$ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>';
438 438
 			}
439 439
 
440
-			foreach ( $variable_prices as $key => $price ) {
440
+			foreach ($variable_prices as $key => $price) {
441 441
 
442
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) );
442
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false)));
443 443
 
444
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
444
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
445 445
 			}
446 446
 			$ajax_response .= '</select>';
447 447
 			echo $ajax_response;
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	give_die();
452 452
 }
453 453
 
454
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
454
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
455 455
 
456 456
 
457 457
 /**
@@ -462,25 +462,25 @@  discard block
 block discarded – undo
462 462
  * @return void
463 463
  */
464 464
 function give_check_for_form_price_variations_html() {
465
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
465
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
466 466
 		wp_die();
467 467
 	}
468 468
 
469
-	$form_id    = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : 0;
470
-	$payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : 0;
471
-	$form       = get_post( $form_id );
469
+	$form_id    = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : 0;
470
+	$payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : 0;
471
+	$form       = get_post($form_id);
472 472
 
473
-	if ( 'give_forms' != $form->post_type ) {
473
+	if ('give_forms' != $form->post_type) {
474 474
 		wp_die();
475 475
 	}
476 476
 
477
-	if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) {
478
-		esc_html_e( 'n/a', 'give' );
477
+	if ( ! give_has_variable_prices($form_id) || ! $form_id) {
478
+		esc_html_e('n/a', 'give');
479 479
 	} else {
480 480
 		$prices_atts = '';
481
-		if ( $variable_prices = give_get_variable_prices( $form_id ) ) {
482
-			foreach ( $variable_prices as $variable_price ) {
483
-				$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
481
+		if ($variable_prices = give_get_variable_prices($form_id)) {
482
+			foreach ($variable_prices as $variable_price) {
483
+				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false));
484 484
 			}
485 485
 		}
486 486
 
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
 			'chosen'           => true,
492 492
 			'show_option_all'  => '',
493 493
 			'show_option_none' => '',
494
-			'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
494
+			'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
495 495
 		);
496 496
 
497
-		if ( $payment_id ) {
497
+		if ($payment_id) {
498 498
 			// Payment object.
499
-			$payment = new Give_Payment( $payment_id );
499
+			$payment = new Give_Payment($payment_id);
500 500
 
501 501
 			// Payment meta.
502 502
 			$payment_meta                               = $payment->get_meta();
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
 		}
505 505
 
506 506
 		// Render variable prices select tag html.
507
-		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
507
+		give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
508 508
 	}
509 509
 
510 510
 	give_die();
511 511
 }
512 512
 
513
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
513
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 2 patches
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
  * @copyright    Copyright (c) 2016, WordImpress
8 8
  * @license      https://opensource.org/licenses/gpl-license GNU Public License
9 9
  */
10
-$current_user     = wp_get_current_user();
10
+$current_user = wp_get_current_user();
11 11
 
12
-if ( is_user_logged_in() ):
12
+if (is_user_logged_in()):
13 13
 	$user_id = get_current_user_id();
14
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
15
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
14
+	$first_name   = get_user_meta($user_id, 'first_name', true);
15
+	$last_name    = get_user_meta($user_id, 'last_name', true);
16 16
 	$display_name = $current_user->display_name;
17
-	$address      = give_get_donor_address( $user_id );
17
+	$address      = give_get_donor_address($user_id);
18 18
 
19
-	if ( isset( $_GET['updated'] ) && $_GET['updated'] == true && ! give_get_errors() ): ?>
19
+	if (isset($_GET['updated']) && $_GET['updated'] == true && ! give_get_errors()): ?>
20 20
 		<p class="give_success">
21
-			<strong><?php esc_html_e( 'Success:', 'give' ); ?></strong> <?php esc_html_e( 'Your profile has been updated.', 'give' ); ?>
21
+			<strong><?php esc_html_e('Success:', 'give'); ?></strong> <?php esc_html_e('Your profile has been updated.', 'give'); ?>
22 22
 		</p>
23 23
 	<?php endif; ?>
24 24
 
25
-	<?php Give()->notices->render_frontend_notices( 0 ); ?>
25
+	<?php Give()->notices->render_frontend_notices(0); ?>
26 26
 
27 27
 	<?php
28 28
 	/**
@@ -32,38 +32,38 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @since 1.0
34 34
 	 */
35
-	do_action( 'give_profile_editor_before' );
35
+	do_action('give_profile_editor_before');
36 36
 	?>
37 37
 
38 38
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" method="post">
39 39
 
40 40
 		<fieldset>
41 41
 
42
-			<legend id="give_profile_name_label"><?php esc_html_e( 'Change your Name', 'give' ); ?></legend>
42
+			<legend id="give_profile_name_label"><?php esc_html_e('Change your Name', 'give'); ?></legend>
43 43
 
44 44
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
45
-				<label for="give_first_name"><?php esc_html_e( 'First Name', 'give' ); ?></label>
46
-				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr( $first_name ); ?>"/>
45
+				<label for="give_first_name"><?php esc_html_e('First Name', 'give'); ?></label>
46
+				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr($first_name); ?>"/>
47 47
 			</p>
48 48
 
49 49
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
50
-				<label for="give_last_name"><?php esc_html_e( 'Last Name', 'give' ); ?></label>
51
-				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr( $last_name ); ?>"/>
50
+				<label for="give_last_name"><?php esc_html_e('Last Name', 'give'); ?></label>
51
+				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr($last_name); ?>"/>
52 52
 			</p>
53 53
 
54 54
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
55
-				<label for="give_display_name"><?php esc_html_e( 'Display Name', 'give' ); ?></label>
55
+				<label for="give_display_name"><?php esc_html_e('Display Name', 'give'); ?></label>
56 56
 				<select name="give_display_name" id="give_display_name" class="select give-select">
57
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
58
-						<option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
57
+					<?php if ( ! empty($current_user->first_name)): ?>
58
+						<option <?php selected($display_name, $current_user->first_name); ?> value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
59 59
 					<?php endif; ?>
60
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
61
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
62
-						<option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
60
+					<option <?php selected($display_name, $current_user->user_nicename); ?> value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
61
+					<?php if ( ! empty($current_user->last_name)): ?>
62
+						<option <?php selected($display_name, $current_user->last_name); ?> value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
63 63
 					<?php endif; ?>
64
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
65
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
66
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
64
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
65
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?> value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option>
66
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?> value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option>
67 67
 					<?php endif; ?>
68 68
 				</select>
69 69
 				<?php
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 				 *
75 75
 				 * @since 1.0
76 76
 				 */
77
-				do_action( 'give_profile_editor_name' );
77
+				do_action('give_profile_editor_name');
78 78
 				?>
79 79
 			</p>
80 80
 
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 			 *
87 87
 			 * @since 1.0
88 88
 			 */
89
-			do_action( 'give_profile_editor_after_name' );
89
+			do_action('give_profile_editor_after_name');
90 90
 			?>
91 91
 
92 92
 			<p class="form-row form-row-last form-row-responsive">
93
-				<label for="give_email"><?php esc_html_e( 'Email Address', 'give' ); ?></label>
94
-				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
93
+				<label for="give_email"><?php esc_html_e('Email Address', 'give'); ?></label>
94
+				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
95 95
 				<?php
96 96
 				/**
97 97
 				 * Fires in the profile editor shortcode, to the email section.
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 				 *
101 101
 				 * @since 1.0
102 102
 				 */
103
-				do_action( 'give_profile_editor_email' );
103
+				do_action('give_profile_editor_email');
104 104
 				?>
105 105
 			</p>
106 106
 
@@ -112,63 +112,63 @@  discard block
 block discarded – undo
112 112
 			 *
113 113
 			 * @since 1.0
114 114
 			 */
115
-			do_action( 'give_profile_editor_after_email' );
115
+			do_action('give_profile_editor_after_email');
116 116
 			?>
117 117
 
118
-			<legend id="give_profile_billing_address_label"><?php esc_html_e( 'Change your Billing Address', 'give' ); ?></legend>
118
+			<legend id="give_profile_billing_address_label"><?php esc_html_e('Change your Billing Address', 'give'); ?></legend>
119 119
 
120 120
 			<div id="give_profile_billing_address_wrap">
121 121
 
122 122
 				<p id="give-card-address-wrap" class="form-row form-row-first form-row-responsive">
123
-					<label for="give_address_line1"><?php esc_html_e( 'Address 1', 'give' ); ?></label>
124
-					<input name="give_address_line1" id="give_address_line1" class="text give-input" type="text" value="<?php echo esc_attr( $address['line1'] ); ?>"/>
123
+					<label for="give_address_line1"><?php esc_html_e('Address 1', 'give'); ?></label>
124
+					<input name="give_address_line1" id="give_address_line1" class="text give-input" type="text" value="<?php echo esc_attr($address['line1']); ?>"/>
125 125
 				</p>
126 126
 
127 127
 				<p id="give-card-address-2-wrap" class="form-row form-row-last form-row-responsive">
128
-					<label for="give_address_line2"><?php esc_html_e( 'Address 2', 'give' ); ?></label>
129
-					<input name="give_address_line2" id="give_address_line2" class="text give-input" type="text" value="<?php echo esc_attr( $address['line2'] ); ?>"/>
128
+					<label for="give_address_line2"><?php esc_html_e('Address 2', 'give'); ?></label>
129
+					<input name="give_address_line2" id="give_address_line2" class="text give-input" type="text" value="<?php echo esc_attr($address['line2']); ?>"/>
130 130
 				</p>
131 131
 
132 132
 				<p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive">
133
-					<label for="give_address_city"><?php esc_html_e( 'City', 'give' ); ?></label>
134
-					<input name="give_address_city" id="give_address_city" class="text give-input" type="text" value="<?php echo esc_attr( $address['city'] ); ?>"/>
133
+					<label for="give_address_city"><?php esc_html_e('City', 'give'); ?></label>
134
+					<input name="give_address_city" id="give_address_city" class="text give-input" type="text" value="<?php echo esc_attr($address['city']); ?>"/>
135 135
 				</p>
136 136
 
137 137
 				<p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive">
138
-					<label for="give_address_zip"><?php esc_html_e( 'Zip / Postal Code', 'give' ); ?></label>
139
-					<input name="give_address_zip" id="give_address_zip" class="text give-input" type="text" value="<?php echo esc_attr( $address['zip'] ); ?>"/>
138
+					<label for="give_address_zip"><?php esc_html_e('Zip / Postal Code', 'give'); ?></label>
139
+					<input name="give_address_zip" id="give_address_zip" class="text give-input" type="text" value="<?php echo esc_attr($address['zip']); ?>"/>
140 140
 				</p>
141 141
 
142 142
 				<?php
143
-				$selected_country = ( ! empty( $address['country'] ) ? $address['country'] : '' );
143
+				$selected_country = ( ! empty($address['country']) ? $address['country'] : '');
144 144
 				?>
145 145
 
146 146
 				<p id="give-card-country-wrap" class="form-row form-row-first form-row-responsive">
147
-					<label for="give_address_country"><?php esc_html_e( 'Country', 'give' ); ?></label>
147
+					<label for="give_address_country"><?php esc_html_e('Country', 'give'); ?></label>
148 148
 					<select name="give_address_country" id="give_address_country" class="select give-select">
149
-						<?php foreach ( give_get_country_list() as $key => $country ) : ?>
150
-							<option value="<?php echo $key; ?>"<?php selected( $selected_country, $key ); ?>><?php echo esc_html( $country ); ?></option>
149
+						<?php foreach (give_get_country_list() as $key => $country) : ?>
150
+							<option value="<?php echo $key; ?>"<?php selected($selected_country, $key); ?>><?php echo esc_html($country); ?></option>
151 151
 						<?php endforeach; ?>
152 152
 					</select>
153 153
 				</p>
154 154
 
155 155
 				<?php
156 156
 				$selected_state = '';
157
-				if ( $selected_country === give_get_country() ) {
157
+				if ($selected_country === give_get_country()) {
158 158
 					// Get defalut selected state by admin.
159 159
 					$selected_state = give_get_state();
160 160
 				}
161 161
 
162
-				$selected_state = ! empty( $address['state'] ) ? $address['state'] : $selected_state;
162
+				$selected_state = ! empty($address['state']) ? $address['state'] : $selected_state;
163 163
 
164
-				$label        = __( 'State', 'give' );
164
+				$label        = __('State', 'give');
165 165
 				$states_label = give_get_states_label();
166 166
 				// Check if $country code exists in the array key for states label.
167
-				if ( array_key_exists( $selected_country, $states_label ) ) {
168
-					$label = $states_label[ $selected_country ];
167
+				if (array_key_exists($selected_country, $states_label)) {
168
+					$label = $states_label[$selected_country];
169 169
 				}
170 170
 
171
-				$states = give_get_states( $selected_country );
171
+				$states = give_get_states($selected_country);
172 172
 
173 173
 				// Get the country list that do not have any states init.
174 174
 				$no_states_country = give_no_states_country_list();
@@ -177,17 +177,17 @@  discard block
 block discarded – undo
177 177
 				$states_not_required_country_list = give_states_not_required_country_list();
178 178
 				?>
179 179
 
180
-				<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' : ''; ?>">
181
-					<label for="give_address_state"><?php esc_html_e( 'State / Province / County', 'give' ); ?></label>
180
+				<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' : ''; ?>">
181
+					<label for="give_address_state"><?php esc_html_e('State / Province / County', 'give'); ?></label>
182 182
 					<?php
183
-					if ( ! empty( $states ) ) : ?>
183
+					if ( ! empty($states)) : ?>
184 184
 						<select
185 185
 								name="give_address_state"
186 186
 								id="give_address_state"
187 187
 								class="give_address_state"
188 188
 							<?php
189
-							foreach ( $states as $state_code => $state ) {
190
-								echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
189
+							foreach ($states as $state_code => $state) {
190
+								echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
191 191
 							}
192 192
 							?>
193 193
 						</select>
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 				 *
207 207
 				 * @since 1.0
208 208
 				 */
209
-				do_action( 'give_profile_editor_address' );
209
+				do_action('give_profile_editor_address');
210 210
 				?>
211 211
 
212 212
 			</div>
@@ -219,19 +219,19 @@  discard block
 block discarded – undo
219 219
 			 *
220 220
 			 * @since 1.0
221 221
 			 */
222
-			do_action( 'give_profile_editor_after_address' );
222
+			do_action('give_profile_editor_after_address');
223 223
 			?>
224 224
 
225
-			<legend id="give_profile_password_label"><?php esc_html_e( 'Change your Password', 'give' ); ?></legend>
225
+			<legend id="give_profile_password_label"><?php esc_html_e('Change your Password', 'give'); ?></legend>
226 226
 
227 227
 			<div id="give_profile_password_wrap" class="give-clearfix">
228 228
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
229
-					<label for="give_new_user_pass1"><?php esc_html_e( 'New Password', 'give' ); ?></label>
229
+					<label for="give_new_user_pass1"><?php esc_html_e('New Password', 'give'); ?></label>
230 230
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" type="password"/>
231 231
 				</p>
232 232
 
233 233
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
234
-					<label for="give_new_user_pass2"><?php esc_html_e( 'Re-enter Password', 'give' ); ?></label>
234
+					<label for="give_new_user_pass2"><?php esc_html_e('Re-enter Password', 'give'); ?></label>
235 235
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" type="password"/>
236 236
 					<?php
237 237
 					/**
@@ -241,12 +241,12 @@  discard block
 block discarded – undo
241 241
 					 *
242 242
 					 * @since 1.0
243 243
 					 */
244
-					do_action( 'give_profile_editor_password' );
244
+					do_action('give_profile_editor_password');
245 245
 					?>
246 246
 				</p>
247 247
 			</div>
248 248
 
249
-			<p class="give_password_change_notice"><?php esc_html_e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
249
+			<p class="give_password_change_notice"><?php esc_html_e('Please note after changing your password, you must log back in.', 'give'); ?></p>
250 250
 
251 251
 			<?php
252 252
 			/**
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 			 *
257 257
 			 * @since 1.0
258 258
 			 */
259
-			do_action( 'give_profile_editor_after_password' );
259
+			do_action('give_profile_editor_after_password');
260 260
 			?>
261 261
 
262 262
 			<p id="give_profile_submit_wrap">
263
-				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
263
+				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
264 264
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
265
-				<input type="hidden" name="give_redirect" value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
266
-				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php esc_attr_e( 'Save Changes', 'give' ); ?>"/>
265
+				<input type="hidden" name="give_redirect" value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
266
+				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php esc_attr_e('Save Changes', 'give'); ?>"/>
267 267
 			</p>
268 268
 
269 269
 		</fieldset>
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
 	 *
279 279
 	 * @since 1.0
280 280
 	 */
281
-	do_action( 'give_profile_editor_after' );
281
+	do_action('give_profile_editor_after');
282 282
 	?>
283 283
 
284 284
 	<?php
285 285
 else:
286
-	esc_html_e( 'You need to login to edit your profile.', 'give' );
286
+	esc_html_e('You need to login to edit your profile.', 'give');
287 287
 	echo give_login_form();
288 288
 endif;
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -191,9 +191,12 @@  discard block
 block discarded – undo
191 191
 							}
192 192
 							?>
193 193
 						</select>
194
-					<?php else : ?>
194
+					<?php else {
195
+	: ?>
195 196
 						<input type="text" size="6" name="give_address_state" id="give_address_state" class="give_address_state give-input"
196
-						       placeholder="<?php echo $label; ?>" value="<?php echo $selected_state; ?>"/>
197
+						       placeholder="<?php echo $label;
198
+}
199
+?>" value="<?php echo $selected_state; ?>"/>
197 200
 					<?php endif;
198 201
 					?>
199 202
 				</p>
@@ -282,7 +285,9 @@  discard block
 block discarded – undo
282 285
 	?>
283 286
 
284 287
 	<?php
285
-else:
288
+else {
289
+	:
286 290
 	esc_html_e( 'You need to login to edit your profile.', 'give' );
291
+}
287 292
 	echo give_login_form();
288 293
 endif;
Please login to merge, or discard this patch.