Test Failed
Pull Request — master (#2482)
by Devin
05:37
created
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__( 'Philippines', 'give' ),
262
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
263
-		'PL' => esc_html__( 'Poland', 'give' ),
264
-		'PT' => esc_html__( 'Portugal', 'give' ),
265
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
266
-		'QA' => esc_html__( 'Qatar', 'give' ),
267
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
268
-		'RO' => esc_html__( 'Romania', 'give' ),
269
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
270
-		'RW' => esc_html__( 'Rwanda', 'give' ),
271
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
272
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
273
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
274
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
275
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
276
-		'SM' => esc_html__( 'San Marino', 'give' ),
277
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
278
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
279
-		'SN' => esc_html__( 'Senegal', 'give' ),
280
-		'RS' => esc_html__( 'Serbia', 'give' ),
281
-		'SC' => esc_html__( 'Seychelles', 'give' ),
282
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
283
-		'SG' => esc_html__( 'Singapore', 'give' ),
284
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
285
-		'SI' => esc_html__( 'Slovenia', 'give' ),
286
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
287
-		'SO' => esc_html__( 'Somalia', 'give' ),
288
-		'ZA' => esc_html__( 'South Africa', 'give' ),
289
-		'GS' => esc_html__( 'South Georgia', 'give' ),
290
-		'KR' => esc_html__( 'South Korea', 'give' ),
291
-		'ES' => esc_html__( 'Spain', 'give' ),
292
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
293
-		'SD' => esc_html__( 'Sudan', 'give' ),
294
-		'SR' => esc_html__( 'Suriname', 'give' ),
295
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
296
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
297
-		'SE' => esc_html__( 'Sweden', 'give' ),
298
-		'CH' => esc_html__( 'Switzerland', 'give' ),
299
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
300
-		'TW' => esc_html__( 'Taiwan', 'give' ),
301
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
302
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
303
-		'TG' => esc_html__( 'Togo', 'give' ),
304
-		'TK' => esc_html__( 'Tokelau', 'give' ),
305
-		'TO' => esc_html__( 'Tonga', 'give' ),
306
-		'TH' => esc_html__( 'Thailand', 'give' ),
307
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
308
-		'TN' => esc_html__( 'Tunisia', 'give' ),
309
-		'TR' => esc_html__( 'Turkey', 'give' ),
310
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
311
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
312
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
313
-		'UG' => esc_html__( 'Uganda', 'give' ),
314
-		'UA' => esc_html__( 'Ukraine', 'give' ),
315
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
316
-		'UY' => esc_html__( 'Uruguay', 'give' ),
317
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
318
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
319
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
320
-		'VE' => esc_html__( 'Venezuela', 'give' ),
321
-		'VN' => esc_html__( 'Vietnam', 'give' ),
322
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
323
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
324
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
325
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
326
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
327
-		'YE' => esc_html__( 'Yemen', 'give' ),
328
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
329
-		'ZM' => esc_html__( 'Zambia', 'give' ),
330
-		'ZW' => esc_html__( 'Zimbabwe', 'give' ),
87
+		'US' => esc_html__('United States', 'give'),
88
+		'CA' => esc_html__('Canada', 'give'),
89
+		'GB' => esc_html__('United Kingdom', 'give'),
90
+		'AF' => esc_html__('Afghanistan', 'give'),
91
+		'AL' => esc_html__('Albania', 'give'),
92
+		'DZ' => esc_html__('Algeria', 'give'),
93
+		'AS' => esc_html__('American Samoa', 'give'),
94
+		'AD' => esc_html__('Andorra', 'give'),
95
+		'AO' => esc_html__('Angola', 'give'),
96
+		'AI' => esc_html__('Anguilla', 'give'),
97
+		'AQ' => esc_html__('Antarctica', 'give'),
98
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
99
+		'AR' => esc_html__('Argentina', 'give'),
100
+		'AM' => esc_html__('Armenia', 'give'),
101
+		'AW' => esc_html__('Aruba', 'give'),
102
+		'AU' => esc_html__('Australia', 'give'),
103
+		'AT' => esc_html__('Austria', 'give'),
104
+		'AZ' => esc_html__('Azerbaijan', 'give'),
105
+		'BS' => esc_html__('Bahamas', 'give'),
106
+		'BH' => esc_html__('Bahrain', 'give'),
107
+		'BD' => esc_html__('Bangladesh', 'give'),
108
+		'BB' => esc_html__('Barbados', 'give'),
109
+		'BY' => esc_html__('Belarus', 'give'),
110
+		'BE' => esc_html__('Belgium', 'give'),
111
+		'BZ' => esc_html__('Belize', 'give'),
112
+		'BJ' => esc_html__('Benin', 'give'),
113
+		'BM' => esc_html__('Bermuda', 'give'),
114
+		'BT' => esc_html__('Bhutan', 'give'),
115
+		'BO' => esc_html__('Bolivia', 'give'),
116
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
117
+		'BW' => esc_html__('Botswana', 'give'),
118
+		'BV' => esc_html__('Bouvet Island', 'give'),
119
+		'BR' => esc_html__('Brazil', 'give'),
120
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
121
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
122
+		'BG' => esc_html__('Bulgaria', 'give'),
123
+		'BF' => esc_html__('Burkina Faso', 'give'),
124
+		'BI' => esc_html__('Burundi', 'give'),
125
+		'KH' => esc_html__('Cambodia', 'give'),
126
+		'CM' => esc_html__('Cameroon', 'give'),
127
+		'CV' => esc_html__('Cape Verde', 'give'),
128
+		'KY' => esc_html__('Cayman Islands', 'give'),
129
+		'CF' => esc_html__('Central African Republic', 'give'),
130
+		'TD' => esc_html__('Chad', 'give'),
131
+		'CL' => esc_html__('Chile', 'give'),
132
+		'CN' => esc_html__('China', 'give'),
133
+		'CX' => esc_html__('Christmas Island', 'give'),
134
+		'CC' => esc_html__('Cocos Islands', 'give'),
135
+		'CO' => esc_html__('Colombia', 'give'),
136
+		'KM' => esc_html__('Comoros', 'give'),
137
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
138
+		'CG' => esc_html__('Congo, Republic of', 'give'),
139
+		'CK' => esc_html__('Cook Islands', 'give'),
140
+		'CR' => esc_html__('Costa Rica', 'give'),
141
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
142
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
143
+		'CU' => esc_html__('Cuba', 'give'),
144
+		'CY' => esc_html__('Cyprus Island', 'give'),
145
+		'CZ' => esc_html__('Czech Republic', 'give'),
146
+		'DK' => esc_html__('Denmark', 'give'),
147
+		'DJ' => esc_html__('Djibouti', 'give'),
148
+		'DM' => esc_html__('Dominica', 'give'),
149
+		'DO' => esc_html__('Dominican Republic', 'give'),
150
+		'TP' => esc_html__('East Timor', 'give'),
151
+		'EC' => esc_html__('Ecuador', 'give'),
152
+		'EG' => esc_html__('Egypt', 'give'),
153
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
154
+		'SV' => esc_html__('El Salvador', 'give'),
155
+		'ER' => esc_html__('Eritrea', 'give'),
156
+		'EE' => esc_html__('Estonia', 'give'),
157
+		'ET' => esc_html__('Ethiopia', 'give'),
158
+		'FK' => esc_html__('Falkland Islands', 'give'),
159
+		'FO' => esc_html__('Faroe Islands', 'give'),
160
+		'FJ' => esc_html__('Fiji', 'give'),
161
+		'FI' => esc_html__('Finland', 'give'),
162
+		'FR' => esc_html__('France', 'give'),
163
+		'GF' => esc_html__('French Guiana', 'give'),
164
+		'PF' => esc_html__('French Polynesia', 'give'),
165
+		'TF' => esc_html__('French Southern Territories', 'give'),
166
+		'GA' => esc_html__('Gabon', 'give'),
167
+		'GM' => esc_html__('Gambia', 'give'),
168
+		'GE' => esc_html__('Georgia', 'give'),
169
+		'DE' => esc_html__('Germany', 'give'),
170
+		'GR' => esc_html__('Greece', 'give'),
171
+		'GH' => esc_html__('Ghana', 'give'),
172
+		'GI' => esc_html__('Gibraltar', 'give'),
173
+		'GL' => esc_html__('Greenland', 'give'),
174
+		'GD' => esc_html__('Grenada', 'give'),
175
+		'GP' => esc_html__('Guadeloupe', 'give'),
176
+		'GU' => esc_html__('Guam', 'give'),
177
+		'GT' => esc_html__('Guatemala', 'give'),
178
+		'GG' => esc_html__('Guernsey', 'give'),
179
+		'GN' => esc_html__('Guinea', 'give'),
180
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
181
+		'GY' => esc_html__('Guyana', 'give'),
182
+		'HT' => esc_html__('Haiti', 'give'),
183
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
184
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
185
+		'HN' => esc_html__('Honduras', 'give'),
186
+		'HK' => esc_html__('Hong Kong', 'give'),
187
+		'HU' => esc_html__('Hungary', 'give'),
188
+		'IS' => esc_html__('Iceland', 'give'),
189
+		'IN' => esc_html__('India', 'give'),
190
+		'ID' => esc_html__('Indonesia', 'give'),
191
+		'IR' => esc_html__('Iran', 'give'),
192
+		'IQ' => esc_html__('Iraq', 'give'),
193
+		'IE' => esc_html__('Ireland', 'give'),
194
+		'IM' => esc_html__('Isle of Man', 'give'),
195
+		'IL' => esc_html__('Israel', 'give'),
196
+		'IT' => esc_html__('Italy', 'give'),
197
+		'JM' => esc_html__('Jamaica', 'give'),
198
+		'JP' => esc_html__('Japan', 'give'),
199
+		'JE' => esc_html__('Jersey', 'give'),
200
+		'JO' => esc_html__('Jordan', 'give'),
201
+		'KZ' => esc_html__('Kazakhstan', 'give'),
202
+		'KE' => esc_html__('Kenya', 'give'),
203
+		'KI' => esc_html__('Kiribati', 'give'),
204
+		'KW' => esc_html__('Kuwait', 'give'),
205
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
206
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
207
+		'LV' => esc_html__('Latvia', 'give'),
208
+		'LB' => esc_html__('Lebanon', 'give'),
209
+		'LS' => esc_html__('Lesotho', 'give'),
210
+		'LR' => esc_html__('Liberia', 'give'),
211
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
212
+		'LI' => esc_html__('Liechtenstein', 'give'),
213
+		'LT' => esc_html__('Lithuania', 'give'),
214
+		'LU' => esc_html__('Luxembourg', 'give'),
215
+		'MO' => esc_html__('Macau', 'give'),
216
+		'MK' => esc_html__('Macedonia', 'give'),
217
+		'MG' => esc_html__('Madagascar', 'give'),
218
+		'MW' => esc_html__('Malawi', 'give'),
219
+		'MY' => esc_html__('Malaysia', 'give'),
220
+		'MV' => esc_html__('Maldives', 'give'),
221
+		'ML' => esc_html__('Mali', 'give'),
222
+		'MT' => esc_html__('Malta', 'give'),
223
+		'MH' => esc_html__('Marshall Islands', 'give'),
224
+		'MQ' => esc_html__('Martinique', 'give'),
225
+		'MR' => esc_html__('Mauritania', 'give'),
226
+		'MU' => esc_html__('Mauritius', 'give'),
227
+		'YT' => esc_html__('Mayotte', 'give'),
228
+		'MX' => esc_html__('Mexico', 'give'),
229
+		'FM' => esc_html__('Micronesia', 'give'),
230
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
231
+		'MC' => esc_html__('Monaco', 'give'),
232
+		'MN' => esc_html__('Mongolia', 'give'),
233
+		'ME' => esc_html__('Montenegro', 'give'),
234
+		'MS' => esc_html__('Montserrat', 'give'),
235
+		'MA' => esc_html__('Morocco', 'give'),
236
+		'MZ' => esc_html__('Mozambique', 'give'),
237
+		'MM' => esc_html__('Myanmar', 'give'),
238
+		'NA' => esc_html__('Namibia', 'give'),
239
+		'NR' => esc_html__('Nauru', 'give'),
240
+		'NP' => esc_html__('Nepal', 'give'),
241
+		'NL' => esc_html__('Netherlands', 'give'),
242
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
243
+		'NC' => esc_html__('New Caledonia', 'give'),
244
+		'NZ' => esc_html__('New Zealand', 'give'),
245
+		'NI' => esc_html__('Nicaragua', 'give'),
246
+		'NE' => esc_html__('Niger', 'give'),
247
+		'NG' => esc_html__('Nigeria', 'give'),
248
+		'NU' => esc_html__('Niue', 'give'),
249
+		'NF' => esc_html__('Norfolk Island', 'give'),
250
+		'KP' => esc_html__('North Korea', 'give'),
251
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
252
+		'NO' => esc_html__('Norway', 'give'),
253
+		'OM' => esc_html__('Oman', 'give'),
254
+		'PK' => esc_html__('Pakistan', 'give'),
255
+		'PW' => esc_html__('Palau', 'give'),
256
+		'PS' => esc_html__('Palestinian Territories', 'give'),
257
+		'PA' => esc_html__('Panama', 'give'),
258
+		'PG' => esc_html__('Papua New Guinea', 'give'),
259
+		'PY' => esc_html__('Paraguay', 'give'),
260
+		'PE' => esc_html__('Peru', 'give'),
261
+		'PH' => esc_html__('Philippines', 'give'),
262
+		'PN' => esc_html__('Pitcairn Island', 'give'),
263
+		'PL' => esc_html__('Poland', 'give'),
264
+		'PT' => esc_html__('Portugal', 'give'),
265
+		'PR' => esc_html__('Puerto Rico', 'give'),
266
+		'QA' => esc_html__('Qatar', 'give'),
267
+		'RE' => esc_html__('Reunion Island', 'give'),
268
+		'RO' => esc_html__('Romania', 'give'),
269
+		'RU' => esc_html__('Russian Federation', 'give'),
270
+		'RW' => esc_html__('Rwanda', 'give'),
271
+		'SH' => esc_html__('Saint Helena', 'give'),
272
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
273
+		'LC' => esc_html__('Saint Lucia', 'give'),
274
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
275
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
276
+		'SM' => esc_html__('San Marino', 'give'),
277
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
278
+		'SA' => esc_html__('Saudi Arabia', 'give'),
279
+		'SN' => esc_html__('Senegal', 'give'),
280
+		'RS' => esc_html__('Serbia', 'give'),
281
+		'SC' => esc_html__('Seychelles', 'give'),
282
+		'SL' => esc_html__('Sierra Leone', 'give'),
283
+		'SG' => esc_html__('Singapore', 'give'),
284
+		'SK' => esc_html__('Slovak Republic', 'give'),
285
+		'SI' => esc_html__('Slovenia', 'give'),
286
+		'SB' => esc_html__('Solomon Islands', 'give'),
287
+		'SO' => esc_html__('Somalia', 'give'),
288
+		'ZA' => esc_html__('South Africa', 'give'),
289
+		'GS' => esc_html__('South Georgia', 'give'),
290
+		'KR' => esc_html__('South Korea', 'give'),
291
+		'ES' => esc_html__('Spain', 'give'),
292
+		'LK' => esc_html__('Sri Lanka', 'give'),
293
+		'SD' => esc_html__('Sudan', 'give'),
294
+		'SR' => esc_html__('Suriname', 'give'),
295
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
296
+		'SZ' => esc_html__('Swaziland', 'give'),
297
+		'SE' => esc_html__('Sweden', 'give'),
298
+		'CH' => esc_html__('Switzerland', 'give'),
299
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
300
+		'TW' => esc_html__('Taiwan', 'give'),
301
+		'TJ' => esc_html__('Tajikistan', 'give'),
302
+		'TZ' => esc_html__('Tanzania', 'give'),
303
+		'TG' => esc_html__('Togo', 'give'),
304
+		'TK' => esc_html__('Tokelau', 'give'),
305
+		'TO' => esc_html__('Tonga', 'give'),
306
+		'TH' => esc_html__('Thailand', 'give'),
307
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
308
+		'TN' => esc_html__('Tunisia', 'give'),
309
+		'TR' => esc_html__('Turkey', 'give'),
310
+		'TM' => esc_html__('Turkmenistan', 'give'),
311
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
312
+		'TV' => esc_html__('Tuvalu', 'give'),
313
+		'UG' => esc_html__('Uganda', 'give'),
314
+		'UA' => esc_html__('Ukraine', 'give'),
315
+		'AE' => esc_html__('United Arab Emirates', 'give'),
316
+		'UY' => esc_html__('Uruguay', 'give'),
317
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
318
+		'UZ' => esc_html__('Uzbekistan', 'give'),
319
+		'VU' => esc_html__('Vanuatu', 'give'),
320
+		'VE' => esc_html__('Venezuela', 'give'),
321
+		'VN' => esc_html__('Vietnam', 'give'),
322
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
323
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
324
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
325
+		'EH' => esc_html__('Western Sahara', 'give'),
326
+		'WS' => esc_html__('Western Samoa', 'give'),
327
+		'YE' => esc_html__('Yemen', 'give'),
328
+		'YU' => esc_html__('Yugoslavia', 'give'),
329
+		'ZM' => esc_html__('Zambia', 'give'),
330
+		'ZW' => esc_html__('Zimbabwe', 'give'),
331 331
 	);
332 332
 
333
-	return (array) apply_filters( 'give_countries', $countries );
333
+	return (array) apply_filters('give_countries', $countries);
334 334
 }
335 335
 
336 336
 /**
@@ -384,7 +384,7 @@  discard block
 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ıyaman', 'give' ),
809
-		'TR03' => __( 'Afyon', 'give' ),
810
-		'TR04' => __( 'Ağrı', 'give' ),
811
-		'TR05' => __( 'Amasya', 'give' ),
812
-		'TR06' => __( 'Ankara', 'give' ),
813
-		'TR07' => __( 'Antalya', 'give' ),
814
-		'TR08' => __( 'Artvin', 'give' ),
815
-		'TR09' => __( 'Aydın', 'give' ),
816
-		'TR10' => __( 'Balıkesir', 'give' ),
817
-		'TR11' => __( 'Bilecik', 'give' ),
818
-		'TR12' => __( 'Bingöl', 'give' ),
819
-		'TR13' => __( 'Bitlis', 'give' ),
820
-		'TR14' => __( 'Bolu', 'give' ),
821
-		'TR15' => __( 'Burdur', 'give' ),
822
-		'TR16' => __( 'Bursa', 'give' ),
823
-		'TR17' => __( 'Çanakkale', 'give' ),
824
-		'TR18' => __( 'Çankırı', 'give' ),
825
-		'TR19' => __( 'Çorum', 'give' ),
826
-		'TR20' => __( 'Denizli', 'give' ),
827
-		'TR21' => __( 'Diyarbakır', 'give' ),
828
-		'TR22' => __( 'Edirne', 'give' ),
829
-		'TR23' => __( 'Elazığ', 'give' ),
830
-		'TR24' => __( 'Erzincan', 'give' ),
831
-		'TR25' => __( 'Erzurum', 'give' ),
832
-		'TR26' => __( 'Eskişehir', 'give' ),
833
-		'TR27' => __( 'Gaziantep', 'give' ),
834
-		'TR28' => __( 'Giresun', 'give' ),
835
-		'TR29' => __( 'Gümüşhane', 'give' ),
836
-		'TR30' => __( 'Hakkari', 'give' ),
837
-		'TR31' => __( 'Hatay', 'give' ),
838
-		'TR32' => __( 'Isparta', 'give' ),
839
-		'TR33' => __( 'İçel', 'give' ),
840
-		'TR34' => __( 'İstanbul', 'give' ),
841
-		'TR35' => __( 'İzmir', 'give' ),
842
-		'TR36' => __( 'Kars', 'give' ),
843
-		'TR37' => __( 'Kastamonu', 'give' ),
844
-		'TR38' => __( 'Kayseri', 'give' ),
845
-		'TR39' => __( 'Kırklareli', 'give' ),
846
-		'TR40' => __( 'Kırşehir', 'give' ),
847
-		'TR41' => __( 'Kocaeli', 'give' ),
848
-		'TR42' => __( 'Konya', 'give' ),
849
-		'TR43' => __( 'Kütahya', 'give' ),
850
-		'TR44' => __( 'Malatya', 'give' ),
851
-		'TR45' => __( 'Manisa', 'give' ),
852
-		'TR46' => __( 'Kahramanmaraş', 'give' ),
853
-		'TR47' => __( 'Mardin', 'give' ),
854
-		'TR48' => __( 'Muğla', 'give' ),
855
-		'TR49' => __( 'Muş', 'give' ),
856
-		'TR50' => __( 'Nevşehir', 'give' ),
857
-		'TR51' => __( 'Niğde', 'give' ),
858
-		'TR52' => __( 'Ordu', 'give' ),
859
-		'TR53' => __( 'Rize', 'give' ),
860
-		'TR54' => __( 'Sakarya', 'give' ),
861
-		'TR55' => __( 'Samsun', 'give' ),
862
-		'TR56' => __( 'Siirt', 'give' ),
863
-		'TR57' => __( 'Sinop', 'give' ),
864
-		'TR58' => __( 'Sivas', 'give' ),
865
-		'TR59' => __( 'Tekirdağ', 'give' ),
866
-		'TR60' => __( 'Tokat', 'give' ),
867
-		'TR61' => __( 'Trabzon', 'give' ),
868
-		'TR62' => __( 'Tunceli', 'give' ),
869
-		'TR63' => __( 'Şanlıurfa', 'give' ),
870
-		'TR64' => __( 'Uşak', 'give' ),
871
-		'TR65' => __( 'Van', 'give' ),
872
-		'TR66' => __( 'Yozgat', 'give' ),
873
-		'TR67' => __( 'Zonguldak', 'give' ),
874
-		'TR68' => __( 'Aksaray', 'give' ),
875
-		'TR69' => __( 'Bayburt', 'give' ),
876
-		'TR70' => __( 'Karaman', 'give' ),
877
-		'TR71' => __( 'Kırıkkale', 'give' ),
878
-		'TR72' => __( 'Batman', 'give' ),
879
-		'TR73' => __( 'Şırnak', 'give' ),
880
-		'TR74' => __( 'Bartın', 'give' ),
881
-		'TR75' => __( 'Ardahan', 'give' ),
882
-		'TR76' => __( 'Iğdır', 'give' ),
883
-		'TR77' => __( 'Yalova', 'give' ),
884
-		'TR78' => __( 'Karabük', 'give' ),
885
-		'TR79' => __( 'Kilis', 'give' ),
886
-		'TR80' => __( 'Osmaniye', 'give' ),
887
-		'TR81' => __( 'Düzce', 'give' ),
807
+		'TR01' => __('Adana', 'give'),
808
+		'TR02' => __('Adıyaman', 'give'),
809
+		'TR03' => __('Afyon', 'give'),
810
+		'TR04' => __('Ağrı', 'give'),
811
+		'TR05' => __('Amasya', 'give'),
812
+		'TR06' => __('Ankara', 'give'),
813
+		'TR07' => __('Antalya', 'give'),
814
+		'TR08' => __('Artvin', 'give'),
815
+		'TR09' => __('Aydın', 'give'),
816
+		'TR10' => __('Balıkesir', 'give'),
817
+		'TR11' => __('Bilecik', 'give'),
818
+		'TR12' => __('Bingöl', 'give'),
819
+		'TR13' => __('Bitlis', 'give'),
820
+		'TR14' => __('Bolu', 'give'),
821
+		'TR15' => __('Burdur', 'give'),
822
+		'TR16' => __('Bursa', 'give'),
823
+		'TR17' => __('Çanakkale', 'give'),
824
+		'TR18' => __('Çankırı', 'give'),
825
+		'TR19' => __('Çorum', 'give'),
826
+		'TR20' => __('Denizli', 'give'),
827
+		'TR21' => __('Diyarbakır', 'give'),
828
+		'TR22' => __('Edirne', 'give'),
829
+		'TR23' => __('Elazığ', 'give'),
830
+		'TR24' => __('Erzincan', 'give'),
831
+		'TR25' => __('Erzurum', 'give'),
832
+		'TR26' => __('Eskişehir', 'give'),
833
+		'TR27' => __('Gaziantep', 'give'),
834
+		'TR28' => __('Giresun', 'give'),
835
+		'TR29' => __('Gümüşhane', 'give'),
836
+		'TR30' => __('Hakkari', 'give'),
837
+		'TR31' => __('Hatay', 'give'),
838
+		'TR32' => __('Isparta', 'give'),
839
+		'TR33' => __('İçel', 'give'),
840
+		'TR34' => __('İstanbul', 'give'),
841
+		'TR35' => __('İzmir', 'give'),
842
+		'TR36' => __('Kars', 'give'),
843
+		'TR37' => __('Kastamonu', 'give'),
844
+		'TR38' => __('Kayseri', 'give'),
845
+		'TR39' => __('Kırklareli', 'give'),
846
+		'TR40' => __('Kırşehir', 'give'),
847
+		'TR41' => __('Kocaeli', 'give'),
848
+		'TR42' => __('Konya', 'give'),
849
+		'TR43' => __('Kütahya', 'give'),
850
+		'TR44' => __('Malatya', 'give'),
851
+		'TR45' => __('Manisa', 'give'),
852
+		'TR46' => __('Kahramanmaraş', 'give'),
853
+		'TR47' => __('Mardin', 'give'),
854
+		'TR48' => __('Muğla', 'give'),
855
+		'TR49' => __('Muş', 'give'),
856
+		'TR50' => __('Nevşehir', 'give'),
857
+		'TR51' => __('Niğde', 'give'),
858
+		'TR52' => __('Ordu', 'give'),
859
+		'TR53' => __('Rize', 'give'),
860
+		'TR54' => __('Sakarya', 'give'),
861
+		'TR55' => __('Samsun', 'give'),
862
+		'TR56' => __('Siirt', 'give'),
863
+		'TR57' => __('Sinop', 'give'),
864
+		'TR58' => __('Sivas', 'give'),
865
+		'TR59' => __('Tekirdağ', 'give'),
866
+		'TR60' => __('Tokat', 'give'),
867
+		'TR61' => __('Trabzon', 'give'),
868
+		'TR62' => __('Tunceli', 'give'),
869
+		'TR63' => __('Şanlıurfa', 'give'),
870
+		'TR64' => __('Uşak', 'give'),
871
+		'TR65' => __('Van', 'give'),
872
+		'TR66' => __('Yozgat', 'give'),
873
+		'TR67' => __('Zonguldak', 'give'),
874
+		'TR68' => __('Aksaray', 'give'),
875
+		'TR69' => __('Bayburt', 'give'),
876
+		'TR70' => __('Karaman', 'give'),
877
+		'TR71' => __('Kırıkkale', 'give'),
878
+		'TR72' => __('Batman', 'give'),
879
+		'TR73' => __('Şırnak', 'give'),
880
+		'TR74' => __('Bartın', 'give'),
881
+		'TR75' => __('Ardahan', 'give'),
882
+		'TR76' => __('Iğdır', 'give'),
883
+		'TR77' => __('Yalova', 'give'),
884
+		'TR78' => __('Karabük', 'give'),
885
+		'TR79' => __('Kilis', 'give'),
886
+		'TR80' => __('Osmaniye', 'give'),
887
+		'TR81' => __('Düzce', 'give'),
888 888
 	);
889 889
 
890
-	return apply_filters( 'give_turkey_states', $states );
890
+	return apply_filters('give_turkey_states', $states);
891 891
 }
892 892
 
893 893
 /**
@@ -899,51 +899,51 @@  discard block
 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ímac', 'give' ),
1081
-		'ARE' => __( 'Arequipa', 'give' ),
1082
-		'AYA' => __( 'Ayacucho', 'give' ),
1083
-		'CAJ' => __( 'Cajamarca', 'give' ),
1084
-		'CUS' => __( 'Cusco', 'give' ),
1085
-		'HUV' => __( 'Huancavelica', 'give' ),
1086
-		'HUC' => __( 'Huánuco', 'give' ),
1087
-		'ICA' => __( 'Ica', 'give' ),
1088
-		'JUN' => __( 'Junín', 'give' ),
1089
-		'LAL' => __( 'La Libertad', 'give' ),
1090
-		'LAM' => __( 'Lambayeque', 'give' ),
1091
-		'LIM' => __( 'Lima', 'give' ),
1092
-		'LOR' => __( 'Loreto', 'give' ),
1093
-		'MDD' => __( 'Madre de Dios', 'give' ),
1094
-		'MOQ' => __( 'Moquegua', 'give' ),
1095
-		'PAS' => __( 'Pasco', 'give' ),
1096
-		'PIU' => __( 'Piura', 'give' ),
1097
-		'PUN' => __( 'Puno', 'give' ),
1098
-		'SAM' => __( 'San Martín', 'give' ),
1099
-		'TAC' => __( 'Tacna', 'give' ),
1100
-		'TUM' => __( 'Tumbes', 'give' ),
1101
-		'UCA' => __( 'Ucayali', 'give' ),
1076
+		'CAL' => __('El Callao', 'give'),
1077
+		'LMA' => __('Municipalidad Metropolitana de Lima', 'give'),
1078
+		'AMA' => __('Amazonas', 'give'),
1079
+		'ANC' => __('Ancash', 'give'),
1080
+		'APU' => __('Apurímac', 'give'),
1081
+		'ARE' => __('Arequipa', 'give'),
1082
+		'AYA' => __('Ayacucho', 'give'),
1083
+		'CAJ' => __('Cajamarca', 'give'),
1084
+		'CUS' => __('Cusco', 'give'),
1085
+		'HUV' => __('Huancavelica', 'give'),
1086
+		'HUC' => __('Huánuco', 'give'),
1087
+		'ICA' => __('Ica', 'give'),
1088
+		'JUN' => __('Junín', 'give'),
1089
+		'LAL' => __('La Libertad', 'give'),
1090
+		'LAM' => __('Lambayeque', 'give'),
1091
+		'LIM' => __('Lima', 'give'),
1092
+		'LOR' => __('Loreto', 'give'),
1093
+		'MDD' => __('Madre de Dios', 'give'),
1094
+		'MOQ' => __('Moquegua', 'give'),
1095
+		'PAS' => __('Pasco', 'give'),
1096
+		'PIU' => __('Piura', 'give'),
1097
+		'PUN' => __('Puno', 'give'),
1098
+		'SAM' => __('San Martín', 'give'),
1099
+		'TAC' => __('Tacna', 'give'),
1100
+		'TUM' => __('Tumbes', 'give'),
1101
+		'UCA' => __('Ucayali', 'give'),
1102 1102
 	);
1103 1103
 
1104
-	return apply_filters( 'give_peru_states', $states );
1104
+	return apply_filters('give_peru_states', $states);
1105 1105
 }
1106 1106
 
1107 1107
 /**
@@ -1113,23 +1113,23 @@  discard block
 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ónoma de Buenos Aires', 'give' ),
1682
-		'B' => __( 'Buenos Aires', 'give' ),
1683
-		'K' => __( 'Catamarca', 'give' ),
1684
-		'H' => __( 'Chaco', 'give' ),
1685
-		'U' => __( 'Chubut', 'give' ),
1686
-		'X' => __( 'Córdoba', 'give' ),
1687
-		'W' => __( 'Corrientes', 'give' ),
1688
-		'E' => __( 'Entre Ríos', 'give' ),
1689
-		'P' => __( 'Formosa', 'give' ),
1690
-		'Y' => __( 'Jujuy', 'give' ),
1691
-		'L' => __( 'La Pampa', 'give' ),
1692
-		'F' => __( 'La Rioja', 'give' ),
1693
-		'M' => __( 'Mendoza', 'give' ),
1694
-		'N' => __( 'Misiones', 'give' ),
1695
-		'Q' => __( 'Neuquén', 'give' ),
1696
-		'R' => __( 'Río Negro', 'give' ),
1697
-		'A' => __( 'Salta', 'give' ),
1698
-		'J' => __( 'San Juan', 'give' ),
1699
-		'D' => __( 'San Luis', 'give' ),
1700
-		'Z' => __( 'Santa Cruz', 'give' ),
1701
-		'S' => __( 'Santa Fe', 'give' ),
1702
-		'G' => __( 'Santiago del Estero', 'give' ),
1703
-		'V' => __( 'Tierra del Fuego', 'give' ),
1704
-		'T' => __( 'Tucumán', 'give' ),
1681
+		'C' => __('Ciudad Autónoma de Buenos Aires', 'give'),
1682
+		'B' => __('Buenos Aires', 'give'),
1683
+		'K' => __('Catamarca', 'give'),
1684
+		'H' => __('Chaco', 'give'),
1685
+		'U' => __('Chubut', 'give'),
1686
+		'X' => __('Córdoba', 'give'),
1687
+		'W' => __('Corrientes', 'give'),
1688
+		'E' => __('Entre Ríos', 'give'),
1689
+		'P' => __('Formosa', 'give'),
1690
+		'Y' => __('Jujuy', 'give'),
1691
+		'L' => __('La Pampa', 'give'),
1692
+		'F' => __('La Rioja', 'give'),
1693
+		'M' => __('Mendoza', 'give'),
1694
+		'N' => __('Misiones', 'give'),
1695
+		'Q' => __('Neuquén', 'give'),
1696
+		'R' => __('Río Negro', 'give'),
1697
+		'A' => __('Salta', 'give'),
1698
+		'J' => __('San Juan', 'give'),
1699
+		'D' => __('San Luis', 'give'),
1700
+		'Z' => __('Santa Cruz', 'give'),
1701
+		'S' => __('Santa Fe', 'give'),
1702
+		'G' => __('Santiago del Estero', 'give'),
1703
+		'V' => __('Tierra del Fuego', 'give'),
1704
+		'T' => __('Tucumán', 'give'),
1705 1705
 	);
1706 1706
 
1707
-	return apply_filters( 'give_argentina_states', $states );
1707
+	return apply_filters('give_argentina_states', $states);
1708 1708
 }
1709 1709
 
1710 1710
 /**
@@ -1785,7 +1785,7 @@  discard block
 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 / 新疆',
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 (ยโสธร)',
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ña', 'give' ),
2260
-		'VI' => esc_html__( 'Álava', 'give' ),
2261
-		'AB' => esc_html__( 'Albacete', 'give' ),
2262
-		'A'  => esc_html__( 'Alicante', 'give' ),
2263
-		'AL' => esc_html__( 'Almería', 'give' ),
2264
-		'O'  => esc_html__( 'Asturias', 'give' ),
2265
-		'AV' => esc_html__( 'Ávila', 'give' ),
2266
-		'BA' => esc_html__( 'Badajoz', 'give' ),
2267
-		'PM' => esc_html__( 'Baleares', 'give' ),
2268
-		'B'  => esc_html__( 'Barcelona', 'give' ),
2269
-		'BU' => esc_html__( 'Burgos', 'give' ),
2270
-		'CC' => esc_html__( 'Cáceres', 'give' ),
2271
-		'CA' => esc_html__( 'Cádiz', 'give' ),
2272
-		'S'  => esc_html__( 'Cantabria', 'give' ),
2273
-		'CS' => esc_html__( 'Castellón', 'give' ),
2274
-		'CE' => esc_html__( 'Ceuta', 'give' ),
2275
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
2276
-		'CO' => esc_html__( 'Córdoba', 'give' ),
2277
-		'CU' => esc_html__( 'Cuenca', 'give' ),
2278
-		'GI' => esc_html__( 'Girona', 'give' ),
2279
-		'GR' => esc_html__( 'Granada', 'give' ),
2280
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
2281
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
2282
-		'H'  => esc_html__( 'Huelva', 'give' ),
2283
-		'HU' => esc_html__( 'Huesca', 'give' ),
2284
-		'J'  => esc_html__( 'Jaén', 'give' ),
2285
-		'LO' => esc_html__( 'La Rioja', 'give' ),
2286
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
2287
-		'LE' => esc_html__( 'León', 'give' ),
2288
-		'L'  => esc_html__( 'Lleida', 'give' ),
2289
-		'LU' => esc_html__( 'Lugo', 'give' ),
2290
-		'M'  => esc_html__( 'Madrid', 'give' ),
2291
-		'MA' => esc_html__( 'Málaga', 'give' ),
2292
-		'ML' => esc_html__( 'Melilla', 'give' ),
2293
-		'MU' => esc_html__( 'Murcia', 'give' ),
2294
-		'NA' => esc_html__( 'Navarra', 'give' ),
2295
-		'OR' => esc_html__( 'Ourense', 'give' ),
2296
-		'P'  => esc_html__( 'Palencia', 'give' ),
2297
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
2298
-		'SA' => esc_html__( 'Salamanca', 'give' ),
2299
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
2300
-		'SG' => esc_html__( 'Segovia', 'give' ),
2301
-		'SE' => esc_html__( 'Sevilla', 'give' ),
2302
-		'SO' => esc_html__( 'Soria', 'give' ),
2303
-		'T'  => esc_html__( 'Tarragona', 'give' ),
2304
-		'TE' => esc_html__( 'Teruel', 'give' ),
2305
-		'TO' => esc_html__( 'Toledo', 'give' ),
2306
-		'V'  => esc_html__( 'Valencia', 'give' ),
2307
-		'VA' => esc_html__( 'Valladolid', 'give' ),
2308
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
2309
-		'ZA' => esc_html__( 'Zamora', 'give' ),
2310
-		'Z'  => esc_html__( 'Zaragoza', 'give' ),
2259
+		'C'  => esc_html__('A Coruña', 'give'),
2260
+		'VI' => esc_html__('Álava', 'give'),
2261
+		'AB' => esc_html__('Albacete', 'give'),
2262
+		'A'  => esc_html__('Alicante', 'give'),
2263
+		'AL' => esc_html__('Almería', 'give'),
2264
+		'O'  => esc_html__('Asturias', 'give'),
2265
+		'AV' => esc_html__('Ávila', 'give'),
2266
+		'BA' => esc_html__('Badajoz', 'give'),
2267
+		'PM' => esc_html__('Baleares', 'give'),
2268
+		'B'  => esc_html__('Barcelona', 'give'),
2269
+		'BU' => esc_html__('Burgos', 'give'),
2270
+		'CC' => esc_html__('Cáceres', 'give'),
2271
+		'CA' => esc_html__('Cádiz', 'give'),
2272
+		'S'  => esc_html__('Cantabria', 'give'),
2273
+		'CS' => esc_html__('Castellón', 'give'),
2274
+		'CE' => esc_html__('Ceuta', 'give'),
2275
+		'CR' => esc_html__('Ciudad Real', 'give'),
2276
+		'CO' => esc_html__('Córdoba', 'give'),
2277
+		'CU' => esc_html__('Cuenca', 'give'),
2278
+		'GI' => esc_html__('Girona', 'give'),
2279
+		'GR' => esc_html__('Granada', 'give'),
2280
+		'GU' => esc_html__('Guadalajara', 'give'),
2281
+		'SS' => esc_html__('Gipuzkoa', 'give'),
2282
+		'H'  => esc_html__('Huelva', 'give'),
2283
+		'HU' => esc_html__('Huesca', 'give'),
2284
+		'J'  => esc_html__('Jaén', 'give'),
2285
+		'LO' => esc_html__('La Rioja', 'give'),
2286
+		'GC' => esc_html__('Las Palmas', 'give'),
2287
+		'LE' => esc_html__('León', 'give'),
2288
+		'L'  => esc_html__('Lleida', 'give'),
2289
+		'LU' => esc_html__('Lugo', 'give'),
2290
+		'M'  => esc_html__('Madrid', 'give'),
2291
+		'MA' => esc_html__('Málaga', 'give'),
2292
+		'ML' => esc_html__('Melilla', 'give'),
2293
+		'MU' => esc_html__('Murcia', 'give'),
2294
+		'NA' => esc_html__('Navarra', 'give'),
2295
+		'OR' => esc_html__('Ourense', 'give'),
2296
+		'P'  => esc_html__('Palencia', 'give'),
2297
+		'PO' => esc_html__('Pontevedra', 'give'),
2298
+		'SA' => esc_html__('Salamanca', 'give'),
2299
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
2300
+		'SG' => esc_html__('Segovia', 'give'),
2301
+		'SE' => esc_html__('Sevilla', 'give'),
2302
+		'SO' => esc_html__('Soria', 'give'),
2303
+		'T'  => esc_html__('Tarragona', 'give'),
2304
+		'TE' => esc_html__('Teruel', 'give'),
2305
+		'TO' => esc_html__('Toledo', 'give'),
2306
+		'V'  => esc_html__('Valencia', 'give'),
2307
+		'VA' => esc_html__('Valladolid', 'give'),
2308
+		'BI' => esc_html__('Bizkaia', 'give'),
2309
+		'ZA' => esc_html__('Zamora', 'give'),
2310
+		'Z'  => esc_html__('Zaragoza', 'give'),
2311 2311
 	);
2312 2312
 
2313
-	return apply_filters( 'give_spain_states', $states );
2313
+	return apply_filters('give_spain_states', $states);
2314 2314
 }
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param $url
74 74
 	 *
75
-	 * @return mixed
75
+	 * @return string
76 76
 	 */
77 77
 	public function give_update_cmb_meta_box_url( $url ) {
78 78
 		// Path to Give's CMB
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
  * @since      1.3.5
936 936
  *
937 937
  * @param $array
938
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
938
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
939 939
  * @param $insert   |array a valid array of options to insert
940 940
  *
941 941
  * @return array
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  * @since 1.0
975 975
  *
976 976
  * @param array $field_arr
977
- * @param array $saved_values
977
+ * @param string|boolean $saved_values
978 978
  *
979 979
  * @return void
980 980
  */
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
  * @since  1.0
1010 1010
  *
1011 1011
  * @param  array $field_arr
1012
- * @param  array $saved_value
1012
+ * @param  string|boolean $saved_value
1013 1013
  *
1014 1014
  * @return void
1015 1015
  */
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
  * @params $string text
1164 1164
  * @params $filter array
1165 1165
  *
1166
- * @return text $string
1166
+ * @return string $string
1167 1167
  */
1168 1168
 function give_slug_to_title( $string, $filters = array() ) {
1169 1169
 
Please login to merge, or discard this patch.
Spacing   +372 added lines, -372 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	public function __construct() {
44 44
 
45 45
 		// Custom CMB2 Settings Fields
46
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
47
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
48
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
49
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
50
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
51
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
52
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
53
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
46
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
47
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
48
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
49
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
50
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
51
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
52
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
53
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
54 54
 	}
55 55
 
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since  1.0
61 61
 	 */
62 62
 	public function init() {
63
-		register_setting( $this->key, $this->key );
63
+		register_setting($this->key, $this->key);
64 64
 
65 65
 	}
66 66
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return mixed
76 76
 	 */
77
-	public function give_update_cmb_meta_box_url( $url ) {
77
+	public function give_update_cmb_meta_box_url($url) {
78 78
 		// Path to Give's CMB
79
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
79
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
80 80
 	}
81 81
 
82 82
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function give_get_settings_tabs() {
90 90
 
91
-		$settings = $this->give_settings( null );
91
+		$settings = $this->give_settings(null);
92 92
 
93 93
 		$tabs             = array();
94
-		$tabs['general']  = __( 'General', 'give' );
95
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
96
-		$tabs['display']  = __( 'Display Options', 'give' );
97
-		$tabs['emails']   = __( 'Emails', 'give' );
94
+		$tabs['general']  = __('General', 'give');
95
+		$tabs['gateways'] = __('Payment Gateways', 'give');
96
+		$tabs['display']  = __('Display Options', 'give');
97
+		$tabs['emails']   = __('Emails', 'give');
98 98
 
99
-		if ( ! empty( $settings['addons']['fields'] ) ) {
100
-			$tabs['addons'] = __( 'Add-ons', 'give' );
99
+		if ( ! empty($settings['addons']['fields'])) {
100
+			$tabs['addons'] = __('Add-ons', 'give');
101 101
 		}
102 102
 
103
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
104
-			$tabs['licenses'] = __( 'Licenses', 'give' );
103
+		if ( ! empty($settings['licenses']['fields'])) {
104
+			$tabs['licenses'] = __('Licenses', 'give');
105 105
 		}
106 106
 
107
-		$tabs['advanced']    = __( 'Advanced', 'give' );
108
-		$tabs['api']         = __( 'API', 'give' );
109
-		$tabs['system_info'] = __( 'System Info', 'give' );
107
+		$tabs['advanced']    = __('Advanced', 'give');
108
+		$tabs['api']         = __('API', 'give');
109
+		$tabs['system_info'] = __('System Info', 'give');
110 110
 
111
-		return apply_filters( 'give_settings_tabs', $tabs );
111
+		return apply_filters('give_settings_tabs', $tabs);
112 112
 	}
113 113
 
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function admin_page_display() {
121 121
 
122
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
122
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
123 123
 
124 124
 		?>
125 125
 
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 
130 130
 			<h2 class="nav-tab-wrapper">
131 131
 				<?php
132
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
132
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
133 133
 
134
-					$tab_url = esc_url( add_query_arg( array(
134
+					$tab_url = esc_url(add_query_arg(array(
135 135
 						'settings-updated' => false,
136 136
 						'tab'              => $tab_id,
137
-					) ) );
137
+					)));
138 138
 
139 139
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
140 140
 
141
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
141
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
142 142
 
143 143
 				}
144 144
 				?>
145 145
 			</h2>
146 146
 
147
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
147
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
148 148
 
149 149
 		</div><!-- .wrap -->
150 150
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @return string
168 168
 	 */
169
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
169
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
170 170
 
171 171
 		// only modify the give settings form
172
-		if ( 'give_settings' == $object_id ) {
172
+		if ('give_settings' == $object_id) {
173 173
 
174
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
174
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
175 175
 
176 176
 		}
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return array
190 190
 	 */
191
-	public function give_settings( $active_tab ) {
191
+	public function give_settings($active_tab) {
192 192
 
193 193
 		$give_settings = array(
194 194
 			/**
@@ -196,99 +196,99 @@  discard block
 block discarded – undo
196 196
 			 */
197 197
 			'general'     => array(
198 198
 				'id'         => 'general_settings',
199
-				'give_title' => __( 'General Settings', 'give' ),
200
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
201
-				'fields'     => apply_filters( 'give_settings_general', array(
199
+				'give_title' => __('General Settings', 'give'),
200
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
201
+				'fields'     => apply_filters('give_settings_general', array(
202 202
 						array(
203
-							'name' => __( 'General Settings', 'give' ),
203
+							'name' => __('General Settings', 'give'),
204 204
 							'desc' => '',
205 205
 							'type' => 'give_title',
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name'    => __( 'Success Page', 'give' ),
209
+							'name'    => __('Success Page', 'give'),
210 210
 							/* translators: %s: [give_receipt] */
211
-							'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>' ),
211
+							'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>'),
212 212
 							'id'      => 'success_page',
213 213
 							'type'    => 'select',
214
-							'options' => give_cmb2_get_post_options( array(
214
+							'options' => give_cmb2_get_post_options(array(
215 215
 								'post_type'   => 'page',
216 216
 								'numberposts' => 999,
217
-							) ),
217
+							)),
218 218
 						),
219 219
 						array(
220
-							'name'    => __( 'Failed Donation Page', 'give' ),
221
-							'desc'    => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
220
+							'name'    => __('Failed Donation Page', 'give'),
221
+							'desc'    => __('The page donors are sent to if their donation is cancelled or fails.', 'give'),
222 222
 							'id'      => 'failure_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226 226
 								'numberposts' => 999,
227
-							) ),
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => __( 'Donation History Page', 'give' ),
230
+							'name'    => __('Donation History Page', 'give'),
231 231
 							/* translators: %s: [donation_history] */
232
-							'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>' ),
232
+							'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>'),
233 233
 							'id'      => 'history_page',
234 234
 							'type'    => 'select',
235
-							'options' => give_cmb2_get_post_options( array(
235
+							'options' => give_cmb2_get_post_options(array(
236 236
 								'post_type'   => 'page',
237 237
 								'numberposts' => 999,
238
-							) ),
238
+							)),
239 239
 						),
240 240
 						array(
241
-							'name'    => __( 'Base Country', 'give' ),
242
-							'desc'    => __( 'The country your site operates from.', 'give' ),
241
+							'name'    => __('Base Country', 'give'),
242
+							'desc'    => __('The country your site operates from.', 'give'),
243 243
 							'id'      => 'base_country',
244 244
 							'type'    => 'select',
245 245
 							'options' => give_get_country_list(),
246 246
 						),
247 247
 						array(
248
-							'name' => __( 'Currency Settings', 'give' ),
248
+							'name' => __('Currency Settings', 'give'),
249 249
 							'desc' => '',
250 250
 							'type' => 'give_title',
251 251
 							'id'   => 'give_title_general_settings_2',
252 252
 						),
253 253
 						array(
254
-							'name'    => __( 'Currency', 'give' ),
255
-							'desc'    => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
254
+							'name'    => __('Currency', 'give'),
255
+							'desc'    => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
256 256
 							'id'      => 'currency',
257 257
 							'type'    => 'select',
258 258
 							'options' => give_get_currencies(),
259 259
 							'default' => 'USD',
260 260
 						),
261 261
 						array(
262
-							'name'    => __( 'Currency Position', 'give' ),
263
-							'desc'    => __( 'The position of the currency symbol.', 'give' ),
262
+							'name'    => __('Currency Position', 'give'),
263
+							'desc'    => __('The position of the currency symbol.', 'give'),
264 264
 							'id'      => 'currency_position',
265 265
 							'type'    => 'select',
266 266
 							'options' => array(
267 267
 								/* translators: %s: currency symbol */
268
-								'before' => sprintf( __( 'Before - %s&#x200e;10', 'give' ), give_currency_symbol( give_get_currency() ) ),
268
+								'before' => sprintf(__('Before - %s&#x200e;10', 'give'), give_currency_symbol(give_get_currency())),
269 269
 								/* translators: %s: currency symbol */
270
-								'after'  => sprintf( __( 'After - 10%s&#x200f;', 'give' ), give_currency_symbol( give_get_currency() ) ),
270
+								'after'  => sprintf(__('After - 10%s&#x200f;', 'give'), give_currency_symbol(give_get_currency())),
271 271
 							),
272 272
 							'default' => 'before',
273 273
 						),
274 274
 						array(
275
-							'name'            => __( 'Thousands Separator', 'give' ),
276
-							'desc'            => __( 'The symbol (usually , or .) to separate thousands.', 'give' ),
275
+							'name'            => __('Thousands Separator', 'give'),
276
+							'desc'            => __('The symbol (usually , or .) to separate thousands.', 'give'),
277 277
 							'id'              => 'thousands_separator',
278 278
 							'type'            => 'text_small',
279 279
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
280 280
 							'default'         => ',',
281 281
 						),
282 282
 						array(
283
-							'name'    => __( 'Decimal Separator', 'give' ),
284
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
283
+							'name'    => __('Decimal Separator', 'give'),
284
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
285 285
 							'id'      => 'decimal_separator',
286 286
 							'type'    => 'text_small',
287 287
 							'default' => '.',
288 288
 						),
289 289
 						array(
290
-							'name'            => __( 'Number of Decimals', 'give' ),
291
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
290
+							'name'            => __('Number of Decimals', 'give'),
291
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
292 292
 							'id'              => 'number_decimals',
293 293
 							'type'            => 'text_small',
294 294
 							'default'         => 2,
@@ -302,83 +302,83 @@  discard block
 block discarded – undo
302 302
 			 */
303 303
 			'gateways'    => array(
304 304
 				'id'         => 'payment_gateways',
305
-				'give_title' => __( 'Payment Gateways', 'give' ),
306
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
307
-				'fields'     => apply_filters( 'give_settings_gateways', array(
305
+				'give_title' => __('Payment Gateways', 'give'),
306
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
307
+				'fields'     => apply_filters('give_settings_gateways', array(
308 308
 						array(
309
-							'name' => __( 'Gateways Settings', 'give' ),
309
+							'name' => __('Gateways Settings', 'give'),
310 310
 							'desc' => '',
311 311
 							'id'   => 'give_title_gateway_settings_1',
312 312
 							'type' => 'give_title',
313 313
 						),
314 314
 						array(
315
-							'name' => __( 'Test Mode', 'give' ),
316
-							'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
315
+							'name' => __('Test Mode', 'give'),
316
+							'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
317 317
 							'id'   => 'test_mode',
318 318
 							'type' => 'checkbox',
319 319
 						),
320 320
 						array(
321
-							'name' => __( 'Enabled Gateways', 'give' ),
322
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
321
+							'name' => __('Enabled Gateways', 'give'),
322
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
323 323
 							'id'   => 'gateways',
324 324
 							'type' => 'enabled_gateways',
325 325
 						),
326 326
 						array(
327
-							'name' => __( 'Default Gateway', 'give' ),
328
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
327
+							'name' => __('Default Gateway', 'give'),
328
+							'desc' => __('The gateway that will be selected by default.', 'give'),
329 329
 							'id'   => 'default_gateway',
330 330
 							'type' => 'default_gateway',
331 331
 						),
332 332
 						array(
333
-							'name' => __( 'PayPal Standard', 'give' ),
333
+							'name' => __('PayPal Standard', 'give'),
334 334
 							'desc' => '',
335 335
 							'type' => 'give_title',
336 336
 							'id'   => 'give_title_gateway_settings_2',
337 337
 						),
338 338
 						array(
339
-							'name' => __( 'PayPal Email', 'give' ),
340
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
339
+							'name' => __('PayPal Email', 'give'),
340
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
341 341
 							'id'   => 'paypal_email',
342 342
 							'type' => 'text_email',
343 343
 						),
344 344
 						array(
345
-							'name' => __( 'PayPal Page Style', 'give' ),
346
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
345
+							'name' => __('PayPal Page Style', 'give'),
346
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
347 347
 							'id'   => 'paypal_page_style',
348 348
 							'type' => 'text',
349 349
 						),
350 350
 						array(
351
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
352
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
351
+							'name'    => __('PayPal Transaction Type', 'give'),
352
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
353 353
 							'id'      => 'paypal_button_type',
354 354
 							'type'    => 'radio_inline',
355 355
 							'options' => array(
356
-								'donation' => __( 'Donation', 'give' ),
357
-								'standard' => __( 'Standard Transaction', 'give' ),
356
+								'donation' => __('Donation', 'give'),
357
+								'standard' => __('Standard Transaction', 'give'),
358 358
 							),
359 359
 							'default' => 'donation',
360 360
 						),
361 361
 						array(
362
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
363
-							'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
362
+							'name' => __('Disable PayPal IPN Verification', 'give'),
363
+							'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
364 364
 							'id'   => 'disable_paypal_verification',
365 365
 							'type' => 'checkbox',
366 366
 						),
367 367
 						array(
368
-							'name' => __( 'Offline Donations', 'give' ),
368
+							'name' => __('Offline Donations', 'give'),
369 369
 							'desc' => '',
370 370
 							'type' => 'give_title',
371 371
 							'id'   => 'give_title_gateway_settings_3',
372 372
 						),
373 373
 						array(
374
-							'name' => __( 'Collect Billing Details', 'give' ),
375
-							'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
374
+							'name' => __('Collect Billing Details', 'give'),
375
+							'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
376 376
 							'id'   => 'give_offline_donation_enable_billing_fields',
377 377
 							'type' => 'checkbox',
378 378
 						),
379 379
 						array(
380
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
381
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
380
+							'name'    => __('Offline Donation Instructions', 'give'),
381
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
382 382
 							'id'      => 'global_offline_donation_content',
383 383
 							'default' => give_get_default_offline_donation_content(),
384 384
 							'type'    => 'wysiwyg',
@@ -387,15 +387,15 @@  discard block
 block discarded – undo
387 387
 							),
388 388
 						),
389 389
 						array(
390
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
391
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
390
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
391
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
392 392
 							'id'      => 'offline_donation_subject',
393
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
393
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
394 394
 							'type'    => 'text',
395 395
 						),
396 396
 						array(
397
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
398
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
397
+							'name'    => __('Offline Donation Email Instructions', 'give'),
398
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
399 399
 							'id'      => 'global_offline_donation_email',
400 400
 							'default' => give_get_default_offline_donation_email_content(),
401 401
 							'type'    => 'wysiwyg',
@@ -409,104 +409,104 @@  discard block
 block discarded – undo
409 409
 			/** Display Settings */
410 410
 			'display'     => array(
411 411
 				'id'         => 'display_settings',
412
-				'give_title' => __( 'Display Settings', 'give' ),
413
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
414
-				'fields'     => apply_filters( 'give_settings_display', array(
412
+				'give_title' => __('Display Settings', 'give'),
413
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
414
+				'fields'     => apply_filters('give_settings_display', array(
415 415
 						array(
416
-							'name' => __( 'Display Settings', 'give' ),
416
+							'name' => __('Display Settings', 'give'),
417 417
 							'desc' => '',
418 418
 							'id'   => 'give_title_display_settings_1',
419 419
 							'type' => 'give_title',
420 420
 						),
421 421
 						array(
422
-							'name' => __( 'Disable CSS', 'give' ),
423
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
422
+							'name' => __('Disable CSS', 'give'),
423
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
424 424
 							'id'   => 'disable_css',
425 425
 							'type' => 'checkbox',
426 426
 						),
427 427
 						array(
428
-							'name' => __( 'Enable Floating Labels', 'give' ),
428
+							'name' => __('Enable Floating Labels', 'give'),
429 429
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
430
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
430
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
431 431
 								'a' => array(
432 432
 									'href'   => array(),
433 433
 									'target' => array(),
434 434
 								),
435
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
435
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
436 436
 							'id'   => 'floatlabels',
437 437
 							'type' => 'checkbox',
438 438
 						),
439 439
 						array(
440
-							'name' => __( 'Disable Welcome Screen', 'give' ),
440
+							'name' => __('Disable Welcome Screen', 'give'),
441 441
 							/* translators: %s: about page URL */
442
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array(
442
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array(
443 443
 								'a' => array(
444 444
 									'href'   => array(),
445 445
 									'target' => array(),
446 446
 								),
447
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
447
+							)), esc_url(admin_url('index.php?page=give-about'))),
448 448
 							'id'   => 'disable_welcome',
449 449
 							'type' => 'checkbox',
450 450
 						),
451 451
 						array(
452
-							'name' => __( 'Post Types', 'give' ),
452
+							'name' => __('Post Types', 'give'),
453 453
 							'desc' => '',
454 454
 							'id'   => 'give_title_display_settings_2',
455 455
 							'type' => 'give_title',
456 456
 						),
457 457
 						array(
458
-							'name' => __( 'Disable Form Single Views', 'give' ),
459
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
458
+							'name' => __('Disable Form Single Views', 'give'),
459
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
460 460
 							'id'   => 'disable_forms_singular',
461 461
 							'type' => 'checkbox',
462 462
 						),
463 463
 						array(
464
-							'name' => __( 'Disable Form Archives', 'give' ),
465
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
464
+							'name' => __('Disable Form Archives', 'give'),
465
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
466 466
 							'id'   => 'disable_forms_archives',
467 467
 							'type' => 'checkbox',
468 468
 						),
469 469
 						array(
470
-							'name' => __( 'Disable Form Excerpts', 'give' ),
471
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
470
+							'name' => __('Disable Form Excerpts', 'give'),
471
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
472 472
 							'id'   => 'disable_forms_excerpt',
473 473
 							'type' => 'checkbox',
474 474
 						),
475 475
 						array(
476
-							'name'    => __( 'Featured Image Size', 'give' ),
477
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
476
+							'name'    => __('Featured Image Size', 'give'),
477
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
478 478
 							'id'      => 'featured_image_size',
479 479
 							'type'    => 'select',
480 480
 							'default' => 'large',
481 481
 							'options' => give_get_featured_image_sizes(),
482 482
 						),
483 483
 						array(
484
-							'name' => __( 'Disable Form Featured Image', 'give' ),
485
-							'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
484
+							'name' => __('Disable Form Featured Image', 'give'),
485
+							'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
486 486
 							'id'   => 'disable_form_featured_img',
487 487
 							'type' => 'checkbox',
488 488
 						),
489 489
 						array(
490
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
491
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
490
+							'name' => __('Disable Single Form Sidebar', 'give'),
491
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
492 492
 							'id'   => 'disable_form_sidebar',
493 493
 							'type' => 'checkbox',
494 494
 						),
495 495
 						array(
496
-							'name' => __( 'Taxonomies', 'give' ),
496
+							'name' => __('Taxonomies', 'give'),
497 497
 							'desc' => '',
498 498
 							'id'   => 'give_title_display_settings_3',
499 499
 							'type' => 'give_title',
500 500
 						),
501 501
 						array(
502
-							'name' => __( 'Enable Form Categories', 'give' ),
503
-							'desc' => __( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
502
+							'name' => __('Enable Form Categories', 'give'),
503
+							'desc' => __('Enables the "Category" taxonomy for all Give forms.', 'give'),
504 504
 							'id'   => 'categories',
505 505
 							'type' => 'checkbox',
506 506
 						),
507 507
 						array(
508
-							'name' => __( 'Enable Form Tags', 'give' ),
509
-							'desc' => __( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
508
+							'name' => __('Enable Form Tags', 'give'),
509
+							'desc' => __('Enables the "Tag" taxonomy for all Give forms.', 'give'),
510 510
 							'id'   => 'tags',
511 511
 							'type' => 'checkbox',
512 512
 						),
@@ -519,101 +519,101 @@  discard block
 block discarded – undo
519 519
 			 */
520 520
 			'emails'      => array(
521 521
 				'id'         => 'email_settings',
522
-				'give_title' => __( 'Email Settings', 'give' ),
523
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
524
-				'fields'     => apply_filters( 'give_settings_emails', array(
522
+				'give_title' => __('Email Settings', 'give'),
523
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
524
+				'fields'     => apply_filters('give_settings_emails', array(
525 525
 						array(
526
-							'name' => __( 'Email Settings', 'give' ),
526
+							'name' => __('Email Settings', 'give'),
527 527
 							'desc' => '',
528 528
 							'id'   => 'give_title_email_settings_1',
529 529
 							'type' => 'give_title',
530 530
 						),
531 531
 						array(
532 532
 							'id'      => 'email_template',
533
-							'name'    => __( 'Email Template', 'give' ),
534
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
533
+							'name'    => __('Email Template', 'give'),
534
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
535 535
 							'type'    => 'select',
536 536
 							'options' => give_get_email_templates(),
537 537
 						),
538 538
 						array(
539 539
 							'id'   => 'email_logo',
540
-							'name' => __( 'Logo', 'give' ),
541
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
540
+							'name' => __('Logo', 'give'),
541
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
542 542
 							'type' => 'file',
543 543
 						),
544 544
 						array(
545 545
 							'id'      => 'from_name',
546
-							'name'    => __( 'From Name', 'give' ),
547
-							'desc'    => __( 'The name that appears in the "From" field in donation receipt emails.', 'give' ),
548
-							'default' => get_bloginfo( 'name' ),
546
+							'name'    => __('From Name', 'give'),
547
+							'desc'    => __('The name that appears in the "From" field in donation receipt emails.', 'give'),
548
+							'default' => get_bloginfo('name'),
549 549
 							'type'    => 'text',
550 550
 						),
551 551
 						array(
552 552
 							'id'      => 'from_email',
553
-							'name'    => __( 'From Email', 'give' ),
554
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
555
-							'default' => get_bloginfo( 'admin_email' ),
553
+							'name'    => __('From Email', 'give'),
554
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
555
+							'default' => get_bloginfo('admin_email'),
556 556
 							'type'    => 'text',
557 557
 						),
558 558
 						array(
559
-							'name' => __( 'Donation Receipt', 'give' ),
559
+							'name' => __('Donation Receipt', 'give'),
560 560
 							'desc' => '',
561 561
 							'id'   => 'give_title_email_settings_2',
562 562
 							'type' => 'give_title',
563 563
 						),
564 564
 						array(
565 565
 							'id'      => 'donation_subject',
566
-							'name'    => __( 'Donation Email Subject', 'give' ),
567
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
568
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
566
+							'name'    => __('Donation Email Subject', 'give'),
567
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
568
+							'default' => esc_attr__('Donation Receipt', 'give'),
569 569
 							'type'    => 'text',
570 570
 						),
571 571
 						array(
572 572
 							'id'      => 'donation_receipt',
573
-							'name'    => __( 'Donation Receipt', 'give' ),
573
+							'name'    => __('Donation Receipt', 'give'),
574 574
 							'desc'    => sprintf(
575 575
 							/* translators: %s: emails tags list */
576
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
577
-								'<br/>' . give_get_emails_tags_list()
576
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
577
+								'<br/>'.give_get_emails_tags_list()
578 578
 							),
579 579
 							'type'    => 'wysiwyg',
580 580
 							'default' => give_get_default_donation_receipt_email(),
581 581
 						),
582 582
 						array(
583
-							'name' => __( 'New Donation Notification', 'give' ),
583
+							'name' => __('New Donation Notification', 'give'),
584 584
 							'desc' => '',
585 585
 							'id'   => 'give_title_email_settings_3',
586 586
 							'type' => 'give_title',
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'donation_notification_subject',
590
-							'name'    => __( 'Donation Notification Subject', 'give' ),
591
-							'desc'    => __( 'Enter the subject line for the donation notification email.', 'give' ),
590
+							'name'    => __('Donation Notification Subject', 'give'),
591
+							'desc'    => __('Enter the subject line for the donation notification email.', 'give'),
592 592
 							'type'    => 'text',
593
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
593
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give'),
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'donation_notification',
597
-							'name'    => __( 'Donation Notification', 'give' ),
597
+							'name'    => __('Donation Notification', 'give'),
598 598
 							'desc'    => sprintf(
599 599
 							/* translators: %s: emails tags list */
600
-								__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
601
-								'<br/>' . give_get_emails_tags_list()
600
+								__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
601
+								'<br/>'.give_get_emails_tags_list()
602 602
 							),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_notification_email(),
605 605
 						),
606 606
 						array(
607 607
 							'id'      => 'admin_notice_emails',
608
-							'name'    => __( 'Donation Notification Emails', 'give' ),
609
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
608
+							'name'    => __('Donation Notification Emails', 'give'),
609
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
610 610
 							'type'    => 'textarea',
611
-							'default' => get_bloginfo( 'admin_email' ),
611
+							'default' => get_bloginfo('admin_email'),
612 612
 						),
613 613
 						array(
614 614
 							'id'   => 'disable_admin_notices',
615
-							'name' => __( 'Disable Admin Notifications', 'give' ),
616
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
615
+							'name' => __('Disable Admin Notifications', 'give'),
616
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
617 617
 							'type' => 'checkbox',
618 618
 						),
619 619
 					)
@@ -622,99 +622,99 @@  discard block
 block discarded – undo
622 622
 			/** Extension Settings */
623 623
 			'addons'      => array(
624 624
 				'id'         => 'addons',
625
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
626
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
627
-				'fields'     => apply_filters( 'give_settings_addons', array()
625
+				'give_title' => __('Give Add-ons Settings', 'give'),
626
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
627
+				'fields'     => apply_filters('give_settings_addons', array()
628 628
 				),
629 629
 			),
630 630
 			/** Licenses Settings */
631 631
 			'licenses'    => array(
632 632
 				'id'         => 'licenses',
633
-				'give_title' => __( 'Give Licenses', 'give' ),
634
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
635
-				'fields'     => apply_filters( 'give_settings_licenses', array()
633
+				'give_title' => __('Give Licenses', 'give'),
634
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
635
+				'fields'     => apply_filters('give_settings_licenses', array()
636 636
 				),
637 637
 			),
638 638
 			/** Advanced Options */
639 639
 			'advanced'    => array(
640 640
 				'id'         => 'advanced_options',
641
-				'give_title' => __( 'Advanced Options', 'give' ),
642
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
643
-				'fields'     => apply_filters( 'give_settings_advanced', array(
641
+				'give_title' => __('Advanced Options', 'give'),
642
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
643
+				'fields'     => apply_filters('give_settings_advanced', array(
644 644
 						array(
645
-							'name' => __( 'Access Control', 'give' ),
645
+							'name' => __('Access Control', 'give'),
646 646
 							'desc' => '',
647 647
 							'id'   => 'give_title_session_control_1',
648 648
 							'type' => 'give_title',
649 649
 						),
650 650
 						array(
651 651
 							'id'      => 'session_lifetime',
652
-							'name'    => __( 'Session Lifetime', 'give' ),
653
-							'desc'    => __( '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' ),
652
+							'name'    => __('Session Lifetime', 'give'),
653
+							'desc'    => __('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'),
654 654
 							'type'    => 'select',
655 655
 							'options' => array(
656
-								'86400'  => __( '24 Hours', 'give' ),
657
-								'172800' => __( '48 Hours', 'give' ),
658
-								'259200' => __( '72 Hours', 'give' ),
659
-								'604800' => __( '1 Week', 'give' ),
656
+								'86400'  => __('24 Hours', 'give'),
657
+								'172800' => __('48 Hours', 'give'),
658
+								'259200' => __('72 Hours', 'give'),
659
+								'604800' => __('1 Week', 'give'),
660 660
 							),
661 661
 						),
662 662
 						array(
663
-							'name' => __( 'Email Access', 'give' ),
664
-							'desc' => __( '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' ),
663
+							'name' => __('Email Access', 'give'),
664
+							'desc' => __('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'),
665 665
 							'id'   => 'email_access',
666 666
 							'type' => 'checkbox',
667 667
 						),
668 668
 						array(
669 669
 							'id'      => 'recaptcha_key',
670
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
670
+							'name'    => __('reCAPTCHA Site Key', 'give'),
671 671
 							/* translators: %s: https://www.google.com/recaptcha/ */
672
-							'desc'    => sprintf( __( '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( 'https://www.google.com/recaptcha/' ) ),
672
+							'desc'    => sprintf(__('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('https://www.google.com/recaptcha/')),
673 673
 							'default' => '',
674 674
 							'type'    => 'text',
675 675
 						),
676 676
 						array(
677 677
 							'id'      => 'recaptcha_secret',
678
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
679
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
678
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
679
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
680 680
 							'default' => '',
681 681
 							'type'    => 'text',
682 682
 						),
683 683
 						array(
684
-							'name' => __( 'Data Control', 'give' ),
684
+							'name' => __('Data Control', 'give'),
685 685
 							'desc' => '',
686 686
 							'id'   => 'give_title_data_control_2',
687 687
 							'type' => 'give_title',
688 688
 						),
689 689
 						array(
690
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
691
-							'desc' => __( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
690
+							'name' => __('Remove All Data on Uninstall?', 'give'),
691
+							'desc' => __('When the plugin is deleted, completely remove all Give data.', 'give'),
692 692
 							'id'   => 'uninstall_on_delete',
693 693
 							'type' => 'checkbox',
694 694
 						),
695 695
 						array(
696
-							'name' => __( 'Filter Control', 'give' ),
696
+							'name' => __('Filter Control', 'give'),
697 697
 							'desc' => '',
698 698
 							'id'   => 'give_title_filter_control',
699 699
 							'type' => 'give_title',
700 700
 						),
701 701
 						array(
702 702
 							/* translators: %s: the_content */
703
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
703
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
704 704
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
705
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
705
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
706 706
 							'id'   => 'disable_the_content_filter',
707 707
 							'type' => 'checkbox',
708 708
 						),
709 709
 						array(
710
-							'name' => __( 'Script Loading', 'give' ),
710
+							'name' => __('Script Loading', 'give'),
711 711
 							'desc' => '',
712 712
 							'id'   => 'give_title_script_control',
713 713
 							'type' => 'give_title',
714 714
 						),
715 715
 						array(
716
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
717
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
716
+							'name' => __('Load Scripts in Footer?', 'give'),
717
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
718 718
 							'id'   => 'scripts_footer',
719 719
 							'type' => 'checkbox',
720 720
 						),
@@ -724,13 +724,13 @@  discard block
 block discarded – undo
724 724
 			/** API Settings */
725 725
 			'api'         => array(
726 726
 				'id'         => 'api',
727
-				'give_title' => __( 'API', 'give' ),
728
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
727
+				'give_title' => __('API', 'give'),
728
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
729 729
 				'show_names' => false, // Hide field names on the left
730
-				'fields'     => apply_filters( 'give_settings_system', array(
730
+				'fields'     => apply_filters('give_settings_system', array(
731 731
 						array(
732 732
 							'id'   => 'api',
733
-							'name' => __( 'API', 'give' ),
733
+							'name' => __('API', 'give'),
734 734
 							'type' => 'api',
735 735
 						),
736 736
 					)
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 			/** Licenses Settings */
740 740
 			'system_info' => array(
741 741
 				'id'         => 'system_info',
742
-				'give_title' => __( 'System Info', 'give' ),
743
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
744
-				'fields'     => apply_filters( 'give_settings_system', array(
742
+				'give_title' => __('System Info', 'give'),
743
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
744
+				'fields'     => apply_filters('give_settings_system', array(
745 745
 						array(
746 746
 							'id'   => 'system-info-textarea',
747
-							'name' => __( 'System Info', 'give' ),
748
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
747
+							'name' => __('System Info', 'give'),
748
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
749 749
 							'type' => 'system_info',
750 750
 						),
751 751
 					)
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 			),
754 754
 		);
755 755
 
756
-		$give_settings = apply_filters( 'give_registered_settings', $give_settings );
756
+		$give_settings = apply_filters('give_registered_settings', $give_settings);
757 757
 
758 758
 		// Return all settings array if no active tab
759
-		if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) {
759
+		if (empty($active_tab) || ! isset($give_settings[$active_tab])) {
760 760
 			return $give_settings;
761 761
 		}
762 762
 
763 763
 		// Add other tabs and settings fields as needed
764
-		return $give_settings[ $active_tab ];
764
+		return $give_settings[$active_tab];
765 765
 
766 766
 	}
767 767
 
@@ -770,11 +770,11 @@  discard block
 block discarded – undo
770 770
 	 */
771 771
 	public function settings_notices() {
772 772
 
773
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
773
+		if ( ! isset($_POST['give_settings_saved'])) {
774 774
 			return;
775 775
 		}
776 776
 
777
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
777
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
778 778
 
779 779
 	}
780 780
 
@@ -789,14 +789,14 @@  discard block
 block discarded – undo
789 789
 	 * @return mixed         Field value or exception is thrown.
790 790
 	 * @throws Exception     Throws an exception if the field is invalid.
791 791
 	 */
792
-	public function __get( $field ) {
792
+	public function __get($field) {
793 793
 
794 794
 		// Allowed fields to retrieve
795
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
795
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
796 796
 			return $this->{$field};
797 797
 		}
798 798
 
799
-		throw new Exception( sprintf( __( 'Invalid property: %s', 'give' ), $field ) );
799
+		throw new Exception(sprintf(__('Invalid property: %s', 'give'), $field));
800 800
 	}
801 801
 
802 802
 
@@ -815,12 +815,12 @@  discard block
 block discarded – undo
815 815
  *
816 816
  * @return mixed        Option value
817 817
  */
818
-function give_get_option( $key = '', $default = false ) {
818
+function give_get_option($key = '', $default = false) {
819 819
 	$give_options = give_get_settings();
820
-	$value        = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
821
-	$value        = apply_filters( 'give_get_option', $value, $key, $default );
820
+	$value        = ! empty($give_options[$key]) ? $give_options[$key] : $default;
821
+	$value        = apply_filters('give_get_option', $value, $key, $default);
822 822
 
823
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
823
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
824 824
 }
825 825
 
826 826
 
@@ -838,33 +838,33 @@  discard block
 block discarded – undo
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
841
-function give_update_option( $key = '', $value = false ) {
841
+function give_update_option($key = '', $value = false) {
842 842
 
843 843
 	// If no key, exit
844
-	if ( empty( $key ) ) {
844
+	if (empty($key)) {
845 845
 		return false;
846 846
 	}
847 847
 
848
-	if ( empty( $value ) ) {
849
-		$remove_option = give_delete_option( $key );
848
+	if (empty($value)) {
849
+		$remove_option = give_delete_option($key);
850 850
 
851 851
 		return $remove_option;
852 852
 	}
853 853
 
854 854
 	// First let's grab the current settings
855
-	$options = get_option( 'give_settings' );
855
+	$options = get_option('give_settings');
856 856
 
857 857
 	// Let's let devs alter that value coming in
858
-	$value = apply_filters( 'give_update_option', $value, $key );
858
+	$value = apply_filters('give_update_option', $value, $key);
859 859
 
860 860
 	// Next let's try to update the value
861
-	$options[ $key ] = $value;
862
-	$did_update      = update_option( 'give_settings', $options );
861
+	$options[$key] = $value;
862
+	$did_update      = update_option('give_settings', $options);
863 863
 
864 864
 	// If it updated, let's update the global variable
865
-	if ( $did_update ) {
865
+	if ($did_update) {
866 866
 		global $give_options;
867
-		$give_options[ $key ] = $value;
867
+		$give_options[$key] = $value;
868 868
 	}
869 869
 
870 870
 	return $did_update;
@@ -883,25 +883,25 @@  discard block
 block discarded – undo
883 883
  *
884 884
  * @return boolean True if updated, false if not.
885 885
  */
886
-function give_delete_option( $key = '' ) {
886
+function give_delete_option($key = '') {
887 887
 
888 888
 	// If no key, exit
889
-	if ( empty( $key ) ) {
889
+	if (empty($key)) {
890 890
 		return false;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Next let's try to update the value
897
-	if ( isset( $options[ $key ] ) ) {
898
-		unset( $options[ $key ] );
897
+	if (isset($options[$key])) {
898
+		unset($options[$key]);
899 899
 	}
900 900
 
901
-	$did_update = update_option( 'give_settings', $options );
901
+	$did_update = update_option('give_settings', $options);
902 902
 
903 903
 	// If it updated, let's update the global variable
904
-	if ( $did_update ) {
904
+	if ($did_update) {
905 905
 		global $give_options;
906 906
 		$give_options = $options;
907 907
 	}
@@ -920,9 +920,9 @@  discard block
 block discarded – undo
920 920
  */
921 921
 function give_get_settings() {
922 922
 
923
-	$settings = get_option( 'give_settings' );
923
+	$settings = get_option('give_settings');
924 924
 
925
-	return (array) apply_filters( 'give_get_settings', $settings );
925
+	return (array) apply_filters('give_get_settings', $settings);
926 926
 
927 927
 }
928 928
 
@@ -940,25 +940,25 @@  discard block
 block discarded – undo
940 940
  *
941 941
  * @return array
942 942
  */
943
-function give_settings_array_insert( $array, $position, $insert ) {
944
-	if ( is_int( $position ) ) {
945
-		array_splice( $array, $position, 0, $insert );
943
+function give_settings_array_insert($array, $position, $insert) {
944
+	if (is_int($position)) {
945
+		array_splice($array, $position, 0, $insert);
946 946
 	} else {
947 947
 
948
-		foreach ( $array as $index => $subarray ) {
949
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
948
+		foreach ($array as $index => $subarray) {
949
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
950 950
 				$pos = $index;
951 951
 			}
952 952
 		}
953 953
 
954
-		if ( ! isset( $pos ) ) {
954
+		if ( ! isset($pos)) {
955 955
 			return $array;
956 956
 		}
957 957
 
958 958
 		$array = array_merge(
959
-			array_slice( $array, 0, $pos ),
959
+			array_slice($array, 0, $pos),
960 960
 			$insert,
961
-			array_slice( $array, $pos )
961
+			array_slice($array, $pos)
962 962
 		);
963 963
 	}
964 964
 
@@ -978,23 +978,23 @@  discard block
 block discarded – undo
978 978
  *
979 979
  * @return void
980 980
  */
981
-function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) {
981
+function give_enabled_gateways_callback($field_arr, $saved_values = array()) {
982 982
 
983 983
 	$id       = $field_arr['id'];
984
-	$gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() );
984
+	$gateways = give_get_ordered_payment_gateways(give_get_payment_gateways());
985 985
 
986 986
 	echo '<ul class="give-checklist-fields give-payment-gatways-list">';
987 987
 
988
-	foreach ( $gateways as $key => $option ) :
988
+	foreach ($gateways as $key => $option) :
989 989
 
990
-		if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) {
990
+		if (is_array($saved_values) && array_key_exists($key, $saved_values)) {
991 991
 			$enabled = '1';
992 992
 		} else {
993 993
 			$enabled = null;
994 994
 		}
995 995
 
996
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
997
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
996
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
997
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
998 998
 
999 999
 	endforeach;
1000 1000
 
@@ -1013,16 +1013,16 @@  discard block
 block discarded – undo
1013 1013
  *
1014 1014
  * @return void
1015 1015
  */
1016
-function give_default_gateway_callback( $field_arr, $saved_value ) {
1016
+function give_default_gateway_callback($field_arr, $saved_value) {
1017 1017
 	$id          = $field_arr['id'];
1018 1018
 	$gateways    = give_get_enabled_payment_gateways();
1019
-	$saved_value = give_get_default_gateway( null );
1019
+	$saved_value = give_get_default_gateway(null);
1020 1020
 
1021
-	echo '<select class="give-select" name="' . $id . '" id="' . $id . '">';
1021
+	echo '<select class="give-select" name="'.$id.'" id="'.$id.'">';
1022 1022
 
1023
-	foreach ( $gateways as $key => $option ) :
1024
-		$selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : '';
1025
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1023
+	foreach ($gateways as $key => $option) :
1024
+		$selected = isset($saved_value) ? selected($key, $saved_value, false) : '';
1025
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1026 1026
 	endforeach;
1027 1027
 
1028 1028
 	echo '</select>';
@@ -1040,13 +1040,13 @@  discard block
 block discarded – undo
1040 1040
  *
1041 1041
  * @return void
1042 1042
  */
1043
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1043
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1044 1044
 
1045 1045
 	$id                = $field_type_object->field->args['id'];
1046 1046
 	$title             = $field_type_object->field->args['name'];
1047 1047
 	$field_description = $field_type_object->field->args['desc'];
1048 1048
 
1049
-	echo '<hr>' . $field_description;
1049
+	echo '<hr>'.$field_description;
1050 1050
 
1051 1051
 }
1052 1052
 
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
  *
1062 1062
  * @return void
1063 1063
  */
1064
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1064
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1065 1065
 
1066 1066
 	$id                = $field_type_object->field->args['id'];
1067 1067
 	$title             = $field_type_object->field->args['name'];
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1081 1081
  * @return array An array of options that matches the CMB2 options array
1082 1082
  */
1083
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1083
+function give_cmb2_get_post_options($query_args, $force = false) {
1084 1084
 
1085
-	$post_options = array( '' => '' ); // Blank option
1085
+	$post_options = array('' => ''); // Blank option
1086 1086
 
1087
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1087
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1088 1088
 		return $post_options;
1089 1089
 	}
1090 1090
 
1091
-	$args = wp_parse_args( $query_args, array(
1091
+	$args = wp_parse_args($query_args, array(
1092 1092
 		'post_type'   => 'page',
1093 1093
 		'numberposts' => 10,
1094
-	) );
1094
+	));
1095 1095
 
1096
-	$posts = get_posts( $args );
1096
+	$posts = get_posts($args);
1097 1097
 
1098
-	if ( $posts ) {
1099
-		foreach ( $posts as $post ) {
1098
+	if ($posts) {
1099
+		foreach ($posts as $post) {
1100 1100
 
1101
-			$post_options[ $post->ID ] = $post->post_title;
1101
+			$post_options[$post->ID] = $post->post_title;
1102 1102
 
1103 1103
 		}
1104 1104
 	}
@@ -1123,33 +1123,33 @@  discard block
 block discarded – undo
1123 1123
 
1124 1124
 	$sizes            = array();
1125 1125
 	$get_sizes        = get_intermediate_image_sizes();
1126
-	$core_image_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1126
+	$core_image_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1127 1127
 
1128 1128
 
1129 1129
 	// This will help us to filter special characters from a string
1130
-	$filter_slug_items = array( '_', '-' );
1130
+	$filter_slug_items = array('_', '-');
1131 1131
 
1132
-	foreach ( $get_sizes as $_size ) {
1132
+	foreach ($get_sizes as $_size) {
1133 1133
 
1134 1134
 		// Converting image size slug to title case
1135
-		$sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items );
1135
+		$sizes[$_size] = give_slug_to_title($_size, $filter_slug_items);
1136 1136
 
1137
-		if ( in_array( $_size, $core_image_sizes ) ) {
1138
-			$sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1139
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1140
-			$sizes[ $_size ] .= " ({$_wp_additional_image_sizes[ $_size ]['width']} x {$_wp_additional_image_sizes[ $_size ]['height']}";
1137
+		if (in_array($_size, $core_image_sizes)) {
1138
+			$sizes[$_size] .= ' ('.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1139
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1140
+			$sizes[$_size] .= " ({$_wp_additional_image_sizes[$_size]['width']} x {$_wp_additional_image_sizes[$_size]['height']}";
1141 1141
 		}
1142 1142
 
1143 1143
 		// Based on the above image height check, label the respective resolution as responsive
1144
-		if ( ( array_key_exists( $_size, $_wp_additional_image_sizes ) && ! $_wp_additional_image_sizes[ $_size ]['crop'] ) || ( in_array( $_size, $core_image_sizes ) && ! get_option( "{$_size}_crop" ) ) ) {
1145
-			$sizes[ $_size ] .= ' - responsive';
1144
+		if ((array_key_exists($_size, $_wp_additional_image_sizes) && ! $_wp_additional_image_sizes[$_size]['crop']) || (in_array($_size, $core_image_sizes) && ! get_option("{$_size}_crop"))) {
1145
+			$sizes[$_size] .= ' - responsive';
1146 1146
 		}
1147 1147
 
1148
-		$sizes[ $_size ] .= ')';
1148
+		$sizes[$_size] .= ')';
1149 1149
 
1150 1150
 	}
1151 1151
 
1152
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1152
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1153 1153
 }
1154 1154
 
1155 1155
 
@@ -1165,14 +1165,14 @@  discard block
 block discarded – undo
1165 1165
  *
1166 1166
  * @return text $string
1167 1167
  */
1168
-function give_slug_to_title( $string, $filters = array() ) {
1168
+function give_slug_to_title($string, $filters = array()) {
1169 1169
 
1170
-	foreach ( $filters as $filter_item ) {
1171
-		$string = str_replace( $filter_item, ' ', $string );
1170
+	foreach ($filters as $filter_item) {
1171
+		$string = str_replace($filter_item, ' ', $string);
1172 1172
 	}
1173 1173
 
1174 1174
 	// Return updated string after converting it to title case
1175
-	return ucwords( $string );
1175
+	return ucwords($string);
1176 1176
 
1177 1177
 }
1178 1178
 
@@ -1188,18 +1188,18 @@  discard block
 block discarded – undo
1188 1188
  *
1189 1189
  * @return void
1190 1190
  */
1191
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1191
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1192 1192
 	/* @var CMB2_Types $field_type_object */
1193 1193
 
1194 1194
 	$id                 = $field_type_object->field->args['id'];
1195 1195
 	$field_description  = $field_type_object->field->args['desc'];
1196 1196
 	$license            = $field_type_object->field->args['options']['license'];
1197 1197
 	$license_key        = $escaped_value;
1198
-	$is_license_key     = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1199
-	$is_valid_license   = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1198
+	$is_license_key     = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1199
+	$is_valid_license   = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1200 1200
 	$shortname          = $field_type_object->field->args['options']['shortname'];
1201 1201
 	$field_classes      = 'regular-text give-license-field';
1202
-	$type               = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1202
+	$type               = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1203 1203
 	$custom_html        = '';
1204 1204
 	$messages           = array();
1205 1205
 	$class              = '';
@@ -1211,83 +1211,83 @@  discard block
 block discarded – undo
1211 1211
 
1212 1212
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1213 1213
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1214
-	if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1214
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1215 1215
 		$is_license_key = false;
1216 1216
 	}
1217 1217
 
1218 1218
 	// Check if current license is part of subscription or not.
1219
-	$subscriptions = get_option( 'give_subscriptions' );
1219
+	$subscriptions = get_option('give_subscriptions');
1220 1220
 
1221
-	if ( $is_license_key && $subscriptions ) {
1222
-		foreach ( $subscriptions as $subscription ) {
1223
-			if ( in_array( $license_key, $subscription['licenses'] ) ) {
1221
+	if ($is_license_key && $subscriptions) {
1222
+		foreach ($subscriptions as $subscription) {
1223
+			if (in_array($license_key, $subscription['licenses'])) {
1224 1224
 				$is_in_subscription = $subscription['id'];
1225 1225
 				break;
1226 1226
 			}
1227 1227
 		}
1228 1228
 	}
1229 1229
 
1230
-	if ( $is_license_key ) {
1230
+	if ($is_license_key) {
1231 1231
 
1232
-		if ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1232
+		if (empty($license->success) && property_exists($license, 'error')) {
1233 1233
 
1234 1234
 			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1235
-			switch ( $license->error ) {
1235
+			switch ($license->error) {
1236 1236
 				case 'expired' :
1237 1237
 					$class          = $license->error;
1238 1238
 					$messages[]     = sprintf(
1239
-						__( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1240
-						date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1241
-						$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1239
+						__('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'),
1240
+						date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1241
+						$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1242 1242
 					);
1243
-					$license_status = 'license-' . $class;
1243
+					$license_status = 'license-'.$class;
1244 1244
 					break;
1245 1245
 
1246 1246
 				case 'missing' :
1247 1247
 					$class          = $license->error;
1248 1248
 					$messages[]     = sprintf(
1249
-						__( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1250
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1249
+						__('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'),
1250
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1251 1251
 					);
1252
-					$license_status = 'license-' . $class;
1252
+					$license_status = 'license-'.$class;
1253 1253
 					break;
1254 1254
 
1255 1255
 				case 'invalid' :
1256 1256
 					$class          = $license->error;
1257 1257
 					$messages[]     = sprintf(
1258
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1258
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1259 1259
 						$addon_name,
1260
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1260
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1261 1261
 					);
1262
-					$license_status = 'license-' . $class;
1262
+					$license_status = 'license-'.$class;
1263 1263
 					break;
1264 1264
 
1265 1265
 				case 'site_inactive' :
1266 1266
 					$class          = $license->error;
1267 1267
 					$messages[]     = sprintf(
1268
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1268
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1269 1269
 						$addon_name,
1270
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1270
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1271 1271
 					);
1272
-					$license_status = 'license-' . $class;
1272
+					$license_status = 'license-'.$class;
1273 1273
 					break;
1274 1274
 
1275 1275
 				case 'item_name_mismatch' :
1276 1276
 					$class          = $license->error;
1277
-					$messages[]     = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name );
1278
-					$license_status = 'license-' . $class;
1277
+					$messages[]     = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name);
1278
+					$license_status = 'license-'.$class;
1279 1279
 					break;
1280 1280
 
1281 1281
 				case 'no_activations_left':
1282 1282
 					$class          = $license->error;
1283
-					$messages[]     = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1284
-					$license_status = 'license-' . $class;
1283
+					$messages[]     = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1284
+					$license_status = 'license-'.$class;
1285 1285
 					break;
1286 1286
 
1287 1287
 				default:
1288 1288
 					$class          = $license->error;
1289 1289
 					$messages[]     = sprintf(
1290
-						__( 'Your license is not activated. Please <a href="%3$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs. %2$sError Code: %1$s.', 'give' ),
1290
+						__('Your license is not activated. Please <a href="%3$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs. %2$sError Code: %1$s.', 'give'),
1291 1291
 						$license->error,
1292 1292
 						'<br/>',
1293 1293
 						"{$account_page_link}?utm_campaign=admin&utm_source=licenses&utm_medium={$license->error}"
@@ -1296,74 +1296,74 @@  discard block
 block discarded – undo
1296 1296
 					break;
1297 1297
 			}
1298 1298
 
1299
-		} elseif ( $is_in_subscription ) {
1299
+		} elseif ($is_in_subscription) {
1300 1300
 
1301
-			$subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] );
1302
-			$subscription_status  = __( 'renew', 'give' );
1301
+			$subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1302
+			$subscription_status  = __('renew', 'give');
1303 1303
 
1304
-			if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) {
1305
-				$subscription_status = __( 'expire', 'give' );
1304
+			if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1305
+				$subscription_status = __('expire', 'give');
1306 1306
 			}
1307 1307
 
1308
-			if ( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1309
-				$messages[]     = sprintf(
1310
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1311
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1312
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1313
-					$checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1308
+			if ($subscription_expires < current_time('timestamp', 1)) {
1309
+				$messages[] = sprintf(
1310
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1311
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1312
+					$subscriptions[$is_in_subscription]['payment_id'],
1313
+					$checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1314 1314
 				);
1315 1315
 				$license_status = 'license-expired';
1316
-			} elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1316
+			} elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1317 1317
 				$messages[]     = sprintf(
1318
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ),
1319
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1320
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1318
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'),
1319
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1320
+					$subscriptions[$is_in_subscription]['payment_id'],
1321 1321
 					$subscription_status,
1322
-					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) )
1322
+					human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1323 1323
 				);
1324 1324
 				$license_status = 'license-expires-soon';
1325 1325
 			} else {
1326 1326
 				$messages[]     = sprintf(
1327
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ),
1328
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1329
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1327
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'),
1328
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1329
+					$subscriptions[$is_in_subscription]['payment_id'],
1330 1330
 					$subscription_status,
1331
-					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) )
1331
+					date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1332 1332
 				);
1333 1333
 				$license_status = 'license-expiration-date';
1334 1334
 			}
1335 1335
 
1336
-		} elseif ( empty( $license->success ) ) {
1336
+		} elseif (empty($license->success)) {
1337 1337
 			$class          = 'invalid';
1338 1338
 			$messages[]     = sprintf(
1339
-				__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1339
+				__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1340 1340
 				$addon_name,
1341
-				$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1341
+				$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1342 1342
 			);
1343
-			$license_status = 'license-' . $class;
1343
+			$license_status = 'license-'.$class;
1344 1344
 
1345 1345
 		} else {
1346
-			switch ( $license->license ) {
1346
+			switch ($license->license) {
1347 1347
 				case 'valid' :
1348 1348
 				default:
1349 1349
 					$class      = 'valid';
1350
-					$now        = current_time( 'timestamp' );
1351
-					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1350
+					$now        = current_time('timestamp');
1351
+					$expiration = strtotime($license->expires, current_time('timestamp'));
1352 1352
 
1353
-					if ( 'lifetime' === $license->expires ) {
1354
-						$messages[]     = __( 'License key never expires.', 'give' );
1353
+					if ('lifetime' === $license->expires) {
1354
+						$messages[]     = __('License key never expires.', 'give');
1355 1355
 						$license_status = 'license-lifetime-notice';
1356
-					} elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1356
+					} elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1357 1357
 						$messages[]     = sprintf(
1358
-							__( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1359
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1360
-							$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1358
+							__('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1359
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1360
+							$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1361 1361
 						);
1362 1362
 						$license_status = 'license-expires-soon';
1363 1363
 					} else {
1364 1364
 						$messages[]     = sprintf(
1365
-							__( 'Your license key expires on %s.', 'give' ),
1366
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1365
+							__('Your license key expires on %s.', 'give'),
1366
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1367 1367
 						);
1368 1368
 						$license_status = 'license-expiration-date';
1369 1369
 					}
@@ -1371,15 +1371,15 @@  discard block
 block discarded – undo
1371 1371
 			}
1372 1372
 		}
1373 1373
 	} else {
1374
-		$messages[]     = sprintf(
1375
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1374
+		$messages[] = sprintf(
1375
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1376 1376
 			$addon_name
1377 1377
 		);
1378 1378
 		$license_status = 'inactive';
1379 1379
 	}
1380 1380
 
1381 1381
 	// Add class for input field if license is active.
1382
-	if ( $is_valid_license ) {
1382
+	if ($is_valid_license) {
1383 1383
 		$field_classes .= ' give-license-active';
1384 1384
 	}
1385 1385
 
@@ -1387,33 +1387,33 @@  discard block
 block discarded – undo
1387 1387
 	$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">";
1388 1388
 
1389 1389
 	// If license is active so show deactivate button.
1390
-	if ( $is_valid_license ) {
1390
+	if ($is_valid_license) {
1391 1391
 		// Get input field html.
1392 1392
 		$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">";
1393 1393
 
1394
-		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1394
+		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1395 1395
 
1396 1396
 	}
1397 1397
 
1398 1398
 	// Field description.
1399
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1399
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1400 1400
 
1401 1401
 	// If no messages found then inform user that to get updated in future register yourself.
1402
-	if ( empty( $messages ) ) {
1403
-		$messages[] = apply_filters( "{$shortname}_default_addon_notice", __( 'To receive updates, please enter your valid license key.', 'give' ) );
1402
+	if (empty($messages)) {
1403
+		$messages[] = apply_filters("{$shortname}_default_addon_notice", __('To receive updates, please enter your valid license key.', 'give'));
1404 1404
 	}
1405 1405
 
1406
-	foreach ( $messages as $message ) {
1407
-		$custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">';
1408
-		$custom_html .= '<p>' . $message . '</p>';
1406
+	foreach ($messages as $message) {
1407
+		$custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">';
1408
+		$custom_html .= '<p>'.$message.'</p>';
1409 1409
 		$custom_html .= '</div>';
1410 1410
 	}
1411 1411
 
1412 1412
 	// Field html.
1413
-	$custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object );
1413
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1414 1414
 
1415 1415
 	// Nonce.
1416
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1416
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1417 1417
 
1418 1418
 	// Print field html.
1419 1419
 	echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>";
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
  */
1429 1429
 function give_api_callback() {
1430 1430
 
1431
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1431
+	if ( ! current_user_can('manage_give_settings')) {
1432 1432
 		return;
1433 1433
 	}
1434 1434
 
@@ -1437,9 +1437,9 @@  discard block
 block discarded – undo
1437 1437
 	 *
1438 1438
 	 * @since 1.0
1439 1439
 	 */
1440
-	do_action( 'give_tools_api_keys_before' );
1440
+	do_action('give_tools_api_keys_before');
1441 1441
 
1442
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1442
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1443 1443
 
1444 1444
 	$api_keys_table = new Give_API_Keys_Table();
1445 1445
 	$api_keys_table->prepare_items();
@@ -1448,9 +1448,9 @@  discard block
 block discarded – undo
1448 1448
 	<span class="cmb2-metabox-description api-description">
1449 1449
 		<?php echo sprintf(
1450 1450
 		/* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */
1451
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1452
-			esc_url( 'http://docs.givewp.com/api' ),
1453
-			esc_url( 'http://docs.givewp.com/addon-zapier' )
1451
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1452
+			esc_url('http://docs.givewp.com/api'),
1453
+			esc_url('http://docs.givewp.com/addon-zapier')
1454 1454
 		); ?>
1455 1455
 	</span>
1456 1456
 	<?php
@@ -1460,10 +1460,10 @@  discard block
 block discarded – undo
1460 1460
 	 *
1461 1461
 	 * @since 1.0
1462 1462
 	 */
1463
-	do_action( 'give_tools_api_keys_after' );
1463
+	do_action('give_tools_api_keys_after');
1464 1464
 }
1465 1465
 
1466
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1466
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1467 1467
 
1468 1468
 /**
1469 1469
  * Hook Callback
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
  *
1477 1477
  * @return void
1478 1478
  */
1479
-function give_hook_callback( $args ) {
1479
+function give_hook_callback($args) {
1480 1480
 
1481 1481
 	$id = $args['id'];
1482 1482
 
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 	 *
1486 1486
 	 * @since 1.0
1487 1487
 	 */
1488
-	do_action( "give_{$id}" );
1488
+	do_action("give_{$id}");
1489 1489
 
1490 1490
 }
1491 1491
 
@@ -1500,19 +1500,19 @@  discard block
 block discarded – undo
1500 1500
  *
1501 1501
  * @return bool
1502 1502
  */
1503
-function give_is_setting_enabled( $value, $compare_with = null ) {
1504
-	if ( ! is_null( $compare_with ) ) {
1503
+function give_is_setting_enabled($value, $compare_with = null) {
1504
+	if ( ! is_null($compare_with)) {
1505 1505
 
1506
-		if ( is_array( $compare_with ) ) {
1506
+		if (is_array($compare_with)) {
1507 1507
 			// Output.
1508
-			return in_array( $value, $compare_with );
1508
+			return in_array($value, $compare_with);
1509 1509
 		}
1510 1510
 
1511 1511
 		// Output.
1512
-		return ( $value === $compare_with );
1512
+		return ($value === $compare_with);
1513 1513
 	}
1514 1514
 
1515 1515
 	// Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled
1516 1516
 	// Output.
1517
-	return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false );
1517
+	return (in_array($value, array('enabled', 'on', 'yes')) ? true : false);
1518 1518
 }
1519 1519
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 	/**
491 491
 	 * Get donor email html.
492 492
 	 *
493
-	 * @param object $payment Contains all the data of the payment.
493
+	 * @param Give_Payment $payment Contains all the data of the payment.
494 494
 	 *
495 495
 	 * @access public
496 496
 	 * @since  1.0
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	/**
514 514
 	 * Get Row Actions
515 515
 	 *
516
-	 * @param object $payment Payment Data.
516
+	 * @param Give_Payment $payment Payment Data.
517 517
 	 *
518 518
 	 * @since 1.6
519 519
 	 *
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 	/**
566 566
 	 *  Get payment status html.
567 567
 	 *
568
-	 * @param object $payment Contains all the data of the payment.
568
+	 * @param Give_Payment $payment Contains all the data of the payment.
569 569
 	 *
570 570
 	 * @access public
571 571
 	 * @since  1.0
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	/**
616 616
 	 * Get donor html.
617 617
 	 *
618
-	 * @param object $payment Contains all the data of the payment.
618
+	 * @param Give_Payment $payment Contains all the data of the payment.
619 619
 	 *
620 620
 	 * @access public
621 621
 	 * @since  1.0
Please login to merge, or discard this patch.
Spacing   +200 added lines, -200 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  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
 
17 17
 // Load WP_List_Table if not loaded.
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 		// Set parent defaults.
137 137
 		parent::__construct(
138 138
 			array(
139
-				'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
140
-				'plural'   => give_get_forms_label_plural(),      // Plural name of the listed records.
141
-				'ajax'     => false,                              // Does this table support ajax?
139
+				'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
140
+				'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
141
+				'ajax'     => false, // Does this table support ajax?
142 142
 			)
143 143
 		);
144 144
 
145 145
 		$this->process_bulk_action();
146 146
 		$this->get_payment_counts();
147
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
147
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
148 148
 	}
149 149
 
150 150
 	/**
@@ -153,31 +153,31 @@  discard block
 block discarded – undo
153 153
 	 * @return void
154 154
 	 */
155 155
 	public function advanced_filters() {
156
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
157
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
158
-		$status     = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : '';
159
-		$donor      = isset( $_GET['donor'] ) ? sanitize_text_field( $_GET['donor'] ) : '';
160
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : '';
161
-		$form_id    = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0;
156
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
157
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
158
+		$status     = isset($_GET['status']) ? sanitize_text_field($_GET['status']) : '';
159
+		$donor      = isset($_GET['donor']) ? sanitize_text_field($_GET['donor']) : '';
160
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : '';
161
+		$form_id    = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : 0;
162 162
 		?>
163 163
 		<div id="give-payment-filters" class="give-filters">
164
-			<?php $this->search_box( __( 'Search', 'give' ), 'give-payments' ); ?>
164
+			<?php $this->search_box(__('Search', 'give'), 'give-payments'); ?>
165 165
 			<div id="give-payment-date-filters">
166 166
 				<div class="give-filter give-filter-half">
167 167
 					<label for="start-date"
168
-						   class="give-start-date-label"><?php _e( 'Start Date', 'give' ); ?></label>
168
+						   class="give-start-date-label"><?php _e('Start Date', 'give'); ?></label>
169 169
 					<input type="text" id="start-date" name="start-date" class="give_datepicker"
170 170
 						   value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy" />
171 171
 				</div>
172 172
 				<div class="give-filter give-filter-half">
173
-					<label for="end-date" class="give-end-date-label"><?php _e( 'End Date', 'give' ); ?></label>
173
+					<label for="end-date" class="give-end-date-label"><?php _e('End Date', 'give'); ?></label>
174 174
 					<input type="text" id="end-date" name="end-date" class="give_datepicker"
175 175
 						   value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy" />
176 176
 				</div>
177 177
 			</div>
178 178
 			<div id="give-payment-form-filter" class="give-filter">
179 179
 				<label for="give-donation-forms-filter"
180
-					   class="give-donation-forms-filter-label"><?php _e( 'Form', 'give' ); ?></label>
180
+					   class="give-donation-forms-filter-label"><?php _e('Form', 'give'); ?></label>
181 181
 				<?php
182 182
 				// Filter Donations by Donation Forms.
183 183
 				echo Give()->html->forms_dropdown(
@@ -187,24 +187,24 @@  discard block
 block discarded – undo
187 187
 						'class'    => 'give-donation-forms-filter',
188 188
 						'selected' => $form_id, // Make sure to have $form_id set to 0, if there is no selection.
189 189
 						'chosen'   => true,
190
-						'number'   => - 1,
190
+						'number'   => -1,
191 191
 					)
192 192
 				);
193 193
 				?>
194 194
 			</div>
195 195
 
196
-			<?php if ( ! empty( $status ) ) : ?>
197
-				<input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>" />
196
+			<?php if ( ! empty($status)) : ?>
197
+				<input type="hidden" name="status" value="<?php echo esc_attr($status); ?>" />
198 198
 			<?php endif; ?>
199 199
 
200 200
 			<div class="give-filter">
201
-				<?php submit_button( __( 'Apply', 'give' ), 'secondary', '', false ); ?>
201
+				<?php submit_button(__('Apply', 'give'), 'secondary', '', false); ?>
202 202
 				<?php
203 203
 				// Clear active filters button.
204
-				if ( ! empty( $start_date ) || ! empty( $end_date ) || ! empty( $donor ) || ! empty( $search ) || ! empty( $status ) || ! empty( $form_id ) ) :
204
+				if ( ! empty($start_date) || ! empty($end_date) || ! empty($donor) || ! empty($search) || ! empty($status) || ! empty($form_id)) :
205 205
 				?>
206
-					<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>"
207
-					   class="button give-clear-filters-button"><?php _e( 'Clear Filters', 'give' ); ?></a>
206
+					<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>"
207
+					   class="button give-clear-filters-button"><?php _e('Clear Filters', 'give'); ?></a>
208 208
 				<?php endif; ?>
209 209
 			</div>
210 210
 		</div>
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
 	 *
224 224
 	 * @return void
225 225
 	 */
226
-	public function search_box( $text, $input_id ) {
227
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
226
+	public function search_box($text, $input_id) {
227
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
228 228
 			return;
229 229
 		}
230 230
 
231
-		$input_id = $input_id . '-search-input';
231
+		$input_id = $input_id.'-search-input';
232 232
 
233
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
234
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
233
+		if ( ! empty($_REQUEST['orderby'])) {
234
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
235 235
 		}
236
-		if ( ! empty( $_REQUEST['order'] ) ) {
237
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
236
+		if ( ! empty($_REQUEST['order'])) {
237
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
238 238
 		}
239 239
 		?>
240 240
 		<div class="give-filter give-filter-search" role="search">
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			 *
247 247
 			 * @since 1.7
248 248
 			 */
249
-			do_action( 'give_payment_history_search' );
249
+			do_action('give_payment_history_search');
250 250
 			?>
251 251
 			<label class="screen-reader-text" for="<?php echo $input_id; ?>"><?php echo $text; ?>:</label>
252 252
 			<input type="search" id="<?php echo $input_id; ?>" name="s" value="<?php _admin_search_query(); ?>" />
@@ -272,52 +272,52 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function get_views() {
274 274
 
275
-		$current = isset( $_GET['status'] ) ? $_GET['status'] : '';
275
+		$current = isset($_GET['status']) ? $_GET['status'] : '';
276 276
 		$views   = array();
277 277
 		$tabs    = array(
278 278
 			'all'         => array(
279 279
 				'total_count',
280
-				__( 'All', 'give' ),
280
+				__('All', 'give'),
281 281
 			),
282 282
 			'publish'     => array(
283 283
 				'complete_count',
284
-				__( 'Completed', 'give' ),
284
+				__('Completed', 'give'),
285 285
 			),
286 286
 			'pending'     => array(
287 287
 				'pending_count',
288
-				__( 'Pending', 'give' ),
288
+				__('Pending', 'give'),
289 289
 			),
290 290
 			'processing'  => array(
291 291
 				'processing_count',
292
-				__( 'Processing', 'give' ),
292
+				__('Processing', 'give'),
293 293
 			),
294 294
 			'refunded'    => array(
295 295
 				'refunded_count',
296
-				__( 'Refunded', 'give' ),
296
+				__('Refunded', 'give'),
297 297
 			),
298 298
 			'revoked'     => array(
299 299
 				'revoked_count',
300
-				__( 'Revoked', 'give' ),
300
+				__('Revoked', 'give'),
301 301
 			),
302 302
 			'failed'      => array(
303 303
 				'failed_count',
304
-				__( 'Failed', 'give' ),
304
+				__('Failed', 'give'),
305 305
 			),
306 306
 			'cancelled'   => array(
307 307
 				'cancelled_count',
308
-				__( 'Cancelled', 'give' ),
308
+				__('Cancelled', 'give'),
309 309
 			),
310 310
 			'abandoned'   => array(
311 311
 				'abandoned_count',
312
-				__( 'Abandoned', 'give' ),
312
+				__('Abandoned', 'give'),
313 313
 			),
314 314
 			'preapproval' => array(
315 315
 				'preapproval_count',
316
-				__( 'Preapproval Pending', 'give' ),
316
+				__('Preapproval Pending', 'give'),
317 317
 			),
318 318
 		);
319 319
 
320
-		foreach ( $tabs as $key => $tab ) {
320
+		foreach ($tabs as $key => $tab) {
321 321
 			$count_key = $tab[0];
322 322
 			$name      = $tab[1];
323 323
 			$count     = $this->$count_key;
@@ -332,26 +332,26 @@  discard block
 block discarded – undo
332 332
 			 *
333 333
 			 * @since 1.8.12
334 334
 			 */
335
-			if ( 'all' === $key || $key === $current || apply_filters( 'give_payments_table_show_all_status', 0 < $count, $key, $count ) ) {
335
+			if ('all' === $key || $key === $current || apply_filters('give_payments_table_show_all_status', 0 < $count, $key, $count)) {
336 336
 
337
-				$views[ $key ] = sprintf(
337
+				$views[$key] = sprintf(
338 338
 					'<a href="%s" %s >%s&nbsp;<span class="count">(%s)</span></a>',
339 339
 					esc_url(
340
-						( 'all' === (string) $key ) ? remove_query_arg( array( 'status', 'paged' ) ) : add_query_arg(
340
+						('all' === (string) $key) ? remove_query_arg(array('status', 'paged')) : add_query_arg(
341 341
 							array(
342 342
 								'status' => $key,
343 343
 								'paged'  => false,
344
-							), admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' )
344
+							), admin_url('edit.php?post_type=give_forms&page=give-payment-history')
345 345
 						)
346 346
 					),
347
-					( ( 'all' === $key && empty( $current ) ) ) ? 'class="current"' : ( $current == $key ) ? 'class="current"' : '',
347
+					(('all' === $key && empty($current))) ? 'class="current"' : ($current == $key) ? 'class="current"' : '',
348 348
 					$name,
349 349
 					$count
350 350
 				);
351 351
 			}
352 352
 		}
353 353
 
354
-		return apply_filters( 'give_payments_table_views', $views, $this );
354
+		return apply_filters('give_payments_table_views', $views, $this);
355 355
 	}
356 356
 
357 357
 	/**
@@ -365,18 +365,18 @@  discard block
 block discarded – undo
365 365
 	public function get_columns() {
366 366
 		$columns = array(
367 367
 			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text.
368
-			'donation'      => __( 'Donation', 'give' ),
369
-			'donation_form' => __( 'Donation Form', 'give' ),
370
-			'status'        => __( 'Status', 'give' ),
371
-			'date'          => __( 'Date', 'give' ),
372
-			'amount'        => __( 'Amount', 'give' ),
368
+			'donation'      => __('Donation', 'give'),
369
+			'donation_form' => __('Donation Form', 'give'),
370
+			'status'        => __('Status', 'give'),
371
+			'date'          => __('Date', 'give'),
372
+			'amount'        => __('Amount', 'give'),
373 373
 		);
374 374
 
375
-		if ( current_user_can( 'view_give_payments' ) ) {
376
-			$columns['details'] = __( 'Details', 'give' );
375
+		if (current_user_can('view_give_payments')) {
376
+			$columns['details'] = __('Details', 'give');
377 377
 		}
378 378
 
379
-		return apply_filters( 'give_payments_table_columns', $columns );
379
+		return apply_filters('give_payments_table_columns', $columns);
380 380
 	}
381 381
 
382 382
 	/**
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
 	 */
390 390
 	public function get_sortable_columns() {
391 391
 		$columns = array(
392
-			'donation'      => array( 'ID', true ),
393
-			'donation_form' => array( 'donation_form', false ),
394
-			'status'        => array( 'status', false ),
395
-			'amount'        => array( 'amount', false ),
396
-			'date'          => array( 'date', false ),
392
+			'donation'      => array('ID', true),
393
+			'donation_form' => array('donation_form', false),
394
+			'status'        => array('status', false),
395
+			'amount'        => array('amount', false),
396
+			'date'          => array('date', false),
397 397
 		);
398 398
 
399
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
399
+		return apply_filters('give_payments_table_sortable_columns', $columns);
400 400
 	}
401 401
 
402 402
 	/**
@@ -422,69 +422,69 @@  discard block
 block discarded – undo
422 422
 	 *
423 423
 	 * @return string Column Name
424 424
 	 */
425
-	public function column_default( $payment, $column_name ) {
425
+	public function column_default($payment, $column_name) {
426 426
 
427
-		$single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details' ) ) );
428
-		$row_actions         = $this->get_row_actions( $payment );
427
+		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details')));
428
+		$row_actions         = $this->get_row_actions($payment);
429 429
 		$value = '';
430 430
 
431
-		switch ( $column_name ) {
431
+		switch ($column_name) {
432 432
 			case 'donation':
433
-				if ( current_user_can( 'view_give_payments' ) ) {
434
-					$value = sprintf( '<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>', $single_donation_url, sprintf( __( 'View Donation #%s', 'give' ), $payment->ID ), $payment->ID, __( 'by', 'give' ), $this->get_donor( $payment ) );
433
+				if (current_user_can('view_give_payments')) {
434
+					$value = sprintf('<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>', $single_donation_url, sprintf(__('View Donation #%s', 'give'), $payment->ID), $payment->ID, __('by', 'give'), $this->get_donor($payment));
435 435
 				} else {
436
-					$value = sprintf( '#%1$s ' . __( 'by', 'give' ) . ' %2$s <br/>', $payment->ID, $this->get_donor( $payment ) );
436
+					$value = sprintf('#%1$s '.__('by', 'give').' %2$s <br/>', $payment->ID, $this->get_donor($payment));
437 437
 				}
438
-				$value .= $this->get_donor_email( $payment );
439
-				$value .= $this->row_actions( $row_actions );
438
+				$value .= $this->get_donor_email($payment);
439
+				$value .= $this->row_actions($row_actions);
440 440
 				break;
441 441
 
442 442
 			case 'amount':
443
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
443
+				$amount = ! empty($payment->total) ? $payment->total : 0;
444 444
 				$value  = give_currency_filter(
445 445
 					give_format_amount(
446 446
 						$amount, array(
447 447
 							'sanitize'    => false,
448 448
 							'donation_id' => $payment->ID,
449 449
 						)
450
-					), give_get_payment_currency_code( $payment->ID )
450
+					), give_get_payment_currency_code($payment->ID)
451 451
 				);
452
-				$value .= sprintf( '<br><small>%1$s %2$s</small>', __( 'via', 'give' ), give_get_gateway_admin_label( $payment->gateway ) );
452
+				$value .= sprintf('<br><small>%1$s %2$s</small>', __('via', 'give'), give_get_gateway_admin_label($payment->gateway));
453 453
 				break;
454 454
 
455 455
 			case 'donation_form':
456
-				$form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title;
457
-				$value      = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>';
458
-				$level      = give_get_payment_form_title( $payment->meta, true );
456
+				$form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title;
457
+				$value      = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>';
458
+				$level      = give_get_payment_form_title($payment->meta, true);
459 459
 
460
-				if ( ! empty( $level ) ) {
460
+				if ( ! empty($level)) {
461 461
 					$value .= $level;
462 462
 				}
463 463
 
464 464
 				break;
465 465
 
466 466
 			case 'date':
467
-				$date  = strtotime( $payment->date );
468
-				$value = date_i18n( give_date_format(), $date );
467
+				$date  = strtotime($payment->date);
468
+				$value = date_i18n(give_date_format(), $date);
469 469
 				break;
470 470
 
471 471
 			case 'status':
472
-				$value = $this->get_payment_status( $payment );
472
+				$value = $this->get_payment_status($payment);
473 473
 				break;
474 474
 
475 475
 			case 'details':
476
-				if ( current_user_can( 'view_give_payments' ) ) {
477
-					$value = sprintf( '<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', $single_donation_url, sprintf( __( 'View Donation #%s', 'give' ), $payment->ID ) );
476
+				if (current_user_can('view_give_payments')) {
477
+					$value = sprintf('<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', $single_donation_url, sprintf(__('View Donation #%s', 'give'), $payment->ID));
478 478
 				}
479 479
 				break;
480 480
 
481 481
 			default:
482
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
482
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
483 483
 				break;
484 484
 
485 485
 		}// End switch().
486 486
 
487
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
487
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
488 488
 	}
489 489
 
490 490
 	/**
@@ -497,17 +497,17 @@  discard block
 block discarded – undo
497 497
 	 *
498 498
 	 * @return string Data shown in the Email column
499 499
 	 */
500
-	public function get_donor_email( $payment ) {
500
+	public function get_donor_email($payment) {
501 501
 
502
-		$email = give_get_payment_user_email( $payment->ID );
502
+		$email = give_get_payment_user_email($payment->ID);
503 503
 
504
-		if ( empty( $email ) ) {
505
-			$email = __( '(unknown)', 'give' );
504
+		if (empty($email)) {
505
+			$email = __('(unknown)', 'give');
506 506
 		}
507 507
 
508
-		$value = '<a href="mailto:' . $email . '" data-tooltip="' . __( 'Email donor', 'give' ) . '">' . $email . '</a>';
508
+		$value = '<a href="mailto:'.$email.'" data-tooltip="'.__('Email donor', 'give').'">'.$email.'</a>';
509 509
 
510
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
510
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
511 511
 	}
512 512
 
513 513
 	/**
@@ -519,18 +519,18 @@  discard block
 block discarded – undo
519 519
 	 *
520 520
 	 * @return array $actions
521 521
 	 */
522
-	function get_row_actions( $payment ) {
522
+	function get_row_actions($payment) {
523 523
 
524 524
 		$actions = array();
525
-		$email   = give_get_payment_user_email( $payment->ID );
525
+		$email   = give_get_payment_user_email($payment->ID);
526 526
 
527 527
 		// Add search term string back to base URL.
528
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
529
-		if ( ! empty( $search_terms ) ) {
530
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
528
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
529
+		if ( ! empty($search_terms)) {
530
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
531 531
 		}
532 532
 
533
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
533
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
534 534
 
535 535
 			$actions['email_links'] = sprintf(
536 536
 				'<a class="resend-single-donation-receipt" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url(
@@ -540,12 +540,12 @@  discard block
 block discarded – undo
540 540
 							'purchase_id' => $payment->ID,
541 541
 						), $this->base_url
542 542
 					), 'give_payment_nonce'
543
-				), sprintf( __( 'Resend Donation %s Receipt', 'give' ), $payment->ID ), __( 'Resend Receipt', 'give' )
543
+				), sprintf(__('Resend Donation %s Receipt', 'give'), $payment->ID), __('Resend Receipt', 'give')
544 544
 			);
545 545
 
546 546
 		}
547 547
 
548
-		if ( current_user_can( 'view_give_payments' ) ) {
548
+		if (current_user_can('view_give_payments')) {
549 549
 			$actions['delete'] = sprintf(
550 550
 				'<a class="delete-single-donation" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url(
551 551
 					add_query_arg(
@@ -554,11 +554,11 @@  discard block
 block discarded – undo
554 554
 							'purchase_id' => $payment->ID,
555 555
 						), $this->base_url
556 556
 					), 'give_donation_nonce'
557
-				), sprintf( __( 'Delete Donation %s', 'give' ), $payment->ID ), __( 'Delete', 'give' )
557
+				), sprintf(__('Delete Donation %s', 'give'), $payment->ID), __('Delete', 'give')
558 558
 			);
559 559
 		}
560 560
 
561
-		return apply_filters( 'give_payment_row_actions', $actions, $payment );
561
+		return apply_filters('give_payment_row_actions', $actions, $payment);
562 562
 	}
563 563
 
564 564
 
@@ -572,14 +572,14 @@  discard block
 block discarded – undo
572 572
 	 *
573 573
 	 * @return string Data shown in the Email column
574 574
 	 */
575
-	function get_payment_status( $payment ) {
576
-		$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
577
-		if ( 'test' === $payment->mode ) {
578
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . __( 'This donation was made in test mode.', 'give' ) . '">' . __( 'Test', 'give' ) . '</span>';
575
+	function get_payment_status($payment) {
576
+		$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
577
+		if ('test' === $payment->mode) {
578
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.__('This donation was made in test mode.', 'give').'">'.__('Test', 'give').'</span>';
579 579
 		}
580 580
 
581
-		if ( true === $payment->import && true === (bool) apply_filters( 'give_payment_show_importer_label', false ) ) {
582
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . __( 'This donation was imported.', 'give' ) . '">' . __( 'Import', 'give' ) . '</span>';
581
+		if (true === $payment->import && true === (bool) apply_filters('give_payment_show_importer_label', false)) {
582
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.__('This donation was imported.', 'give').'">'.__('Import', 'give').'</span>';
583 583
 		}
584 584
 
585 585
 		return $value;
@@ -595,8 +595,8 @@  discard block
 block discarded – undo
595 595
 	 *
596 596
 	 * @return string Displays a checkbox.
597 597
 	 */
598
-	public function column_cb( $payment ) {
599
-		return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', 'payment', $payment->ID );
598
+	public function column_cb($payment) {
599
+		return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />', 'payment', $payment->ID);
600 600
 	}
601 601
 
602 602
 	/**
@@ -608,8 +608,8 @@  discard block
 block discarded – undo
608 608
 	 *
609 609
 	 * @return string Displays a checkbox.
610 610
 	 */
611
-	public function get_payment_id( $payment ) {
612
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
611
+	public function get_payment_id($payment) {
612
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
613 613
 	}
614 614
 
615 615
 	/**
@@ -622,32 +622,32 @@  discard block
 block discarded – undo
622 622
 	 *
623 623
 	 * @return string Data shown in the User column
624 624
 	 */
625
-	public function get_donor( $payment ) {
625
+	public function get_donor($payment) {
626 626
 
627
-		$donor_id           = give_get_payment_donor_id( $payment->ID );
628
-		$donor_billing_name = give_get_donor_name_by( $payment->ID, 'donation' );
629
-		$donor_name         = give_get_donor_name_by( $donor_id, 'donor' );
627
+		$donor_id           = give_get_payment_donor_id($payment->ID);
628
+		$donor_billing_name = give_get_donor_name_by($payment->ID, 'donation');
629
+		$donor_name         = give_get_donor_name_by($donor_id, 'donor');
630 630
 
631 631
 		$value = '';
632
-		if ( ! empty( $donor_id ) ) {
632
+		if ( ! empty($donor_id)) {
633 633
 
634 634
 			// Check whether the donor name and WP_User name is same or not.
635
-			if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) {
636
-				$value .= $donor_billing_name . ' (';
635
+			if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) {
636
+				$value .= $donor_billing_name.' (';
637 637
 			}
638 638
 
639
-			$value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>';
639
+			$value .= '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id")).'">'.$donor_name.'</a>';
640 640
 
641 641
 			// Check whether the donor name and WP_User name is same or not.
642
-			if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) {
642
+			if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) {
643 643
 				$value .= ')';
644 644
 			}
645 645
 		} else {
646
-			$email  = give_get_payment_user_email( $payment->ID );
647
-			$value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . __( '(donor missing)', 'give' ) . '</a>';
646
+			$email  = give_get_payment_user_email($payment->ID);
647
+			$value .= '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.__('(donor missing)', 'give').'</a>';
648 648
 		}
649 649
 
650
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
650
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
651 651
 	}
652 652
 
653 653
 	/**
@@ -660,20 +660,20 @@  discard block
 block discarded – undo
660 660
 	 */
661 661
 	public function get_bulk_actions() {
662 662
 		$actions = array(
663
-			'delete'                 => __( 'Delete', 'give' ),
664
-			'set-status-publish'     => __( 'Set To Completed', 'give' ),
665
-			'set-status-pending'     => __( 'Set To Pending', 'give' ),
666
-			'set-status-processing'  => __( 'Set To Processing', 'give' ),
667
-			'set-status-refunded'    => __( 'Set To Refunded', 'give' ),
668
-			'set-status-revoked'     => __( 'Set To Revoked', 'give' ),
669
-			'set-status-failed'      => __( 'Set To Failed', 'give' ),
670
-			'set-status-cancelled'   => __( 'Set To Cancelled', 'give' ),
671
-			'set-status-abandoned'   => __( 'Set To Abandoned', 'give' ),
672
-			'set-status-preapproval' => __( 'Set To Preapproval', 'give' ),
673
-			'resend-receipt'         => __( 'Resend Email Receipts', 'give' ),
663
+			'delete'                 => __('Delete', 'give'),
664
+			'set-status-publish'     => __('Set To Completed', 'give'),
665
+			'set-status-pending'     => __('Set To Pending', 'give'),
666
+			'set-status-processing'  => __('Set To Processing', 'give'),
667
+			'set-status-refunded'    => __('Set To Refunded', 'give'),
668
+			'set-status-revoked'     => __('Set To Revoked', 'give'),
669
+			'set-status-failed'      => __('Set To Failed', 'give'),
670
+			'set-status-cancelled'   => __('Set To Cancelled', 'give'),
671
+			'set-status-abandoned'   => __('Set To Abandoned', 'give'),
672
+			'set-status-preapproval' => __('Set To Preapproval', 'give'),
673
+			'resend-receipt'         => __('Resend Email Receipts', 'give'),
674 674
 		);
675 675
 
676
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
676
+		return apply_filters('give_payments_table_bulk_actions', $actions);
677 677
 	}
678 678
 
679 679
 	/**
@@ -685,63 +685,63 @@  discard block
 block discarded – undo
685 685
 	 * @return void
686 686
 	 */
687 687
 	public function process_bulk_action() {
688
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
688
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
689 689
 		$action = $this->current_action();
690 690
 
691
-		if ( ! is_array( $ids ) ) {
692
-			$ids = array( $ids );
691
+		if ( ! is_array($ids)) {
692
+			$ids = array($ids);
693 693
 		}
694 694
 
695
-		if ( empty( $action ) ) {
695
+		if (empty($action)) {
696 696
 			return;
697 697
 		}
698 698
 
699
-		foreach ( $ids as $id ) {
699
+		foreach ($ids as $id) {
700 700
 
701 701
 			// Detect when a bulk action is being triggered.
702
-			switch ( $this->current_action() ) {
702
+			switch ($this->current_action()) {
703 703
 
704 704
 				case 'delete':
705
-					give_delete_donation( $id );
705
+					give_delete_donation($id);
706 706
 					break;
707 707
 
708 708
 				case 'set-status-publish':
709
-					give_update_payment_status( $id, 'publish' );
709
+					give_update_payment_status($id, 'publish');
710 710
 					break;
711 711
 
712 712
 				case 'set-status-pending':
713
-					give_update_payment_status( $id, 'pending' );
713
+					give_update_payment_status($id, 'pending');
714 714
 					break;
715 715
 
716 716
 				case 'set-status-processing':
717
-					give_update_payment_status( $id, 'processing' );
717
+					give_update_payment_status($id, 'processing');
718 718
 					break;
719 719
 
720 720
 				case 'set-status-refunded':
721
-					give_update_payment_status( $id, 'refunded' );
721
+					give_update_payment_status($id, 'refunded');
722 722
 					break;
723 723
 				case 'set-status-revoked':
724
-					give_update_payment_status( $id, 'revoked' );
724
+					give_update_payment_status($id, 'revoked');
725 725
 					break;
726 726
 
727 727
 				case 'set-status-failed':
728
-					give_update_payment_status( $id, 'failed' );
728
+					give_update_payment_status($id, 'failed');
729 729
 					break;
730 730
 
731 731
 				case 'set-status-cancelled':
732
-					give_update_payment_status( $id, 'cancelled' );
732
+					give_update_payment_status($id, 'cancelled');
733 733
 					break;
734 734
 
735 735
 				case 'set-status-abandoned':
736
-					give_update_payment_status( $id, 'abandoned' );
736
+					give_update_payment_status($id, 'abandoned');
737 737
 					break;
738 738
 
739 739
 				case 'set-status-preapproval':
740
-					give_update_payment_status( $id, 'preapproval' );
740
+					give_update_payment_status($id, 'preapproval');
741 741
 					break;
742 742
 
743 743
 				case 'resend-receipt':
744
-					give_email_donation_receipt( $id, false );
744
+					give_email_donation_receipt($id, false);
745 745
 					break;
746 746
 			}// End switch().
747 747
 
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 			 *
754 754
 			 * @since 1.7
755 755
 			 */
756
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
756
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
757 757
 		}// End foreach().
758 758
 
759 759
 	}
@@ -770,32 +770,32 @@  discard block
 block discarded – undo
770 770
 
771 771
 		$args = array();
772 772
 
773
-		if ( isset( $_GET['user'] ) ) {
774
-			$args['user'] = urldecode( $_GET['user'] );
775
-		} elseif ( isset( $_GET['donor'] ) ) {
776
-			$args['donor'] = absint( $_GET['donor'] );
777
-		} elseif ( isset( $_GET['s'] ) ) {
778
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
779
-			if ( $is_user ) {
780
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
781
-				unset( $args['s'] );
773
+		if (isset($_GET['user'])) {
774
+			$args['user'] = urldecode($_GET['user']);
775
+		} elseif (isset($_GET['donor'])) {
776
+			$args['donor'] = absint($_GET['donor']);
777
+		} elseif (isset($_GET['s'])) {
778
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
779
+			if ($is_user) {
780
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
781
+				unset($args['s']);
782 782
 			} else {
783
-				$args['s'] = sanitize_text_field( $_GET['s'] );
783
+				$args['s'] = sanitize_text_field($_GET['s']);
784 784
 			}
785 785
 		}
786 786
 
787
-		if ( ! empty( $_GET['start-date'] ) ) {
788
-			$args['start-date'] = urldecode( $_GET['start-date'] );
787
+		if ( ! empty($_GET['start-date'])) {
788
+			$args['start-date'] = urldecode($_GET['start-date']);
789 789
 		}
790 790
 
791
-		if ( ! empty( $_GET['end-date'] ) ) {
792
-			$args['end-date'] = urldecode( $_GET['end-date'] );
791
+		if ( ! empty($_GET['end-date'])) {
792
+			$args['end-date'] = urldecode($_GET['end-date']);
793 793
 		}
794 794
 
795
-		$args['form_id'] = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null;
796
-		$args['gateway'] = ! empty( $_GET['gateway'] ) ? give_clean( $_GET['gateway'] ) : null;
795
+		$args['form_id'] = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : null;
796
+		$args['gateway'] = ! empty($_GET['gateway']) ? give_clean($_GET['gateway']) : null;
797 797
 
798
-		$payment_count           = give_count_payments( $args );
798
+		$payment_count           = give_count_payments($args);
799 799
 		$this->complete_count    = $payment_count->publish;
800 800
 		$this->pending_count     = $payment_count->pending;
801 801
 		$this->processing_count  = $payment_count->processing;
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 		$this->abandoned_count   = $payment_count->abandoned;
807 807
 		$this->preapproval_count = $payment_count->preapproval;
808 808
 
809
-		foreach ( $payment_count as $count ) {
809
+		foreach ($payment_count as $count) {
810 810
 			$this->total_count += $count;
811 811
 		}
812 812
 
@@ -824,29 +824,29 @@  discard block
 block discarded – undo
824 824
 	public function payments_data() {
825 825
 
826 826
 		$per_page   = $this->per_page;
827
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
828
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
829
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
830
-		$donor      = isset( $_GET['donor'] ) ? $_GET['donor'] : null;
831
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
832
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
833
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
834
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
835
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
836
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
837
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
838
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
839
-		$form_id    = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null;
840
-		$gateway    = ! empty( $_GET['gateway'] ) ? give_clean( $_GET['gateway'] ) : null;
841
-
842
-		if ( ! empty( $search ) ) {
827
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
828
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
829
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
830
+		$donor      = isset($_GET['donor']) ? $_GET['donor'] : null;
831
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
832
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
833
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
834
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
835
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
836
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
837
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
838
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
839
+		$form_id    = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : null;
840
+		$gateway    = ! empty($_GET['gateway']) ? give_clean($_GET['gateway']) : null;
841
+
842
+		if ( ! empty($search)) {
843 843
 			$status = 'any'; // Force all payment statuses when searching.
844 844
 		}
845 845
 
846 846
 		$args = array(
847 847
 			'output'     => 'payments',
848 848
 			'number'     => $per_page,
849
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
849
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
850 850
 			'orderby'    => $orderby,
851 851
 			'order'      => $order,
852 852
 			'user'       => $user,
@@ -863,12 +863,12 @@  discard block
 block discarded – undo
863 863
 			'give_forms' => $form_id,
864 864
 		);
865 865
 
866
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
866
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
867 867
 			$args['search_in_notes'] = true;
868
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
868
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
869 869
 		}
870 870
 
871
-		$p_query = new Give_Payments_Query( $args );
871
+		$p_query = new Give_Payments_Query($args);
872 872
 
873 873
 		return $p_query->get_payments();
874 874
 
@@ -889,17 +889,17 @@  discard block
 block discarded – undo
889 889
 	 */
890 890
 	public function prepare_items() {
891 891
 
892
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
892
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
893 893
 
894 894
 		$columns  = $this->get_columns();
895 895
 		$hidden   = array(); // No hidden columns.
896 896
 		$sortable = $this->get_sortable_columns();
897 897
 		$data     = $this->payments_data();
898
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
898
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
899 899
 
900
-		$this->_column_headers = array( $columns, $hidden, $sortable );
900
+		$this->_column_headers = array($columns, $hidden, $sortable);
901 901
 
902
-		switch ( $status ) {
902
+		switch ($status) {
903 903
 			case 'publish':
904 904
 				$total_items = $this->complete_count;
905 905
 				break;
@@ -932,8 +932,8 @@  discard block
 block discarded – undo
932 932
 				break;
933 933
 			default:
934 934
 				// Retrieve the count of the non-default-Give status.
935
-				$count       = wp_count_posts( 'give_payment' );
936
-				$total_items = isset( $count->{$status} ) ? $count->{$status} : 0;
935
+				$count       = wp_count_posts('give_payment');
936
+				$total_items = isset($count->{$status} ) ? $count->{$status} : 0;
937 937
 				break;
938 938
 		}
939 939
 
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 				// We have to calculate the total number of items.
946 946
 				'per_page'    => $this->per_page,
947 947
 				// We have to determine how many items to show on a page.
948
-				'total_pages' => ceil( $total_items / $this->per_page ),
948
+				'total_pages' => ceil($total_items / $this->per_page),
949 949
 			// We have to calculate the total number of pages.
950 950
 			)
951 951
 		);
Please login to merge, or discard this patch.
includes/ajax-functions.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -521,7 +521,7 @@
 block discarded – undo
521 521
  *
522 522
  * @since 1.8.17
523 523
  *
524
- * @return bool
524
+ * @return false|null
525 525
  */
526 526
 function give_confirm_email_for_donation_access() {
527 527
 
Please login to merge, or discard this patch.
Spacing   +126 added lines, -126 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 ) ) {
223
-		$args         = array(
221
+	$states = give_get_states($country);
222
+	if ( ! empty($states)) {
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,11 +260,11 @@  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 265
 
266
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
267
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
266
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
267
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
268 268
 
269 269
 /**
270 270
  * Retrieve donation forms via AJAX for chosen dropdown search field.
@@ -276,19 +276,19 @@  discard block
 block discarded – undo
276 276
 function give_ajax_form_search() {
277 277
 	global $wpdb;
278 278
 
279
-	$search   = esc_sql( sanitize_text_field( $_GET['s'] ) );
280
-	$excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() );
279
+	$search   = esc_sql(sanitize_text_field($_GET['s']));
280
+	$excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array());
281 281
 
282 282
 	$results = array();
283
-	if ( current_user_can( 'edit_give_forms' ) ) {
284
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
283
+	if (current_user_can('edit_give_forms')) {
284
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
285 285
 	} else {
286
-		$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
+		$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");
287 287
 	}
288 288
 
289
-	if ( $items ) {
289
+	if ($items) {
290 290
 
291
-		foreach ( $items as $item ) {
291
+		foreach ($items as $item) {
292 292
 
293 293
 			$results[] = array(
294 294
 				'id'   => $item->ID,
@@ -299,18 +299,18 @@  discard block
 block discarded – undo
299 299
 
300 300
 		$items[] = array(
301 301
 			'id'   => 0,
302
-			'name' => __( 'No forms found.', 'give' ),
302
+			'name' => __('No forms found.', 'give'),
303 303
 		);
304 304
 
305 305
 	}
306 306
 
307
-	echo json_encode( $results );
307
+	echo json_encode($results);
308 308
 
309 309
 	give_die();
310 310
 }
311 311
 
312
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
313
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
312
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
313
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
314 314
 
315 315
 /**
316 316
  * Search the donors database via Ajax
@@ -322,38 +322,38 @@  discard block
 block discarded – undo
322 322
 function give_ajax_donor_search() {
323 323
 	global $wpdb;
324 324
 
325
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
325
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
326 326
 	$results = array();
327
-	if ( ! current_user_can( 'view_give_reports' ) ) {
327
+	if ( ! current_user_can('view_give_reports')) {
328 328
 		$donors = array();
329 329
 	} else {
330
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
330
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
331 331
 	}
332 332
 
333
-	if ( $donors ) {
333
+	if ($donors) {
334 334
 
335
-		foreach ( $donors as $donor ) {
335
+		foreach ($donors as $donor) {
336 336
 
337 337
 			$results[] = array(
338 338
 				'id'   => $donor->id,
339
-				'name' => $donor->name . ' (' . $donor->email . ')',
339
+				'name' => $donor->name.' ('.$donor->email.')',
340 340
 			);
341 341
 		}
342 342
 	} else {
343 343
 
344 344
 		$donors[] = array(
345 345
 			'id'   => 0,
346
-			'name' => __( 'No donors found.', 'give' ),
346
+			'name' => __('No donors found.', 'give'),
347 347
 		);
348 348
 
349 349
 	}
350 350
 
351
-	echo json_encode( $results );
351
+	echo json_encode($results);
352 352
 
353 353
 	give_die();
354 354
 }
355 355
 
356
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
356
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
357 357
 
358 358
 
359 359
 /**
@@ -365,39 +365,39 @@  discard block
 block discarded – undo
365 365
  */
366 366
 function give_ajax_search_users() {
367 367
 
368
-	if ( current_user_can( 'manage_give_settings' ) ) {
368
+	if (current_user_can('manage_give_settings')) {
369 369
 
370
-		$search = esc_sql( sanitize_text_field( $_GET['s'] ) );
370
+		$search = esc_sql(sanitize_text_field($_GET['s']));
371 371
 
372 372
 		$get_users_args = array(
373 373
 			'number' => 9999,
374
-			'search' => $search . '*',
374
+			'search' => $search.'*',
375 375
 		);
376 376
 
377
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
377
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
378 378
 
379
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search );
379
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search);
380 380
 		$results     = array();
381 381
 
382
-		if ( $found_users ) {
382
+		if ($found_users) {
383 383
 
384
-			foreach ( $found_users as $user ) {
384
+			foreach ($found_users as $user) {
385 385
 
386 386
 				$results[] = array(
387 387
 					'id'   => $user->ID,
388
-					'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ),
388
+					'name' => esc_html($user->user_login.' ('.$user->user_email.')'),
389 389
 				);
390 390
 			}
391 391
 		} else {
392 392
 
393 393
 			$results[] = array(
394 394
 				'id'   => 0,
395
-				'name' => __( 'No users found.', 'give' ),
395
+				'name' => __('No users found.', 'give'),
396 396
 			);
397 397
 
398 398
 		}
399 399
 
400
-		echo json_encode( $results );
400
+		echo json_encode($results);
401 401
 
402 402
 	}// End if().
403 403
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
 }
407 407
 
408
-add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' );
408
+add_action('wp_ajax_give_user_search', 'give_ajax_search_users');
409 409
 
410 410
 
411 411
 /**
@@ -417,32 +417,32 @@  discard block
 block discarded – undo
417 417
  */
418 418
 function give_check_for_form_price_variations() {
419 419
 
420
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
421
-		die( '-1' );
420
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
421
+		die('-1');
422 422
 	}
423 423
 
424
-	$form_id = intval( $_POST['form_id'] );
425
-	$form    = get_post( $form_id );
424
+	$form_id = intval($_POST['form_id']);
425
+	$form    = get_post($form_id);
426 426
 
427
-	if ( 'give_forms' != $form->post_type ) {
428
-		die( '-2' );
427
+	if ('give_forms' != $form->post_type) {
428
+		die('-2');
429 429
 	}
430 430
 
431
-	if ( give_has_variable_prices( $form_id ) ) {
432
-		$variable_prices = give_get_variable_prices( $form_id );
431
+	if (give_has_variable_prices($form_id)) {
432
+		$variable_prices = give_get_variable_prices($form_id);
433 433
 
434
-		if ( $variable_prices ) {
434
+		if ($variable_prices) {
435 435
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
436 436
 
437
-			if ( isset( $_POST['all_prices'] ) ) {
438
-				$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
437
+			if (isset($_POST['all_prices'])) {
438
+				$ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>';
439 439
 			}
440 440
 
441
-			foreach ( $variable_prices as $key => $price ) {
441
+			foreach ($variable_prices as $key => $price) {
442 442
 
443
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) );
443
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false)));
444 444
 
445
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
445
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
446 446
 			}
447 447
 			$ajax_response .= '</select>';
448 448
 			echo $ajax_response;
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	give_die();
453 453
 }
454 454
 
455
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
455
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
456 456
 
457 457
 
458 458
 /**
@@ -463,28 +463,28 @@  discard block
 block discarded – undo
463 463
  * @return void
464 464
  */
465 465
 function give_check_for_form_price_variations_html() {
466
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
466
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
467 467
 		wp_die();
468 468
 	}
469 469
 
470
-	$form_id    = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : false;
471
-	$payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : false;
472
-	if ( empty( $form_id ) || empty( $payment_id ) ) {
470
+	$form_id    = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : false;
471
+	$payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : false;
472
+	if (empty($form_id) || empty($payment_id)) {
473 473
 		wp_die();
474 474
 	}
475 475
 
476
-	$form = get_post( $form_id );
477
-	if ( ! empty( $form->post_type ) && 'give_forms' != $form->post_type ) {
476
+	$form = get_post($form_id);
477
+	if ( ! empty($form->post_type) && 'give_forms' != $form->post_type) {
478 478
 		wp_die();
479 479
 	}
480 480
 
481
-	if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) {
482
-		esc_html_e( 'n/a', 'give' );
481
+	if ( ! give_has_variable_prices($form_id) || ! $form_id) {
482
+		esc_html_e('n/a', 'give');
483 483
 	} else {
484 484
 		$prices_atts = array();
485
-		if ( $variable_prices = give_get_variable_prices( $form_id ) ) {
486
-			foreach ( $variable_prices as $variable_price ) {
487
-				$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
485
+		if ($variable_prices = give_get_variable_prices($form_id)) {
486
+			foreach ($variable_prices as $variable_price) {
487
+				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false));
488 488
 			}
489 489
 		}
490 490
 
@@ -495,12 +495,12 @@  discard block
 block discarded – undo
495 495
 			'chosen'           => true,
496 496
 			'show_option_all'  => '',
497 497
 			'show_option_none' => '',
498
-			'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
498
+			'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
499 499
 		);
500 500
 
501
-		if ( $payment_id ) {
501
+		if ($payment_id) {
502 502
 			// Payment object.
503
-			$payment = new Give_Payment( $payment_id );
503
+			$payment = new Give_Payment($payment_id);
504 504
 
505 505
 			// Payment meta.
506 506
 			$payment_meta                               = $payment->get_meta();
@@ -508,13 +508,13 @@  discard block
 block discarded – undo
508 508
 		}
509 509
 
510 510
 		// Render variable prices select tag html.
511
-		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
511
+		give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
512 512
 	}
513 513
 
514 514
 	give_die();
515 515
 }
516 516
 
517
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
517
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
518 518
 
519 519
 /**
520 520
  * Send Confirmation Email For Complete Donation History Access.
@@ -526,24 +526,24 @@  discard block
 block discarded – undo
526 526
 function give_confirm_email_for_donation_access() {
527 527
 
528 528
 	// Verify Security using Nonce.
529
-	if ( ! check_ajax_referer( 'give_ajax_nonce', 'nonce' ) ) {
529
+	if ( ! check_ajax_referer('give_ajax_nonce', 'nonce')) {
530 530
 		return false;
531 531
 	}
532 532
 
533 533
 	// Bail Out, if email is empty.
534
-	if ( empty( $_POST['email'] ) ) {
534
+	if (empty($_POST['email'])) {
535 535
 		return false;
536 536
 	}
537 537
 
538
-	$donor = Give()->donors->get_donor_by( 'email', $_POST['email'] );
539
-	if ( Give()->email_access->can_send_email( $donor->id ) ) {
538
+	$donor = Give()->donors->get_donor_by('email', $_POST['email']);
539
+	if (Give()->email_access->can_send_email($donor->id)) {
540 540
 		$return     = array();
541
-		$email_sent = Give()->email_access->send_email( $donor->id, $donor->email );
541
+		$email_sent = Give()->email_access->send_email($donor->id, $donor->email);
542 542
 
543
-		if ( ! $email_sent ) {
543
+		if ( ! $email_sent) {
544 544
 			$return['status']  = 'error';
545 545
 			$return['message'] = Give()->notices->print_frontend_notice(
546
-				__( 'Unable to send email. Please try again.', 'give' ),
546
+				__('Unable to send email. Please try again.', 'give'),
547 547
 				false,
548 548
 				'error'
549 549
 			);
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 
552 552
 		$return['status']  = 'success';
553 553
 		$return['message'] = Give()->notices->print_frontend_notice(
554
-			__( 'Please check your email and click on the link to access your complete donation history.', 'give' ),
554
+			__('Please check your email and click on the link to access your complete donation history.', 'give'),
555 555
 			false,
556 556
 			'success'
557 557
 		);
@@ -562,16 +562,16 @@  discard block
 block discarded – undo
562 562
 		$return['status']  = 'error';
563 563
 		$return['message'] = Give()->notices->print_frontend_notice(
564 564
 			sprintf(
565
-				__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
566
-				sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value )
565
+				__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
566
+				sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value)
567 567
 			),
568 568
 			false,
569 569
 			'error'
570 570
 		);
571 571
 	}
572 572
 
573
-	echo json_encode( $return );
573
+	echo json_encode($return);
574 574
 	give_die();
575 575
 }
576 576
 
577
-add_action( 'wp_ajax_nopriv_give_confirm_email_for_donations_access', 'give_confirm_email_for_donation_access' );
578 577
\ No newline at end of file
578
+add_action('wp_ajax_nopriv_give_confirm_email_for_donations_access', 'give_confirm_email_for_donation_access');
579 579
\ No newline at end of file
Please login to merge, or discard this patch.
includes/class-give-email-access.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
 	 * @since  1.0
243 243
 	 * @access public
244 244
 	 *
245
-	 * @return bool
245
+	 * @return boolean|null
246 246
 	 */
247 247
 	public function check_for_token() {
248 248
 
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 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
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	public function __construct() {
107 107
 
108 108
 		// get it started
109
-		add_action( 'init', array( $this, 'init' ) );
109
+		add_action('init', array($this, 'init'));
110 110
 	}
111 111
 
112 112
 	/**
@@ -122,28 +122,28 @@  discard block
 block discarded – undo
122 122
 	public function init() {
123 123
 
124 124
 		// Bail Out, if user is logged in.
125
-		if ( is_user_logged_in() ) {
125
+		if (is_user_logged_in()) {
126 126
 			return;
127 127
 		}
128 128
 
129 129
 		// Are db columns setup?
130
-		$is_setup = give_get_option( 'email_access_installed' );
131
-		if ( empty( $is_setup ) ) {
130
+		$is_setup = give_get_option('email_access_installed');
131
+		if (empty($is_setup)) {
132 132
 			$this->create_columns();
133 133
 		}
134 134
 
135 135
 		// Timeouts.
136
-		$this->verify_throttle  = apply_filters( 'give_nl_verify_throttle', 300 );
137
-		$this->limit_throttle   = apply_filters( 'give_nl_limit_throttle', 3 );
138
-		$this->token_expiration = apply_filters( 'give_nl_token_expiration', 7200 );
136
+		$this->verify_throttle  = apply_filters('give_nl_verify_throttle', 300);
137
+		$this->limit_throttle   = apply_filters('give_nl_limit_throttle', 3);
138
+		$this->token_expiration = apply_filters('give_nl_token_expiration', 7200);
139 139
 
140 140
 		// Setup login.
141 141
 		$this->check_for_token();
142 142
 
143
-		if ( $this->token_exists ) {
144
-			add_filter( 'give_can_view_receipt', '__return_true' );
145
-			add_filter( 'give_user_pending_verification', '__return_false' );
146
-			add_filter( 'give_get_users_donations_args', array( $this, 'users_donations_args' ) );
143
+		if ($this->token_exists) {
144
+			add_filter('give_can_view_receipt', '__return_true');
145
+			add_filter('give_user_pending_verification', '__return_false');
146
+			add_filter('give_get_users_donations_args', array($this, 'users_donations_args'));
147 147
 		}
148 148
 
149 149
 	}
@@ -158,23 +158,23 @@  discard block
 block discarded – undo
158 158
 	 *
159 159
 	 * @return bool
160 160
 	 */
161
-	public function can_send_email( $donor_id ) {
161
+	public function can_send_email($donor_id) {
162 162
 
163
-		$donor = Give()->donors->get_donor_by( 'id', $donor_id );
163
+		$donor = Give()->donors->get_donor_by('id', $donor_id);
164 164
 
165
-		if ( is_object( $donor ) && count( $donor ) > 0 ) {
165
+		if (is_object($donor) && count($donor) > 0) {
166 166
 
167
-			$email_throttle_count = (int) give_get_meta( $donor_id, '_give_email_throttle_count', true );
167
+			$email_throttle_count = (int) give_get_meta($donor_id, '_give_email_throttle_count', true);
168 168
 
169 169
 			$cache_key = "give_cache_email_throttle_limit_exhausted_{$donor_id}";
170 170
 			if (
171 171
 				$email_throttle_count < $this->limit_throttle &&
172
-				true !== Give_Cache::get( $cache_key )
172
+				true !== Give_Cache::get($cache_key)
173 173
 			) {
174
-				give_update_meta( $donor_id, '_give_email_throttle_count', $email_throttle_count + 1 );
174
+				give_update_meta($donor_id, '_give_email_throttle_count', $email_throttle_count + 1);
175 175
 			} else {
176
-				give_update_meta( $donor_id, '_give_email_throttle_count', 0 );
177
-				Give_Cache::set( $cache_key, true, $this->verify_throttle );
176
+				give_update_meta($donor_id, '_give_email_throttle_count', 0);
177
+				Give_Cache::set($cache_key, true, $this->verify_throttle);
178 178
 				return false;
179 179
 			}
180 180
 
@@ -194,45 +194,45 @@  discard block
 block discarded – undo
194 194
 	 *
195 195
 	 * @return bool
196 196
 	 */
197
-	public function send_email( $customer_id, $email ) {
197
+	public function send_email($customer_id, $email) {
198 198
 
199
-		$verify_key = wp_generate_password( 20, false );
199
+		$verify_key = wp_generate_password(20, false);
200 200
 
201 201
 		// Generate a new verify key
202
-		$this->set_verify_key( $customer_id, $email, $verify_key );
202
+		$this->set_verify_key($customer_id, $email, $verify_key);
203 203
 
204
-		$access_url = add_query_arg( array(
204
+		$access_url = add_query_arg(array(
205 205
 			'give_nl' => $verify_key,
206
-		), give_get_history_page_uri() );
206
+		), give_get_history_page_uri());
207 207
 
208
-		if ( ! empty( $_GET['payment_key'] ) ) {
209
-			$access_url = add_query_arg( array(
210
-				'payment_key' => give_clean( $_GET['payment_key'] ),
211
-			), $access_url );
208
+		if ( ! empty($_GET['payment_key'])) {
209
+			$access_url = add_query_arg(array(
210
+				'payment_key' => give_clean($_GET['payment_key']),
211
+			), $access_url);
212 212
 		}
213 213
 
214 214
 		// Nice subject and message.
215
-		$subject = apply_filters( 'give_email_access_token_subject', sprintf( __( 'Please confirm your email for %s', 'give' ), get_bloginfo( 'url' ) ) );
215
+		$subject = apply_filters('give_email_access_token_subject', sprintf(__('Please confirm your email for %s', 'give'), get_bloginfo('url')));
216 216
 
217 217
 		$message = sprintf(
218
-			__( 'Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give' ),
219
-			get_bloginfo( 'url' ),
220
-			get_bloginfo( 'admin_email' )
221
-		) . "\n\n";
218
+			__('Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give'),
219
+			get_bloginfo('url'),
220
+			get_bloginfo('admin_email')
221
+		)."\n\n";
222 222
 		$message .= sprintf(
223
-			__( '<a href="%s" target="_blank">%s</a>', 'give' ),
224
-			esc_url( $access_url ),
225
-			__( 'View your donation history &raquo;', 'give' )
226
-		) . "\n\n";
223
+			__('<a href="%s" target="_blank">%s</a>', 'give'),
224
+			esc_url($access_url),
225
+			__('View your donation history &raquo;', 'give')
226
+		)."\n\n";
227 227
 		$message .= "\n\n";
228
-		$message .= __( 'Sincerely,', 'give' ) . "\n";
229
-		$message .= get_bloginfo( 'name' ) . "\n";
228
+		$message .= __('Sincerely,', 'give')."\n";
229
+		$message .= get_bloginfo('name')."\n";
230 230
 
231
-		$message = apply_filters( 'give_email_access_token_message', $message );
231
+		$message = apply_filters('give_email_access_token_message', $message);
232 232
 
233 233
 		// Send the email.
234
-		Give()->emails->__set( 'heading', apply_filters( 'give_email_access_token_heading', __( 'Confirm Email', 'give' ) ) );
235
-		return Give()->emails->send( $email, $subject, $message );
234
+		Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', __('Confirm Email', 'give')));
235
+		return Give()->emails->send($email, $subject, $message);
236 236
 
237 237
 	}
238 238
 
@@ -246,28 +246,28 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public function check_for_token() {
248 248
 
249
-		$token = isset( $_GET['give_nl'] ) ? $_GET['give_nl'] : '';
249
+		$token = isset($_GET['give_nl']) ? $_GET['give_nl'] : '';
250 250
 
251 251
 		// Check for cookie.
252
-		if ( empty( $token ) ) {
253
-			$token = isset( $_COOKIE['give_nl'] ) ? $_COOKIE['give_nl'] : '';
252
+		if (empty($token)) {
253
+			$token = isset($_COOKIE['give_nl']) ? $_COOKIE['give_nl'] : '';
254 254
 		}
255 255
 
256 256
 		// Must have a token.
257
-		if ( ! empty( $token ) ) {
257
+		if ( ! empty($token)) {
258 258
 
259
-			if ( ! $this->is_valid_token( $token ) ) {
260
-				if ( ! $this->is_valid_verify_key( $token ) ) {
259
+			if ( ! $this->is_valid_token($token)) {
260
+				if ( ! $this->is_valid_verify_key($token)) {
261 261
 					return false;
262 262
 				}
263 263
 			}
264 264
 
265 265
 			// Set Receipt Access Session.
266
-			Give()->session->set( 'receipt_access', true );
266
+			Give()->session->set('receipt_access', true);
267 267
 			$this->token_exists = true;
268 268
 			// Set cookie.
269
-			$lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time();
270
-			@setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
269
+			$lifetime = current_time('timestamp') + Give()->session->set_expiration_time();
270
+			@setcookie('give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
271 271
 
272 272
 			return true;
273 273
 		}
@@ -283,26 +283,26 @@  discard block
 block discarded – undo
283 283
 	 *
284 284
 	 * @return bool
285 285
 	 */
286
-	public function is_valid_token( $token ) {
286
+	public function is_valid_token($token) {
287 287
 
288 288
 		global $wpdb;
289 289
 
290 290
 		// Make sure token isn't expired.
291
-		$expires = date( 'Y-m-d H:i:s', time() - $this->token_expiration );
291
+		$expires = date('Y-m-d H:i:s', time() - $this->token_expiration);
292 292
 
293 293
 		$email = $wpdb->get_var(
294
-			$wpdb->prepare( "SELECT email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s AND verify_throttle >= %s LIMIT 1", $token, $expires )
294
+			$wpdb->prepare("SELECT email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s AND verify_throttle >= %s LIMIT 1", $token, $expires)
295 295
 		);
296 296
 
297
-		if ( ! empty( $email ) ) {
297
+		if ( ! empty($email)) {
298 298
 			$this->token_email = $email;
299 299
 			$this->token       = $token;
300 300
 			return true;
301 301
 		}
302 302
 
303 303
 		// Set error only if email access form isn't being submitted.
304
-		if ( ! isset( $_POST['give_email'] ) && ! isset( $_POST['_wpnonce'] ) ) {
305
-			give_set_error( 'give_email_token_expired', apply_filters( 'give_email_token_expired_message', __( 'Your access token has expired. Please request a new one below:', 'give' ) ) );
304
+		if ( ! isset($_POST['give_email']) && ! isset($_POST['_wpnonce'])) {
305
+			give_set_error('give_email_token_expired', apply_filters('give_email_token_expired_message', __('Your access token has expired. Please request a new one below:', 'give')));
306 306
 		}
307 307
 
308 308
 		return false;
@@ -321,25 +321,25 @@  discard block
 block discarded – undo
321 321
 	 *
322 322
 	 * @return void
323 323
 	 */
324
-	public function set_verify_key( $customer_id, $email, $verify_key ) {
324
+	public function set_verify_key($customer_id, $email, $verify_key) {
325 325
 		global $wpdb;
326 326
 
327
-		$now = date( 'Y-m-d H:i:s' );
327
+		$now = date('Y-m-d H:i:s');
328 328
 
329 329
 		// Insert or update?
330 330
 		$row_id = (int) $wpdb->get_var(
331
-			$wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id )
331
+			$wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id)
332 332
 		);
333 333
 
334 334
 		// Update.
335
-		if ( ! empty( $row_id ) ) {
335
+		if ( ! empty($row_id)) {
336 336
 			$wpdb->query(
337
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id )
337
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id)
338 338
 			);
339 339
 		} // Insert.
340 340
 		else {
341 341
 			$wpdb->query(
342
-				$wpdb->prepare( "INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now )
342
+				$wpdb->prepare("INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now)
343 343
 			);
344 344
 		}
345 345
 	}
@@ -354,21 +354,21 @@  discard block
 block discarded – undo
354 354
 	 *
355 355
 	 * @return bool
356 356
 	 */
357
-	public function is_valid_verify_key( $token ) {
357
+	public function is_valid_verify_key($token) {
358 358
 		/* @var WPDB $wpdb */
359 359
 		global $wpdb;
360 360
 
361 361
 		// See if the verify_key exists.
362 362
 		$row = $wpdb->get_row(
363
-			$wpdb->prepare( "SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token )
363
+			$wpdb->prepare("SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token)
364 364
 		);
365 365
 
366
-		$now = date( 'Y-m-d H:i:s' );
366
+		$now = date('Y-m-d H:i:s');
367 367
 
368 368
 		// Set token and remove verify key.
369
-		if ( ! empty( $row ) ) {
369
+		if ( ! empty($row)) {
370 370
 			$wpdb->query(
371
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id )
371
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id)
372 372
 			);
373 373
 
374 374
 			$this->token_email = $row->email;
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 *
393 393
 	 * @return mixed
394 394
 	 */
395
-	public function users_donations_args( $args ) {
395
+	public function users_donations_args($args) {
396 396
 		$args['user'] = $this->token_email;
397 397
 
398 398
 		return $args;
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
 		global $wpdb;
414 414
 
415 415
 		// Create columns in customers table
416
-		$query = $wpdb->query( "ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`" );
416
+		$query = $wpdb->query("ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`");
417 417
 
418 418
 		// Columns added properly
419
-		if ( $query ) {
420
-			give_update_option( 'email_access_installed', 1 );
419
+		if ($query) {
420
+			give_update_option('email_access_installed', 1);
421 421
 		}
422 422
 
423 423
 	}
Please login to merge, or discard this patch.
includes/forms/functions.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  *
156 156
  * Used to redirect a user back to the donation form if there are errors present.
157 157
  *
158
- * @param array $args
158
+ * @param string $args
159 159
  *
160 160
  * @access public
161 161
  * @since  1.0
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
  * @since  1.0
302 302
  * @since  1.8.16 Add security check
303 303
  *
304
- * @return bool
304
+ * @return false|null
305 305
  */
306 306
 function give_listen_for_failed_payments() {
307 307
 
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
  *
750 750
  * @param int $form_id ID number of the form to retrieve the minimum price for
751 751
  *
752
- * @return mixed string|int Minimum price of the form
752
+ * @return string string|int Minimum price of the form
753 753
  */
754 754
 function give_get_form_minimum_price( $form_id = 0 ) {
755 755
 
Please login to merge, or discard this patch.
Spacing   +216 added lines, -217 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,14 +23,14 @@  discard block
 block discarded – undo
23 23
 
24 24
 	global $typenow;
25 25
 
26
-	if ( $typenow != 'give_forms' ) {
26
+	if ($typenow != 'give_forms') {
27 27
 		return true;
28 28
 	}
29 29
 
30 30
 	return false;
31 31
 }
32 32
 
33
-add_filter( 'give_shortcode_button_condition', 'give_shortcode_button_condition' );
33
+add_filter('give_shortcode_button_condition', 'give_shortcode_button_condition');
34 34
 
35 35
 
36 36
 /**
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
  *
41 41
  * @return int|false
42 42
  */
43
-function get_form_id_from_args( $args ) {
43
+function get_form_id_from_args($args) {
44 44
 
45
-	if ( isset( $args['form_id'] ) && $args['form_id'] != 0 ) {
45
+	if (isset($args['form_id']) && $args['form_id'] != 0) {
46 46
 
47
-		return intval( $args['form_id'] );
47
+		return intval($args['form_id']);
48 48
 	}
49 49
 
50 50
 	return false;
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
  *
60 60
  * @return bool
61 61
  */
62
-function give_is_float_labels_enabled( $args ) {
62
+function give_is_float_labels_enabled($args) {
63 63
 
64 64
 	$float_labels = '';
65 65
 
66
-	if ( ! empty( $args['float_labels'] ) ) {
66
+	if ( ! empty($args['float_labels'])) {
67 67
 		$float_labels = $args['float_labels'];
68 68
 	}
69 69
 
70
-	if ( empty( $float_labels ) ) {
71
-		$float_labels = give_get_meta( $args['form_id'], '_give_form_floating_labels', true );
70
+	if (empty($float_labels)) {
71
+		$float_labels = give_get_meta($args['form_id'], '_give_form_floating_labels', true);
72 72
 	}
73 73
 
74
-	if ( empty( $float_labels ) || ( 'global' === $float_labels ) ) {
75
-		$float_labels = give_get_option( 'floatlabels', 'disabled' );
74
+	if (empty($float_labels) || ('global' === $float_labels)) {
75
+		$float_labels = give_get_option('floatlabels', 'disabled');
76 76
 	}
77 77
 
78
-	return give_is_setting_enabled( $float_labels );
78
+	return give_is_setting_enabled($float_labels);
79 79
 }
80 80
 
81 81
 /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 	$can_checkout = true;
93 93
 
94
-	return (bool) apply_filters( 'give_can_checkout', $can_checkout );
94
+	return (bool) apply_filters('give_can_checkout', $can_checkout);
95 95
 }
96 96
 
97 97
 /**
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 function give_get_success_page_uri() {
106 106
 	$give_options = give_get_settings();
107 107
 
108
-	$success_page = isset( $give_options['success_page'] ) ? get_permalink( absint( $give_options['success_page'] ) ) : get_bloginfo( 'url' );
108
+	$success_page = isset($give_options['success_page']) ? get_permalink(absint($give_options['success_page'])) : get_bloginfo('url');
109 109
 
110
-	return apply_filters( 'give_get_success_page_uri', $success_page );
110
+	return apply_filters('give_get_success_page_uri', $success_page);
111 111
 }
112 112
 
113 113
 /**
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function give_is_success_page() {
121 121
 	$give_options    = give_get_settings();
122
-	$is_success_page = isset( $give_options['success_page'] ) ? is_page( $give_options['success_page'] ) : false;
122
+	$is_success_page = isset($give_options['success_page']) ? is_page($give_options['success_page']) : false;
123 123
 
124
-	return apply_filters( 'give_is_success_page', $is_success_page );
124
+	return apply_filters('give_is_success_page', $is_success_page);
125 125
 }
126 126
 
127 127
 /**
@@ -135,17 +135,17 @@  discard block
 block discarded – undo
135 135
  * @since       1.0
136 136
  * @return      void
137 137
  */
138
-function give_send_to_success_page( $query_string = null ) {
138
+function give_send_to_success_page($query_string = null) {
139 139
 
140 140
 	$redirect = give_get_success_page_uri();
141 141
 
142
-	if ( $query_string ) {
142
+	if ($query_string) {
143 143
 		$redirect .= $query_string;
144 144
 	}
145 145
 
146
-	$gateway = isset( $_REQUEST['give-gateway'] ) ? $_REQUEST['give-gateway'] : '';
146
+	$gateway = isset($_REQUEST['give-gateway']) ? $_REQUEST['give-gateway'] : '';
147 147
 
148
-	wp_redirect( apply_filters( 'give_success_page_redirect', $redirect, $gateway, $query_string ) );
148
+	wp_redirect(apply_filters('give_success_page_redirect', $redirect, $gateway, $query_string));
149 149
 	give_die();
150 150
 }
151 151
 
@@ -161,19 +161,19 @@  discard block
 block discarded – undo
161 161
  * @since  1.0
162 162
  * @return Void
163 163
  */
164
-function give_send_back_to_checkout( $args = array() ) {
164
+function give_send_back_to_checkout($args = array()) {
165 165
 
166
-	$url     = isset( $_POST['give-current-url'] ) ? sanitize_text_field( $_POST['give-current-url'] ) : '';
166
+	$url     = isset($_POST['give-current-url']) ? sanitize_text_field($_POST['give-current-url']) : '';
167 167
 	$form_id = 0;
168 168
 
169 169
 	// Set the form_id.
170
-	if ( isset( $_POST['give-form-id'] ) ) {
171
-		$form_id = sanitize_text_field( $_POST['give-form-id'] );
170
+	if (isset($_POST['give-form-id'])) {
171
+		$form_id = sanitize_text_field($_POST['give-form-id']);
172 172
 	}
173 173
 
174 174
 	// Need a URL to continue. If none, redirect back to single form.
175
-	if ( empty( $url ) ) {
176
-		wp_safe_redirect( get_permalink( $form_id ) );
175
+	if (empty($url)) {
176
+		wp_safe_redirect(get_permalink($form_id));
177 177
 		give_die();
178 178
 	}
179 179
 
@@ -182,41 +182,41 @@  discard block
 block discarded – undo
182 182
 	);
183 183
 
184 184
 	// Set the $level_id.
185
-	if ( isset( $_POST['give-price-id'] ) ) {
186
-		$defaults['level-id'] = sanitize_text_field( $_POST['give-price-id'] );
185
+	if (isset($_POST['give-price-id'])) {
186
+		$defaults['level-id'] = sanitize_text_field($_POST['give-price-id']);
187 187
 	}
188 188
 
189 189
 	// Check for backward compatibility.
190
-	if ( is_string( $args ) ) {
191
-		$args = str_replace( '?', '', $args );
190
+	if (is_string($args)) {
191
+		$args = str_replace('?', '', $args);
192 192
 	}
193 193
 
194
-	$args = wp_parse_args( $args, $defaults );
194
+	$args = wp_parse_args($args, $defaults);
195 195
 
196 196
 	// Merge URL query with $args to maintain third-party URL parameters after redirect.
197
-	$url_data = wp_parse_url( $url );
197
+	$url_data = wp_parse_url($url);
198 198
 
199 199
 	// Check if an array to prevent notices before parsing.
200
-	if ( isset( $url_data['query'] ) && ! empty( $url_data['query'] ) ) {
201
-		parse_str( $url_data['query'], $query );
200
+	if (isset($url_data['query']) && ! empty($url_data['query'])) {
201
+		parse_str($url_data['query'], $query);
202 202
 
203 203
 		// Precaution: don't allow any CC info.
204
-		unset( $query['card_number'] );
205
-		unset( $query['card_cvc'] );
204
+		unset($query['card_number']);
205
+		unset($query['card_cvc']);
206 206
 
207 207
 	} else {
208 208
 		// No $url_data so pass empty array.
209 209
 		$query = array();
210 210
 	}
211 211
 
212
-	$new_query        = array_merge( $args, $query );
213
-	$new_query_string = http_build_query( $new_query );
212
+	$new_query        = array_merge($args, $query);
213
+	$new_query_string = http_build_query($new_query);
214 214
 
215 215
 	// Assemble URL parts.
216
-	$redirect = home_url( '/' . $url_data['path'] . '?' . $new_query_string . '#give-form-' . $form_id . '-wrap' );
216
+	$redirect = home_url('/'.$url_data['path'].'?'.$new_query_string.'#give-form-'.$form_id.'-wrap');
217 217
 
218 218
 	// Redirect them.
219
-	wp_safe_redirect( apply_filters( 'give_send_back_to_checkout', $redirect, $args ) );
219
+	wp_safe_redirect(apply_filters('give_send_back_to_checkout', $redirect, $args));
220 220
 	give_die();
221 221
 
222 222
 }
@@ -232,16 +232,16 @@  discard block
 block discarded – undo
232 232
  * @since       1.0
233 233
  * @return      string
234 234
  */
235
-function give_get_success_page_url( $query_string = null ) {
235
+function give_get_success_page_url($query_string = null) {
236 236
 
237
-	$success_page = give_get_option( 'success_page', 0 );
238
-	$success_page = get_permalink( $success_page );
237
+	$success_page = give_get_option('success_page', 0);
238
+	$success_page = get_permalink($success_page);
239 239
 
240
-	if ( $query_string ) {
240
+	if ($query_string) {
241 241
 		$success_page .= $query_string;
242 242
 	}
243 243
 
244
-	return apply_filters( 'give_success_page_url', $success_page );
244
+	return apply_filters('give_success_page_url', $success_page);
245 245
 
246 246
 }
247 247
 
@@ -254,32 +254,31 @@  discard block
 block discarded – undo
254 254
  *
255 255
  * @return mixed Full URL to the Failed Donation Page, if present, home page if it doesn't exist.
256 256
  */
257
-function give_get_failed_transaction_uri( $extras = false ) {
257
+function give_get_failed_transaction_uri($extras = false) {
258 258
 	$give_options = give_get_settings();
259 259
 
260 260
 	// Remove question mark.
261
-	if ( 0 === strpos( $extras, '?' ) ) {
262
-		$extras = substr( $extras, 1 );
261
+	if (0 === strpos($extras, '?')) {
262
+		$extras = substr($extras, 1);
263 263
 	}
264 264
 
265
-	$extras_args = wp_parse_args( $extras );
265
+	$extras_args = wp_parse_args($extras);
266 266
 
267 267
 	// Set nonce if payment id exist in extra params.
268
-	if ( array_key_exists( 'payment-id', $extras_args ) ) {
269
-		$extras_args['_wpnonce'] = wp_create_nonce( "give-failed-donation-{$extras_args['payment-id']}" );
270
-		$extras                  = http_build_query( $extras_args );
268
+	if (array_key_exists('payment-id', $extras_args)) {
269
+		$extras_args['_wpnonce'] = wp_create_nonce("give-failed-donation-{$extras_args['payment-id']}");
270
+		$extras                  = http_build_query($extras_args);
271 271
 	}
272 272
 
273
-	$uri = ! empty( $give_options['failure_page'] ) ?
274
-		trailingslashit( get_permalink( $give_options['failure_page'] ) ) :
275
-		home_url();
273
+	$uri = ! empty($give_options['failure_page']) ?
274
+		trailingslashit(get_permalink($give_options['failure_page'])) : home_url();
276 275
 
277 276
 
278
-	if ( $extras ) {
277
+	if ($extras) {
279 278
 		$uri .= "?{$extras}";
280 279
 	}
281 280
 
282
-	return apply_filters( 'give_get_failed_transaction_uri', $uri );
281
+	return apply_filters('give_get_failed_transaction_uri', $uri);
283 282
 }
284 283
 
285 284
 /**
@@ -290,9 +289,9 @@  discard block
 block discarded – undo
290 289
  */
291 290
 function give_is_failed_transaction_page() {
292 291
 	$give_options = give_get_settings();
293
-	$ret          = isset( $give_options['failure_page'] ) ? is_page( $give_options['failure_page'] ) : false;
292
+	$ret          = isset($give_options['failure_page']) ? is_page($give_options['failure_page']) : false;
294 293
 
295
-	return apply_filters( 'give_is_failure_page', $ret );
294
+	return apply_filters('give_is_failure_page', $ret);
296 295
 }
297 296
 
298 297
 /**
@@ -305,25 +304,25 @@  discard block
 block discarded – undo
305 304
  */
306 305
 function give_listen_for_failed_payments() {
307 306
 
308
-	$failed_page = give_get_option( 'failure_page', 0 );
309
-	$payment_id  = ! empty( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : 0;
310
-	$nonce       = ! empty( $_GET['_wpnonce'] ) ? give_clean( $_GET['_wpnonce'] ) : false;
307
+	$failed_page = give_get_option('failure_page', 0);
308
+	$payment_id  = ! empty($_GET['payment-id']) ? absint($_GET['payment-id']) : 0;
309
+	$nonce       = ! empty($_GET['_wpnonce']) ? give_clean($_GET['_wpnonce']) : false;
311 310
 
312 311
 	// Bailout.
313
-	if ( ! $failed_page || ! is_page( $failed_page ) || ! $payment_id || ! $nonce ) {
312
+	if ( ! $failed_page || ! is_page($failed_page) || ! $payment_id || ! $nonce) {
314 313
 		return false;
315 314
 	}
316 315
 
317 316
 	// Security check.
318
-	if ( ! wp_verify_nonce( $nonce, "give-failed-donation-{$payment_id}" ) ) {
319
-		wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ) );
317
+	if ( ! wp_verify_nonce($nonce, "give-failed-donation-{$payment_id}")) {
318
+		wp_die(__('Nonce verification failed.', 'give'), __('Error', 'give'));
320 319
 	}
321 320
 
322 321
 	// Set payment status to failure
323
-	give_update_payment_status( $payment_id, 'failed' );
322
+	give_update_payment_status($payment_id, 'failed');
324 323
 }
325 324
 
326
-add_action( 'template_redirect', 'give_listen_for_failed_payments' );
325
+add_action('template_redirect', 'give_listen_for_failed_payments');
327 326
 
328 327
 /**
329 328
  * Retrieve the Donation History page URI
@@ -336,9 +335,9 @@  discard block
 block discarded – undo
336 335
 function give_get_history_page_uri() {
337 336
 	$give_options = give_get_settings();
338 337
 
339
-	$history_page = isset( $give_options['history_page'] ) ? get_permalink( absint( $give_options['history_page'] ) ) : get_bloginfo( 'url' );
338
+	$history_page = isset($give_options['history_page']) ? get_permalink(absint($give_options['history_page'])) : get_bloginfo('url');
340 339
 
341
-	return apply_filters( 'give_get_history_page_uri', $history_page );
340
+	return apply_filters('give_get_history_page_uri', $history_page);
342 341
 }
343 342
 
344 343
 /**
@@ -351,11 +350,11 @@  discard block
 block discarded – undo
351 350
  * @since       1.0
352 351
  * @return      bool
353 352
  */
354
-function give_field_is_required( $field = '', $form_id ) {
353
+function give_field_is_required($field = '', $form_id) {
355 354
 
356
-	$required_fields = give_get_required_fields( $form_id );
355
+	$required_fields = give_get_required_fields($form_id);
357 356
 
358
-	return array_key_exists( $field, $required_fields );
357
+	return array_key_exists($field, $required_fields);
359 358
 }
360 359
 
361 360
 /**
@@ -373,14 +372,14 @@  discard block
 block discarded – undo
373 372
  *
374 373
  * @return void
375 374
  */
376
-function give_record_donation_in_log( $give_form_id = 0, $payment_id, $price_id = false, $donation_date = null ) {
375
+function give_record_donation_in_log($give_form_id = 0, $payment_id, $price_id = false, $donation_date = null) {
377 376
 	global $give_logs;
378 377
 
379 378
 	$log_data = array(
380 379
 		'post_parent'   => $give_form_id,
381 380
 		'log_type'      => 'sale',
382
-		'post_date'     => isset( $donation_date ) ? $donation_date : null,
383
-		'post_date_gmt' => isset( $donation_date ) ? $donation_date : null,
381
+		'post_date'     => isset($donation_date) ? $donation_date : null,
382
+		'post_date_gmt' => isset($donation_date) ? $donation_date : null,
384 383
 	);
385 384
 
386 385
 	$log_meta = array(
@@ -388,7 +387,7 @@  discard block
 block discarded – undo
388 387
 		'price_id'   => (int) $price_id,
389 388
 	);
390 389
 
391
-	$give_logs->insert_log( $log_data, $log_meta );
390
+	$give_logs->insert_log($log_data, $log_meta);
392 391
 }
393 392
 
394 393
 
@@ -402,11 +401,11 @@  discard block
 block discarded – undo
402 401
  *
403 402
  * @return bool|int
404 403
  */
405
-function give_increase_donation_count( $form_id = 0, $quantity = 1 ) {
404
+function give_increase_donation_count($form_id = 0, $quantity = 1) {
406 405
 	$quantity = (int) $quantity;
407
-	$form     = new Give_Donate_Form( $form_id );
406
+	$form     = new Give_Donate_Form($form_id);
408 407
 
409
-	return $form->increase_sales( $quantity );
408
+	return $form->increase_sales($quantity);
410 409
 }
411 410
 
412 411
 /**
@@ -419,11 +418,11 @@  discard block
 block discarded – undo
419 418
  *
420 419
  * @return bool|int
421 420
  */
422
-function give_decrease_donation_count( $form_id = 0, $quantity = 1 ) {
421
+function give_decrease_donation_count($form_id = 0, $quantity = 1) {
423 422
 	$quantity = (int) $quantity;
424
-	$form     = new Give_Donate_Form( $form_id );
423
+	$form     = new Give_Donate_Form($form_id);
425 424
 
426
-	return $form->decrease_sales( $quantity );
425
+	return $form->decrease_sales($quantity);
427 426
 }
428 427
 
429 428
 /**
@@ -436,10 +435,10 @@  discard block
 block discarded – undo
436 435
  *
437 436
  * @return bool|int
438 437
  */
439
-function give_increase_earnings( $give_form_id = 0, $amount ) {
440
-	$form = new Give_Donate_Form( $give_form_id );
438
+function give_increase_earnings($give_form_id = 0, $amount) {
439
+	$form = new Give_Donate_Form($give_form_id);
441 440
 
442
-	return $form->increase_earnings( $amount );
441
+	return $form->increase_earnings($amount);
443 442
 }
444 443
 
445 444
 /**
@@ -454,11 +453,11 @@  discard block
 block discarded – undo
454 453
  *
455 454
  * @return bool|int
456 455
  */
457
-function give_decrease_form_earnings( $form_id = 0, $amount ) {
456
+function give_decrease_form_earnings($form_id = 0, $amount) {
458 457
 
459
-	$form = new Give_Donate_Form( $form_id );
458
+	$form = new Give_Donate_Form($form_id);
460 459
 
461
-	return $form->decrease_earnings( $amount );
460
+	return $form->decrease_earnings($amount);
462 461
 }
463 462
 
464 463
 
@@ -471,15 +470,15 @@  discard block
 block discarded – undo
471 470
  *
472 471
  * @return int $earnings Earnings for a certain form
473 472
  */
474
-function give_get_form_earnings_stats( $form_id = 0 ) {
475
-	$give_form = new Give_Donate_Form( $form_id );
473
+function give_get_form_earnings_stats($form_id = 0) {
474
+	$give_form = new Give_Donate_Form($form_id);
476 475
 
477 476
 	/**
478 477
 	 * Filter the form earnings
479 478
 	 *
480 479
 	 * @since 1.8.17
481 480
 	 */
482
-	return apply_filters( 'give_get_form_earnings_stats', $give_form->earnings, $form_id, $give_form );
481
+	return apply_filters('give_get_form_earnings_stats', $give_form->earnings, $form_id, $give_form);
483 482
 }
484 483
 
485 484
 
@@ -492,8 +491,8 @@  discard block
 block discarded – undo
492 491
  *
493 492
  * @return int $sales Amount of sales for a certain form
494 493
  */
495
-function give_get_form_sales_stats( $give_form_id = 0 ) {
496
-	$give_form = new Give_Donate_Form( $give_form_id );
494
+function give_get_form_sales_stats($give_form_id = 0) {
495
+	$give_form = new Give_Donate_Form($give_form_id);
497 496
 
498 497
 	return $give_form->sales;
499 498
 }
@@ -508,16 +507,16 @@  discard block
 block discarded – undo
508 507
  *
509 508
  * @return float $sales Average monthly sales
510 509
  */
511
-function give_get_average_monthly_form_sales( $form_id = 0 ) {
512
-	$sales        = give_get_form_sales_stats( $form_id );
513
-	$release_date = get_post_field( 'post_date', $form_id );
510
+function give_get_average_monthly_form_sales($form_id = 0) {
511
+	$sales        = give_get_form_sales_stats($form_id);
512
+	$release_date = get_post_field('post_date', $form_id);
514 513
 
515
-	$diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) );
514
+	$diff = abs(current_time('timestamp') - strtotime($release_date));
516 515
 
517
-	$months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication
516
+	$months = floor($diff / (30 * 60 * 60 * 24)); // Number of months since publication
518 517
 
519
-	if ( $months > 0 ) {
520
-		$sales = ( $sales / $months );
518
+	if ($months > 0) {
519
+		$sales = ($sales / $months);
521 520
 	}
522 521
 
523 522
 	return $sales;
@@ -533,16 +532,16 @@  discard block
 block discarded – undo
533 532
  *
534 533
  * @return float $earnings Average monthly earnings
535 534
  */
536
-function give_get_average_monthly_form_earnings( $form_id = 0 ) {
537
-	$earnings     = give_get_form_earnings_stats( $form_id );
538
-	$release_date = get_post_field( 'post_date', $form_id );
535
+function give_get_average_monthly_form_earnings($form_id = 0) {
536
+	$earnings     = give_get_form_earnings_stats($form_id);
537
+	$release_date = get_post_field('post_date', $form_id);
539 538
 
540
-	$diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) );
539
+	$diff = abs(current_time('timestamp') - strtotime($release_date));
541 540
 
542
-	$months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication
541
+	$months = floor($diff / (30 * 60 * 60 * 24)); // Number of months since publication
543 542
 
544
-	if ( $months > 0 ) {
545
-		$earnings = ( $earnings / $months );
543
+	if ($months > 0) {
544
+		$earnings = ($earnings / $months);
546 545
 	}
547 546
 
548 547
 	return $earnings < 0 ? 0 : $earnings;
@@ -563,27 +562,27 @@  discard block
 block discarded – undo
563 562
  *
564 563
  * @return string $price_name Name of the price option
565 564
  */
566
-function give_get_price_option_name( $form_id = 0, $price_id = 0, $payment_id = 0, $use_fallback = true ) {
565
+function give_get_price_option_name($form_id = 0, $price_id = 0, $payment_id = 0, $use_fallback = true) {
567 566
 
568
-	$prices     = give_get_variable_prices( $form_id );
567
+	$prices     = give_get_variable_prices($form_id);
569 568
 	$price_name = '';
570 569
 
571
-	if ( false === $prices ) {
570
+	if (false === $prices) {
572 571
 		return $price_name;
573 572
 	}
574 573
 
575
-	foreach ( $prices as $price ) {
574
+	foreach ($prices as $price) {
576 575
 
577
-		if ( intval( $price['_give_id']['level_id'] ) == intval( $price_id ) ) {
576
+		if (intval($price['_give_id']['level_id']) == intval($price_id)) {
578 577
 
579
-			$price_text     = isset( $price['_give_text'] ) ? $price['_give_text'] : '';
580
-			$price_fallback = $use_fallback ? give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ), '', true ) : '';
581
-			$price_name     = ! empty( $price_text ) ? $price_text : $price_fallback;
578
+			$price_text     = isset($price['_give_text']) ? $price['_give_text'] : '';
579
+			$price_fallback = $use_fallback ? give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false)), '', true) : '';
580
+			$price_name     = ! empty($price_text) ? $price_text : $price_fallback;
582 581
 
583 582
 		}
584 583
 	}
585 584
 
586
-	return apply_filters( 'give_get_price_option_name', $price_name, $form_id, $payment_id, $price_id );
585
+	return apply_filters('give_get_price_option_name', $price_name, $form_id, $payment_id, $price_id);
587 586
 }
588 587
 
589 588
 
@@ -597,25 +596,25 @@  discard block
 block discarded – undo
597 596
  *
598 597
  * @return string $range A fully formatted price range
599 598
  */
600
-function give_price_range( $form_id = 0, $formatted = true ) {
601
-	$low        = give_get_lowest_price_option( $form_id );
602
-	$high       = give_get_highest_price_option( $form_id );
603
-	$order_type = ! empty( $_REQUEST['order'] ) ? $_REQUEST['order'] : 'asc';
599
+function give_price_range($form_id = 0, $formatted = true) {
600
+	$low        = give_get_lowest_price_option($form_id);
601
+	$high       = give_get_highest_price_option($form_id);
602
+	$order_type = ! empty($_REQUEST['order']) ? $_REQUEST['order'] : 'asc';
604 603
 
605 604
 	$range = sprintf(
606 605
 		'<span class="give_price_range_%1$s">%2$s</span><span class="give_price_range_sep">&nbsp;&ndash;&nbsp;</span><span class="give_price_range_%3$s">%4$s</span>',
607 606
 		'asc' === $order_type ? 'low' : 'high',
608
-		'asc' === $order_type ? give_currency_filter( give_format_amount( $low, array( 'sanitize' => false ) ) ) : give_currency_filter( give_format_amount( $high, array( 'sanitize' => false ) ) ),
607
+		'asc' === $order_type ? give_currency_filter(give_format_amount($low, array('sanitize' => false))) : give_currency_filter(give_format_amount($high, array('sanitize' => false))),
609 608
 		'asc' === $order_type ? 'high' : 'low',
610
-		'asc' === $order_type ? give_currency_filter( give_format_amount( $high, array( 'sanitize' => false ) ) ) : give_currency_filter( give_format_amount( $low, array( 'sanitize' => false ) ) )
609
+		'asc' === $order_type ? give_currency_filter(give_format_amount($high, array('sanitize' => false))) : give_currency_filter(give_format_amount($low, array('sanitize' => false)))
611 610
 
612 611
 	);
613 612
 
614
-	if ( ! $formatted ) {
615
-		$range = wp_strip_all_tags( $range );
613
+	if ( ! $formatted) {
614
+		$range = wp_strip_all_tags($range);
616 615
 	}
617 616
 
618
-	return apply_filters( 'give_price_range', $range, $form_id, $low, $high );
617
+	return apply_filters('give_price_range', $range, $form_id, $low, $high);
619 618
 }
620 619
 
621 620
 
@@ -630,35 +629,35 @@  discard block
 block discarded – undo
630 629
  *
631 630
  * @return int ID of the lowest price
632 631
  */
633
-function give_get_lowest_price_id( $form_id = 0 ) {
632
+function give_get_lowest_price_id($form_id = 0) {
634 633
 
635
-	if ( empty( $form_id ) ) {
634
+	if (empty($form_id)) {
636 635
 		$form_id = get_the_ID();
637 636
 	}
638 637
 
639
-	if ( ! give_has_variable_prices( $form_id ) ) {
640
-		return give_get_form_price( $form_id );
638
+	if ( ! give_has_variable_prices($form_id)) {
639
+		return give_get_form_price($form_id);
641 640
 	}
642 641
 
643
-	$prices = give_get_variable_prices( $form_id );
642
+	$prices = give_get_variable_prices($form_id);
644 643
 
645 644
 	$min = $min_id = 0;
646 645
 
647
-	if ( ! empty( $prices ) ) {
646
+	if ( ! empty($prices)) {
648 647
 
649
-		foreach ( $prices as $key => $price ) {
648
+		foreach ($prices as $key => $price) {
650 649
 
651
-			if ( empty( $price['_give_amount'] ) ) {
650
+			if (empty($price['_give_amount'])) {
652 651
 				continue;
653 652
 			}
654 653
 
655
-			if ( ! isset( $min ) ) {
654
+			if ( ! isset($min)) {
656 655
 				$min = $price['_give_amount'];
657 656
 			} else {
658
-				$min = min( $min, $price['_give_amount'] );
657
+				$min = min($min, $price['_give_amount']);
659 658
 			}
660 659
 
661
-			if ( $price['_give_amount'] == $min ) {
660
+			if ($price['_give_amount'] == $min) {
662 661
 				$min_id = $price['_give_id']['level_id'];
663 662
 			}
664 663
 		}
@@ -676,22 +675,22 @@  discard block
 block discarded – undo
676 675
  *
677 676
  * @return float Amount of the lowest price
678 677
  */
679
-function give_get_lowest_price_option( $form_id = 0 ) {
680
-	if ( empty( $form_id ) ) {
678
+function give_get_lowest_price_option($form_id = 0) {
679
+	if (empty($form_id)) {
681 680
 		$form_id = get_the_ID();
682 681
 	}
683 682
 
684
-	if ( ! give_has_variable_prices( $form_id ) ) {
685
-		return give_get_form_price( $form_id );
683
+	if ( ! give_has_variable_prices($form_id)) {
684
+		return give_get_form_price($form_id);
686 685
 	}
687 686
 
688
-	if ( ! ( $low = get_post_meta( $form_id, '_give_levels_minimum_amount', true ) ) ) {
687
+	if ( ! ($low = get_post_meta($form_id, '_give_levels_minimum_amount', true))) {
689 688
 		// Backward compatibility.
690
-		$prices = wp_list_pluck( give_get_variable_prices( $form_id ), '_give_amount' );
691
-		$low    = ! empty( $prices ) ? min( $prices ) : 0;
689
+		$prices = wp_list_pluck(give_get_variable_prices($form_id), '_give_amount');
690
+		$low    = ! empty($prices) ? min($prices) : 0;
692 691
 	}
693 692
 
694
-	return give_maybe_sanitize_amount( $low );
693
+	return give_maybe_sanitize_amount($low);
695 694
 }
696 695
 
697 696
 /**
@@ -703,23 +702,23 @@  discard block
 block discarded – undo
703 702
  *
704 703
  * @return float Amount of the highest price
705 704
  */
706
-function give_get_highest_price_option( $form_id = 0 ) {
705
+function give_get_highest_price_option($form_id = 0) {
707 706
 
708
-	if ( empty( $form_id ) ) {
707
+	if (empty($form_id)) {
709 708
 		$form_id = get_the_ID();
710 709
 	}
711 710
 
712
-	if ( ! give_has_variable_prices( $form_id ) ) {
713
-		return give_get_form_price( $form_id );
711
+	if ( ! give_has_variable_prices($form_id)) {
712
+		return give_get_form_price($form_id);
714 713
 	}
715 714
 
716
-	if ( ! ( $high = get_post_meta( $form_id, '_give_levels_maximum_amount', true ) ) ) {
715
+	if ( ! ($high = get_post_meta($form_id, '_give_levels_maximum_amount', true))) {
717 716
 		// Backward compatibility.
718
-		$prices = wp_list_pluck( give_get_variable_prices( $form_id ), '_give_amount' );
719
-		$high   = ! empty( $prices ) ? max( $prices ) : 0;
717
+		$prices = wp_list_pluck(give_get_variable_prices($form_id), '_give_amount');
718
+		$high   = ! empty($prices) ? max($prices) : 0;
720 719
 	}
721 720
 
722
-	return give_maybe_sanitize_amount( $high );
721
+	return give_maybe_sanitize_amount($high);
723 722
 }
724 723
 
725 724
 /**
@@ -731,15 +730,15 @@  discard block
 block discarded – undo
731 730
  *
732 731
  * @return mixed string|int Price of the form
733 732
  */
734
-function give_get_form_price( $form_id = 0 ) {
733
+function give_get_form_price($form_id = 0) {
735 734
 
736
-	if ( empty( $form_id ) ) {
735
+	if (empty($form_id)) {
737 736
 		return false;
738 737
 	}
739 738
 
740
-	$form = new Give_Donate_Form( $form_id );
739
+	$form = new Give_Donate_Form($form_id);
741 740
 
742
-	return $form->__get( 'price' );
741
+	return $form->__get('price');
743 742
 }
744 743
 
745 744
 /**
@@ -751,13 +750,13 @@  discard block
 block discarded – undo
751 750
  *
752 751
  * @return mixed string|int Minimum price of the form
753 752
  */
754
-function give_get_form_minimum_price( $form_id = 0 ) {
753
+function give_get_form_minimum_price($form_id = 0) {
755 754
 
756
-	if ( empty( $form_id ) ) {
755
+	if (empty($form_id)) {
757 756
 		return false;
758 757
 	}
759 758
 
760
-	$form = new Give_Donate_Form( $form_id );
759
+	$form = new Give_Donate_Form($form_id);
761 760
 
762 761
 	return $form->get_minimum_price();
763 762
 
@@ -774,48 +773,48 @@  discard block
 block discarded – undo
774 773
  *
775 774
  * @return int $formatted_price
776 775
  */
777
-function give_price( $form_id = 0, $echo = true, $price_id = false ) {
776
+function give_price($form_id = 0, $echo = true, $price_id = false) {
778 777
 	$price = 0;
779 778
 
780
-	if ( empty( $form_id ) ) {
779
+	if (empty($form_id)) {
781 780
 		$form_id = get_the_ID();
782 781
 	}
783 782
 
784
-	if ( give_has_variable_prices( $form_id ) ) {
783
+	if (give_has_variable_prices($form_id)) {
785 784
 
786
-		$prices = give_get_variable_prices( $form_id );
785
+		$prices = give_get_variable_prices($form_id);
787 786
 
788
-		if ( false !== $price_id ) {
787
+		if (false !== $price_id) {
789 788
 
790 789
 			// loop through multi-prices to see which is default
791
-			foreach ( $prices as $price ) {
790
+			foreach ($prices as $price) {
792 791
 				// this is the default price
793
-				if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
792
+				if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
794 793
 					$price = (float) $price['_give_amount'];
795 794
 				};
796 795
 			}
797 796
 		} else {
798 797
 
799
-			$price = give_get_lowest_price_option( $form_id );
798
+			$price = give_get_lowest_price_option($form_id);
800 799
 		}
801 800
 	} else {
802 801
 
803
-		$price = give_get_form_price( $form_id );
802
+		$price = give_get_form_price($form_id);
804 803
 	}
805 804
 
806
-	$price           = apply_filters( 'give_form_price', give_maybe_sanitize_amount( $price ), $form_id );
807
-	$formatted_price = '<span class="give_price" id="give_price_' . $form_id . '">' . $price . '</span>';
808
-	$formatted_price = apply_filters( 'give_form_price_after_html', $formatted_price, $form_id, $price );
805
+	$price           = apply_filters('give_form_price', give_maybe_sanitize_amount($price), $form_id);
806
+	$formatted_price = '<span class="give_price" id="give_price_'.$form_id.'">'.$price.'</span>';
807
+	$formatted_price = apply_filters('give_form_price_after_html', $formatted_price, $form_id, $price);
809 808
 
810
-	if ( $echo ) {
809
+	if ($echo) {
811 810
 		echo $formatted_price;
812 811
 	} else {
813 812
 		return $formatted_price;
814 813
 	}
815 814
 }
816 815
 
817
-add_filter( 'give_form_price', 'give_format_amount', 10 );
818
-add_filter( 'give_form_price', 'give_currency_filter', 20 );
816
+add_filter('give_form_price', 'give_format_amount', 10);
817
+add_filter('give_form_price', 'give_currency_filter', 20);
819 818
 
820 819
 
821 820
 /**
@@ -828,19 +827,19 @@  discard block
 block discarded – undo
828 827
  *
829 828
  * @return float $amount Amount of the price option
830 829
  */
831
-function give_get_price_option_amount( $form_id = 0, $price_id = 0 ) {
832
-	$prices = give_get_variable_prices( $form_id );
830
+function give_get_price_option_amount($form_id = 0, $price_id = 0) {
831
+	$prices = give_get_variable_prices($form_id);
833 832
 
834 833
 	$amount = 0.00;
835 834
 
836
-	foreach ( $prices as $price ) {
837
-		if ( isset( $price['_give_id']['level_id'] ) && $price['_give_id']['level_id'] == $price_id ) {
838
-			$amount = isset( $price['_give_amount'] ) ? $price['_give_amount'] : 0.00;
835
+	foreach ($prices as $price) {
836
+		if (isset($price['_give_id']['level_id']) && $price['_give_id']['level_id'] == $price_id) {
837
+			$amount = isset($price['_give_amount']) ? $price['_give_amount'] : 0.00;
839 838
 			break;
840 839
 		};
841 840
 	}
842 841
 
843
-	return apply_filters( 'give_get_price_option_amount', give_maybe_sanitize_amount( $amount ), $form_id, $price_id );
842
+	return apply_filters('give_get_price_option_amount', give_maybe_sanitize_amount($amount), $form_id, $price_id);
844 843
 }
845 844
 
846 845
 /**
@@ -852,13 +851,13 @@  discard block
 block discarded – undo
852 851
  *
853 852
  * @return mixed string|int Goal of the form
854 853
  */
855
-function give_get_form_goal( $form_id = 0 ) {
854
+function give_get_form_goal($form_id = 0) {
856 855
 
857
-	if ( empty( $form_id ) ) {
856
+	if (empty($form_id)) {
858 857
 		return false;
859 858
 	}
860 859
 
861
-	$form = new Give_Donate_Form( $form_id );
860
+	$form = new Give_Donate_Form($form_id);
862 861
 
863 862
 	return $form->goal;
864 863
 
@@ -874,27 +873,27 @@  discard block
 block discarded – undo
874 873
  *
875 874
  * @return string $formatted_goal
876 875
  */
877
-function give_goal( $form_id = 0, $echo = true ) {
876
+function give_goal($form_id = 0, $echo = true) {
878 877
 
879
-	if ( empty( $form_id ) ) {
878
+	if (empty($form_id)) {
880 879
 		$form_id = get_the_ID();
881 880
 	}
882 881
 
883
-	$goal = give_get_form_goal( $form_id );
882
+	$goal = give_get_form_goal($form_id);
884 883
 
885
-	$goal           = apply_filters( 'give_form_goal', give_maybe_sanitize_amount( $goal ), $form_id );
886
-	$formatted_goal = '<span class="give_price" id="give_price_' . $form_id . '">' . $goal . '</span>';
887
-	$formatted_goal = apply_filters( 'give_form_price_after_html', $formatted_goal, $form_id, $goal );
884
+	$goal           = apply_filters('give_form_goal', give_maybe_sanitize_amount($goal), $form_id);
885
+	$formatted_goal = '<span class="give_price" id="give_price_'.$form_id.'">'.$goal.'</span>';
886
+	$formatted_goal = apply_filters('give_form_price_after_html', $formatted_goal, $form_id, $goal);
888 887
 
889
-	if ( $echo ) {
888
+	if ($echo) {
890 889
 		echo $formatted_goal;
891 890
 	} else {
892 891
 		return $formatted_goal;
893 892
 	}
894 893
 }
895 894
 
896
-add_filter( 'give_form_goal', 'give_format_amount', 10 );
897
-add_filter( 'give_form_goal', 'give_currency_filter', 20 );
895
+add_filter('give_form_goal', 'give_format_amount', 10);
896
+add_filter('give_form_goal', 'give_currency_filter', 20);
898 897
 
899 898
 
900 899
 /**
@@ -906,15 +905,15 @@  discard block
 block discarded – undo
906 905
  *
907 906
  * @return bool  $ret Whether or not the logged_in_only setting is set
908 907
  */
909
-function give_logged_in_only( $form_id ) {
908
+function give_logged_in_only($form_id) {
910 909
 	// If _give_logged_in_only is set to enable then guest can donate from that specific form.
911 910
 	// Otherwise it is member only donation form.
912
-	$val = give_get_meta( $form_id, '_give_logged_in_only', true );
913
-	$val = ! empty( $val ) ? $val : 'enabled';
911
+	$val = give_get_meta($form_id, '_give_logged_in_only', true);
912
+	$val = ! empty($val) ? $val : 'enabled';
914 913
 
915
-	$ret = ! give_is_setting_enabled( $val );
914
+	$ret = ! give_is_setting_enabled($val);
916 915
 
917
-	return (bool) apply_filters( 'give_logged_in_only', $ret, $form_id );
916
+	return (bool) apply_filters('give_logged_in_only', $ret, $form_id);
918 917
 }
919 918
 
920 919
 
@@ -927,11 +926,11 @@  discard block
 block discarded – undo
927 926
  *
928 927
  * @return string
929 928
  */
930
-function give_show_login_register_option( $form_id ) {
929
+function give_show_login_register_option($form_id) {
931 930
 
932
-	$show_register_form = give_get_meta( $form_id, '_give_show_register_form', true );
931
+	$show_register_form = give_get_meta($form_id, '_give_show_register_form', true);
933 932
 
934
-	return apply_filters( 'give_show_register_form', $show_register_form, $form_id );
933
+	return apply_filters('give_show_register_form', $show_register_form, $form_id);
935 934
 
936 935
 }
937 936
 
@@ -947,12 +946,12 @@  discard block
 block discarded – undo
947 946
  *
948 947
  * @return array
949 948
  */
950
-function _give_get_prefill_form_field_values( $form_id ) {
949
+function _give_get_prefill_form_field_values($form_id) {
951 950
 	$logged_in_donor_info = array();
952 951
 
953
-	if ( is_user_logged_in() ) :
954
-		$donor_data    = get_userdata( get_current_user_id() );
955
-		$donor_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
952
+	if (is_user_logged_in()) :
953
+		$donor_data    = get_userdata(get_current_user_id());
954
+		$donor_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
956 955
 
957 956
 		$logged_in_donor_info = array(
958 957
 			// First name.
@@ -965,42 +964,42 @@  discard block
 block discarded – undo
965 964
 			'give_email'      => $donor_data->user_email,
966 965
 
967 966
 			// Street address 1.
968
-			'card_address'    => ( ! empty( $donor_address['line1'] ) ? $donor_address['line1'] : '' ),
967
+			'card_address'    => ( ! empty($donor_address['line1']) ? $donor_address['line1'] : ''),
969 968
 
970 969
 			// Street address 2.
971
-			'card_address_2'  => ( ! empty( $donor_address['line2'] ) ? $donor_address['line2'] : '' ),
970
+			'card_address_2'  => ( ! empty($donor_address['line2']) ? $donor_address['line2'] : ''),
972 971
 
973 972
 			// Country.
974
-			'billing_country' => ( ! empty( $donor_address['country'] ) ? $donor_address['country'] : '' ),
973
+			'billing_country' => ( ! empty($donor_address['country']) ? $donor_address['country'] : ''),
975 974
 
976 975
 			// State.
977
-			'card_state'      => ( ! empty( $donor_address['state'] ) ? $donor_address['state'] : '' ),
976
+			'card_state'      => ( ! empty($donor_address['state']) ? $donor_address['state'] : ''),
978 977
 
979 978
 			// City.
980
-			'card_city'       => ( ! empty( $donor_address['city'] ) ? $donor_address['city'] : '' ),
979
+			'card_city'       => ( ! empty($donor_address['city']) ? $donor_address['city'] : ''),
981 980
 
982 981
 			// Zipcode
983
-			'card_zip'        => ( ! empty( $donor_address['zip'] ) ? $donor_address['zip'] : '' ),
982
+			'card_zip'        => ( ! empty($donor_address['zip']) ? $donor_address['zip'] : ''),
984 983
 		);
985 984
 	endif;
986 985
 
987 986
 	// Bailout: Auto fill form field values only form form which donor is donating.
988 987
 	if (
989
-		empty( $_GET['form-id'] )
988
+		empty($_GET['form-id'])
990 989
 		|| ! $form_id
991
-		|| ( $form_id !== absint( $_GET['form-id'] ) )
990
+		|| ($form_id !== absint($_GET['form-id']))
992 991
 	) {
993 992
 		return $logged_in_donor_info;
994 993
 	}
995 994
 
996 995
 	// Get purchase data.
997
-	$give_purchase_data = Give()->session->get( 'give_purchase' );
996
+	$give_purchase_data = Give()->session->get('give_purchase');
998 997
 
999 998
 	// Get donor info from form data.
1000
-	$give_donor_info_in_session = empty( $give_purchase_data['post_data'] )
999
+	$give_donor_info_in_session = empty($give_purchase_data['post_data'])
1001 1000
 		? array()
1002 1001
 		: $give_purchase_data['post_data'];
1003 1002
 
1004 1003
 	// Output.
1005
-	return wp_parse_args( $give_donor_info_in_session, $logged_in_donor_info );
1004
+	return wp_parse_args($give_donor_info_in_session, $logged_in_donor_info);
1006 1005
 }
Please login to merge, or discard this patch.
includes/login-register.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
  * @param string $user_login Username
181 181
  * @param string $user_pass  Password
182 182
  *
183
- * @return bool
183
+ * @return false|null
184 184
  */
185 185
 function give_log_user_in( $user_id, $user_login, $user_pass ) {
186 186
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
  *
222 222
  * @param array $data Data sent from the register form
223 223
  *
224
- * @return bool
224
+ * @return false|null
225 225
  */
226 226
 function give_process_register_form( $data ) {
227 227
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
  *
308 308
  * @since 1.8.17
309 309
  *
310
- * @return bool
310
+ * @return boolean|null
311 311
  */
312 312
 function give_email_access_login() {
313 313
 
Please login to merge, or discard this patch.
Spacing   +99 added lines, -99 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
 
@@ -26,23 +26,23 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return string Login form
28 28
  */
29
-function give_login_form( $login_redirect = '', $logout_redirect = '' ) {
30
-	if ( empty( $login_redirect ) ) {
31
-		$login_redirect = add_query_arg( 'give-login-success', 'true', give_get_current_page_url() );
29
+function give_login_form($login_redirect = '', $logout_redirect = '') {
30
+	if (empty($login_redirect)) {
31
+		$login_redirect = add_query_arg('give-login-success', 'true', give_get_current_page_url());
32 32
 	}
33 33
 
34
-	if ( empty( $logout_redirect ) ) {
35
-		$logout_redirect = add_query_arg( 'give-logout-success', 'true', give_get_current_page_url() );
34
+	if (empty($logout_redirect)) {
35
+		$logout_redirect = add_query_arg('give-logout-success', 'true', give_get_current_page_url());
36 36
 	}
37 37
 
38 38
 	// Add user_logout action to logout url.
39 39
 	$logout_redirect = add_query_arg(
40 40
 		array(
41 41
 			'give_action'          => 'user_logout',
42
-			'give_logout_nonce'    => wp_create_nonce( 'give-logout-nonce' ),
43
-			'give_logout_redirect' => urlencode( $logout_redirect ),
42
+			'give_logout_nonce'    => wp_create_nonce('give-logout-nonce'),
43
+			'give_logout_redirect' => urlencode($logout_redirect),
44 44
 		),
45
-		home_url( '/' )
45
+		home_url('/')
46 46
 	);
47 47
 
48 48
 	ob_start();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		)
56 56
 	);
57 57
 
58
-	return apply_filters( 'give_login_form', ob_get_clean() );
58
+	return apply_filters('give_login_form', ob_get_clean());
59 59
 }
60 60
 
61 61
 /**
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
  *
69 69
  * @return string Register form
70 70
  */
71
-function give_register_form( $redirect = '' ) {
72
-	if ( empty( $redirect ) ) {
71
+function give_register_form($redirect = '') {
72
+	if (empty($redirect)) {
73 73
 		$redirect = give_get_current_page_url();
74 74
 	}
75 75
 
76 76
 	ob_start();
77 77
 
78
-	if ( ! is_user_logged_in() ) {
78
+	if ( ! is_user_logged_in()) {
79 79
 		give_get_template(
80 80
 			'shortcode-register',
81 81
 			array(
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		);
85 85
 	}
86 86
 
87
-	return apply_filters( 'give_register_form', ob_get_clean() );
87
+	return apply_filters('give_register_form', ob_get_clean());
88 88
 }
89 89
 
90 90
 /**
@@ -96,40 +96,40 @@  discard block
 block discarded – undo
96 96
  *
97 97
  * @return void
98 98
  */
99
-function give_process_login_form( $data ) {
100
-	if ( wp_verify_nonce( $data['give_login_nonce'], 'give-login-nonce' ) ) {
99
+function give_process_login_form($data) {
100
+	if (wp_verify_nonce($data['give_login_nonce'], 'give-login-nonce')) {
101 101
 
102 102
 		// Set Receipt Access Session.
103
-		if ( ! empty( $_GET['payment_key'] ) ) {
104
-			Give()->session->set( 'receipt_access', true );
103
+		if ( ! empty($_GET['payment_key'])) {
104
+			Give()->session->set('receipt_access', true);
105 105
 		}
106 106
 
107
-		$user_data = get_user_by( 'login', $data['give_user_login'] );
108
-		if ( ! $user_data ) {
109
-			$user_data = get_user_by( 'email', $data['give_user_login'] );
107
+		$user_data = get_user_by('login', $data['give_user_login']);
108
+		if ( ! $user_data) {
109
+			$user_data = get_user_by('email', $data['give_user_login']);
110 110
 		}
111
-		if ( $user_data ) {
111
+		if ($user_data) {
112 112
 			$user_ID    = $user_data->ID;
113 113
 			$user_email = $user_data->user_email;
114
-			if ( wp_check_password( $data['give_user_pass'], $user_data->user_pass, $user_ID ) ) {
115
-				give_log_user_in( $user_data->ID, $data['give_user_login'], $data['give_user_pass'] );
114
+			if (wp_check_password($data['give_user_pass'], $user_data->user_pass, $user_ID)) {
115
+				give_log_user_in($user_data->ID, $data['give_user_login'], $data['give_user_pass']);
116 116
 			} else {
117
-				give_set_error( 'password_incorrect', __( 'The password you entered is incorrect.', 'give' ) );
117
+				give_set_error('password_incorrect', __('The password you entered is incorrect.', 'give'));
118 118
 			}
119 119
 		} else {
120
-			give_set_error( 'username_incorrect', __( 'The username you entered does not exist.', 'give' ) );
120
+			give_set_error('username_incorrect', __('The username you entered does not exist.', 'give'));
121 121
 		}
122 122
 		// Check for errors and redirect if none present
123 123
 		$errors = give_get_errors();
124
-		if ( ! $errors ) {
125
-			$redirect = apply_filters( 'give_login_redirect', $data['give_login_redirect'], $user_ID );
126
-			wp_redirect( $redirect );
124
+		if ( ! $errors) {
125
+			$redirect = apply_filters('give_login_redirect', $data['give_login_redirect'], $user_ID);
126
+			wp_redirect($redirect);
127 127
 			give_die();
128 128
 		}
129 129
 	}
130 130
 }
131 131
 
132
-add_action( 'give_user_login', 'give_process_login_form' );
132
+add_action('give_user_login', 'give_process_login_form');
133 133
 
134 134
 
135 135
 /**
@@ -141,18 +141,18 @@  discard block
 block discarded – undo
141 141
  *
142 142
  * @return void
143 143
  */
144
-function give_process_user_logout( $data ) {
145
-	if ( wp_verify_nonce( $data['give_logout_nonce'], 'give-logout-nonce' ) && is_user_logged_in() ) {
144
+function give_process_user_logout($data) {
145
+	if (wp_verify_nonce($data['give_logout_nonce'], 'give-logout-nonce') && is_user_logged_in()) {
146 146
 
147 147
 		// Prevent occurring of any custom action on wp_logout.
148
-		remove_all_actions( 'wp_logout' );
148
+		remove_all_actions('wp_logout');
149 149
 
150 150
 		/**
151 151
 		 * Fires before processing user logout.
152 152
 		 *
153 153
 		 * @since 1.0
154 154
 		 */
155
-		do_action( 'give_before_user_logout' );
155
+		do_action('give_before_user_logout');
156 156
 
157 157
 		// Logout user.
158 158
 		wp_logout();
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 		 *
163 163
 		 * @since 1.0
164 164
 		 */
165
-		do_action( 'give_after_user_logout' );
165
+		do_action('give_after_user_logout');
166 166
 
167
-		wp_redirect( $data['give_logout_redirect'] );
167
+		wp_redirect($data['give_logout_redirect']);
168 168
 		give_die();
169 169
 	}
170 170
 }
171 171
 
172
-add_action( 'give_user_logout', 'give_process_user_logout' );
172
+add_action('give_user_logout', 'give_process_user_logout');
173 173
 
174 174
 /**
175 175
  * Log User In
@@ -182,14 +182,14 @@  discard block
 block discarded – undo
182 182
  *
183 183
  * @return bool
184 184
  */
185
-function give_log_user_in( $user_id, $user_login, $user_pass ) {
185
+function give_log_user_in($user_id, $user_login, $user_pass) {
186 186
 
187
-	if ( $user_id < 1 ) {
187
+	if ($user_id < 1) {
188 188
 		return false;
189 189
 	}
190 190
 
191
-	wp_set_auth_cookie( $user_id );
192
-	wp_set_current_user( $user_id, $user_login );
191
+	wp_set_auth_cookie($user_id);
192
+	wp_set_current_user($user_id, $user_login);
193 193
 
194 194
 	/**
195 195
 	 * Fires after the user has successfully logged in.
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 * @param string $user_login Username.
200 200
 	 * @param WP_User $$user      WP_User object of the logged-in user.
201 201
 	 */
202
-	do_action( 'wp_login', $user_login, get_userdata( $user_id ) );
202
+	do_action('wp_login', $user_login, get_userdata($user_id));
203 203
 
204 204
 	/**
205 205
 	 * Fires after give user has successfully logged in.
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 * @param string $user_login Username.
211 211
 	 * @param string $user_pass  User password.
212 212
 	 */
213
-	do_action( 'give_log_user_in', $user_id, $user_login, $user_pass );
213
+	do_action('give_log_user_in', $user_id, $user_login, $user_pass);
214 214
 }
215 215
 
216 216
 
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
  *
224 224
  * @return bool
225 225
  */
226
-function give_process_register_form( $data ) {
226
+function give_process_register_form($data) {
227 227
 
228
-	if ( is_user_logged_in() ) {
228
+	if (is_user_logged_in()) {
229 229
 		return false;
230 230
 	}
231 231
 
232
-	if ( empty( $_POST['give_register_submit'] ) ) {
232
+	if (empty($_POST['give_register_submit'])) {
233 233
 		return false;
234 234
 	}
235 235
 
@@ -238,38 +238,38 @@  discard block
 block discarded – undo
238 238
 	 *
239 239
 	 * @since 1.0
240 240
 	 */
241
-	do_action( 'give_pre_process_register_form' );
241
+	do_action('give_pre_process_register_form');
242 242
 
243
-	if ( empty( $data['give_user_login'] ) ) {
244
-		give_set_error( 'empty_username', esc_html__( 'Invalid username.', 'give' ) );
243
+	if (empty($data['give_user_login'])) {
244
+		give_set_error('empty_username', esc_html__('Invalid username.', 'give'));
245 245
 	}
246 246
 
247
-	if ( username_exists( $data['give_user_login'] ) ) {
248
-		give_set_error( 'username_unavailable', esc_html__( 'Username already taken.', 'give' ) );
247
+	if (username_exists($data['give_user_login'])) {
248
+		give_set_error('username_unavailable', esc_html__('Username already taken.', 'give'));
249 249
 	}
250 250
 
251
-	if ( ! validate_username( $data['give_user_login'] ) ) {
252
-		give_set_error( 'username_invalid', esc_html__( 'Invalid username.', 'give' ) );
251
+	if ( ! validate_username($data['give_user_login'])) {
252
+		give_set_error('username_invalid', esc_html__('Invalid username.', 'give'));
253 253
 	}
254 254
 
255
-	if ( email_exists( $data['give_user_email'] ) ) {
256
-		give_set_error( 'email_unavailable', esc_html__( 'Email address already taken.', 'give' ) );
255
+	if (email_exists($data['give_user_email'])) {
256
+		give_set_error('email_unavailable', esc_html__('Email address already taken.', 'give'));
257 257
 	}
258 258
 
259
-	if ( empty( $data['give_user_email'] ) || ! is_email( $data['give_user_email'] ) ) {
260
-		give_set_error( 'email_invalid', esc_html__( 'Invalid email.', 'give' ) );
259
+	if (empty($data['give_user_email']) || ! is_email($data['give_user_email'])) {
260
+		give_set_error('email_invalid', esc_html__('Invalid email.', 'give'));
261 261
 	}
262 262
 
263
-	if ( ! empty( $data['give_payment_email'] ) && $data['give_payment_email'] != $data['give_user_email'] && ! is_email( $data['give_payment_email'] ) ) {
264
-		give_set_error( 'payment_email_invalid', esc_html__( 'Invalid payment email.', 'give' ) );
263
+	if ( ! empty($data['give_payment_email']) && $data['give_payment_email'] != $data['give_user_email'] && ! is_email($data['give_payment_email'])) {
264
+		give_set_error('payment_email_invalid', esc_html__('Invalid payment email.', 'give'));
265 265
 	}
266 266
 
267
-	if ( empty( $_POST['give_user_pass'] ) ) {
268
-		give_set_error( 'empty_password', esc_html__( 'Please enter a password.', 'give' ) );
267
+	if (empty($_POST['give_user_pass'])) {
268
+		give_set_error('empty_password', esc_html__('Please enter a password.', 'give'));
269 269
 	}
270 270
 
271
-	if ( ( ! empty( $_POST['give_user_pass'] ) && empty( $_POST['give_user_pass2'] ) ) || ( $_POST['give_user_pass'] !== $_POST['give_user_pass2'] ) ) {
272
-		give_set_error( 'password_mismatch', esc_html__( 'Passwords don\'t match.', 'give' ) );
271
+	if (( ! empty($_POST['give_user_pass']) && empty($_POST['give_user_pass2'])) || ($_POST['give_user_pass'] !== $_POST['give_user_pass2'])) {
272
+		give_set_error('password_mismatch', esc_html__('Passwords don\'t match.', 'give'));
273 273
 	}
274 274
 
275 275
 	/**
@@ -277,29 +277,29 @@  discard block
 block discarded – undo
277 277
 	 *
278 278
 	 * @since 1.0
279 279
 	 */
280
-	do_action( 'give_process_register_form' );
280
+	do_action('give_process_register_form');
281 281
 
282 282
 	// Check for errors and redirect if none present
283 283
 	$errors = give_get_errors();
284 284
 
285
-	if ( empty( $errors ) ) {
285
+	if (empty($errors)) {
286 286
 
287
-		$redirect = apply_filters( 'give_register_redirect', $data['give_redirect'] );
287
+		$redirect = apply_filters('give_register_redirect', $data['give_redirect']);
288 288
 
289
-		give_register_and_login_new_user( array(
289
+		give_register_and_login_new_user(array(
290 290
 			'user_login'      => $data['give_user_login'],
291 291
 			'user_pass'       => $data['give_user_pass'],
292 292
 			'user_email'      => $data['give_user_email'],
293
-			'user_registered' => date( 'Y-m-d H:i:s' ),
294
-			'role'            => get_option( 'default_role' ),
295
-		) );
293
+			'user_registered' => date('Y-m-d H:i:s'),
294
+			'role'            => get_option('default_role'),
295
+		));
296 296
 
297
-		wp_redirect( $redirect );
297
+		wp_redirect($redirect);
298 298
 		give_die();
299 299
 	}
300 300
 }
301 301
 
302
-add_action( 'give_user_register', 'give_process_register_form' );
302
+add_action('give_user_register', 'give_process_register_form');
303 303
 
304 304
 
305 305
 /**
@@ -312,23 +312,23 @@  discard block
 block discarded – undo
312 312
 function give_email_access_login() {
313 313
 
314 314
 	// Verify nonce.
315
-	if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'give' ) ) {
315
+	if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce($_POST['_wpnonce'], 'give')) {
316 316
 		return false;
317 317
 	}
318 318
 
319 319
 	// Need email to proceed.
320
-	$email = isset( $_POST['give_email'] ) ? give_clean( $_POST['give_email'] ) : '';
321
-	if ( empty( $email ) ) {
322
-		give_set_error( 'give_empty_email', __( 'Please enter the email address you used for your donation.', 'give' ) );
320
+	$email = isset($_POST['give_email']) ? give_clean($_POST['give_email']) : '';
321
+	if (empty($email)) {
322
+		give_set_error('give_empty_email', __('Please enter the email address you used for your donation.', 'give'));
323 323
 	}
324 324
 
325
-	$recaptcha_key    = give_get_option( 'recaptcha_key' );
326
-	$recaptcha_secret = give_get_option( 'recaptcha_secret' );
327
-	$enable_recaptcha = ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ? true : false;
328
-	$access_token     = ! empty( $_GET['payment_key'] ) ? $_GET['payment_key'] : '';
325
+	$recaptcha_key    = give_get_option('recaptcha_key');
326
+	$recaptcha_secret = give_get_option('recaptcha_secret');
327
+	$enable_recaptcha = ! empty($recaptcha_key) && ! empty($recaptcha_secret) ? true : false;
328
+	$access_token     = ! empty($_GET['payment_key']) ? $_GET['payment_key'] : '';
329 329
 
330 330
 	// Use reCAPTCHA.
331
-	if ( $enable_recaptcha ) {
331
+	if ($enable_recaptcha) {
332 332
 
333 333
 		$args = array(
334 334
 			'secret'   => $recaptcha_secret,
@@ -336,43 +336,43 @@  discard block
 block discarded – undo
336 336
 			'remoteip' => $_POST['give_ip'],
337 337
 		);
338 338
 
339
-		if ( ! empty( $args['response'] ) ) {
340
-			$request = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array(
339
+		if ( ! empty($args['response'])) {
340
+			$request = wp_remote_post('https://www.google.com/recaptcha/api/siteverify', array(
341 341
 				'body' => $args,
342
-			) );
343
-			if ( ! is_wp_error( $request ) || 200 == wp_remote_retrieve_response_code( $request ) ) {
342
+			));
343
+			if ( ! is_wp_error($request) || 200 == wp_remote_retrieve_response_code($request)) {
344 344
 
345
-				$response = json_decode( $request['body'], true );
345
+				$response = json_decode($request['body'], true);
346 346
 
347 347
 				// reCAPTCHA fail.
348
-				if ( ! $response['success'] ) {
349
-					give_set_error( 'give_recaptcha_test_failed', apply_filters( 'give_recaptcha_test_failed_message', __( 'reCAPTCHA test failed.', 'give' ) ) );
348
+				if ( ! $response['success']) {
349
+					give_set_error('give_recaptcha_test_failed', apply_filters('give_recaptcha_test_failed_message', __('reCAPTCHA test failed.', 'give')));
350 350
 				}
351 351
 			} else {
352 352
 
353 353
 				// Connection issue.
354
-				give_set_error( 'give_recaptcha_connection_issue', apply_filters( 'give_recaptcha_connection_issue_message', __( 'Unable to connect to reCAPTCHA server.', 'give' ) ) );
354
+				give_set_error('give_recaptcha_connection_issue', apply_filters('give_recaptcha_connection_issue_message', __('Unable to connect to reCAPTCHA server.', 'give')));
355 355
 
356 356
 			}  // End if().
357 357
 		} else {
358 358
 
359
-			give_set_error( 'give_recaptcha_failed', apply_filters( 'give_recaptcha_failed_message', __( 'It looks like the reCAPTCHA test has failed.', 'give' ) ) );
359
+			give_set_error('give_recaptcha_failed', apply_filters('give_recaptcha_failed_message', __('It looks like the reCAPTCHA test has failed.', 'give')));
360 360
 
361 361
 		}  // End if().
362 362
 	}  // End if().
363 363
 
364 364
 	// If no errors or only expired token key error - then send email.
365
-	if ( ! give_get_errors() ) {
365
+	if ( ! give_get_errors()) {
366 366
 
367
-		$donor = Give()->donors->get_donor_by( 'email', $email );
367
+		$donor = Give()->donors->get_donor_by('email', $email);
368 368
 
369 369
 		Give()->email_access->init();
370 370
 
371 371
 		// Verify that donor object is present and donor is connected with its user profile or not.
372
-		if ( is_object( $donor ) ) {
372
+		if (is_object($donor)) {
373 373
 
374 374
 			// Verify that email can be sent.
375
-			if ( ! Give()->email_access->can_send_email( $donor->id ) ) {
375
+			if ( ! Give()->email_access->can_send_email($donor->id)) {
376 376
 
377 377
 				$_POST['email-access-exhausted'] = true;
378 378
 
@@ -380,10 +380,10 @@  discard block
 block discarded – undo
380 380
 
381 381
 			} else {
382 382
 				// Send the email. Requests not
383
-				$email_sent = Give()->email_access->send_email( $donor->id, $donor->email );
383
+				$email_sent = Give()->email_access->send_email($donor->id, $donor->email);
384 384
 
385
-				if ( ! $email_sent ) {
386
-					give_set_error( 'give_email_access_send_issue', __( 'Unable to send email. Please try again.', 'give' ) );
385
+				if ( ! $email_sent) {
386
+					give_set_error('give_email_access_send_issue', __('Unable to send email. Please try again.', 'give'));
387 387
 					return false;
388 388
 				}
389 389
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
 		} else {
396 396
 
397
-			give_set_error( 'give-no-donations', __( 'We were unable to find any donations associated with the email address provided. Please try again using another email.', 'give' ) );
397
+			give_set_error('give-no-donations', __('We were unable to find any donations associated with the email address provided. Please try again using another email.', 'give'));
398 398
 
399 399
 		}  // End if().
400 400
 
@@ -402,4 +402,4 @@  discard block
 block discarded – undo
402 402
 
403 403
 }
404 404
 
405
-add_action( 'give_email_access_form_login', 'give_email_access_login' );
406 405
\ No newline at end of file
406
+add_action('give_email_access_form_login', 'give_email_access_login');
407 407
\ No newline at end of file
Please login to merge, or discard this patch.
includes/payments/functions.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
  *
711 711
  * @since 1.0
712 712
  *
713
- * @return int $earnings Earnings
713
+ * @return double $earnings Earnings
714 714
  */
715 715
 function give_get_earnings_by_date( $day = null, $month_num, $year = null, $hour = null ) {
716 716
 
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
  *
1008 1008
  * @since 1.0
1009 1009
  *
1010
- * @return array $user_info User Info Meta Values.
1010
+ * @return string $user_info User Info Meta Values.
1011 1011
  */
1012 1012
 function give_get_payment_meta_user_info( $payment_id ) {
1013 1013
 	$payment = new Give_Payment( $payment_id );
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
  *
1025 1025
  * @since 1.0
1026 1026
  *
1027
- * @return int $form_id Form ID.
1027
+ * @return string $form_id Form ID.
1028 1028
  */
1029 1029
 function give_get_payment_form_id( $payment_id ) {
1030 1030
 	$payment = new Give_Payment( $payment_id );
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
  * and give_format_amount() to format the amount correctly in case of formatted amount.
1332 1332
  *
1333 1333
  * @param int|Give_Payment $donation    Donation ID or Donation Object.
1334
- * @param bool|array       $format_args Currency Formatting Arguments.
1334
+ * @param string       $format_args Currency Formatting Arguments.
1335 1335
  *
1336 1336
  * @since 1.0
1337 1337
  * @since 1.8.17 Added filter and internally use functions.
Please login to merge, or discard this patch.
Spacing   +421 added lines, -421 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
 
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
  *
44 44
  * @return array $payments Payments retrieved from the database
45 45
  */
46
-function give_get_payments( $args = array() ) {
46
+function give_get_payments($args = array()) {
47 47
 
48 48
 	// Fallback to post objects to ensure backwards compatibility.
49
-	if ( ! isset( $args['output'] ) ) {
49
+	if ( ! isset($args['output'])) {
50 50
 		$args['output'] = 'posts';
51 51
 	}
52 52
 
53
-	$args     = apply_filters( 'give_get_payments_args', $args );
54
-	$payments = new Give_Payments_Query( $args );
53
+	$args     = apply_filters('give_get_payments_args', $args);
54
+	$payments = new Give_Payments_Query($args);
55 55
 
56 56
 	return $payments->get_payments();
57 57
 }
@@ -66,48 +66,48 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @return mixed
68 68
  */
69
-function give_get_payment_by( $field = '', $value = '' ) {
69
+function give_get_payment_by($field = '', $value = '') {
70 70
 
71
-	if ( empty( $field ) || empty( $value ) ) {
71
+	if (empty($field) || empty($value)) {
72 72
 		return false;
73 73
 	}
74 74
 
75
-	switch ( strtolower( $field ) ) {
75
+	switch (strtolower($field)) {
76 76
 
77 77
 		case 'id':
78
-			$payment = new Give_Payment( $value );
78
+			$payment = new Give_Payment($value);
79 79
 			$id      = $payment->ID;
80 80
 
81
-			if ( empty( $id ) ) {
81
+			if (empty($id)) {
82 82
 				return false;
83 83
 			}
84 84
 
85 85
 			break;
86 86
 
87 87
 		case 'key':
88
-			$payment = give_get_payments( array(
88
+			$payment = give_get_payments(array(
89 89
 				'meta_key'       => '_give_payment_purchase_key',
90 90
 				'meta_value'     => $value,
91 91
 				'posts_per_page' => 1,
92 92
 				'fields'         => 'ids',
93
-			) );
93
+			));
94 94
 
95
-			if ( $payment ) {
96
-				$payment = new Give_Payment( $payment[0] );
95
+			if ($payment) {
96
+				$payment = new Give_Payment($payment[0]);
97 97
 			}
98 98
 
99 99
 			break;
100 100
 
101 101
 		case 'payment_number':
102
-			$payment = give_get_payments( array(
102
+			$payment = give_get_payments(array(
103 103
 				'meta_key'       => '_give_payment_number',
104 104
 				'meta_value'     => $value,
105 105
 				'posts_per_page' => 1,
106 106
 				'fields'         => 'ids',
107
-			) );
107
+			));
108 108
 
109
-			if ( $payment ) {
110
-				$payment = new Give_Payment( $payment[0] );
109
+			if ($payment) {
110
+				$payment = new Give_Payment($payment[0]);
111 111
 			}
112 112
 
113 113
 			break;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 			return false;
117 117
 	}// End switch().
118 118
 
119
-	if ( $payment ) {
119
+	if ($payment) {
120 120
 		return $payment;
121 121
 	}
122 122
 
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
  *
133 133
  * @return int|bool Payment ID if payment is inserted, false otherwise.
134 134
  */
135
-function give_insert_payment( $payment_data = array() ) {
135
+function give_insert_payment($payment_data = array()) {
136 136
 
137
-	if ( empty( $payment_data ) ) {
137
+	if (empty($payment_data)) {
138 138
 		return false;
139 139
 	}
140 140
 
@@ -145,25 +145,25 @@  discard block
 block discarded – undo
145 145
 	 *
146 146
 	 * @param array $payment_data Arguments passed.
147 147
 	 */
148
-	$payment_data = apply_filters( 'give_pre_insert_payment', $payment_data );
148
+	$payment_data = apply_filters('give_pre_insert_payment', $payment_data);
149 149
 
150 150
 	$payment    = new Give_Payment();
151
-	$gateway    = ! empty( $payment_data['gateway'] ) ? $payment_data['gateway'] : '';
152
-	$gateway    = empty( $gateway ) && isset( $_POST['give-gateway'] ) ? $_POST['give-gateway'] : $gateway;
153
-	$form_id    = isset( $payment_data['give_form_id'] ) ? $payment_data['give_form_id'] : 0;
154
-	$price_id   = give_get_payment_meta_price_id( $payment_data );
155
-	$form_title = isset( $payment_data['give_form_title'] ) ? $payment_data['give_form_title'] : get_the_title( $form_id );
151
+	$gateway    = ! empty($payment_data['gateway']) ? $payment_data['gateway'] : '';
152
+	$gateway    = empty($gateway) && isset($_POST['give-gateway']) ? $_POST['give-gateway'] : $gateway;
153
+	$form_id    = isset($payment_data['give_form_id']) ? $payment_data['give_form_id'] : 0;
154
+	$price_id   = give_get_payment_meta_price_id($payment_data);
155
+	$form_title = isset($payment_data['give_form_title']) ? $payment_data['give_form_title'] : get_the_title($form_id);
156 156
 
157 157
 	// Set properties.
158 158
 	$payment->total          = $payment_data['price'];
159
-	$payment->status         = ! empty( $payment_data['status'] ) ? $payment_data['status'] : 'pending';
160
-	$payment->currency       = ! empty( $payment_data['currency'] ) ? $payment_data['currency'] : give_get_currency( $payment_data['give_form_id'], $payment_data );
159
+	$payment->status         = ! empty($payment_data['status']) ? $payment_data['status'] : 'pending';
160
+	$payment->currency       = ! empty($payment_data['currency']) ? $payment_data['currency'] : give_get_currency($payment_data['give_form_id'], $payment_data);
161 161
 	$payment->user_info      = $payment_data['user_info'];
162 162
 	$payment->gateway        = $gateway;
163 163
 	$payment->form_title     = $form_title;
164 164
 	$payment->form_id        = $form_id;
165 165
 	$payment->price_id       = $price_id;
166
-	$payment->donor_id       = ( ! empty( $payment_data['donor_id'] ) ? $payment_data['donor_id'] : '' );
166
+	$payment->donor_id       = ( ! empty($payment_data['donor_id']) ? $payment_data['donor_id'] : '');
167 167
 	$payment->user_id        = $payment_data['user_info']['id'];
168 168
 	$payment->email          = $payment_data['user_email'];
169 169
 	$payment->first_name     = $payment_data['user_info']['first_name'];
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	$payment->email          = $payment_data['user_info']['email'];
172 172
 	$payment->ip             = give_get_ip();
173 173
 	$payment->key            = $payment_data['purchase_key'];
174
-	$payment->mode           = ( ! empty( $payment_data['mode'] ) ? (string) $payment_data['mode'] : ( give_is_test_mode() ? 'test' : 'live' ) );
175
-	$payment->parent_payment = ! empty( $payment_data['parent'] ) ? absint( $payment_data['parent'] ) : '';
174
+	$payment->mode           = ( ! empty($payment_data['mode']) ? (string) $payment_data['mode'] : (give_is_test_mode() ? 'test' : 'live'));
175
+	$payment->parent_payment = ! empty($payment_data['parent']) ? absint($payment_data['parent']) : '';
176 176
 
177 177
 	// Add the donation.
178 178
 	$args = array(
@@ -180,19 +180,19 @@  discard block
 block discarded – undo
180 180
 		'price_id' => $payment->price_id,
181 181
 	);
182 182
 
183
-	$payment->add_donation( $payment->form_id, $args );
183
+	$payment->add_donation($payment->form_id, $args);
184 184
 
185 185
 
186 186
 	// Set date if present.
187
-	if ( isset( $payment_data['post_date'] ) ) {
187
+	if (isset($payment_data['post_date'])) {
188 188
 		$payment->date = $payment_data['post_date'];
189 189
 	}
190 190
 
191 191
 	// Handle sequential payments.
192
-	if ( give_get_option( 'enable_sequential' ) ) {
192
+	if (give_get_option('enable_sequential')) {
193 193
 		$number          = give_get_next_payment_number();
194
-		$payment->number = give_format_payment_number( $number );
195
-		update_option( 'give_last_payment_number', $number );
194
+		$payment->number = give_format_payment_number($number);
195
+		update_option('give_last_payment_number', $number);
196 196
 	}
197 197
 
198 198
 	// Save payment.
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
 	 * @param int   $payment_id   The payment ID.
207 207
 	 * @param array $payment_data Arguments passed.
208 208
 	 */
209
-	do_action( 'give_insert_payment', $payment->ID, $payment_data );
209
+	do_action('give_insert_payment', $payment->ID, $payment_data);
210 210
 
211 211
 	// Return payment ID upon success.
212
-	if ( ! empty( $payment->ID ) ) {
212
+	if ( ! empty($payment->ID)) {
213 213
 		return $payment->ID;
214 214
 	}
215 215
 
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
  *
226 226
  * @return bool|int
227 227
  */
228
-function give_create_payment( $payment_data ) {
228
+function give_create_payment($payment_data) {
229 229
 
230
-	$form_id  = intval( $payment_data['post_data']['give-form-id'] );
231
-	$price_id = isset( $payment_data['post_data']['give-price-id'] ) ? $payment_data['post_data']['give-price-id'] : '';
230
+	$form_id  = intval($payment_data['post_data']['give-form-id']);
231
+	$price_id = isset($payment_data['post_data']['give-price-id']) ? $payment_data['post_data']['give-price-id'] : '';
232 232
 
233 233
 	// Collect payment data.
234 234
 	$insert_payment_data = array(
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		'date'            => $payment_data['date'],
240 240
 		'user_email'      => $payment_data['user_email'],
241 241
 		'purchase_key'    => $payment_data['purchase_key'],
242
-		'currency'        => give_get_currency( $form_id, $payment_data ),
242
+		'currency'        => give_get_currency($form_id, $payment_data),
243 243
 		'user_info'       => $payment_data['user_info'],
244 244
 		'status'          => 'pending',
245 245
 		'gateway'         => 'paypal',
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @param array $insert_payment_data
254 254
 	 */
255
-	$insert_payment_data = apply_filters( 'give_create_payment', $insert_payment_data );
255
+	$insert_payment_data = apply_filters('give_create_payment', $insert_payment_data);
256 256
 
257 257
 	// Record the pending payment.
258
-	return give_insert_payment( $insert_payment_data );
258
+	return give_insert_payment($insert_payment_data);
259 259
 }
260 260
 
261 261
 /**
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
  *
269 269
  * @return bool
270 270
  */
271
-function give_update_payment_status( $payment_id, $new_status = 'publish' ) {
271
+function give_update_payment_status($payment_id, $new_status = 'publish') {
272 272
 
273 273
 	$updated = false;
274
-	$payment = new Give_Payment( $payment_id );
274
+	$payment = new Give_Payment($payment_id);
275 275
 
276
-	if ( $payment && $payment->ID > 0 ) {
276
+	if ($payment && $payment->ID > 0) {
277 277
 
278 278
 		$payment->status = $new_status;
279 279
 		$updated         = $payment->save();
@@ -295,48 +295,48 @@  discard block
 block discarded – undo
295 295
  *
296 296
  * @return void
297 297
  */
298
-function give_delete_donation( $payment_id = 0, $update_donor = true ) {
298
+function give_delete_donation($payment_id = 0, $update_donor = true) {
299 299
 
300 300
 	global $give_logs;
301 301
 
302
-	$payment  = new Give_Payment( $payment_id );
302
+	$payment = new Give_Payment($payment_id);
303 303
 
304 304
 	// Bailout.
305
-	if( ! $payment->ID ) {
305
+	if ( ! $payment->ID) {
306 306
 		return;
307 307
 	}
308 308
 
309
-	$amount   = give_donation_amount( $payment_id );
309
+	$amount   = give_donation_amount($payment_id);
310 310
 	$status   = $payment->post_status;
311
-	$donor_id = give_get_payment_donor_id( $payment_id );
312
-	$donor    = new Give_Donor( $donor_id );
311
+	$donor_id = give_get_payment_donor_id($payment_id);
312
+	$donor    = new Give_Donor($donor_id);
313 313
 
314 314
 	// Only undo donations that aren't these statuses.
315
-	$dont_undo_statuses = apply_filters( 'give_undo_donation_statuses', array(
315
+	$dont_undo_statuses = apply_filters('give_undo_donation_statuses', array(
316 316
 		'pending',
317 317
 		'cancelled',
318
-	) );
318
+	));
319 319
 
320
-	if ( ! in_array( $status, $dont_undo_statuses ) ) {
321
-		give_undo_donation( $payment_id );
320
+	if ( ! in_array($status, $dont_undo_statuses)) {
321
+		give_undo_donation($payment_id);
322 322
 	}
323 323
 
324 324
 	// Only undo donations that aren't these statuses.
325
-	$status_to_decrease_stats = apply_filters( 'give_decrease_donor_statuses', array( 'publish' ) );
325
+	$status_to_decrease_stats = apply_filters('give_decrease_donor_statuses', array('publish'));
326 326
 
327
-	if ( in_array( $status, $status_to_decrease_stats ) ) {
327
+	if (in_array($status, $status_to_decrease_stats)) {
328 328
 
329 329
 		// Only decrease earnings if they haven't already been decreased (or were never increased for this payment).
330
-		give_decrease_total_earnings( $amount );
330
+		give_decrease_total_earnings($amount);
331 331
 
332 332
 		// @todo: Refresh only range related stat cache
333 333
 		give_delete_donation_stats();
334 334
 
335
-		if ( $donor->id && $update_donor ) {
335
+		if ($donor->id && $update_donor) {
336 336
 
337 337
 			// Decrement the stats for the donor.
338 338
 			$donor->decrease_donation_count();
339
-			$donor->decrease_value( $amount );
339
+			$donor->decrease_value($amount);
340 340
 
341 341
 		}
342 342
 	}
@@ -348,23 +348,23 @@  discard block
 block discarded – undo
348 348
 	 *
349 349
 	 * @since 1.0
350 350
 	 */
351
-	do_action( 'give_payment_delete', $payment_id );
351
+	do_action('give_payment_delete', $payment_id);
352 352
 
353
-	if ( $donor->id && $update_donor ) {
353
+	if ($donor->id && $update_donor) {
354 354
 		// Remove the payment ID from the donor.
355
-		$donor->remove_payment( $payment_id );
355
+		$donor->remove_payment($payment_id);
356 356
 	}
357 357
 
358 358
 	// Remove the payment.
359
-	wp_delete_post( $payment_id, true );
359
+	wp_delete_post($payment_id, true);
360 360
 
361 361
 	// Remove related sale log entries.
362
-	$give_logs->delete_logs( null, 'sale', array(
362
+	$give_logs->delete_logs(null, 'sale', array(
363 363
 		array(
364 364
 			'key'   => '_give_log_payment_id',
365 365
 			'value' => $payment_id,
366 366
 		),
367
-	) );
367
+	));
368 368
 
369 369
 	/**
370 370
 	 * Fires after payment deleted.
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	 *
374 374
 	 * @since 1.0
375 375
 	 */
376
-	do_action( 'give_payment_deleted', $payment_id );
376
+	do_action('give_payment_deleted', $payment_id);
377 377
 }
378 378
 
379 379
 /**
@@ -388,20 +388,20 @@  discard block
 block discarded – undo
388 388
  *
389 389
  * @return void
390 390
  */
391
-function give_undo_donation( $payment_id ) {
391
+function give_undo_donation($payment_id) {
392 392
 
393
-	$payment = new Give_Payment( $payment_id );
393
+	$payment = new Give_Payment($payment_id);
394 394
 
395
-	$maybe_decrease_earnings = apply_filters( 'give_decrease_earnings_on_undo', true, $payment, $payment->form_id );
396
-	if ( true === $maybe_decrease_earnings ) {
395
+	$maybe_decrease_earnings = apply_filters('give_decrease_earnings_on_undo', true, $payment, $payment->form_id);
396
+	if (true === $maybe_decrease_earnings) {
397 397
 		// Decrease earnings.
398
-		give_decrease_form_earnings( $payment->form_id, $payment->total );
398
+		give_decrease_form_earnings($payment->form_id, $payment->total);
399 399
 	}
400 400
 
401
-	$maybe_decrease_donations = apply_filters( 'give_decrease_donations_on_undo', true, $payment, $payment->form_id );
402
-	if ( true === $maybe_decrease_donations ) {
401
+	$maybe_decrease_donations = apply_filters('give_decrease_donations_on_undo', true, $payment, $payment->form_id);
402
+	if (true === $maybe_decrease_donations) {
403 403
 		// Decrease donation count.
404
-		give_decrease_donation_count( $payment->form_id );
404
+		give_decrease_donation_count($payment->form_id);
405 405
 	}
406 406
 
407 407
 }
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
  *
419 419
  * @return object $stats Contains the number of payments per payment status.
420 420
  */
421
-function give_count_payments( $args = array() ) {
421
+function give_count_payments($args = array()) {
422 422
 
423 423
 	global $wpdb;
424 424
 
@@ -430,18 +430,18 @@  discard block
 block discarded – undo
430 430
 		'form_id'    => null,
431 431
 	);
432 432
 
433
-	$args = wp_parse_args( $args, $defaults );
433
+	$args = wp_parse_args($args, $defaults);
434 434
 
435 435
 	$select = 'SELECT p.post_status,count( * ) AS num_posts';
436 436
 	$join   = '';
437
-	$where  = "WHERE p.post_type = 'give_payment' AND p.post_status IN ('" . implode( "','", give_get_payment_status_keys() ) . "')";
437
+	$where  = "WHERE p.post_type = 'give_payment' AND p.post_status IN ('".implode("','", give_get_payment_status_keys())."')";
438 438
 
439 439
 	// Count payments for a specific user.
440
-	if ( ! empty( $args['user'] ) ) {
440
+	if ( ! empty($args['user'])) {
441 441
 
442
-		if ( is_email( $args['user'] ) ) {
442
+		if (is_email($args['user'])) {
443 443
 			$field = 'email';
444
-		} elseif ( is_numeric( $args['user'] ) ) {
444
+		} elseif (is_numeric($args['user'])) {
445 445
 			$field = 'id';
446 446
 		} else {
447 447
 			$field = '';
@@ -449,101 +449,101 @@  discard block
 block discarded – undo
449 449
 
450 450
 		$join = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
451 451
 
452
-		if ( ! empty( $field ) ) {
452
+		if ( ! empty($field)) {
453 453
 			$where .= "
454 454
 				AND m.meta_key = '_give_payment_user_{$field}'
455 455
 				AND m.meta_value = '{$args['user']}'";
456 456
 		}
457
-	} elseif ( ! empty( $args['donor'] ) ) {
457
+	} elseif ( ! empty($args['donor'])) {
458 458
 
459
-		$join  = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
459
+		$join = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
460 460
 		$where .= "
461 461
 			AND m.meta_key = '_give_payment_customer_id'
462 462
 			AND m.meta_value = '{$args['donor']}'";
463 463
 
464 464
 		// Count payments for a search.
465
-	} elseif ( ! empty( $args['s'] ) ) {
465
+	} elseif ( ! empty($args['s'])) {
466 466
 
467
-		if ( is_email( $args['s'] ) || strlen( $args['s'] ) == 32 ) {
467
+		if (is_email($args['s']) || strlen($args['s']) == 32) {
468 468
 
469
-			if ( is_email( $args['s'] ) ) {
469
+			if (is_email($args['s'])) {
470 470
 				$field = '_give_payment_user_email';
471 471
 			} else {
472 472
 				$field = '_give_payment_purchase_key';
473 473
 			}
474 474
 
475
-			$join  = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
476
-			$where .= $wpdb->prepare( '
475
+			$join = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
476
+			$where .= $wpdb->prepare('
477 477
                 AND m.meta_key = %s
478
-                AND m.meta_value = %s', $field, $args['s'] );
478
+                AND m.meta_value = %s', $field, $args['s']);
479 479
 
480
-		} elseif ( '#' == substr( $args['s'], 0, 1 ) ) {
480
+		} elseif ('#' == substr($args['s'], 0, 1)) {
481 481
 
482
-			$search = str_replace( '#:', '', $args['s'] );
483
-			$search = str_replace( '#', '', $search );
482
+			$search = str_replace('#:', '', $args['s']);
483
+			$search = str_replace('#', '', $search);
484 484
 
485 485
 			$select = 'SELECT p.post_status,count( * ) AS num_posts ';
486 486
 			$join   = '';
487
-			$where  = $wpdb->prepare( 'WHERE p.post_type=%s  AND p.ID = %d ', 'give_payment', $search );
487
+			$where  = $wpdb->prepare('WHERE p.post_type=%s  AND p.ID = %d ', 'give_payment', $search);
488 488
 
489
-		} elseif ( is_numeric( $args['s'] ) ) {
489
+		} elseif (is_numeric($args['s'])) {
490 490
 
491
-			$join  = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
492
-			$where .= $wpdb->prepare( "
491
+			$join = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
492
+			$where .= $wpdb->prepare("
493 493
 				AND m.meta_key = '_give_payment_user_id'
494
-				AND m.meta_value = %d", $args['s'] );
494
+				AND m.meta_value = %d", $args['s']);
495 495
 
496 496
 		} else {
497
-			$search = $wpdb->esc_like( $args['s'] );
498
-			$search = '%' . $search . '%';
497
+			$search = $wpdb->esc_like($args['s']);
498
+			$search = '%'.$search.'%';
499 499
 
500
-			$where .= $wpdb->prepare( 'AND ((p.post_title LIKE %s) OR (p.post_content LIKE %s))', $search, $search );
500
+			$where .= $wpdb->prepare('AND ((p.post_title LIKE %s) OR (p.post_content LIKE %s))', $search, $search);
501 501
 		}// End if().
502 502
 	}// End if().
503 503
 
504
-	if ( ! empty( $args['form_id'] ) && is_numeric( $args['form_id'] ) ) {
504
+	if ( ! empty($args['form_id']) && is_numeric($args['form_id'])) {
505 505
 
506
-		$join  = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
507
-		$where .= $wpdb->prepare( '
506
+		$join = "LEFT JOIN $wpdb->postmeta m ON (p.ID = m.post_id)";
507
+		$where .= $wpdb->prepare('
508 508
                 AND m.meta_key = %s
509
-                AND m.meta_value = %s', '_give_payment_form_id', $args['form_id'] );
509
+                AND m.meta_value = %s', '_give_payment_form_id', $args['form_id']);
510 510
 	}
511 511
 
512 512
 	// Limit payments count by date.
513
-	if ( ! empty( $args['start-date'] ) && false !== strpos( $args['start-date'], '/' ) ) {
513
+	if ( ! empty($args['start-date']) && false !== strpos($args['start-date'], '/')) {
514 514
 
515
-		$date_parts = explode( '/', $args['start-date'] );
516
-		$month      = ! empty( $date_parts[0] ) && is_numeric( $date_parts[0] ) ? $date_parts[0] : 0;
517
-		$day        = ! empty( $date_parts[1] ) && is_numeric( $date_parts[1] ) ? $date_parts[1] : 0;
518
-		$year       = ! empty( $date_parts[2] ) && is_numeric( $date_parts[2] ) ? $date_parts[2] : 0;
515
+		$date_parts = explode('/', $args['start-date']);
516
+		$month      = ! empty($date_parts[0]) && is_numeric($date_parts[0]) ? $date_parts[0] : 0;
517
+		$day        = ! empty($date_parts[1]) && is_numeric($date_parts[1]) ? $date_parts[1] : 0;
518
+		$year       = ! empty($date_parts[2]) && is_numeric($date_parts[2]) ? $date_parts[2] : 0;
519 519
 
520
-		$is_date = checkdate( $month, $day, $year );
521
-		if ( false !== $is_date ) {
520
+		$is_date = checkdate($month, $day, $year);
521
+		if (false !== $is_date) {
522 522
 
523
-			$date  = new DateTime( $args['start-date'] );
524
-			$where .= $wpdb->prepare( " AND p.post_date >= '%s'", $date->format( 'Y-m-d' ) );
523
+			$date = new DateTime($args['start-date']);
524
+			$where .= $wpdb->prepare(" AND p.post_date >= '%s'", $date->format('Y-m-d'));
525 525
 
526 526
 		}
527 527
 
528 528
 		// Fixes an issue with the payments list table counts when no end date is specified (with stats class).
529
-		if ( empty( $args['end-date'] ) ) {
529
+		if (empty($args['end-date'])) {
530 530
 			$args['end-date'] = $args['start-date'];
531 531
 		}
532 532
 	}
533 533
 
534
-	if ( ! empty( $args['end-date'] ) && false !== strpos( $args['end-date'], '/' ) ) {
534
+	if ( ! empty($args['end-date']) && false !== strpos($args['end-date'], '/')) {
535 535
 
536
-		$date_parts = explode( '/', $args['end-date'] );
536
+		$date_parts = explode('/', $args['end-date']);
537 537
 
538
-		$month = ! empty( $date_parts[0] ) ? $date_parts[0] : 0;
539
-		$day   = ! empty( $date_parts[1] ) ? $date_parts[1] : 0;
540
-		$year  = ! empty( $date_parts[2] ) ? $date_parts[2] : 0;
538
+		$month = ! empty($date_parts[0]) ? $date_parts[0] : 0;
539
+		$day   = ! empty($date_parts[1]) ? $date_parts[1] : 0;
540
+		$year  = ! empty($date_parts[2]) ? $date_parts[2] : 0;
541 541
 
542
-		$is_date = checkdate( $month, $day, $year );
543
-		if ( false !== $is_date ) {
542
+		$is_date = checkdate($month, $day, $year);
543
+		if (false !== $is_date) {
544 544
 
545
-			$date  = new DateTime( $args['end-date'] );
546
-			$where .= $wpdb->prepare( " AND p.post_date <= '%s'", $date->format( 'Y-m-d' ) );
545
+			$date = new DateTime($args['end-date']);
546
+			$where .= $wpdb->prepare(" AND p.post_date <= '%s'", $date->format('Y-m-d'));
547 547
 
548 548
 		}
549 549
 	}
@@ -555,36 +555,36 @@  discard block
 block discarded – undo
555 555
 		GROUP BY p.post_status
556 556
 	";
557 557
 
558
-	$cache_key = md5( $query );
558
+	$cache_key = md5($query);
559 559
 
560
-	$count = wp_cache_get( $cache_key, 'counts' );
561
-	if ( false !== $count ) {
560
+	$count = wp_cache_get($cache_key, 'counts');
561
+	if (false !== $count) {
562 562
 		return $count;
563 563
 	}
564 564
 
565
-	$count = $wpdb->get_results( $query, ARRAY_A );
565
+	$count = $wpdb->get_results($query, ARRAY_A);
566 566
 
567 567
 	$stats    = array();
568 568
 	$statuses = get_post_stati();
569
-	if ( isset( $statuses['private'] ) && empty( $args['s'] ) ) {
570
-		unset( $statuses['private'] );
569
+	if (isset($statuses['private']) && empty($args['s'])) {
570
+		unset($statuses['private']);
571 571
 	}
572 572
 
573
-	foreach ( $statuses as $state ) {
574
-		$stats[ $state ] = 0;
573
+	foreach ($statuses as $state) {
574
+		$stats[$state] = 0;
575 575
 	}
576 576
 
577
-	foreach ( (array) $count as $row ) {
577
+	foreach ((array) $count as $row) {
578 578
 
579
-		if ( 'private' == $row['post_status'] && empty( $args['s'] ) ) {
579
+		if ('private' == $row['post_status'] && empty($args['s'])) {
580 580
 			continue;
581 581
 		}
582 582
 
583
-		$stats[ $row['post_status'] ] = $row['num_posts'];
583
+		$stats[$row['post_status']] = $row['num_posts'];
584 584
 	}
585 585
 
586 586
 	$stats = (object) $stats;
587
-	wp_cache_set( $cache_key, $stats, 'counts' );
587
+	wp_cache_set($cache_key, $stats, 'counts');
588 588
 
589 589
 	return $stats;
590 590
 }
@@ -599,11 +599,11 @@  discard block
 block discarded – undo
599 599
  *
600 600
  * @return bool $exists True if payment exists, false otherwise.
601 601
  */
602
-function give_check_for_existing_payment( $payment_id ) {
602
+function give_check_for_existing_payment($payment_id) {
603 603
 	$exists  = false;
604
-	$payment = new Give_Payment( $payment_id );
604
+	$payment = new Give_Payment($payment_id);
605 605
 
606
-	if ( $payment_id === $payment->ID && 'publish' === $payment->status ) {
606
+	if ($payment_id === $payment->ID && 'publish' === $payment->status) {
607 607
 		$exists = true;
608 608
 	}
609 609
 
@@ -620,41 +620,41 @@  discard block
 block discarded – undo
620 620
  *
621 621
  * @return bool|mixed True if payment status exists, false otherwise.
622 622
  */
623
-function give_get_payment_status( $payment, $return_label = false ) {
623
+function give_get_payment_status($payment, $return_label = false) {
624 624
 
625
-	if ( is_numeric( $payment ) ) {
625
+	if (is_numeric($payment)) {
626 626
 
627
-		$payment = new Give_Payment( $payment );
627
+		$payment = new Give_Payment($payment);
628 628
 
629
-		if ( ! $payment->ID > 0 ) {
629
+		if ( ! $payment->ID > 0) {
630 630
 			return false;
631 631
 		}
632 632
 
633 633
 	}
634 634
 
635
-	if ( ! is_object( $payment ) || ! isset( $payment->post_status ) ) {
635
+	if ( ! is_object($payment) || ! isset($payment->post_status)) {
636 636
 		return false;
637 637
 	}
638 638
 
639 639
 	$statuses = give_get_payment_statuses();
640 640
 
641
-	if ( ! is_array( $statuses ) || empty( $statuses ) ) {
641
+	if ( ! is_array($statuses) || empty($statuses)) {
642 642
 		return false;
643 643
 	}
644 644
 
645 645
 	// Get payment object if not already given.
646
-	$payment = $payment instanceof Give_Payment ? $payment : new Give_Payment( $payment->ID );
646
+	$payment = $payment instanceof Give_Payment ? $payment : new Give_Payment($payment->ID);
647 647
 
648
-	if ( array_key_exists( $payment->status, $statuses ) ) {
649
-		if ( true === $return_label ) {
648
+	if (array_key_exists($payment->status, $statuses)) {
649
+		if (true === $return_label) {
650 650
 			// Return translated status label.
651
-			return $statuses[ $payment->status ];
651
+			return $statuses[$payment->status];
652 652
 		} else {
653 653
 			// Account that our 'publish' status is labeled 'Complete'
654 654
 			$post_status = 'publish' === $payment->status ? 'Complete' : $payment->post_status;
655 655
 
656 656
 			// Make sure we're matching cases, since they matter
657
-			return array_search( strtolower( $post_status ), array_map( 'strtolower', $statuses ) );
657
+			return array_search(strtolower($post_status), array_map('strtolower', $statuses));
658 658
 		}
659 659
 	}
660 660
 
@@ -670,18 +670,18 @@  discard block
 block discarded – undo
670 670
  */
671 671
 function give_get_payment_statuses() {
672 672
 	$payment_statuses = array(
673
-		'pending'     => __( 'Pending', 'give' ),
674
-		'publish'     => __( 'Complete', 'give' ),
675
-		'refunded'    => __( 'Refunded', 'give' ),
676
-		'failed'      => __( 'Failed', 'give' ),
677
-		'cancelled'   => __( 'Cancelled', 'give' ),
678
-		'abandoned'   => __( 'Abandoned', 'give' ),
679
-		'preapproval' => __( 'Pre-Approved', 'give' ),
680
-		'processing'  => __( 'Processing', 'give' ),
681
-		'revoked'     => __( 'Revoked', 'give' ),
673
+		'pending'     => __('Pending', 'give'),
674
+		'publish'     => __('Complete', 'give'),
675
+		'refunded'    => __('Refunded', 'give'),
676
+		'failed'      => __('Failed', 'give'),
677
+		'cancelled'   => __('Cancelled', 'give'),
678
+		'abandoned'   => __('Abandoned', 'give'),
679
+		'preapproval' => __('Pre-Approved', 'give'),
680
+		'processing'  => __('Processing', 'give'),
681
+		'revoked'     => __('Revoked', 'give'),
682 682
 	);
683 683
 
684
-	return apply_filters( 'give_payment_statuses', $payment_statuses );
684
+	return apply_filters('give_payment_statuses', $payment_statuses);
685 685
 }
686 686
 
687 687
 /**
@@ -694,10 +694,10 @@  discard block
 block discarded – undo
694 694
  * @return array $payment_status All the available payment statuses.
695 695
  */
696 696
 function give_get_payment_status_keys() {
697
-	$statuses = array_keys( give_get_payment_statuses() );
698
-	asort( $statuses );
697
+	$statuses = array_keys(give_get_payment_statuses());
698
+	asort($statuses);
699 699
 
700
-	return array_values( $statuses );
700
+	return array_values($statuses);
701 701
 }
702 702
 
703 703
 /**
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
  *
713 713
  * @return int $earnings Earnings
714 714
  */
715
-function give_get_earnings_by_date( $day = null, $month_num, $year = null, $hour = null ) {
715
+function give_get_earnings_by_date($day = null, $month_num, $year = null, $hour = null) {
716 716
 
717 717
 	// This is getting deprecated soon. Use Give_Payment_Stats with the get_earnings() method instead.
718 718
 	global $wpdb;
@@ -722,33 +722,33 @@  discard block
 block discarded – undo
722 722
 		'nopaging'               => true,
723 723
 		'year'                   => $year,
724 724
 		'monthnum'               => $month_num,
725
-		'post_status'            => array( 'publish' ),
725
+		'post_status'            => array('publish'),
726 726
 		'fields'                 => 'ids',
727 727
 		'update_post_term_cache' => false,
728 728
 	);
729
-	if ( ! empty( $day ) ) {
729
+	if ( ! empty($day)) {
730 730
 		$args['day'] = $day;
731 731
 	}
732 732
 
733
-	if ( isset( $hour ) ) {
733
+	if (isset($hour)) {
734 734
 		$args['hour'] = $hour;
735 735
 	}
736 736
 
737
-	$args = apply_filters( 'give_get_earnings_by_date_args', $args );
738
-	$key  = Give_Cache::get_key( 'give_stats', $args );
737
+	$args = apply_filters('give_get_earnings_by_date_args', $args);
738
+	$key  = Give_Cache::get_key('give_stats', $args);
739 739
 
740
-	if ( ! empty( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'give-refresh-reports' ) ) {
740
+	if ( ! empty($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'give-refresh-reports')) {
741 741
 		$earnings = false;
742 742
 	} else {
743
-		$earnings = Give_Cache::get( $key );
743
+		$earnings = Give_Cache::get($key);
744 744
 	}
745 745
 
746
-	if ( false === $earnings ) {
747
-		$donations = get_posts( $args );
746
+	if (false === $earnings) {
747
+		$donations = get_posts($args);
748 748
 		$earnings  = 0;
749
-		if ( $donations ) {
750
-			$donations      = implode( ',', $donations );
751
-			$earning_totals = $wpdb->get_var( "SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_give_payment_total' AND post_id IN ({$donations})" );
749
+		if ($donations) {
750
+			$donations      = implode(',', $donations);
751
+			$earning_totals = $wpdb->get_var("SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_give_payment_total' AND post_id IN ({$donations})");
752 752
 
753 753
 			/**
754 754
 			 * Filter The earnings by dates.
@@ -759,13 +759,13 @@  discard block
 block discarded – undo
759 759
 			 * @param array $donations      Donations lists.
760 760
 			 * @param array $args           Donation query args.
761 761
 			 */
762
-			$earnings = apply_filters( 'give_get_earnings_by_date', $earning_totals, $donations, $args );
762
+			$earnings = apply_filters('give_get_earnings_by_date', $earning_totals, $donations, $args);
763 763
 		}
764 764
 		// Cache the results for one hour.
765
-		Give_Cache::set( $key, $earnings, HOUR_IN_SECONDS );
765
+		Give_Cache::set($key, $earnings, HOUR_IN_SECONDS);
766 766
 	}
767 767
 
768
-	return round( $earnings, 2 );
768
+	return round($earnings, 2);
769 769
 }
770 770
 
771 771
 /**
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
  *
781 781
  * @return int $count Sales
782 782
  */
783
-function give_get_sales_by_date( $day = null, $month_num = null, $year = null, $hour = null ) {
783
+function give_get_sales_by_date($day = null, $month_num = null, $year = null, $hour = null) {
784 784
 
785 785
 	// This is getting deprecated soon. Use Give_Payment_Stats with the get_sales() method instead.
786 786
 	$args = array(
@@ -788,14 +788,14 @@  discard block
 block discarded – undo
788 788
 		'nopaging'               => true,
789 789
 		'year'                   => $year,
790 790
 		'fields'                 => 'ids',
791
-		'post_status'            => array( 'publish' ),
791
+		'post_status'            => array('publish'),
792 792
 		'update_post_meta_cache' => false,
793 793
 		'update_post_term_cache' => false,
794 794
 	);
795 795
 
796
-	$show_free = apply_filters( 'give_sales_by_date_show_free', true, $args );
796
+	$show_free = apply_filters('give_sales_by_date_show_free', true, $args);
797 797
 
798
-	if ( false === $show_free ) {
798
+	if (false === $show_free) {
799 799
 		$args['meta_query'] = array(
800 800
 			array(
801 801
 				'key'     => '_give_payment_total',
@@ -806,33 +806,33 @@  discard block
 block discarded – undo
806 806
 		);
807 807
 	}
808 808
 
809
-	if ( ! empty( $month_num ) ) {
809
+	if ( ! empty($month_num)) {
810 810
 		$args['monthnum'] = $month_num;
811 811
 	}
812 812
 
813
-	if ( ! empty( $day ) ) {
813
+	if ( ! empty($day)) {
814 814
 		$args['day'] = $day;
815 815
 	}
816 816
 
817
-	if ( isset( $hour ) ) {
817
+	if (isset($hour)) {
818 818
 		$args['hour'] = $hour;
819 819
 	}
820 820
 
821
-	$args = apply_filters( 'give_get_sales_by_date_args', $args );
821
+	$args = apply_filters('give_get_sales_by_date_args', $args);
822 822
 
823
-	$key = Give_Cache::get_key( 'give_stats', $args );
823
+	$key = Give_Cache::get_key('give_stats', $args);
824 824
 
825
-	if ( ! empty( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'give-refresh-reports' ) ) {
825
+	if ( ! empty($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'give-refresh-reports')) {
826 826
 		$count = false;
827 827
 	} else {
828
-		$count = Give_Cache::get( $key );
828
+		$count = Give_Cache::get($key);
829 829
 	}
830 830
 
831
-	if ( false === $count ) {
832
-		$donations = new WP_Query( $args );
831
+	if (false === $count) {
832
+		$donations = new WP_Query($args);
833 833
 		$count     = (int) $donations->post_count;
834 834
 		// Cache the results for one hour.
835
-		Give_Cache::set( $key, $count, HOUR_IN_SECONDS );
835
+		Give_Cache::set($key, $count, HOUR_IN_SECONDS);
836 836
 	}
837 837
 
838 838
 	return $count;
@@ -847,19 +847,19 @@  discard block
 block discarded – undo
847 847
  *
848 848
  * @return bool $ret True if complete, false otherwise.
849 849
  */
850
-function give_is_payment_complete( $payment_id ) {
851
-	$payment = new Give_Payment( $payment_id );
850
+function give_is_payment_complete($payment_id) {
851
+	$payment = new Give_Payment($payment_id);
852 852
 
853 853
 	$ret = false;
854 854
 
855
-	if ( $payment->ID > 0 ) {
855
+	if ($payment->ID > 0) {
856 856
 
857
-		if ( (int) $payment_id === (int) $payment->ID && 'publish' == $payment->status ) {
857
+		if ((int) $payment_id === (int) $payment->ID && 'publish' == $payment->status) {
858 858
 			$ret = true;
859 859
 		}
860 860
 	}
861 861
 
862
-	return apply_filters( 'give_is_payment_complete', $ret, $payment_id, $payment->post_status );
862
+	return apply_filters('give_is_payment_complete', $ret, $payment_id, $payment->post_status);
863 863
 }
864 864
 
865 865
 /**
@@ -885,49 +885,49 @@  discard block
 block discarded – undo
885 885
  *
886 886
  * @return float $total Total earnings.
887 887
  */
888
-function give_get_total_earnings( $recalculate = false ) {
888
+function give_get_total_earnings($recalculate = false) {
889 889
 
890
-	$total = get_option( 'give_earnings_total', 0 );
890
+	$total = get_option('give_earnings_total', 0);
891 891
 
892 892
 	// Calculate total earnings.
893
-	if ( ! $total || $recalculate ) {
893
+	if ( ! $total || $recalculate) {
894 894
 		global $wpdb;
895 895
 
896 896
 		$total = (float) 0;
897 897
 
898
-		$args = apply_filters( 'give_get_total_earnings_args', array(
898
+		$args = apply_filters('give_get_total_earnings_args', array(
899 899
 			'offset' => 0,
900
-			'number' => - 1,
901
-			'status' => array( 'publish' ),
900
+			'number' => -1,
901
+			'status' => array('publish'),
902 902
 			'fields' => 'ids',
903
-		) );
903
+		));
904 904
 
905
-		$payments = give_get_payments( $args );
906
-		if ( $payments ) {
905
+		$payments = give_get_payments($args);
906
+		if ($payments) {
907 907
 
908 908
 			/**
909 909
 			 * If performing a donation, we need to skip the very last payment in the database,
910 910
 			 * since it calls give_increase_total_earnings() on completion,
911 911
 			 * which results in duplicated earnings for the very first donation.
912 912
 			 */
913
-			if ( did_action( 'give_update_payment_status' ) ) {
914
-				array_pop( $payments );
913
+			if (did_action('give_update_payment_status')) {
914
+				array_pop($payments);
915 915
 			}
916 916
 
917
-			if ( ! empty( $payments ) ) {
918
-				$payments = implode( ',', $payments );
919
-				$total    += $wpdb->get_var( "SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_give_payment_total' AND post_id IN({$payments})" );
917
+			if ( ! empty($payments)) {
918
+				$payments = implode(',', $payments);
919
+				$total += $wpdb->get_var("SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_give_payment_total' AND post_id IN({$payments})");
920 920
 			}
921 921
 		}
922 922
 
923
-		update_option( 'give_earnings_total', $total, 'no' );
923
+		update_option('give_earnings_total', $total, 'no');
924 924
 	}
925 925
 
926
-	if ( $total < 0 ) {
926
+	if ($total < 0) {
927 927
 		$total = 0; // Don't ever show negative earnings.
928 928
 	}
929 929
 
930
-	return apply_filters( 'give_total_earnings', round( $total, give_get_price_decimals() ), $total );
930
+	return apply_filters('give_total_earnings', round($total, give_get_price_decimals()), $total);
931 931
 }
932 932
 
933 933
 /**
@@ -939,10 +939,10 @@  discard block
 block discarded – undo
939 939
  *
940 940
  * @return float $total Total earnings.
941 941
  */
942
-function give_increase_total_earnings( $amount = 0 ) {
942
+function give_increase_total_earnings($amount = 0) {
943 943
 	$total = give_get_total_earnings();
944 944
 	$total += $amount;
945
-	update_option( 'give_earnings_total', $total );
945
+	update_option('give_earnings_total', $total);
946 946
 
947 947
 	return $total;
948 948
 }
@@ -956,13 +956,13 @@  discard block
 block discarded – undo
956 956
  *
957 957
  * @return float $total Total earnings.
958 958
  */
959
-function give_decrease_total_earnings( $amount = 0 ) {
959
+function give_decrease_total_earnings($amount = 0) {
960 960
 	$total = give_get_total_earnings();
961 961
 	$total -= $amount;
962
-	if ( $total < 0 ) {
962
+	if ($total < 0) {
963 963
 		$total = 0;
964 964
 	}
965
-	update_option( 'give_earnings_total', $total );
965
+	update_option('give_earnings_total', $total);
966 966
 
967 967
 	return $total;
968 968
 }
@@ -978,10 +978,10 @@  discard block
 block discarded – undo
978 978
  *
979 979
  * @return mixed $meta Payment Meta.
980 980
  */
981
-function give_get_payment_meta( $payment_id = 0, $meta_key = '_give_payment_meta', $single = true ) {
982
-	$payment = new Give_Payment( $payment_id );
981
+function give_get_payment_meta($payment_id = 0, $meta_key = '_give_payment_meta', $single = true) {
982
+	$payment = new Give_Payment($payment_id);
983 983
 
984
-	return $payment->get_meta( $meta_key, $single );
984
+	return $payment->get_meta($meta_key, $single);
985 985
 }
986 986
 
987 987
 /**
@@ -994,10 +994,10 @@  discard block
 block discarded – undo
994 994
  *
995 995
  * @return mixed Meta ID if successful, false if unsuccessful.
996 996
  */
997
-function give_update_payment_meta( $payment_id = 0, $meta_key = '', $meta_value = '', $prev_value = '' ) {
998
-	$payment = new Give_Payment( $payment_id );
997
+function give_update_payment_meta($payment_id = 0, $meta_key = '', $meta_value = '', $prev_value = '') {
998
+	$payment = new Give_Payment($payment_id);
999 999
 
1000
-	return $payment->update_meta( $meta_key, $meta_value, $prev_value );
1000
+	return $payment->update_meta($meta_key, $meta_value, $prev_value);
1001 1001
 }
1002 1002
 
1003 1003
 /**
@@ -1009,8 +1009,8 @@  discard block
 block discarded – undo
1009 1009
  *
1010 1010
  * @return array $user_info User Info Meta Values.
1011 1011
  */
1012
-function give_get_payment_meta_user_info( $payment_id ) {
1013
-	$payment = new Give_Payment( $payment_id );
1012
+function give_get_payment_meta_user_info($payment_id) {
1013
+	$payment = new Give_Payment($payment_id);
1014 1014
 
1015 1015
 	return $payment->user_info;
1016 1016
 }
@@ -1026,8 +1026,8 @@  discard block
 block discarded – undo
1026 1026
  *
1027 1027
  * @return int $form_id Form ID.
1028 1028
  */
1029
-function give_get_payment_form_id( $payment_id ) {
1030
-	$payment = new Give_Payment( $payment_id );
1029
+function give_get_payment_form_id($payment_id) {
1030
+	$payment = new Give_Payment($payment_id);
1031 1031
 
1032 1032
 	return $payment->form_id;
1033 1033
 }
@@ -1041,8 +1041,8 @@  discard block
 block discarded – undo
1041 1041
  *
1042 1042
  * @return string $email User email.
1043 1043
  */
1044
-function give_get_payment_user_email( $payment_id ) {
1045
-	$payment = new Give_Payment( $payment_id );
1044
+function give_get_payment_user_email($payment_id) {
1045
+	$payment = new Give_Payment($payment_id);
1046 1046
 
1047 1047
 	return $payment->email;
1048 1048
 }
@@ -1056,11 +1056,11 @@  discard block
 block discarded – undo
1056 1056
  *
1057 1057
  * @return bool $is_guest_payment If the payment is associated with a user (false) or not (true)
1058 1058
  */
1059
-function give_is_guest_payment( $payment_id ) {
1060
-	$payment_user_id  = give_get_payment_user_id( $payment_id );
1061
-	$is_guest_payment = ! empty( $payment_user_id ) && $payment_user_id > 0 ? false : true;
1059
+function give_is_guest_payment($payment_id) {
1060
+	$payment_user_id  = give_get_payment_user_id($payment_id);
1061
+	$is_guest_payment = ! empty($payment_user_id) && $payment_user_id > 0 ? false : true;
1062 1062
 
1063
-	return (bool) apply_filters( 'give_is_guest_payment', $is_guest_payment, $payment_id );
1063
+	return (bool) apply_filters('give_is_guest_payment', $is_guest_payment, $payment_id);
1064 1064
 }
1065 1065
 
1066 1066
 /**
@@ -1072,8 +1072,8 @@  discard block
 block discarded – undo
1072 1072
  *
1073 1073
  * @return int $user_id User ID.
1074 1074
  */
1075
-function give_get_payment_user_id( $payment_id ) {
1076
-	$payment = new Give_Payment( $payment_id );
1075
+function give_get_payment_user_id($payment_id) {
1076
+	$payment = new Give_Payment($payment_id);
1077 1077
 
1078 1078
 	return $payment->user_id;
1079 1079
 }
@@ -1087,8 +1087,8 @@  discard block
 block discarded – undo
1087 1087
  *
1088 1088
  * @return int $payment->customer_id Donor ID.
1089 1089
  */
1090
-function give_get_payment_donor_id( $payment_id ) {
1091
-	$payment = new Give_Payment( $payment_id );
1090
+function give_get_payment_donor_id($payment_id) {
1091
+	$payment = new Give_Payment($payment_id);
1092 1092
 
1093 1093
 	return $payment->customer_id;
1094 1094
 }
@@ -1102,8 +1102,8 @@  discard block
 block discarded – undo
1102 1102
  *
1103 1103
  * @return string $ip User IP.
1104 1104
  */
1105
-function give_get_payment_user_ip( $payment_id ) {
1106
-	$payment = new Give_Payment( $payment_id );
1105
+function give_get_payment_user_ip($payment_id) {
1106
+	$payment = new Give_Payment($payment_id);
1107 1107
 
1108 1108
 	return $payment->ip;
1109 1109
 }
@@ -1117,8 +1117,8 @@  discard block
 block discarded – undo
1117 1117
  *
1118 1118
  * @return string $date The date the payment was completed.
1119 1119
  */
1120
-function give_get_payment_completed_date( $payment_id = 0 ) {
1121
-	$payment = new Give_Payment( $payment_id );
1120
+function give_get_payment_completed_date($payment_id = 0) {
1121
+	$payment = new Give_Payment($payment_id);
1122 1122
 
1123 1123
 	return $payment->completed_date;
1124 1124
 }
@@ -1132,8 +1132,8 @@  discard block
 block discarded – undo
1132 1132
  *
1133 1133
  * @return string $gateway Gateway.
1134 1134
  */
1135
-function give_get_payment_gateway( $payment_id ) {
1136
-	$payment = new Give_Payment( $payment_id );
1135
+function give_get_payment_gateway($payment_id) {
1136
+	$payment = new Give_Payment($payment_id);
1137 1137
 
1138 1138
 	return $payment->gateway;
1139 1139
 }
@@ -1147,8 +1147,8 @@  discard block
 block discarded – undo
1147 1147
  *
1148 1148
  * @return string $currency The currency code.
1149 1149
  */
1150
-function give_get_payment_currency_code( $payment_id = 0 ) {
1151
-	$payment = new Give_Payment( $payment_id );
1150
+function give_get_payment_currency_code($payment_id = 0) {
1151
+	$payment = new Give_Payment($payment_id);
1152 1152
 
1153 1153
 	return $payment->currency;
1154 1154
 }
@@ -1162,10 +1162,10 @@  discard block
 block discarded – undo
1162 1162
  *
1163 1163
  * @return string $currency The currency name.
1164 1164
  */
1165
-function give_get_payment_currency( $payment_id = 0 ) {
1166
-	$currency = give_get_payment_currency_code( $payment_id );
1165
+function give_get_payment_currency($payment_id = 0) {
1166
+	$currency = give_get_payment_currency_code($payment_id);
1167 1167
 
1168
-	return apply_filters( 'give_payment_currency', give_get_currency_name( $currency ), $payment_id );
1168
+	return apply_filters('give_payment_currency', give_get_currency_name($currency), $payment_id);
1169 1169
 }
1170 1170
 
1171 1171
 /**
@@ -1177,8 +1177,8 @@  discard block
 block discarded – undo
1177 1177
  *
1178 1178
  * @return string $key Donation key.
1179 1179
  */
1180
-function give_get_payment_key( $payment_id = 0 ) {
1181
-	$payment = new Give_Payment( $payment_id );
1180
+function give_get_payment_key($payment_id = 0) {
1181
+	$payment = new Give_Payment($payment_id);
1182 1182
 
1183 1183
 	return $payment->key;
1184 1184
 }
@@ -1194,8 +1194,8 @@  discard block
 block discarded – undo
1194 1194
  *
1195 1195
  * @return string $number Payment order number.
1196 1196
  */
1197
-function give_get_payment_number( $payment_id = 0 ) {
1198
-	$payment = new Give_Payment( $payment_id );
1197
+function give_get_payment_number($payment_id = 0) {
1198
+	$payment = new Give_Payment($payment_id);
1199 1199
 
1200 1200
 	return $payment->number;
1201 1201
 }
@@ -1209,23 +1209,23 @@  discard block
 block discarded – undo
1209 1209
  *
1210 1210
  * @return string      The formatted payment number.
1211 1211
  */
1212
-function give_format_payment_number( $number ) {
1212
+function give_format_payment_number($number) {
1213 1213
 
1214
-	if ( ! give_get_option( 'enable_sequential' ) ) {
1214
+	if ( ! give_get_option('enable_sequential')) {
1215 1215
 		return $number;
1216 1216
 	}
1217 1217
 
1218
-	if ( ! is_numeric( $number ) ) {
1218
+	if ( ! is_numeric($number)) {
1219 1219
 		return $number;
1220 1220
 	}
1221 1221
 
1222
-	$prefix  = give_get_option( 'sequential_prefix' );
1223
-	$number  = absint( $number );
1224
-	$postfix = give_get_option( 'sequential_postfix' );
1222
+	$prefix  = give_get_option('sequential_prefix');
1223
+	$number  = absint($number);
1224
+	$postfix = give_get_option('sequential_postfix');
1225 1225
 
1226
-	$formatted_number = $prefix . $number . $postfix;
1226
+	$formatted_number = $prefix.$number.$postfix;
1227 1227
 
1228
-	return apply_filters( 'give_format_payment_number', $formatted_number, $prefix, $number, $postfix );
1228
+	return apply_filters('give_format_payment_number', $formatted_number, $prefix, $number, $postfix);
1229 1229
 }
1230 1230
 
1231 1231
 /**
@@ -1239,17 +1239,17 @@  discard block
 block discarded – undo
1239 1239
  */
1240 1240
 function give_get_next_payment_number() {
1241 1241
 
1242
-	if ( ! give_get_option( 'enable_sequential' ) ) {
1242
+	if ( ! give_get_option('enable_sequential')) {
1243 1243
 		return false;
1244 1244
 	}
1245 1245
 
1246
-	$number           = get_option( 'give_last_payment_number' );
1247
-	$start            = give_get_option( 'sequential_start', 1 );
1246
+	$number           = get_option('give_last_payment_number');
1247
+	$start            = give_get_option('sequential_start', 1);
1248 1248
 	$increment_number = true;
1249 1249
 
1250
-	if ( false !== $number ) {
1250
+	if (false !== $number) {
1251 1251
 
1252
-		if ( empty( $number ) ) {
1252
+		if (empty($number)) {
1253 1253
 
1254 1254
 			$number           = $start;
1255 1255
 			$increment_number = false;
@@ -1258,24 +1258,24 @@  discard block
 block discarded – undo
1258 1258
 	} else {
1259 1259
 
1260 1260
 		// This case handles the first addition of the new option, as well as if it get's deleted for any reason.
1261
-		$payments     = new Give_Payments_Query( array(
1261
+		$payments = new Give_Payments_Query(array(
1262 1262
 			'number'  => 1,
1263 1263
 			'order'   => 'DESC',
1264 1264
 			'orderby' => 'ID',
1265 1265
 			'output'  => 'posts',
1266 1266
 			'fields'  => 'ids',
1267
-		) );
1267
+		));
1268 1268
 		$last_payment = $payments->get_payments();
1269 1269
 
1270
-		if ( ! empty( $last_payment ) ) {
1270
+		if ( ! empty($last_payment)) {
1271 1271
 
1272
-			$number = give_get_payment_number( $last_payment[0] );
1272
+			$number = give_get_payment_number($last_payment[0]);
1273 1273
 
1274 1274
 		}
1275 1275
 
1276
-		if ( ! empty( $number ) && $number !== (int) $last_payment[0] ) {
1276
+		if ( ! empty($number) && $number !== (int) $last_payment[0]) {
1277 1277
 
1278
-			$number = give_remove_payment_prefix_postfix( $number );
1278
+			$number = give_remove_payment_prefix_postfix($number);
1279 1279
 
1280 1280
 		} else {
1281 1281
 
@@ -1284,13 +1284,13 @@  discard block
 block discarded – undo
1284 1284
 		}
1285 1285
 	}// End if().
1286 1286
 
1287
-	$increment_number = apply_filters( 'give_increment_payment_number', $increment_number, $number );
1287
+	$increment_number = apply_filters('give_increment_payment_number', $increment_number, $number);
1288 1288
 
1289
-	if ( $increment_number ) {
1290
-		$number ++;
1289
+	if ($increment_number) {
1290
+		$number++;
1291 1291
 	}
1292 1292
 
1293
-	return apply_filters( 'give_get_next_payment_number', $number );
1293
+	return apply_filters('give_get_next_payment_number', $number);
1294 1294
 }
1295 1295
 
1296 1296
 /**
@@ -1302,25 +1302,25 @@  discard block
 block discarded – undo
1302 1302
  *
1303 1303
  * @return string The new Payment number without prefix and postfix.
1304 1304
  */
1305
-function give_remove_payment_prefix_postfix( $number ) {
1305
+function give_remove_payment_prefix_postfix($number) {
1306 1306
 
1307
-	$prefix  = give_get_option( 'sequential_prefix' );
1308
-	$postfix = give_get_option( 'sequential_postfix' );
1307
+	$prefix  = give_get_option('sequential_prefix');
1308
+	$postfix = give_get_option('sequential_postfix');
1309 1309
 
1310 1310
 	// Remove prefix.
1311
-	$number = preg_replace( '/' . $prefix . '/', '', $number, 1 );
1311
+	$number = preg_replace('/'.$prefix.'/', '', $number, 1);
1312 1312
 
1313 1313
 	// Remove the postfix.
1314
-	$length      = strlen( $number );
1315
-	$postfix_pos = strrpos( $number, $postfix );
1316
-	if ( false !== $postfix_pos ) {
1317
-		$number = substr_replace( $number, '', $postfix_pos, $length );
1314
+	$length      = strlen($number);
1315
+	$postfix_pos = strrpos($number, $postfix);
1316
+	if (false !== $postfix_pos) {
1317
+		$number = substr_replace($number, '', $postfix_pos, $length);
1318 1318
 	}
1319 1319
 
1320 1320
 	// Ensure it's a whole number.
1321
-	$number = intval( $number );
1321
+	$number = intval($number);
1322 1322
 
1323
-	return apply_filters( 'give_remove_payment_prefix_postfix', $number, $prefix, $postfix );
1323
+	return apply_filters('give_remove_payment_prefix_postfix', $number, $prefix, $postfix);
1324 1324
 
1325 1325
 }
1326 1326
 
@@ -1338,13 +1338,13 @@  discard block
 block discarded – undo
1338 1338
  *
1339 1339
  * @return string $amount Fully formatted donation amount.
1340 1340
  */
1341
-function give_donation_amount( $donation, $format_args = false ) {
1341
+function give_donation_amount($donation, $format_args = false) {
1342 1342
 	/* @var Give_Payment $donation */
1343
-	if ( ! ( $donation instanceof Give_Payment ) ) {
1344
-		$donation = new Give_Payment( absint( $donation ) );
1343
+	if ( ! ($donation instanceof Give_Payment)) {
1344
+		$donation = new Give_Payment(absint($donation));
1345 1345
 	}
1346 1346
 
1347
-	if ( ! is_array( $format_args ) ) {
1347
+	if ( ! is_array($format_args)) {
1348 1348
 		$format_args = array(
1349 1349
 			'currency' => (bool) $format_args,
1350 1350
 			'amount'   => (bool) $format_args,
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 	$amount           = $donation->total;
1363 1363
 	$formatted_amount = $amount;
1364 1364
 
1365
-	if ( $format_args['amount'] ) {
1365
+	if ($format_args['amount']) {
1366 1366
 		$formatted_amount = give_format_amount(
1367 1367
 			$amount,
1368 1368
 			array(
@@ -1372,8 +1372,8 @@  discard block
 block discarded – undo
1372 1372
 		);
1373 1373
 	}
1374 1374
 
1375
-	if ( $format_args['currency'] ) {
1376
-		$formatted_amount = give_currency_filter( $formatted_amount, $donation->currency );
1375
+	if ($format_args['currency']) {
1376
+		$formatted_amount = give_currency_filter($formatted_amount, $donation->currency);
1377 1377
 	}
1378 1378
 
1379 1379
 	/**
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 	 * @param float  $amount           Donation amount.
1386 1386
 	 * @param int    $donation_id      Donation ID.
1387 1387
 	 */
1388
-	return apply_filters( 'give_donation_amount', (string) $formatted_amount, $amount, $donation );
1388
+	return apply_filters('give_donation_amount', (string) $formatted_amount, $amount, $donation);
1389 1389
 }
1390 1390
 
1391 1391
 /**
@@ -1402,10 +1402,10 @@  discard block
 block discarded – undo
1402 1402
  *
1403 1403
  * @return array Fully formatted payment subtotal.
1404 1404
  */
1405
-function give_payment_subtotal( $payment_id = 0 ) {
1406
-	$subtotal = give_get_payment_subtotal( $payment_id );
1405
+function give_payment_subtotal($payment_id = 0) {
1406
+	$subtotal = give_get_payment_subtotal($payment_id);
1407 1407
 
1408
-	return give_currency_filter( give_format_amount( $subtotal, array( 'sanitize' => false ) ), give_get_payment_currency_code( $payment_id ) );
1408
+	return give_currency_filter(give_format_amount($subtotal, array('sanitize' => false)), give_get_payment_currency_code($payment_id));
1409 1409
 }
1410 1410
 
1411 1411
 /**
@@ -1419,8 +1419,8 @@  discard block
 block discarded – undo
1419 1419
  *
1420 1420
  * @return float $subtotal Subtotal for payment (non formatted).
1421 1421
  */
1422
-function give_get_payment_subtotal( $payment_id = 0 ) {
1423
-	$payment = new Give_Payment( $payment_id );
1422
+function give_get_payment_subtotal($payment_id = 0) {
1423
+	$payment = new Give_Payment($payment_id);
1424 1424
 
1425 1425
 	return $payment->subtotal;
1426 1426
 }
@@ -1434,8 +1434,8 @@  discard block
 block discarded – undo
1434 1434
  *
1435 1435
  * @return string The donation ID.
1436 1436
  */
1437
-function give_get_payment_transaction_id( $payment_id = 0 ) {
1438
-	$payment = new Give_Payment( $payment_id );
1437
+function give_get_payment_transaction_id($payment_id = 0) {
1438
+	$payment = new Give_Payment($payment_id);
1439 1439
 
1440 1440
 	return $payment->transaction_id;
1441 1441
 }
@@ -1450,15 +1450,15 @@  discard block
 block discarded – undo
1450 1450
  *
1451 1451
  * @return bool|mixed
1452 1452
  */
1453
-function give_set_payment_transaction_id( $payment_id = 0, $transaction_id = '' ) {
1453
+function give_set_payment_transaction_id($payment_id = 0, $transaction_id = '') {
1454 1454
 
1455
-	if ( empty( $payment_id ) || empty( $transaction_id ) ) {
1455
+	if (empty($payment_id) || empty($transaction_id)) {
1456 1456
 		return false;
1457 1457
 	}
1458 1458
 
1459
-	$transaction_id = apply_filters( 'give_set_payment_transaction_id', $transaction_id, $payment_id );
1459
+	$transaction_id = apply_filters('give_set_payment_transaction_id', $transaction_id, $payment_id);
1460 1460
 
1461
-	return give_update_payment_meta( $payment_id, '_give_payment_transaction_id', $transaction_id );
1461
+	return give_update_payment_meta($payment_id, '_give_payment_transaction_id', $transaction_id);
1462 1462
 }
1463 1463
 
1464 1464
 /**
@@ -1471,12 +1471,12 @@  discard block
 block discarded – undo
1471 1471
  *
1472 1472
  * @return int $purchase Donation ID.
1473 1473
  */
1474
-function give_get_purchase_id_by_key( $key ) {
1474
+function give_get_purchase_id_by_key($key) {
1475 1475
 	global $wpdb;
1476 1476
 
1477
-	$purchase = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_give_payment_purchase_key' AND meta_value = %s LIMIT 1", $key ) );
1477
+	$purchase = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_give_payment_purchase_key' AND meta_value = %s LIMIT 1", $key));
1478 1478
 
1479
-	if ( $purchase != null ) {
1479
+	if ($purchase != null) {
1480 1480
 		return $purchase;
1481 1481
 	}
1482 1482
 
@@ -1494,12 +1494,12 @@  discard block
 block discarded – undo
1494 1494
  *
1495 1495
  * @return int $purchase Donation ID.
1496 1496
  */
1497
-function give_get_purchase_id_by_transaction_id( $key ) {
1497
+function give_get_purchase_id_by_transaction_id($key) {
1498 1498
 	global $wpdb;
1499 1499
 
1500
-	$purchase = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_give_payment_transaction_id' AND meta_value = %s LIMIT 1", $key ) );
1500
+	$purchase = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_give_payment_transaction_id' AND meta_value = %s LIMIT 1", $key));
1501 1501
 
1502
-	if ( $purchase != null ) {
1502
+	if ($purchase != null) {
1503 1503
 		return $purchase;
1504 1504
 	}
1505 1505
 
@@ -1516,23 +1516,23 @@  discard block
 block discarded – undo
1516 1516
  *
1517 1517
  * @return array $notes Donation Notes
1518 1518
  */
1519
-function give_get_payment_notes( $payment_id = 0, $search = '' ) {
1519
+function give_get_payment_notes($payment_id = 0, $search = '') {
1520 1520
 
1521
-	if ( empty( $payment_id ) && empty( $search ) ) {
1521
+	if (empty($payment_id) && empty($search)) {
1522 1522
 		return false;
1523 1523
 	}
1524 1524
 
1525
-	remove_action( 'pre_get_comments', 'give_hide_payment_notes', 10 );
1526
-	remove_filter( 'comments_clauses', 'give_hide_payment_notes_pre_41', 10 );
1525
+	remove_action('pre_get_comments', 'give_hide_payment_notes', 10);
1526
+	remove_filter('comments_clauses', 'give_hide_payment_notes_pre_41', 10);
1527 1527
 
1528
-	$notes = get_comments( array(
1528
+	$notes = get_comments(array(
1529 1529
 		'post_id' => $payment_id,
1530 1530
 		'order'   => 'ASC',
1531 1531
 		'search'  => $search,
1532
-	) );
1532
+	));
1533 1533
 
1534
-	add_action( 'pre_get_comments', 'give_hide_payment_notes', 10 );
1535
-	add_filter( 'comments_clauses', 'give_hide_payment_notes_pre_41', 10, 2 );
1534
+	add_action('pre_get_comments', 'give_hide_payment_notes', 10);
1535
+	add_filter('comments_clauses', 'give_hide_payment_notes_pre_41', 10, 2);
1536 1536
 
1537 1537
 	return $notes;
1538 1538
 }
@@ -1548,8 +1548,8 @@  discard block
 block discarded – undo
1548 1548
  *
1549 1549
  * @return int The new note ID
1550 1550
  */
1551
-function give_insert_payment_note( $payment_id = 0, $note = '' ) {
1552
-	if ( empty( $payment_id ) ) {
1551
+function give_insert_payment_note($payment_id = 0, $note = '') {
1552
+	if (empty($payment_id)) {
1553 1553
 		return false;
1554 1554
 	}
1555 1555
 
@@ -1561,14 +1561,14 @@  discard block
 block discarded – undo
1561 1561
 	 *
1562 1562
 	 * @since 1.0
1563 1563
 	 */
1564
-	do_action( 'give_pre_insert_payment_note', $payment_id, $note );
1564
+	do_action('give_pre_insert_payment_note', $payment_id, $note);
1565 1565
 
1566
-	$note_id = wp_insert_comment( wp_filter_comment( array(
1566
+	$note_id = wp_insert_comment(wp_filter_comment(array(
1567 1567
 		'comment_post_ID'      => $payment_id,
1568 1568
 		'comment_content'      => $note,
1569 1569
 		'user_id'              => is_admin() ? get_current_user_id() : 0,
1570
-		'comment_date'         => current_time( 'mysql' ),
1571
-		'comment_date_gmt'     => current_time( 'mysql', 1 ),
1570
+		'comment_date'         => current_time('mysql'),
1571
+		'comment_date_gmt'     => current_time('mysql', 1),
1572 1572
 		'comment_approved'     => 1,
1573 1573
 		'comment_parent'       => 0,
1574 1574
 		'comment_author'       => '',
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
 		'comment_author_email' => '',
1578 1578
 		'comment_type'         => 'give_payment_note',
1579 1579
 
1580
-	) ) );
1580
+	)));
1581 1581
 
1582 1582
 	/**
1583 1583
 	 * Fires after payment note inserted.
@@ -1588,7 +1588,7 @@  discard block
 block discarded – undo
1588 1588
 	 *
1589 1589
 	 * @since 1.0
1590 1590
 	 */
1591
-	do_action( 'give_insert_payment_note', $note_id, $payment_id, $note );
1591
+	do_action('give_insert_payment_note', $note_id, $payment_id, $note);
1592 1592
 
1593 1593
 	return $note_id;
1594 1594
 }
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
  *
1604 1604
  * @return bool True on success, false otherwise.
1605 1605
  */
1606
-function give_delete_payment_note( $comment_id = 0, $payment_id = 0 ) {
1607
-	if ( empty( $comment_id ) ) {
1606
+function give_delete_payment_note($comment_id = 0, $payment_id = 0) {
1607
+	if (empty($comment_id)) {
1608 1608
 		return false;
1609 1609
 	}
1610 1610
 
@@ -1616,9 +1616,9 @@  discard block
 block discarded – undo
1616 1616
 	 *
1617 1617
 	 * @since 1.0
1618 1618
 	 */
1619
-	do_action( 'give_pre_delete_payment_note', $comment_id, $payment_id );
1619
+	do_action('give_pre_delete_payment_note', $comment_id, $payment_id);
1620 1620
 
1621
-	$ret = wp_delete_comment( $comment_id, true );
1621
+	$ret = wp_delete_comment($comment_id, true);
1622 1622
 
1623 1623
 	/**
1624 1624
 	 * Fires after donation note deleted.
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
 	 *
1629 1629
 	 * @since 1.0
1630 1630
 	 */
1631
-	do_action( 'give_post_delete_payment_note', $comment_id, $payment_id );
1631
+	do_action('give_post_delete_payment_note', $comment_id, $payment_id);
1632 1632
 
1633 1633
 	return $ret;
1634 1634
 }
@@ -1643,32 +1643,32 @@  discard block
 block discarded – undo
1643 1643
  *
1644 1644
  * @return string
1645 1645
  */
1646
-function give_get_payment_note_html( $note, $payment_id = 0 ) {
1646
+function give_get_payment_note_html($note, $payment_id = 0) {
1647 1647
 
1648
-	if ( is_numeric( $note ) ) {
1649
-		$note = get_comment( $note );
1648
+	if (is_numeric($note)) {
1649
+		$note = get_comment($note);
1650 1650
 	}
1651 1651
 
1652
-	if ( ! empty( $note->user_id ) ) {
1653
-		$user = get_userdata( $note->user_id );
1652
+	if ( ! empty($note->user_id)) {
1653
+		$user = get_userdata($note->user_id);
1654 1654
 		$user = $user->display_name;
1655 1655
 	} else {
1656
-		$user = __( 'System', 'give' );
1656
+		$user = __('System', 'give');
1657 1657
 	}
1658 1658
 
1659
-	$date_format = give_date_format() . ', ' . get_option( 'time_format' );
1659
+	$date_format = give_date_format().', '.get_option('time_format');
1660 1660
 
1661
-	$delete_note_url = wp_nonce_url( add_query_arg( array(
1661
+	$delete_note_url = wp_nonce_url(add_query_arg(array(
1662 1662
 		'give-action' => 'delete_payment_note',
1663 1663
 		'note_id'     => $note->comment_ID,
1664 1664
 		'payment_id'  => $payment_id,
1665
-	) ), 'give_delete_payment_note_' . $note->comment_ID );
1665
+	)), 'give_delete_payment_note_'.$note->comment_ID);
1666 1666
 
1667
-	$note_html = '<div class="give-payment-note" id="give-payment-note-' . $note->comment_ID . '">';
1667
+	$note_html = '<div class="give-payment-note" id="give-payment-note-'.$note->comment_ID.'">';
1668 1668
 	$note_html .= '<p>';
1669
-	$note_html .= '<strong>' . $user . '</strong>&nbsp;&ndash;&nbsp;<span style="color:#aaa;font-style:italic;">' . date_i18n( $date_format, strtotime( $note->comment_date ) ) . '</span><br/>';
1669
+	$note_html .= '<strong>'.$user.'</strong>&nbsp;&ndash;&nbsp;<span style="color:#aaa;font-style:italic;">'.date_i18n($date_format, strtotime($note->comment_date)).'</span><br/>';
1670 1670
 	$note_html .= $note->comment_content;
1671
-	$note_html .= '&nbsp;&ndash;&nbsp;<a href="' . esc_url( $delete_note_url ) . '" class="give-delete-payment-note" data-note-id="' . absint( $note->comment_ID ) . '" data-payment-id="' . absint( $payment_id ) . '" aria-label="' . __( 'Delete this donation note.', 'give' ) . '">' . __( 'Delete', 'give' ) . '</a>';
1671
+	$note_html .= '&nbsp;&ndash;&nbsp;<a href="'.esc_url($delete_note_url).'" class="give-delete-payment-note" data-note-id="'.absint($note->comment_ID).'" data-payment-id="'.absint($payment_id).'" aria-label="'.__('Delete this donation note.', 'give').'">'.__('Delete', 'give').'</a>';
1672 1672
 	$note_html .= '</p>';
1673 1673
 	$note_html .= '</div>';
1674 1674
 
@@ -1686,18 +1686,18 @@  discard block
 block discarded – undo
1686 1686
  *
1687 1687
  * @return void
1688 1688
  */
1689
-function give_hide_payment_notes( $query ) {
1690
-	if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.1', '>=' ) ) {
1691
-		$types = isset( $query->query_vars['type__not_in'] ) ? $query->query_vars['type__not_in'] : array();
1692
-		if ( ! is_array( $types ) ) {
1693
-			$types = array( $types );
1689
+function give_hide_payment_notes($query) {
1690
+	if (version_compare(floatval(get_bloginfo('version')), '4.1', '>=')) {
1691
+		$types = isset($query->query_vars['type__not_in']) ? $query->query_vars['type__not_in'] : array();
1692
+		if ( ! is_array($types)) {
1693
+			$types = array($types);
1694 1694
 		}
1695 1695
 		$types[]                           = 'give_payment_note';
1696 1696
 		$query->query_vars['type__not_in'] = $types;
1697 1697
 	}
1698 1698
 }
1699 1699
 
1700
-add_action( 'pre_get_comments', 'give_hide_payment_notes', 10 );
1700
+add_action('pre_get_comments', 'give_hide_payment_notes', 10);
1701 1701
 
1702 1702
 /**
1703 1703
  * Exclude notes (comments) on give_payment post type from showing in Recent Comments widgets
@@ -1709,15 +1709,15 @@  discard block
 block discarded – undo
1709 1709
  *
1710 1710
  * @return array $clauses Updated comment clauses.
1711 1711
  */
1712
-function give_hide_payment_notes_pre_41( $clauses, $wp_comment_query ) {
1713
-	if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.1', '<' ) ) {
1712
+function give_hide_payment_notes_pre_41($clauses, $wp_comment_query) {
1713
+	if (version_compare(floatval(get_bloginfo('version')), '4.1', '<')) {
1714 1714
 		$clauses['where'] .= ' AND comment_type != "give_payment_note"';
1715 1715
 	}
1716 1716
 
1717 1717
 	return $clauses;
1718 1718
 }
1719 1719
 
1720
-add_filter( 'comments_clauses', 'give_hide_payment_notes_pre_41', 10, 2 );
1720
+add_filter('comments_clauses', 'give_hide_payment_notes_pre_41', 10, 2);
1721 1721
 
1722 1722
 
1723 1723
 /**
@@ -1730,15 +1730,15 @@  discard block
 block discarded – undo
1730 1730
  *
1731 1731
  * @return string $where
1732 1732
  */
1733
-function give_hide_payment_notes_from_feeds( $where, $wp_comment_query ) {
1733
+function give_hide_payment_notes_from_feeds($where, $wp_comment_query) {
1734 1734
 	global $wpdb;
1735 1735
 
1736
-	$where .= $wpdb->prepare( ' AND comment_type != %s', 'give_payment_note' );
1736
+	$where .= $wpdb->prepare(' AND comment_type != %s', 'give_payment_note');
1737 1737
 
1738 1738
 	return $where;
1739 1739
 }
1740 1740
 
1741
-add_filter( 'comment_feed_where', 'give_hide_payment_notes_from_feeds', 10, 2 );
1741
+add_filter('comment_feed_where', 'give_hide_payment_notes_from_feeds', 10, 2);
1742 1742
 
1743 1743
 
1744 1744
 /**
@@ -1752,32 +1752,32 @@  discard block
 block discarded – undo
1752 1752
  *
1753 1753
  * @return array|object Array of comment counts.
1754 1754
  */
1755
-function give_remove_payment_notes_in_comment_counts( $stats, $post_id ) {
1755
+function give_remove_payment_notes_in_comment_counts($stats, $post_id) {
1756 1756
 	global $wpdb, $pagenow;
1757 1757
 
1758
-	if ( 'index.php' != $pagenow ) {
1758
+	if ('index.php' != $pagenow) {
1759 1759
 		return $stats;
1760 1760
 	}
1761 1761
 
1762 1762
 	$post_id = (int) $post_id;
1763 1763
 
1764
-	if ( apply_filters( 'give_count_payment_notes_in_comments', false ) ) {
1764
+	if (apply_filters('give_count_payment_notes_in_comments', false)) {
1765 1765
 		return $stats;
1766 1766
 	}
1767 1767
 
1768
-	$stats = wp_cache_get( "comments-{$post_id}", 'counts' );
1768
+	$stats = wp_cache_get("comments-{$post_id}", 'counts');
1769 1769
 
1770
-	if ( false !== $stats ) {
1770
+	if (false !== $stats) {
1771 1771
 		return $stats;
1772 1772
 	}
1773 1773
 
1774 1774
 	$where = 'WHERE comment_type != "give_payment_note"';
1775 1775
 
1776
-	if ( $post_id > 0 ) {
1777
-		$where .= $wpdb->prepare( ' AND comment_post_ID = %d', $post_id );
1776
+	if ($post_id > 0) {
1777
+		$where .= $wpdb->prepare(' AND comment_post_ID = %d', $post_id);
1778 1778
 	}
1779 1779
 
1780
-	$count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A );
1780
+	$count = $wpdb->get_results("SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A);
1781 1781
 
1782 1782
 	$total    = 0;
1783 1783
 	$approved = array(
@@ -1787,30 +1787,30 @@  discard block
 block discarded – undo
1787 1787
 		'trash'        => 'trash',
1788 1788
 		'post-trashed' => 'post-trashed',
1789 1789
 	);
1790
-	foreach ( (array) $count as $row ) {
1790
+	foreach ((array) $count as $row) {
1791 1791
 		// Don't count post-trashed toward totals.
1792
-		if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] ) {
1792
+		if ('post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved']) {
1793 1793
 			$total += $row['num_comments'];
1794 1794
 		}
1795
-		if ( isset( $approved[ $row['comment_approved'] ] ) ) {
1796
-			$stats[ $approved[ $row['comment_approved'] ] ] = $row['num_comments'];
1795
+		if (isset($approved[$row['comment_approved']])) {
1796
+			$stats[$approved[$row['comment_approved']]] = $row['num_comments'];
1797 1797
 		}
1798 1798
 	}
1799 1799
 
1800 1800
 	$stats['total_comments'] = $total;
1801
-	foreach ( $approved as $key ) {
1802
-		if ( empty( $stats[ $key ] ) ) {
1803
-			$stats[ $key ] = 0;
1801
+	foreach ($approved as $key) {
1802
+		if (empty($stats[$key])) {
1803
+			$stats[$key] = 0;
1804 1804
 		}
1805 1805
 	}
1806 1806
 
1807 1807
 	$stats = (object) $stats;
1808
-	wp_cache_set( "comments-{$post_id}", $stats, 'counts' );
1808
+	wp_cache_set("comments-{$post_id}", $stats, 'counts');
1809 1809
 
1810 1810
 	return $stats;
1811 1811
 }
1812 1812
 
1813
-add_filter( 'wp_count_comments', 'give_remove_payment_notes_in_comment_counts', 10, 2 );
1813
+add_filter('wp_count_comments', 'give_remove_payment_notes_in_comment_counts', 10, 2);
1814 1814
 
1815 1815
 
1816 1816
 /**
@@ -1823,9 +1823,9 @@  discard block
 block discarded – undo
1823 1823
  *
1824 1824
  * @return string $where Modified where clause.
1825 1825
  */
1826
-function give_filter_where_older_than_week( $where = '' ) {
1826
+function give_filter_where_older_than_week($where = '') {
1827 1827
 	// Payments older than one week.
1828
-	$start = date( 'Y-m-d', strtotime( '-7 days' ) );
1828
+	$start = date('Y-m-d', strtotime('-7 days'));
1829 1829
 	$where .= " AND post_date <= '{$start}'";
1830 1830
 
1831 1831
 	return $where;
@@ -1845,38 +1845,38 @@  discard block
 block discarded – undo
1845 1845
  *
1846 1846
  * @return string $form_title Returns the full title if $only_level is false, otherwise returns the levels title.
1847 1847
  */
1848
-function give_get_payment_form_title( $payment_meta, $only_level = false, $separator = '' ) {
1848
+function give_get_payment_form_title($payment_meta, $only_level = false, $separator = '') {
1849 1849
 
1850
-	$form_id    = isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : 0;
1851
-	$price_id   = isset( $payment_meta['price_id'] ) ? $payment_meta['price_id'] : null;
1852
-	$form_title = isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '';
1850
+	$form_id    = isset($payment_meta['form_id']) ? $payment_meta['form_id'] : 0;
1851
+	$price_id   = isset($payment_meta['price_id']) ? $payment_meta['price_id'] : null;
1852
+	$form_title = isset($payment_meta['form_title']) ? $payment_meta['form_title'] : '';
1853 1853
 
1854
-	if ( $only_level == true ) {
1854
+	if ($only_level == true) {
1855 1855
 		$form_title = '';
1856 1856
 	}
1857 1857
 
1858 1858
 	// If multi-level, append to the form title.
1859
-	if ( give_has_variable_prices( $form_id ) ) {
1859
+	if (give_has_variable_prices($form_id)) {
1860 1860
 
1861 1861
 		// Only add separator if there is a form title.
1862
-		if ( ! empty( $form_title ) ) {
1863
-			$form_title .= ' ' . $separator . ' ';
1862
+		if ( ! empty($form_title)) {
1863
+			$form_title .= ' '.$separator.' ';
1864 1864
 		}
1865 1865
 
1866 1866
 		$form_title .= '<span class="donation-level-text-wrap">';
1867 1867
 
1868
-		if ( 'custom' === $price_id ) {
1869
-			$custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true );
1870
-			$form_title         .= ! empty( $custom_amount_text ) ? $custom_amount_text : __( 'Custom Amount', 'give' );
1868
+		if ('custom' === $price_id) {
1869
+			$custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true);
1870
+			$form_title .= ! empty($custom_amount_text) ? $custom_amount_text : __('Custom Amount', 'give');
1871 1871
 		} else {
1872
-			$form_title .= give_get_price_option_name( $form_id, $price_id );
1872
+			$form_title .= give_get_price_option_name($form_id, $price_id);
1873 1873
 		}
1874 1874
 
1875 1875
 		$form_title .= '</span>';
1876 1876
 
1877 1877
 	}
1878 1878
 
1879
-	return apply_filters( 'give_get_payment_form_title', $form_title, $payment_meta );
1879
+	return apply_filters('give_get_payment_form_title', $form_title, $payment_meta);
1880 1880
 
1881 1881
 }
1882 1882
 
@@ -1890,19 +1890,19 @@  discard block
 block discarded – undo
1890 1890
  *
1891 1891
  * @return string $price_id
1892 1892
  */
1893
-function give_get_price_id( $form_id, $price ) {
1893
+function give_get_price_id($form_id, $price) {
1894 1894
 	$price_id = null;
1895 1895
 
1896
-	if ( give_has_variable_prices( $form_id ) ) {
1896
+	if (give_has_variable_prices($form_id)) {
1897 1897
 
1898
-		$levels = give_get_meta( $form_id, '_give_donation_levels', true );
1898
+		$levels = give_get_meta($form_id, '_give_donation_levels', true);
1899 1899
 
1900
-		foreach ( $levels as $level ) {
1900
+		foreach ($levels as $level) {
1901 1901
 
1902
-			$level_amount = give_maybe_sanitize_amount( $level['_give_amount'] );
1902
+			$level_amount = give_maybe_sanitize_amount($level['_give_amount']);
1903 1903
 
1904 1904
 			// Check that this indeed the recurring price.
1905
-			if ( $level_amount == $price ) {
1905
+			if ($level_amount == $price) {
1906 1906
 
1907 1907
 				$price_id = $level['_give_id']['level_id'];
1908 1908
 				break;
@@ -1910,13 +1910,13 @@  discard block
 block discarded – undo
1910 1910
 			}
1911 1911
 		}
1912 1912
 
1913
-		if ( is_null( $price_id ) && give_is_custom_price_mode( $form_id ) ) {
1913
+		if (is_null($price_id) && give_is_custom_price_mode($form_id)) {
1914 1914
 			$price_id = 'custom';
1915 1915
 		}
1916 1916
 	}
1917 1917
 
1918 1918
 	// Price ID must be numeric or string.
1919
-	$price_id = ! is_numeric( $price_id ) && ! is_string( $price_id ) ? 0 : $price_id;
1919
+	$price_id = ! is_numeric($price_id) && ! is_string($price_id) ? 0 : $price_id;
1920 1920
 
1921 1921
 	return $price_id;
1922 1922
 }
@@ -1934,10 +1934,10 @@  discard block
 block discarded – undo
1934 1934
  *
1935 1935
  * @return string
1936 1936
  */
1937
-function give_get_form_dropdown( $args = array(), $echo = false ) {
1938
-	$form_dropdown_html = Give()->html->forms_dropdown( $args );
1937
+function give_get_form_dropdown($args = array(), $echo = false) {
1938
+	$form_dropdown_html = Give()->html->forms_dropdown($args);
1939 1939
 
1940
-	if ( ! $echo ) {
1940
+	if ( ! $echo) {
1941 1941
 		return $form_dropdown_html;
1942 1942
 	}
1943 1943
 
@@ -1954,17 +1954,17 @@  discard block
 block discarded – undo
1954 1954
  *
1955 1955
  * @return string|bool
1956 1956
  */
1957
-function give_get_form_variable_price_dropdown( $args = array(), $echo = false ) {
1957
+function give_get_form_variable_price_dropdown($args = array(), $echo = false) {
1958 1958
 
1959 1959
 	// Check for give form id.
1960
-	if ( empty( $args['id'] ) ) {
1960
+	if (empty($args['id'])) {
1961 1961
 		return false;
1962 1962
 	}
1963 1963
 
1964
-	$form = new Give_Donate_Form( $args['id'] );
1964
+	$form = new Give_Donate_Form($args['id']);
1965 1965
 
1966 1966
 	// Check if form has variable prices or not.
1967
-	if ( ! $form->ID || ! $form->has_variable_prices() ) {
1967
+	if ( ! $form->ID || ! $form->has_variable_prices()) {
1968 1968
 		return false;
1969 1969
 	}
1970 1970
 
@@ -1972,24 +1972,24 @@  discard block
 block discarded – undo
1972 1972
 	$variable_price_options = array();
1973 1973
 
1974 1974
 	// Check if multi donation form support custom donation or not.
1975
-	if ( $form->is_custom_price_mode() ) {
1976
-		$variable_price_options['custom'] = _x( 'Custom', 'custom donation dropdown item', 'give' );
1975
+	if ($form->is_custom_price_mode()) {
1976
+		$variable_price_options['custom'] = _x('Custom', 'custom donation dropdown item', 'give');
1977 1977
 	}
1978 1978
 
1979 1979
 	// Get variable price and ID from variable price array.
1980
-	foreach ( $variable_prices as $variable_price ) {
1981
-		$variable_price_options[ $variable_price['_give_id']['level_id'] ] = ! empty( $variable_price['_give_text'] ) ? $variable_price['_give_text'] : give_currency_filter( give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) ) );
1980
+	foreach ($variable_prices as $variable_price) {
1981
+		$variable_price_options[$variable_price['_give_id']['level_id']] = ! empty($variable_price['_give_text']) ? $variable_price['_give_text'] : give_currency_filter(give_format_amount($variable_price['_give_amount'], array('sanitize' => false)));
1982 1982
 	}
1983 1983
 
1984 1984
 	// Update options.
1985
-	$args = array_merge( $args, array(
1985
+	$args = array_merge($args, array(
1986 1986
 		'options' => $variable_price_options,
1987
-	) );
1987
+	));
1988 1988
 
1989 1989
 	// Generate select html.
1990
-	$form_dropdown_html = Give()->html->select( $args );
1990
+	$form_dropdown_html = Give()->html->select($args);
1991 1991
 
1992
-	if ( ! $echo ) {
1992
+	if ( ! $echo) {
1993 1993
 		return $form_dropdown_html;
1994 1994
 	}
1995 1995
 
@@ -2008,16 +2008,16 @@  discard block
 block discarded – undo
2008 2008
  *
2009 2009
  * @return string
2010 2010
  */
2011
-function give_get_payment_meta_price_id( $payment_meta ) {
2011
+function give_get_payment_meta_price_id($payment_meta) {
2012 2012
 
2013
-	if ( isset( $payment_meta['give_price_id'] ) ) {
2013
+	if (isset($payment_meta['give_price_id'])) {
2014 2014
 		$price_id = $payment_meta['give_price_id'];
2015
-	} elseif ( isset( $payment_meta['price_id'] ) ) {
2015
+	} elseif (isset($payment_meta['price_id'])) {
2016 2016
 		$price_id = $payment_meta['price_id'];
2017 2017
 	} else {
2018
-		$price_id = give_get_price_id( $payment_meta['give_form_id'], $payment_meta['price'] );
2018
+		$price_id = give_get_price_id($payment_meta['give_form_id'], $payment_meta['price']);
2019 2019
 	}
2020 2020
 
2021
-	return apply_filters( 'give_get_payment_meta_price_id', $price_id );
2021
+	return apply_filters('give_get_payment_meta_price_id', $price_id);
2022 2022
 
2023 2023
 }
Please login to merge, or discard this patch.
includes/post-types.php 1 patch
Spacing   +160 added lines, -160 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,49 +23,49 @@  discard block
 block discarded – undo
23 23
 function give_setup_post_types() {
24 24
 
25 25
 	// Give Forms single post and archive options.
26
-	$give_forms_singular = give_is_setting_enabled( give_get_option( 'forms_singular' ) );
27
-	$give_forms_archives = give_is_setting_enabled( give_get_option( 'forms_archives' ) );
26
+	$give_forms_singular = give_is_setting_enabled(give_get_option('forms_singular'));
27
+	$give_forms_archives = give_is_setting_enabled(give_get_option('forms_archives'));
28 28
 
29 29
 	// Enable/Disable give_forms links if form is saving.
30
-	if ( Give_Admin_Settings::is_saving_settings() ) {
31
-		if ( isset( $_POST['forms_singular'] ) ) {
32
-			$give_forms_singular = give_is_setting_enabled( give_clean( $_POST['forms_singular'] ) );
30
+	if (Give_Admin_Settings::is_saving_settings()) {
31
+		if (isset($_POST['forms_singular'])) {
32
+			$give_forms_singular = give_is_setting_enabled(give_clean($_POST['forms_singular']));
33 33
 			flush_rewrite_rules();
34 34
 		}
35 35
 
36
-		if ( isset( $_POST['forms_archives'] ) ) {
37
-			$give_forms_archives = give_is_setting_enabled( give_clean( $_POST['forms_archives'] ) );
36
+		if (isset($_POST['forms_archives'])) {
37
+			$give_forms_archives = give_is_setting_enabled(give_clean($_POST['forms_archives']));
38 38
 			flush_rewrite_rules();
39 39
 		}
40 40
 	}
41 41
 
42
-	$give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations';
42
+	$give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations';
43 43
 	// Support for old 'GIVE_FORMS_SLUG' constant
44
-	if ( defined( 'GIVE_FORMS_SLUG' ) ) {
44
+	if (defined('GIVE_FORMS_SLUG')) {
45 45
 		$give_forms_slug = GIVE_FORMS_SLUG;
46 46
 	}
47 47
 
48
-	$give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array(
48
+	$give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array(
49 49
 		'slug'       => $give_forms_slug,
50 50
 		'with_front' => false,
51 51
 	);
52 52
 
53
-	$give_forms_labels = apply_filters( 'give_forms_labels', array(
54
-		'name'               => __( 'Donation Forms', 'give' ),
55
-		'singular_name'      => __( 'Form', 'give' ),
56
-		'add_new'            => __( 'Add Form', 'give' ),
57
-		'add_new_item'       => __( 'Add New Donation Form', 'give' ),
58
-		'edit_item'          => __( 'Edit Donation Form', 'give' ),
59
-		'new_item'           => __( 'New Form', 'give' ),
60
-		'all_items'          => __( 'All Forms', 'give' ),
61
-		'view_item'          => __( 'View Form', 'give' ),
62
-		'search_items'       => __( 'Search Forms', 'give' ),
63
-		'not_found'          => __( 'No forms found.', 'give' ),
64
-		'not_found_in_trash' => __( 'No forms found in Trash.', 'give' ),
53
+	$give_forms_labels = apply_filters('give_forms_labels', array(
54
+		'name'               => __('Donation Forms', 'give'),
55
+		'singular_name'      => __('Form', 'give'),
56
+		'add_new'            => __('Add Form', 'give'),
57
+		'add_new_item'       => __('Add New Donation Form', 'give'),
58
+		'edit_item'          => __('Edit Donation Form', 'give'),
59
+		'new_item'           => __('New Form', 'give'),
60
+		'all_items'          => __('All Forms', 'give'),
61
+		'view_item'          => __('View Form', 'give'),
62
+		'search_items'       => __('Search Forms', 'give'),
63
+		'not_found'          => __('No forms found.', 'give'),
64
+		'not_found_in_trash' => __('No forms found in Trash.', 'give'),
65 65
 		'parent_item_colon'  => '',
66
-		'menu_name'          => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ),
67
-		'name_admin_bar'     => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ),
68
-	) );
66
+		'menu_name'          => apply_filters('give_menu_name', __('Donations', 'give')),
67
+		'name_admin_bar'     => apply_filters('give_name_admin_bar_name', __('Donation Form', 'give')),
68
+	));
69 69
 
70 70
 	// Default give_forms supports.
71 71
 	$give_form_supports = array(
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 	);
78 78
 
79 79
 	// Has the user disabled the excerpt?
80
-	if ( ! give_is_setting_enabled( give_get_option( 'forms_excerpt' ) ) ) {
81
-		unset( $give_form_supports[2] );
80
+	if ( ! give_is_setting_enabled(give_get_option('forms_excerpt'))) {
81
+		unset($give_form_supports[2]);
82 82
 	}
83 83
 
84 84
 	// Has user disabled the featured image?
85
-	if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
86
-		unset( $give_form_supports[1] );
87
-		remove_action( 'give_before_single_form_summary', 'give_show_form_images' );
85
+	if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) {
86
+		unset($give_form_supports[1]);
87
+		remove_action('give_before_single_form_summary', 'give_show_form_images');
88 88
 	}
89 89
 
90 90
 	$give_forms_args = array(
@@ -99,42 +99,42 @@  discard block
 block discarded – undo
99 99
 		'has_archive'        => $give_forms_archives,
100 100
 		'menu_icon'          => 'dashicons-give',
101 101
 		'hierarchical'       => false,
102
-		'supports'           => apply_filters( 'give_forms_supports', $give_form_supports ),
102
+		'supports'           => apply_filters('give_forms_supports', $give_form_supports),
103 103
 	);
104
-	register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) );
104
+	register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args));
105 105
 
106 106
 	/** Donation Post Type */
107 107
 	$payment_labels = array(
108
-		'name'               => _x( 'Donations', 'post type general name', 'give' ),
109
-		'singular_name'      => _x( 'Donation', 'post type singular name', 'give' ),
110
-		'add_new'            => __( 'Add New', 'give' ),
111
-		'add_new_item'       => __( 'Add New Donation', 'give' ),
112
-		'edit_item'          => __( 'Edit Donation', 'give' ),
113
-		'new_item'           => __( 'New Donation', 'give' ),
114
-		'all_items'          => __( 'All Donations', 'give' ),
115
-		'view_item'          => __( 'View Donation', 'give' ),
116
-		'search_items'       => __( 'Search Donations', 'give' ),
117
-		'not_found'          => __( 'No donations found.', 'give' ),
118
-		'not_found_in_trash' => __( 'No donations found in Trash.', 'give' ),
108
+		'name'               => _x('Donations', 'post type general name', 'give'),
109
+		'singular_name'      => _x('Donation', 'post type singular name', 'give'),
110
+		'add_new'            => __('Add New', 'give'),
111
+		'add_new_item'       => __('Add New Donation', 'give'),
112
+		'edit_item'          => __('Edit Donation', 'give'),
113
+		'new_item'           => __('New Donation', 'give'),
114
+		'all_items'          => __('All Donations', 'give'),
115
+		'view_item'          => __('View Donation', 'give'),
116
+		'search_items'       => __('Search Donations', 'give'),
117
+		'not_found'          => __('No donations found.', 'give'),
118
+		'not_found_in_trash' => __('No donations found in Trash.', 'give'),
119 119
 		'parent_item_colon'  => '',
120
-		'menu_name'          => __( 'Donations', 'give' ),
120
+		'menu_name'          => __('Donations', 'give'),
121 121
 	);
122 122
 
123 123
 	$payment_args = array(
124
-		'labels'          => apply_filters( 'give_payment_labels', $payment_labels ),
124
+		'labels'          => apply_filters('give_payment_labels', $payment_labels),
125 125
 		'public'          => false,
126 126
 		'query_var'       => false,
127 127
 		'rewrite'         => false,
128 128
 		'map_meta_cap'    => true,
129 129
 		'capability_type' => 'give_payment',
130
-		'supports'        => array( 'title' ),
130
+		'supports'        => array('title'),
131 131
 		'can_export'      => true,
132 132
 	);
133
-	register_post_type( 'give_payment', $payment_args );
133
+	register_post_type('give_payment', $payment_args);
134 134
 
135 135
 }
136 136
 
137
-add_action( 'init', 'give_setup_post_types', 1 );
137
+add_action('init', 'give_setup_post_types', 1);
138 138
 
139 139
 
140 140
 /**
@@ -147,30 +147,30 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function give_setup_taxonomies() {
149 149
 
150
-	$slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations';
150
+	$slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations';
151 151
 
152 152
 	/** Categories */
153 153
 	$category_labels = array(
154
-		'name'              => _x( 'Form Categories', 'taxonomy general name', 'give' ),
155
-		'singular_name'     => _x( 'Category', 'taxonomy singular name', 'give' ),
156
-		'search_items'      => __( 'Search Categories', 'give' ),
157
-		'all_items'         => __( 'All Categories', 'give' ),
158
-		'parent_item'       => __( 'Parent Category', 'give' ),
159
-		'parent_item_colon' => __( 'Parent Category:', 'give' ),
160
-		'edit_item'         => __( 'Edit Category', 'give' ),
161
-		'update_item'       => __( 'Update Category', 'give' ),
162
-		'add_new_item'      => __( 'Add New Category', 'give' ),
163
-		'new_item_name'     => __( 'New Category Name', 'give' ),
164
-		'menu_name'         => __( 'Categories', 'give' ),
154
+		'name'              => _x('Form Categories', 'taxonomy general name', 'give'),
155
+		'singular_name'     => _x('Category', 'taxonomy singular name', 'give'),
156
+		'search_items'      => __('Search Categories', 'give'),
157
+		'all_items'         => __('All Categories', 'give'),
158
+		'parent_item'       => __('Parent Category', 'give'),
159
+		'parent_item_colon' => __('Parent Category:', 'give'),
160
+		'edit_item'         => __('Edit Category', 'give'),
161
+		'update_item'       => __('Update Category', 'give'),
162
+		'add_new_item'      => __('Add New Category', 'give'),
163
+		'new_item_name'     => __('New Category Name', 'give'),
164
+		'menu_name'         => __('Categories', 'give'),
165 165
 	);
166 166
 
167
-	$category_args = apply_filters( 'give_forms_category_args', array(
167
+	$category_args = apply_filters('give_forms_category_args', array(
168 168
 			'hierarchical' => true,
169
-			'labels'       => apply_filters( 'give_forms_category_labels', $category_labels ),
169
+			'labels'       => apply_filters('give_forms_category_labels', $category_labels),
170 170
 			'show_ui'      => true,
171 171
 			'query_var'    => 'give_forms_category',
172 172
 			'rewrite'      => array(
173
-				'slug'         => $slug . '/category',
173
+				'slug'         => $slug.'/category',
174 174
 				'with_front'   => false,
175 175
 				'hierarchical' => true,
176 176
 			),
@@ -185,26 +185,26 @@  discard block
 block discarded – undo
185 185
 
186 186
 	/** Tags */
187 187
 	$tag_labels = array(
188
-		'name'                  => _x( 'Form Tags', 'taxonomy general name', 'give' ),
189
-		'singular_name'         => _x( 'Tag', 'taxonomy singular name', 'give' ),
190
-		'search_items'          => __( 'Search Tags', 'give' ),
191
-		'all_items'             => __( 'All Tags', 'give' ),
192
-		'parent_item'           => __( 'Parent Tag', 'give' ),
193
-		'parent_item_colon'     => __( 'Parent Tag:', 'give' ),
194
-		'edit_item'             => __( 'Edit Tag', 'give' ),
195
-		'update_item'           => __( 'Update Tag', 'give' ),
196
-		'add_new_item'          => __( 'Add New Tag', 'give' ),
197
-		'new_item_name'         => __( 'New Tag Name', 'give' ),
198
-		'menu_name'             => __( 'Tags', 'give' ),
199
-		'choose_from_most_used' => __( 'Choose from most used tags.', 'give' ),
188
+		'name'                  => _x('Form Tags', 'taxonomy general name', 'give'),
189
+		'singular_name'         => _x('Tag', 'taxonomy singular name', 'give'),
190
+		'search_items'          => __('Search Tags', 'give'),
191
+		'all_items'             => __('All Tags', 'give'),
192
+		'parent_item'           => __('Parent Tag', 'give'),
193
+		'parent_item_colon'     => __('Parent Tag:', 'give'),
194
+		'edit_item'             => __('Edit Tag', 'give'),
195
+		'update_item'           => __('Update Tag', 'give'),
196
+		'add_new_item'          => __('Add New Tag', 'give'),
197
+		'new_item_name'         => __('New Tag Name', 'give'),
198
+		'menu_name'             => __('Tags', 'give'),
199
+		'choose_from_most_used' => __('Choose from most used tags.', 'give'),
200 200
 	);
201 201
 
202
-	$tag_args = apply_filters( 'give_forms_tag_args', array(
202
+	$tag_args = apply_filters('give_forms_tag_args', array(
203 203
 			'hierarchical' => false,
204
-			'labels'       => apply_filters( 'give_forms_tag_labels', $tag_labels ),
204
+			'labels'       => apply_filters('give_forms_tag_labels', $tag_labels),
205 205
 			'show_ui'      => true,
206 206
 			'query_var'    => 'give_forms_tag',
207
-			'rewrite'      => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ),
207
+			'rewrite'      => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true),
208 208
 			'capabilities' => array(
209 209
 				'manage_terms' => 'manage_give_form_terms',
210 210
 				'edit_terms'   => 'edit_give_form_terms',
@@ -215,36 +215,36 @@  discard block
 block discarded – undo
215 215
 	);
216 216
 
217 217
 	// Does the user want category?
218
-	$enable_category = give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) );
218
+	$enable_category = give_is_setting_enabled(give_get_option('categories', 'disabled'));
219 219
 
220 220
 	// Does the user want tag?
221
-	$enable_tag = give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) );
221
+	$enable_tag = give_is_setting_enabled(give_get_option('tags', 'disabled'));
222 222
 
223 223
 	// Enable/Disable category and tag if form is saving.
224
-	if ( Give_Admin_Settings::is_saving_settings() ) {
225
-		if ( isset( $_POST['categories'] ) ) {
226
-			$enable_category = give_is_setting_enabled( give_clean( $_POST['categories'] ) );
224
+	if (Give_Admin_Settings::is_saving_settings()) {
225
+		if (isset($_POST['categories'])) {
226
+			$enable_category = give_is_setting_enabled(give_clean($_POST['categories']));
227 227
 			flush_rewrite_rules();
228 228
 		}
229 229
 
230
-		if ( isset( $_POST['tags'] ) ) {
231
-			$enable_tag = give_is_setting_enabled( give_clean( $_POST['tags'] ) );
230
+		if (isset($_POST['tags'])) {
231
+			$enable_tag = give_is_setting_enabled(give_clean($_POST['tags']));
232 232
 			flush_rewrite_rules();
233 233
 		}
234 234
 	}
235 235
 
236
-	if ( $enable_category ) {
237
-		register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args );
238
-		register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' );
236
+	if ($enable_category) {
237
+		register_taxonomy('give_forms_category', array('give_forms'), $category_args);
238
+		register_taxonomy_for_object_type('give_forms_category', 'give_forms');
239 239
 	}
240 240
 
241
-	if ( $enable_tag ) {
242
-		register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args );
243
-		register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' );
241
+	if ($enable_tag) {
242
+		register_taxonomy('give_forms_tag', array('give_forms'), $tag_args);
243
+		register_taxonomy_for_object_type('give_forms_tag', 'give_forms');
244 244
 	}
245 245
 }
246 246
 
247
-add_action( 'init', 'give_setup_taxonomies', 0 );
247
+add_action('init', 'give_setup_taxonomies', 0);
248 248
 
249 249
 
250 250
 /**
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
  */
256 256
 function give_get_default_form_labels() {
257 257
 	$defaults = array(
258
-		'singular' => __( 'Form', 'give' ),
259
-		'plural'   => __( 'Forms', 'give' ),
258
+		'singular' => __('Form', 'give'),
259
+		'plural'   => __('Forms', 'give'),
260 260
 	);
261 261
 
262
-	return apply_filters( 'give_default_form_name', $defaults );
262
+	return apply_filters('give_default_form_name', $defaults);
263 263
 }
264 264
 
265 265
 /**
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
  *
272 272
  * @return string $defaults['singular'] Singular label
273 273
  */
274
-function give_get_forms_label_singular( $lowercase = false ) {
274
+function give_get_forms_label_singular($lowercase = false) {
275 275
 	$defaults = give_get_default_form_labels();
276 276
 
277
-	return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular'];
277
+	return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular'];
278 278
 }
279 279
 
280 280
 /**
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
  * @since 1.0
284 284
  * @return string $defaults['plural'] Plural label
285 285
  */
286
-function give_get_forms_label_plural( $lowercase = false ) {
286
+function give_get_forms_label_plural($lowercase = false) {
287 287
 	$defaults = give_get_default_form_labels();
288 288
 
289
-	return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural'];
289
+	return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural'];
290 290
 }
291 291
 
292 292
 /**
@@ -298,24 +298,24 @@  discard block
 block discarded – undo
298 298
  *
299 299
  * @return string $title New placeholder text
300 300
  */
301
-function give_change_default_title( $title ) {
301
+function give_change_default_title($title) {
302 302
 	// If a frontend plugin uses this filter (check extensions before changing this function)
303
-	if ( ! is_admin() ) {
304
-		$title = __( 'Enter form title here', 'give' );
303
+	if ( ! is_admin()) {
304
+		$title = __('Enter form title here', 'give');
305 305
 
306 306
 		return $title;
307 307
 	}
308 308
 
309 309
 	$screen = get_current_screen();
310 310
 
311
-	if ( 'give_forms' == $screen->post_type ) {
312
-		$title = __( 'Enter form title here', 'give' );
311
+	if ('give_forms' == $screen->post_type) {
312
+		$title = __('Enter form title here', 'give');
313 313
 	}
314 314
 
315 315
 	return $title;
316 316
 }
317 317
 
318
-add_filter( 'enter_title_here', 'give_change_default_title' );
318
+add_filter('enter_title_here', 'give_change_default_title');
319 319
 
320 320
 /**
321 321
  * Registers Custom Post Statuses which are used by the Payments
@@ -325,67 +325,67 @@  discard block
 block discarded – undo
325 325
  */
326 326
 function give_register_post_type_statuses() {
327 327
 	// Payment Statuses
328
-	register_post_status( 'refunded', array(
329
-		'label'                     => __( 'Refunded', 'give' ),
328
+	register_post_status('refunded', array(
329
+		'label'                     => __('Refunded', 'give'),
330 330
 		'public'                    => true,
331 331
 		'exclude_from_search'       => false,
332 332
 		'show_in_admin_all_list'    => true,
333 333
 		'show_in_admin_status_list' => true,
334
-		'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ),
335
-	) );
336
-	register_post_status( 'failed', array(
337
-		'label'                     => __( 'Failed', 'give' ),
334
+		'label_count'               => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give'),
335
+	));
336
+	register_post_status('failed', array(
337
+		'label'                     => __('Failed', 'give'),
338 338
 		'public'                    => true,
339 339
 		'exclude_from_search'       => false,
340 340
 		'show_in_admin_all_list'    => true,
341 341
 		'show_in_admin_status_list' => true,
342
-		'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ),
343
-	) );
344
-	register_post_status( 'revoked', array(
345
-		'label'                     => __( 'Revoked', 'give' ),
342
+		'label_count'               => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give'),
343
+	));
344
+	register_post_status('revoked', array(
345
+		'label'                     => __('Revoked', 'give'),
346 346
 		'public'                    => true,
347 347
 		'exclude_from_search'       => false,
348 348
 		'show_in_admin_all_list'    => true,
349 349
 		'show_in_admin_status_list' => true,
350
-		'label_count'               => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ),
351
-	) );
352
-	register_post_status( 'cancelled', array(
353
-		'label'                     => __( 'Cancelled', 'give' ),
350
+		'label_count'               => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give'),
351
+	));
352
+	register_post_status('cancelled', array(
353
+		'label'                     => __('Cancelled', 'give'),
354 354
 		'public'                    => true,
355 355
 		'exclude_from_search'       => false,
356 356
 		'show_in_admin_all_list'    => true,
357 357
 		'show_in_admin_status_list' => true,
358
-		'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ),
359
-	) );
360
-	register_post_status( 'abandoned', array(
361
-		'label'                     => __( 'Abandoned', 'give' ),
358
+		'label_count'               => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give'),
359
+	));
360
+	register_post_status('abandoned', array(
361
+		'label'                     => __('Abandoned', 'give'),
362 362
 		'public'                    => true,
363 363
 		'exclude_from_search'       => false,
364 364
 		'show_in_admin_all_list'    => true,
365 365
 		'show_in_admin_status_list' => true,
366
-		'label_count'               => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ),
367
-	) );
368
-	register_post_status( 'processing', array(
369
-		'label'                     => _x( 'Processing', 'Processing payment status', 'give' ),
366
+		'label_count'               => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give'),
367
+	));
368
+	register_post_status('processing', array(
369
+		'label'                     => _x('Processing', 'Processing payment status', 'give'),
370 370
 		'public'                    => true,
371 371
 		'exclude_from_search'       => false,
372 372
 		'show_in_admin_all_list'    => true,
373 373
 		'show_in_admin_status_list' => true,
374
-		'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give' )
375
-	)  );
374
+		'label_count'               => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give')
375
+	));
376 376
 
377
-	register_post_status( 'preapproval', array(
378
-		'label'                     => _x( 'Preapproval', 'Preapproval payment status', 'give' ),
377
+	register_post_status('preapproval', array(
378
+		'label'                     => _x('Preapproval', 'Preapproval payment status', 'give'),
379 379
 		'public'                    => true,
380 380
 		'exclude_from_search'       => false,
381 381
 		'show_in_admin_all_list'    => true,
382 382
 		'show_in_admin_status_list' => true,
383
-		'label_count'               => _n_noop( 'Preapproval <span class="count">(%s)</span>', 'Preapproval <span class="count">(%s)</span>', 'give' ),
384
-	) );
383
+		'label_count'               => _n_noop('Preapproval <span class="count">(%s)</span>', 'Preapproval <span class="count">(%s)</span>', 'give'),
384
+	));
385 385
 
386 386
 }
387 387
 
388
-add_action( 'init', 'give_register_post_type_statuses' );
388
+add_action('init', 'give_register_post_type_statuses');
389 389
 
390 390
 /**
391 391
  * Updated Messages
@@ -398,27 +398,27 @@  discard block
 block discarded – undo
398 398
  *
399 399
  * @return array $messages New post updated messages
400 400
  */
401
-function give_updated_messages( $messages ) {
401
+function give_updated_messages($messages) {
402 402
 	global $post, $post_ID;
403 403
 
404
-	if ( ! give_is_setting_enabled( give_get_option( 'forms_singular' ) ) ) {
404
+	if ( ! give_is_setting_enabled(give_get_option('forms_singular'))) {
405 405
 
406 406
 		$messages['give_forms'] = array(
407
-			1 => __( 'Form updated.', 'give' ),
408
-			4 => __( 'Form updated.', 'give' ),
409
-			6 => __( 'Form published.', 'give' ),
410
-			7 => __( 'Form saved.', 'give' ),
411
-			8 => __( 'Form submitted.', 'give' ),
407
+			1 => __('Form updated.', 'give'),
408
+			4 => __('Form updated.', 'give'),
409
+			6 => __('Form published.', 'give'),
410
+			7 => __('Form saved.', 'give'),
411
+			8 => __('Form submitted.', 'give'),
412 412
 		);
413 413
 
414 414
 	} else {
415 415
 
416 416
 		$messages['give_forms'] = array(
417
-			1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
418
-			4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
419
-			6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form published.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
420
-			7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form saved.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
421
-			8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form submitted.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
417
+			1 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
418
+			4 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
419
+			6 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form published.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
420
+			7 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form saved.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
421
+			8 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form submitted.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
422 422
 		);
423 423
 
424 424
 	}
@@ -426,24 +426,24 @@  discard block
 block discarded – undo
426 426
 	return $messages;
427 427
 }
428 428
 
429
-add_filter( 'post_updated_messages', 'give_updated_messages' );
429
+add_filter('post_updated_messages', 'give_updated_messages');
430 430
 
431 431
 /**
432 432
  * Ensure post thumbnail support is turned on
433 433
  */
434 434
 function give_add_thumbnail_support() {
435
-	if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
435
+	if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) {
436 436
 		return;
437 437
 	}
438 438
 
439
-	if ( ! current_theme_supports( 'post-thumbnails' ) ) {
440
-		add_theme_support( 'post-thumbnails' );
439
+	if ( ! current_theme_supports('post-thumbnails')) {
440
+		add_theme_support('post-thumbnails');
441 441
 	}
442 442
 
443
-	add_post_type_support( 'give_forms', 'thumbnail' );
443
+	add_post_type_support('give_forms', 'thumbnail');
444 444
 }
445 445
 
446
-add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 );
446
+add_action('after_setup_theme', 'give_add_thumbnail_support', 10);
447 447
 
448 448
 /**
449 449
  * Give Sidebars
@@ -454,21 +454,21 @@  discard block
 block discarded – undo
454 454
 
455 455
 	// Single Give Forms (disabled if single turned off in settings)
456 456
 	if (
457
-		give_is_setting_enabled( give_get_option( 'forms_singular' ) )
458
-		&& give_is_setting_enabled( give_get_option( 'form_sidebar' ) )
457
+		give_is_setting_enabled(give_get_option('forms_singular'))
458
+		&& give_is_setting_enabled(give_get_option('form_sidebar'))
459 459
 	) {
460 460
 
461
-		register_sidebar( apply_filters( 'give_forms_single_sidebar', array(
462
-			'name'          => __( 'Give Single Form Sidebar', 'give' ),
461
+		register_sidebar(apply_filters('give_forms_single_sidebar', array(
462
+			'name'          => __('Give Single Form Sidebar', 'give'),
463 463
 			'id'            => 'give-forms-sidebar',
464
-			'description'   => __( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ),
464
+			'description'   => __('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'),
465 465
 			'before_widget' => '<div id="%1$s" class="widget %2$s">',
466 466
 			'after_widget'  => '</div>',
467 467
 			'before_title'  => '<h3 class="widgettitle widget-title">',
468 468
 			'after_title'   => '</h3>',
469
-		) ) );
469
+		)));
470 470
 
471 471
 	}
472 472
 }
473 473
 
474
-add_action( 'widgets_init', 'give_widgets_init', 999 );
474
+add_action('widgets_init', 'give_widgets_init', 999);
Please login to merge, or discard this patch.