Completed
Pull Request — master (#1637)
by Ravinder
16:50
created
includes/country-functions.php 1 patch
Spacing   +333 added lines, -333 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,9 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function give_get_country() {
25 25
 	$give_options = give_get_settings();
26
-	$country = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US';
26
+	$country = isset($give_options['base_country']) ? $give_options['base_country'] : 'US';
27 27
 
28
-	return apply_filters( 'give_give_country', $country );
28
+	return apply_filters('give_give_country', $country);
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function give_get_state() {
38 38
 	$give_options = give_get_settings();
39
-	$state = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false;
39
+	$state = isset($give_options['base_state']) ? $give_options['base_state'] : false;
40 40
 
41
-	return apply_filters( 'give_give_state', $state );
41
+	return apply_filters('give_give_state', $state);
42 42
 }
43 43
 
44 44
 /**
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
  *
51 51
  * @return mixed|void  A list of states for the shop's base country
52 52
  */
53
-function give_get_states( $country = null ) {
53
+function give_get_states($country = null) {
54 54
 
55
-	if ( empty( $country ) ) {
55
+	if (empty($country)) {
56 56
 		$country = give_get_country();
57 57
 	}
58 58
 
59
-	switch ( $country ) :
59
+	switch ($country) :
60 60
 
61 61
 		case 'US' :
62 62
 			$states = give_get_states_list();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
 	endswitch;
108 108
 
109
-	return apply_filters( 'give_give_states', $states );
109
+	return apply_filters('give_give_states', $states);
110 110
 }
111 111
 
112 112
 
@@ -119,253 +119,253 @@  discard block
 block discarded – undo
119 119
 function give_get_country_list() {
120 120
 	$countries = array(
121 121
 		''   => '',
122
-		'US' => esc_html__( 'United States', 'give' ),
123
-		'CA' => esc_html__( 'Canada', 'give' ),
124
-		'GB' => esc_html__( 'United Kingdom', 'give' ),
125
-		'AF' => esc_html__( 'Afghanistan', 'give' ),
126
-		'AL' => esc_html__( 'Albania', 'give' ),
127
-		'DZ' => esc_html__( 'Algeria', 'give' ),
128
-		'AS' => esc_html__( 'American Samoa', 'give' ),
129
-		'AD' => esc_html__( 'Andorra', 'give' ),
130
-		'AO' => esc_html__( 'Angola', 'give' ),
131
-		'AI' => esc_html__( 'Anguilla', 'give' ),
132
-		'AQ' => esc_html__( 'Antarctica', 'give' ),
133
-		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
134
-		'AR' => esc_html__( 'Argentina', 'give' ),
135
-		'AM' => esc_html__( 'Armenia', 'give' ),
136
-		'AW' => esc_html__( 'Aruba', 'give' ),
137
-		'AU' => esc_html__( 'Australia', 'give' ),
138
-		'AT' => esc_html__( 'Austria', 'give' ),
139
-		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
140
-		'BS' => esc_html__( 'Bahamas', 'give'),
141
-		'BH' => esc_html__( 'Bahrain', 'give' ),
142
-		'BD' => esc_html__( 'Bangladesh', 'give' ),
143
-		'BB' => esc_html__( 'Barbados', 'give' ),
144
-		'BY' => esc_html__( 'Belarus', 'give' ),
145
-		'BE' => esc_html__( 'Belgium', 'give' ),
146
-		'BZ' => esc_html__( 'Belize', 'give' ),
147
-		'BJ' => esc_html__( 'Benin', 'give' ),
148
-		'BM' => esc_html__( 'Bermuda', 'give' ),
149
-		'BT' => esc_html__( 'Bhutan', 'give' ),
150
-		'BO' => esc_html__( 'Bolivia', 'give' ),
151
-		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
152
-		'BW' => esc_html__( 'Botswana', 'give' ),
153
-		'BV' => esc_html__( 'Bouvet Island', 'give' ),
154
-		'BR' => esc_html__( 'Brazil', 'give' ),
155
-		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
156
-		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
157
-		'BG' => esc_html__( 'Bulgaria', 'give' ),
158
-		'BF' => esc_html__( 'Burkina Faso', 'give' ),
159
-		'BI' => esc_html__( 'Burundi', 'give' ),
160
-		'KH' => esc_html__( 'Cambodia', 'give' ),
161
-		'CM' => esc_html__( 'Cameroon', 'give' ),
162
-		'CV' => esc_html__( 'Cape Verde', 'give' ),
163
-		'KY' => esc_html__( 'Cayman Islands', 'give' ),
164
-		'CF' => esc_html__( 'Central African Republic', 'give' ),
165
-		'TD' => esc_html__( 'Chad', 'give' ),
166
-		'CL' => esc_html__( 'Chile', 'give' ),
167
-		'CN' => esc_html__( 'China', 'give' ),
168
-		'CX' => esc_html__( 'Christmas Island', 'give' ),
169
-		'CC' => esc_html__( 'Cocos Islands', 'give' ),
170
-		'CO' => esc_html__( 'Colombia', 'give' ),
171
-		'KM' => esc_html__( 'Comoros', 'give' ),
172
-		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
173
-		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
174
-		'CK' => esc_html__( 'Cook Islands', 'give' ),
175
-		'CR' => esc_html__( 'Costa Rica', 'give' ),
176
-		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
177
-		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
178
-		'CU' => esc_html__( 'Cuba', 'give' ),
179
-		'CY' => esc_html__( 'Cyprus Island', 'give' ),
180
-		'CZ' => esc_html__( 'Czech Republic', 'give' ),
181
-		'DK' => esc_html__( 'Denmark', 'give' ),
182
-		'DJ' => esc_html__( 'Djibouti', 'give' ),
183
-		'DM' => esc_html__( 'Dominica', 'give' ),
184
-		'DO' => esc_html__( 'Dominican Republic', 'give' ),
185
-		'TP' => esc_html__( 'East Timor', 'give' ),
186
-		'EC' => esc_html__( 'Ecuador', 'give' ),
187
-		'EG' => esc_html__( 'Egypt', 'give' ),
188
-		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
189
-		'SV' => esc_html__( 'El Salvador', 'give' ),
190
-		'ER' => esc_html__( 'Eritrea', 'give' ),
191
-		'EE' => esc_html__( 'Estonia', 'give' ),
192
-		'ET' => esc_html__( 'Ethiopia', 'give' ),
193
-		'FK' => esc_html__( 'Falkland Islands', 'give' ),
194
-		'FO' => esc_html__( 'Faroe Islands', 'give' ),
195
-		'FJ' => esc_html__( 'Fiji', 'give' ),
196
-		'FI' => esc_html__( 'Finland', 'give' ),
197
-		'FR' => esc_html__( 'France', 'give' ),
198
-		'GF' => esc_html__( 'French Guiana', 'give' ),
199
-		'PF' => esc_html__( 'French Polynesia', 'give' ),
200
-		'TF' => esc_html__( 'French Southern Territories', 'give' ),
201
-		'GA' => esc_html__( 'Gabon', 'give' ),
202
-		'GM' => esc_html__( 'Gambia', 'give' ),
203
-		'GE' => esc_html__( 'Georgia', 'give' ),
204
-		'DE' => esc_html__( 'Germany', 'give' ),
205
-		'GR' => esc_html__( 'Greece', 'give' ),
206
-		'GH' => esc_html__( 'Ghana', 'give' ),
207
-		'GI' => esc_html__( 'Gibraltar', 'give' ),
208
-		'GL' => esc_html__( 'Greenland', 'give' ),
209
-		'GD' => esc_html__( 'Grenada', 'give' ),
210
-		'GP' => esc_html__( 'Guadeloupe', 'give' ),
211
-		'GU' => esc_html__( 'Guam', 'give' ),
212
-		'GT' => esc_html__( 'Guatemala', 'give' ),
213
-		'GG' => esc_html__( 'Guernsey', 'give' ),
214
-		'GN' => esc_html__( 'Guinea', 'give' ),
215
-		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
216
-		'GY' => esc_html__( 'Guyana', 'give' ),
217
-		'HT' => esc_html__( 'Haiti', 'give' ),
218
-		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
219
-		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
220
-		'HN' => esc_html__( 'Honduras', 'give' ),
221
-		'HK' => esc_html__( 'Hong Kong', 'give' ),
222
-		'HU' => esc_html__( 'Hungary', 'give' ),
223
-		'IS' => esc_html__( 'Iceland', 'give' ),
224
-		'IN' => esc_html__( 'India', 'give' ),
225
-		'ID' => esc_html__( 'Indonesia', 'give' ),
226
-		'IR' => esc_html__( 'Iran', 'give' ),
227
-		'IQ' => esc_html__( 'Iraq', 'give' ),
228
-		'IE' => esc_html__( 'Ireland', 'give' ),
229
-		'IM' => esc_html__( 'Isle of Man', 'give' ),
230
-		'IL' => esc_html__( 'Israel', 'give' ),
231
-		'IT' => esc_html__( 'Italy', 'give' ),
232
-		'JM' => esc_html__( 'Jamaica', 'give' ),
233
-		'JP' => esc_html__( 'Japan', 'give' ),
234
-		'JE' => esc_html__( 'Jersey', 'give' ),
235
-		'JO' => esc_html__( 'Jordan', 'give' ),
236
-		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
237
-		'KE' => esc_html__( 'Kenya', 'give' ),
238
-		'KI' => esc_html__( 'Kiribati', 'give' ),
239
-		'KW' => esc_html__( 'Kuwait', 'give' ),
240
-		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
241
-		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
242
-		'LV' => esc_html__( 'Latvia', 'give' ),
243
-		'LB' => esc_html__( 'Lebanon', 'give' ),
244
-		'LS' => esc_html__( 'Lesotho', 'give' ),
245
-		'LR' => esc_html__( 'Liberia', 'give' ),
246
-		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
247
-		'LI' => esc_html__( 'Liechtenstein', 'give' ),
248
-		'LT' => esc_html__( 'Lithuania', 'give' ),
249
-		'LU' => esc_html__( 'Luxembourg', 'give' ),
250
-		'MO' => esc_html__( 'Macau', 'give' ),
251
-		'MK' => esc_html__( 'Macedonia', 'give' ),
252
-		'MG' => esc_html__( 'Madagascar', 'give' ),
253
-		'MW' => esc_html__( 'Malawi', 'give' ),
254
-		'MY' => esc_html__( 'Malaysia', 'give' ),
255
-		'MV' => esc_html__( 'Maldives', 'give' ),
256
-		'ML' => esc_html__( 'Mali', 'give' ),
257
-		'MT' => esc_html__( 'Malta', 'give' ),
258
-		'MH' => esc_html__( 'Marshall Islands', 'give' ),
259
-		'MQ' => esc_html__( 'Martinique', 'give' ),
260
-		'MR' => esc_html__( 'Mauritania', 'give' ),
261
-		'MU' => esc_html__( 'Mauritius', 'give' ),
262
-		'YT' => esc_html__( 'Mayotte', 'give' ),
263
-		'MX' => esc_html__( 'Mexico', 'give' ),
264
-		'FM' => esc_html__( 'Micronesia', 'give' ),
265
-		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
266
-		'MC' => esc_html__( 'Monaco', 'give' ),
267
-		'MN' => esc_html__( 'Mongolia', 'give' ),
268
-		'ME' => esc_html__( 'Montenegro', 'give' ),
269
-		'MS' => esc_html__( 'Montserrat', 'give' ),
270
-		'MA' => esc_html__( 'Morocco', 'give' ),
271
-		'MZ' => esc_html__( 'Mozambique', 'give' ),
272
-		'MM' => esc_html__( 'Myanmar', 'give' ),
273
-		'NA' => esc_html__( 'Namibia', 'give' ),
274
-		'NR' => esc_html__( 'Nauru', 'give' ),
275
-		'NP' => esc_html__( 'Nepal', 'give' ),
276
-		'NL' => esc_html__( 'Netherlands', 'give' ),
277
-		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
278
-		'NC' => esc_html__( 'New Caledonia', 'give' ),
279
-		'NZ' => esc_html__( 'New Zealand', 'give' ),
280
-		'NI' => esc_html__( 'Nicaragua', 'give' ),
281
-		'NE' => esc_html__( 'Niger', 'give' ),
282
-		'NG' => esc_html__( 'Nigeria', 'give' ),
283
-		'NU' => esc_html__( 'Niue', 'give' ),
284
-		'NF' => esc_html__( 'Norfolk Island', 'give' ),
285
-		'KP' => esc_html__( 'North Korea', 'give' ),
286
-		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
287
-		'NO' => esc_html__( 'Norway', 'give' ),
288
-		'OM' => esc_html__( 'Oman', 'give' ),
289
-		'PK' => esc_html__( 'Pakistan', 'give' ),
290
-		'PW' => esc_html__( 'Palau', 'give' ),
291
-		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
292
-		'PA' => esc_html__( 'Panama', 'give' ),
293
-		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
294
-		'PY' => esc_html__( 'Paraguay', 'give' ),
295
-		'PE' => esc_html__( 'Peru', 'give' ),
296
-		'PH' => esc_html__( 'Phillipines', 'give' ),
297
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
298
-		'PL' => esc_html__( 'Poland', 'give' ),
299
-		'PT' => esc_html__( 'Portugal', 'give' ),
300
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
301
-		'QA' => esc_html__( 'Qatar', 'give' ),
302
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
303
-		'RO' => esc_html__( 'Romania', 'give' ),
304
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
305
-		'RW' => esc_html__( 'Rwanda', 'give' ),
306
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
307
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
308
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
309
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
310
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
311
-		'SM' => esc_html__( 'San Marino', 'give' ),
312
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
313
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
314
-		'SN' => esc_html__( 'Senegal', 'give' ),
315
-		'RS' => esc_html__( 'Serbia', 'give' ),
316
-		'SC' => esc_html__( 'Seychelles', 'give' ),
317
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
318
-		'SG' => esc_html__( 'Singapore', 'give' ),
319
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
320
-		'SI' => esc_html__( 'Slovenia', 'give' ),
321
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
322
-		'SO' => esc_html__( 'Somalia', 'give' ),
323
-		'ZA' => esc_html__( 'South Africa', 'give' ),
324
-		'GS' => esc_html__( 'South Georgia', 'give' ),
325
-		'KR' => esc_html__( 'South Korea', 'give' ),
326
-		'ES' => esc_html__( 'Spain', 'give' ),
327
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
328
-		'SD' => esc_html__( 'Sudan', 'give' ),
329
-		'SR' => esc_html__( 'Suriname', 'give' ),
330
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
331
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
332
-		'SE' => esc_html__( 'Sweden', 'give' ),
333
-		'CH' => esc_html__( 'Switzerland', 'give' ),
334
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
335
-		'TW' => esc_html__( 'Taiwan', 'give' ),
336
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
337
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
338
-		'TG' => esc_html__( 'Togo', 'give' ),
339
-		'TK' => esc_html__( 'Tokelau', 'give' ),
340
-		'TO' => esc_html__( 'Tonga', 'give' ),
341
-		'TH' => esc_html__( 'Thailand', 'give' ),
342
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
343
-		'TN' => esc_html__( 'Tunisia', 'give' ),
344
-		'TR' => esc_html__( 'Turkey', 'give' ),
345
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
346
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
347
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
348
-		'UG' => esc_html__( 'Uganda', 'give' ),
349
-		'UA' => esc_html__( 'Ukraine', 'give' ),
350
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
351
-		'UY' => esc_html__( 'Uruguay', 'give' ),
352
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
353
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
354
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
355
-		'VE' => esc_html__( 'Venezuela', 'give' ),
356
-		'VN' => esc_html__( 'Vietnam', 'give' ),
357
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
358
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
359
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
360
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
361
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
362
-		'YE' => esc_html__( 'Yemen', 'give' ),
363
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
364
-		'ZM' => esc_html__( 'Zambia', 'give' ),
365
-		'ZW' => esc_html__( 'Zimbabwe', 'give' )
122
+		'US' => esc_html__('United States', 'give'),
123
+		'CA' => esc_html__('Canada', 'give'),
124
+		'GB' => esc_html__('United Kingdom', 'give'),
125
+		'AF' => esc_html__('Afghanistan', 'give'),
126
+		'AL' => esc_html__('Albania', 'give'),
127
+		'DZ' => esc_html__('Algeria', 'give'),
128
+		'AS' => esc_html__('American Samoa', 'give'),
129
+		'AD' => esc_html__('Andorra', 'give'),
130
+		'AO' => esc_html__('Angola', 'give'),
131
+		'AI' => esc_html__('Anguilla', 'give'),
132
+		'AQ' => esc_html__('Antarctica', 'give'),
133
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
134
+		'AR' => esc_html__('Argentina', 'give'),
135
+		'AM' => esc_html__('Armenia', 'give'),
136
+		'AW' => esc_html__('Aruba', 'give'),
137
+		'AU' => esc_html__('Australia', 'give'),
138
+		'AT' => esc_html__('Austria', 'give'),
139
+		'AZ' => esc_html__('Azerbaijan', 'give'),
140
+		'BS' => esc_html__('Bahamas', 'give'),
141
+		'BH' => esc_html__('Bahrain', 'give'),
142
+		'BD' => esc_html__('Bangladesh', 'give'),
143
+		'BB' => esc_html__('Barbados', 'give'),
144
+		'BY' => esc_html__('Belarus', 'give'),
145
+		'BE' => esc_html__('Belgium', 'give'),
146
+		'BZ' => esc_html__('Belize', 'give'),
147
+		'BJ' => esc_html__('Benin', 'give'),
148
+		'BM' => esc_html__('Bermuda', 'give'),
149
+		'BT' => esc_html__('Bhutan', 'give'),
150
+		'BO' => esc_html__('Bolivia', 'give'),
151
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
152
+		'BW' => esc_html__('Botswana', 'give'),
153
+		'BV' => esc_html__('Bouvet Island', 'give'),
154
+		'BR' => esc_html__('Brazil', 'give'),
155
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
156
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
157
+		'BG' => esc_html__('Bulgaria', 'give'),
158
+		'BF' => esc_html__('Burkina Faso', 'give'),
159
+		'BI' => esc_html__('Burundi', 'give'),
160
+		'KH' => esc_html__('Cambodia', 'give'),
161
+		'CM' => esc_html__('Cameroon', 'give'),
162
+		'CV' => esc_html__('Cape Verde', 'give'),
163
+		'KY' => esc_html__('Cayman Islands', 'give'),
164
+		'CF' => esc_html__('Central African Republic', 'give'),
165
+		'TD' => esc_html__('Chad', 'give'),
166
+		'CL' => esc_html__('Chile', 'give'),
167
+		'CN' => esc_html__('China', 'give'),
168
+		'CX' => esc_html__('Christmas Island', 'give'),
169
+		'CC' => esc_html__('Cocos Islands', 'give'),
170
+		'CO' => esc_html__('Colombia', 'give'),
171
+		'KM' => esc_html__('Comoros', 'give'),
172
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
173
+		'CG' => esc_html__('Congo, Republic of', 'give'),
174
+		'CK' => esc_html__('Cook Islands', 'give'),
175
+		'CR' => esc_html__('Costa Rica', 'give'),
176
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
177
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
178
+		'CU' => esc_html__('Cuba', 'give'),
179
+		'CY' => esc_html__('Cyprus Island', 'give'),
180
+		'CZ' => esc_html__('Czech Republic', 'give'),
181
+		'DK' => esc_html__('Denmark', 'give'),
182
+		'DJ' => esc_html__('Djibouti', 'give'),
183
+		'DM' => esc_html__('Dominica', 'give'),
184
+		'DO' => esc_html__('Dominican Republic', 'give'),
185
+		'TP' => esc_html__('East Timor', 'give'),
186
+		'EC' => esc_html__('Ecuador', 'give'),
187
+		'EG' => esc_html__('Egypt', 'give'),
188
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
189
+		'SV' => esc_html__('El Salvador', 'give'),
190
+		'ER' => esc_html__('Eritrea', 'give'),
191
+		'EE' => esc_html__('Estonia', 'give'),
192
+		'ET' => esc_html__('Ethiopia', 'give'),
193
+		'FK' => esc_html__('Falkland Islands', 'give'),
194
+		'FO' => esc_html__('Faroe Islands', 'give'),
195
+		'FJ' => esc_html__('Fiji', 'give'),
196
+		'FI' => esc_html__('Finland', 'give'),
197
+		'FR' => esc_html__('France', 'give'),
198
+		'GF' => esc_html__('French Guiana', 'give'),
199
+		'PF' => esc_html__('French Polynesia', 'give'),
200
+		'TF' => esc_html__('French Southern Territories', 'give'),
201
+		'GA' => esc_html__('Gabon', 'give'),
202
+		'GM' => esc_html__('Gambia', 'give'),
203
+		'GE' => esc_html__('Georgia', 'give'),
204
+		'DE' => esc_html__('Germany', 'give'),
205
+		'GR' => esc_html__('Greece', 'give'),
206
+		'GH' => esc_html__('Ghana', 'give'),
207
+		'GI' => esc_html__('Gibraltar', 'give'),
208
+		'GL' => esc_html__('Greenland', 'give'),
209
+		'GD' => esc_html__('Grenada', 'give'),
210
+		'GP' => esc_html__('Guadeloupe', 'give'),
211
+		'GU' => esc_html__('Guam', 'give'),
212
+		'GT' => esc_html__('Guatemala', 'give'),
213
+		'GG' => esc_html__('Guernsey', 'give'),
214
+		'GN' => esc_html__('Guinea', 'give'),
215
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
216
+		'GY' => esc_html__('Guyana', 'give'),
217
+		'HT' => esc_html__('Haiti', 'give'),
218
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
219
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
220
+		'HN' => esc_html__('Honduras', 'give'),
221
+		'HK' => esc_html__('Hong Kong', 'give'),
222
+		'HU' => esc_html__('Hungary', 'give'),
223
+		'IS' => esc_html__('Iceland', 'give'),
224
+		'IN' => esc_html__('India', 'give'),
225
+		'ID' => esc_html__('Indonesia', 'give'),
226
+		'IR' => esc_html__('Iran', 'give'),
227
+		'IQ' => esc_html__('Iraq', 'give'),
228
+		'IE' => esc_html__('Ireland', 'give'),
229
+		'IM' => esc_html__('Isle of Man', 'give'),
230
+		'IL' => esc_html__('Israel', 'give'),
231
+		'IT' => esc_html__('Italy', 'give'),
232
+		'JM' => esc_html__('Jamaica', 'give'),
233
+		'JP' => esc_html__('Japan', 'give'),
234
+		'JE' => esc_html__('Jersey', 'give'),
235
+		'JO' => esc_html__('Jordan', 'give'),
236
+		'KZ' => esc_html__('Kazakhstan', 'give'),
237
+		'KE' => esc_html__('Kenya', 'give'),
238
+		'KI' => esc_html__('Kiribati', 'give'),
239
+		'KW' => esc_html__('Kuwait', 'give'),
240
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
241
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
242
+		'LV' => esc_html__('Latvia', 'give'),
243
+		'LB' => esc_html__('Lebanon', 'give'),
244
+		'LS' => esc_html__('Lesotho', 'give'),
245
+		'LR' => esc_html__('Liberia', 'give'),
246
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
247
+		'LI' => esc_html__('Liechtenstein', 'give'),
248
+		'LT' => esc_html__('Lithuania', 'give'),
249
+		'LU' => esc_html__('Luxembourg', 'give'),
250
+		'MO' => esc_html__('Macau', 'give'),
251
+		'MK' => esc_html__('Macedonia', 'give'),
252
+		'MG' => esc_html__('Madagascar', 'give'),
253
+		'MW' => esc_html__('Malawi', 'give'),
254
+		'MY' => esc_html__('Malaysia', 'give'),
255
+		'MV' => esc_html__('Maldives', 'give'),
256
+		'ML' => esc_html__('Mali', 'give'),
257
+		'MT' => esc_html__('Malta', 'give'),
258
+		'MH' => esc_html__('Marshall Islands', 'give'),
259
+		'MQ' => esc_html__('Martinique', 'give'),
260
+		'MR' => esc_html__('Mauritania', 'give'),
261
+		'MU' => esc_html__('Mauritius', 'give'),
262
+		'YT' => esc_html__('Mayotte', 'give'),
263
+		'MX' => esc_html__('Mexico', 'give'),
264
+		'FM' => esc_html__('Micronesia', 'give'),
265
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
266
+		'MC' => esc_html__('Monaco', 'give'),
267
+		'MN' => esc_html__('Mongolia', 'give'),
268
+		'ME' => esc_html__('Montenegro', 'give'),
269
+		'MS' => esc_html__('Montserrat', 'give'),
270
+		'MA' => esc_html__('Morocco', 'give'),
271
+		'MZ' => esc_html__('Mozambique', 'give'),
272
+		'MM' => esc_html__('Myanmar', 'give'),
273
+		'NA' => esc_html__('Namibia', 'give'),
274
+		'NR' => esc_html__('Nauru', 'give'),
275
+		'NP' => esc_html__('Nepal', 'give'),
276
+		'NL' => esc_html__('Netherlands', 'give'),
277
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
278
+		'NC' => esc_html__('New Caledonia', 'give'),
279
+		'NZ' => esc_html__('New Zealand', 'give'),
280
+		'NI' => esc_html__('Nicaragua', 'give'),
281
+		'NE' => esc_html__('Niger', 'give'),
282
+		'NG' => esc_html__('Nigeria', 'give'),
283
+		'NU' => esc_html__('Niue', 'give'),
284
+		'NF' => esc_html__('Norfolk Island', 'give'),
285
+		'KP' => esc_html__('North Korea', 'give'),
286
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
287
+		'NO' => esc_html__('Norway', 'give'),
288
+		'OM' => esc_html__('Oman', 'give'),
289
+		'PK' => esc_html__('Pakistan', 'give'),
290
+		'PW' => esc_html__('Palau', 'give'),
291
+		'PS' => esc_html__('Palestinian Territories', 'give'),
292
+		'PA' => esc_html__('Panama', 'give'),
293
+		'PG' => esc_html__('Papua New Guinea', 'give'),
294
+		'PY' => esc_html__('Paraguay', 'give'),
295
+		'PE' => esc_html__('Peru', 'give'),
296
+		'PH' => esc_html__('Phillipines', 'give'),
297
+		'PN' => esc_html__('Pitcairn Island', 'give'),
298
+		'PL' => esc_html__('Poland', 'give'),
299
+		'PT' => esc_html__('Portugal', 'give'),
300
+		'PR' => esc_html__('Puerto Rico', 'give'),
301
+		'QA' => esc_html__('Qatar', 'give'),
302
+		'RE' => esc_html__('Reunion Island', 'give'),
303
+		'RO' => esc_html__('Romania', 'give'),
304
+		'RU' => esc_html__('Russian Federation', 'give'),
305
+		'RW' => esc_html__('Rwanda', 'give'),
306
+		'SH' => esc_html__('Saint Helena', 'give'),
307
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
308
+		'LC' => esc_html__('Saint Lucia', 'give'),
309
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
310
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
311
+		'SM' => esc_html__('San Marino', 'give'),
312
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
313
+		'SA' => esc_html__('Saudi Arabia', 'give'),
314
+		'SN' => esc_html__('Senegal', 'give'),
315
+		'RS' => esc_html__('Serbia', 'give'),
316
+		'SC' => esc_html__('Seychelles', 'give'),
317
+		'SL' => esc_html__('Sierra Leone', 'give'),
318
+		'SG' => esc_html__('Singapore', 'give'),
319
+		'SK' => esc_html__('Slovak Republic', 'give'),
320
+		'SI' => esc_html__('Slovenia', 'give'),
321
+		'SB' => esc_html__('Solomon Islands', 'give'),
322
+		'SO' => esc_html__('Somalia', 'give'),
323
+		'ZA' => esc_html__('South Africa', 'give'),
324
+		'GS' => esc_html__('South Georgia', 'give'),
325
+		'KR' => esc_html__('South Korea', 'give'),
326
+		'ES' => esc_html__('Spain', 'give'),
327
+		'LK' => esc_html__('Sri Lanka', 'give'),
328
+		'SD' => esc_html__('Sudan', 'give'),
329
+		'SR' => esc_html__('Suriname', 'give'),
330
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
331
+		'SZ' => esc_html__('Swaziland', 'give'),
332
+		'SE' => esc_html__('Sweden', 'give'),
333
+		'CH' => esc_html__('Switzerland', 'give'),
334
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
335
+		'TW' => esc_html__('Taiwan', 'give'),
336
+		'TJ' => esc_html__('Tajikistan', 'give'),
337
+		'TZ' => esc_html__('Tanzania', 'give'),
338
+		'TG' => esc_html__('Togo', 'give'),
339
+		'TK' => esc_html__('Tokelau', 'give'),
340
+		'TO' => esc_html__('Tonga', 'give'),
341
+		'TH' => esc_html__('Thailand', 'give'),
342
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
343
+		'TN' => esc_html__('Tunisia', 'give'),
344
+		'TR' => esc_html__('Turkey', 'give'),
345
+		'TM' => esc_html__('Turkmenistan', 'give'),
346
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
347
+		'TV' => esc_html__('Tuvalu', 'give'),
348
+		'UG' => esc_html__('Uganda', 'give'),
349
+		'UA' => esc_html__('Ukraine', 'give'),
350
+		'AE' => esc_html__('United Arab Emirates', 'give'),
351
+		'UY' => esc_html__('Uruguay', 'give'),
352
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
353
+		'UZ' => esc_html__('Uzbekistan', 'give'),
354
+		'VU' => esc_html__('Vanuatu', 'give'),
355
+		'VE' => esc_html__('Venezuela', 'give'),
356
+		'VN' => esc_html__('Vietnam', 'give'),
357
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
358
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
359
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
360
+		'EH' => esc_html__('Western Sahara', 'give'),
361
+		'WS' => esc_html__('Western Samoa', 'give'),
362
+		'YE' => esc_html__('Yemen', 'give'),
363
+		'YU' => esc_html__('Yugoslavia', 'give'),
364
+		'ZM' => esc_html__('Zambia', 'give'),
365
+		'ZW' => esc_html__('Zimbabwe', 'give')
366 366
 	);
367 367
 
368
-	return apply_filters( 'give_countries', $countries );
368
+	return apply_filters('give_countries', $countries);
369 369
 }
370 370
 
371 371
 /**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		'AP' => 'Armed Forces - Pacific'
447 447
 	);
448 448
 
449
-	return apply_filters( 'give_us_states', $states );
449
+	return apply_filters('give_us_states', $states);
450 450
 }
451 451
 
452 452
 /**
@@ -459,22 +459,22 @@  discard block
 block discarded – undo
459 459
 function give_get_provinces_list() {
460 460
 	$provinces = array(
461 461
 		''   => '',
462
-		'AB' => esc_html__('Alberta', 'give' ),
463
-		'BC' => esc_html__('British Columbia', 'give' ),
464
-		'MB' => esc_html__('Manitoba', 'give' ),
465
-		'NB' => esc_html__('New Brunswick', 'give' ),
466
-		'NL' => esc_html__('Newfoundland and Labrador', 'give' ),
467
-		'NS' => esc_html__('Nova Scotia', 'give' ),
468
-		'NT' => esc_html__('Northwest Territories', 'give' ),
469
-		'NU' => esc_html__('Nunavut', 'give' ),
470
-		'ON' => esc_html__('Ontario', 'give' ),
471
-		'PE' => esc_html__('Prince Edward Island', 'give' ),
472
-		'QC' => esc_html__('Quebec', 'give' ),
473
-		'SK' => esc_html__('Saskatchewan', 'give' ),
474
-		'YT' => esc_html__('Yukon', 'give' )
462
+		'AB' => esc_html__('Alberta', 'give'),
463
+		'BC' => esc_html__('British Columbia', 'give'),
464
+		'MB' => esc_html__('Manitoba', 'give'),
465
+		'NB' => esc_html__('New Brunswick', 'give'),
466
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
467
+		'NS' => esc_html__('Nova Scotia', 'give'),
468
+		'NT' => esc_html__('Northwest Territories', 'give'),
469
+		'NU' => esc_html__('Nunavut', 'give'),
470
+		'ON' => esc_html__('Ontario', 'give'),
471
+		'PE' => esc_html__('Prince Edward Island', 'give'),
472
+		'QC' => esc_html__('Quebec', 'give'),
473
+		'SK' => esc_html__('Saskatchewan', 'give'),
474
+		'YT' => esc_html__('Yukon', 'give')
475 475
 	);
476 476
 
477
-	return apply_filters( 'give_canada_provinces', $provinces );
477
+	return apply_filters('give_canada_provinces', $provinces);
478 478
 }
479 479
 
480 480
 /**
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 		'WA'  => 'Western Australia'
497 497
 	);
498 498
 
499
-	return apply_filters( 'give_australian_states', $states );
499
+	return apply_filters('give_australian_states', $states);
500 500
 }
501 501
 
502 502
 /**
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 		'TO' => 'Tocantins'
538 538
 	);
539 539
 
540
-	return apply_filters( 'give_brazil_states', $states );
540
+	return apply_filters('give_brazil_states', $states);
541 541
 }
542 542
 
543 543
 /**
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		'NEW TERRITORIES' => 'New Territories'
555 555
 	);
556 556
 
557
-	return apply_filters( 'give_hong_kong_states', $states );
557
+	return apply_filters('give_hong_kong_states', $states);
558 558
 }
559 559
 
560 560
 /**
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 		'ZA' => 'Zala'
589 589
 	);
590 590
 
591
-	return apply_filters( 'give_hungary_states', $states );
591
+	return apply_filters('give_hungary_states', $states);
592 592
 }
593 593
 
594 594
 /**
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 		'CN32' => 'Xinjiang / 新疆'
635 635
 	);
636 636
 
637
-	return apply_filters( 'give_chinese_states', $states );
637
+	return apply_filters('give_chinese_states', $states);
638 638
 }
639 639
 
640 640
 /**
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 		'WC' => 'West Coast'
664 664
 	);
665 665
 
666
-	return apply_filters( 'give_new_zealand_states', $states );
666
+	return apply_filters('give_new_zealand_states', $states);
667 667
 }
668 668
 
669 669
 /**
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 		'PB' => 'Papua Barat'
712 712
 	);
713 713
 
714
-	return apply_filters( 'give_indonesia_states', $states );
714
+	return apply_filters('give_indonesia_states', $states);
715 715
 }
716 716
 
717 717
 /**
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 		'PY' => 'Pondicherry (Puducherry)'
762 762
 	);
763 763
 
764
-	return apply_filters( 'give_indian_states', $states );
764
+	return apply_filters('give_indian_states', $states);
765 765
 }
766 766
 
767 767
 /**
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 		'PJY' => 'W.P. Putrajaya'
792 792
 	);
793 793
 
794
-	return apply_filters( 'give_malaysian_states', $states );
794
+	return apply_filters('give_malaysian_states', $states);
795 795
 }
796 796
 
797 797
 /**
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 		'WC'  => 'Western Cape'
815 815
 	);
816 816
 
817
-	return apply_filters( 'give_south_african_states', $states );
817
+	return apply_filters('give_south_african_states', $states);
818 818
 }
819 819
 
820 820
 /**
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		'TH-35' => 'Yasothon (ยโสธร)'
906 906
 	);
907 907
 
908
-	return apply_filters( 'give_thailand_states', $states );
908
+	return apply_filters('give_thailand_states', $states);
909 909
 }
910 910
 
911 911
 /**
@@ -917,59 +917,59 @@  discard block
 block discarded – undo
917 917
 function give_get_spain_states_list() {
918 918
 	$states = array(
919 919
 		''   => '',
920
-		'C'  => esc_html__( 'A Coruña', 'give' ),
921
-		'VI' => esc_html__( 'Álava', 'give' ),
922
-		'AB' => esc_html__( 'Albacete', 'give' ),
923
-		'A'  => esc_html__( 'Alicante', 'give' ),
924
-		'AL' => esc_html__( 'Almería', 'give' ),
925
-		'O'  => esc_html__( 'Asturias', 'give' ),
926
-		'AV' => esc_html__( 'Ávila', 'give' ),
927
-		'BA' => esc_html__( 'Badajoz', 'give' ),
928
-		'PM' => esc_html__( 'Baleares', 'give' ),
929
-		'B'  => esc_html__( 'Barcelona', 'give' ),
930
-		'BU' => esc_html__( 'Burgos', 'give' ),
931
-		'CC' => esc_html__( 'Cáceres', 'give' ),
932
-		'CA' => esc_html__( 'Cádiz', 'give' ),
933
-		'S'  => esc_html__( 'Cantabria', 'give' ),
934
-		'CS' => esc_html__( 'Castellón', 'give' ),
935
-		'CE' => esc_html__( 'Ceuta', 'give' ),
936
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
937
-		'CO' => esc_html__( 'Córdoba', 'give' ),
938
-		'CU' => esc_html__( 'Cuenca', 'give' ),
939
-		'GI' => esc_html__( 'Girona', 'give' ),
940
-		'GR' => esc_html__( 'Granada', 'give' ),
941
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
942
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
943
-		'H'  => esc_html__( 'Huelva', 'give' ),
944
-		'HU' => esc_html__( 'Huesca', 'give' ),
945
-		'J'  => esc_html__( 'Jaén', 'give' ),
946
-		'LO' => esc_html__( 'La Rioja', 'give' ),
947
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
948
-		'LE' => esc_html__( 'León', 'give' ),
949
-		'L'  => esc_html__( 'Lleida', 'give' ),
950
-		'LU' => esc_html__( 'Lugo', 'give' ),
951
-		'M'  => esc_html__( 'Madrid', 'give' ),
952
-		'MA' => esc_html__( 'Málaga', 'give' ),
953
-		'ML' => esc_html__( 'Melilla', 'give' ),
954
-		'MU' => esc_html__( 'Murcia', 'give' ),
955
-		'NA' => esc_html__( 'Navarra', 'give' ),
956
-		'OR' => esc_html__( 'Ourense', 'give' ),
957
-		'P'  => esc_html__( 'Palencia', 'give' ),
958
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
959
-		'SA' => esc_html__( 'Salamanca', 'give' ),
960
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
961
-		'SG' => esc_html__( 'Segovia', 'give' ),
962
-		'SE' => esc_html__( 'Sevilla', 'give' ),
963
-		'SO' => esc_html__( 'Soria', 'give' ),
964
-		'T'  => esc_html__( 'Tarragona', 'give' ),
965
-		'TE' => esc_html__( 'Teruel', 'give' ),
966
-		'TO' => esc_html__( 'Toledo', 'give' ),
967
-		'V'  => esc_html__( 'Valencia', 'give' ),
968
-		'VA' => esc_html__( 'Valladolid', 'give' ),
969
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
970
-		'ZA' => esc_html__( 'Zamora', 'give' ),
971
-		'Z'  => esc_html__( 'Zaragoza', 'give' )
920
+		'C'  => esc_html__('A Coruña', 'give'),
921
+		'VI' => esc_html__('Álava', 'give'),
922
+		'AB' => esc_html__('Albacete', 'give'),
923
+		'A'  => esc_html__('Alicante', 'give'),
924
+		'AL' => esc_html__('Almería', 'give'),
925
+		'O'  => esc_html__('Asturias', 'give'),
926
+		'AV' => esc_html__('Ávila', 'give'),
927
+		'BA' => esc_html__('Badajoz', 'give'),
928
+		'PM' => esc_html__('Baleares', 'give'),
929
+		'B'  => esc_html__('Barcelona', 'give'),
930
+		'BU' => esc_html__('Burgos', 'give'),
931
+		'CC' => esc_html__('Cáceres', 'give'),
932
+		'CA' => esc_html__('Cádiz', 'give'),
933
+		'S'  => esc_html__('Cantabria', 'give'),
934
+		'CS' => esc_html__('Castellón', 'give'),
935
+		'CE' => esc_html__('Ceuta', 'give'),
936
+		'CR' => esc_html__('Ciudad Real', 'give'),
937
+		'CO' => esc_html__('Córdoba', 'give'),
938
+		'CU' => esc_html__('Cuenca', 'give'),
939
+		'GI' => esc_html__('Girona', 'give'),
940
+		'GR' => esc_html__('Granada', 'give'),
941
+		'GU' => esc_html__('Guadalajara', 'give'),
942
+		'SS' => esc_html__('Gipuzkoa', 'give'),
943
+		'H'  => esc_html__('Huelva', 'give'),
944
+		'HU' => esc_html__('Huesca', 'give'),
945
+		'J'  => esc_html__('Jaén', 'give'),
946
+		'LO' => esc_html__('La Rioja', 'give'),
947
+		'GC' => esc_html__('Las Palmas', 'give'),
948
+		'LE' => esc_html__('León', 'give'),
949
+		'L'  => esc_html__('Lleida', 'give'),
950
+		'LU' => esc_html__('Lugo', 'give'),
951
+		'M'  => esc_html__('Madrid', 'give'),
952
+		'MA' => esc_html__('Málaga', 'give'),
953
+		'ML' => esc_html__('Melilla', 'give'),
954
+		'MU' => esc_html__('Murcia', 'give'),
955
+		'NA' => esc_html__('Navarra', 'give'),
956
+		'OR' => esc_html__('Ourense', 'give'),
957
+		'P'  => esc_html__('Palencia', 'give'),
958
+		'PO' => esc_html__('Pontevedra', 'give'),
959
+		'SA' => esc_html__('Salamanca', 'give'),
960
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
961
+		'SG' => esc_html__('Segovia', 'give'),
962
+		'SE' => esc_html__('Sevilla', 'give'),
963
+		'SO' => esc_html__('Soria', 'give'),
964
+		'T'  => esc_html__('Tarragona', 'give'),
965
+		'TE' => esc_html__('Teruel', 'give'),
966
+		'TO' => esc_html__('Toledo', 'give'),
967
+		'V'  => esc_html__('Valencia', 'give'),
968
+		'VA' => esc_html__('Valladolid', 'give'),
969
+		'BI' => esc_html__('Bizkaia', 'give'),
970
+		'ZA' => esc_html__('Zamora', 'give'),
971
+		'Z'  => esc_html__('Zaragoza', 'give')
972 972
 	);
973 973
 
974
-	return apply_filters( 'give_spain_states', $states );
974
+	return apply_filters('give_spain_states', $states);
975 975
 }
Please login to merge, or discard this patch.
includes/deprecated/deprecated-actions.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
  */
5 5
 $give_map_deprecated_actions = give_deprecated_actions();
6 6
 
7
-foreach ( $give_map_deprecated_actions as $new => $old ) {
8
-	add_action( $new, 'give_deprecated_action_mapping', 10, 4 );
7
+foreach ($give_map_deprecated_actions as $new => $old) {
8
+	add_action($new, 'give_deprecated_action_mapping', 10, 4);
9 9
 }
10 10
 
11 11
 /**
@@ -59,20 +59,20 @@  discard block
 block discarded – undo
59 59
  *
60 60
  * @return mixed|void
61 61
  */
62
-function give_deprecated_action_mapping( $data, $arg_1 = '', $arg_2 = '', $arg_3 = '' ) {
62
+function give_deprecated_action_mapping($data, $arg_1 = '', $arg_2 = '', $arg_3 = '') {
63 63
 	$give_map_deprecated_actions = give_deprecated_actions();
64 64
 	$action                      = current_filter();
65 65
 
66
-	if ( isset( $give_map_deprecated_actions[ $action ] ) ) {
67
-		if ( has_action( $give_map_deprecated_actions[ $action ] ) ) {
68
-			do_action( $give_map_deprecated_actions[ $action ], $data, $arg_1, $arg_2, $arg_3 );
66
+	if (isset($give_map_deprecated_actions[$action])) {
67
+		if (has_action($give_map_deprecated_actions[$action])) {
68
+			do_action($give_map_deprecated_actions[$action], $data, $arg_1, $arg_2, $arg_3);
69 69
 
70
-			if ( ! defined( 'DOING_AJAX' ) ) {
70
+			if ( ! defined('DOING_AJAX')) {
71 71
 				// translators: %s: action name.
72 72
 				_give_deprecated_function(
73 73
 					sprintf(
74
-						__( 'The %s action' ),
75
-						$give_map_deprecated_actions[ $action ]
74
+						__('The %s action'),
75
+						$give_map_deprecated_actions[$action]
76 76
 					),
77 77
 					'1.7',
78 78
 					$action
Please login to merge, or discard this patch.
includes/class-give-session.php 1 patch
Spacing   +61 added lines, -61 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
 
@@ -74,53 +74,53 @@  discard block
 block discarded – undo
74 74
 	public function __construct() {
75 75
 
76 76
 		$this->use_php_sessions = $this->use_php_sessions();
77
-		$this->exp_option       = give_get_option( 'session_lifetime' );
77
+		$this->exp_option       = give_get_option('session_lifetime');
78 78
 
79 79
 		// PHP Sessions.
80
-		if ( $this->use_php_sessions ) {
80
+		if ($this->use_php_sessions) {
81 81
 
82
-			if ( is_multisite() ) {
82
+			if (is_multisite()) {
83 83
 
84
-				$this->prefix = '_' . get_current_blog_id();
84
+				$this->prefix = '_'.get_current_blog_id();
85 85
 
86 86
 			}
87 87
 
88
-			add_action( 'init', array( $this, 'maybe_start_session' ), - 2 );
88
+			add_action('init', array($this, 'maybe_start_session'), - 2);
89 89
 
90 90
 		} else {
91 91
 
92
-			if ( ! $this->should_start_session() ) {
92
+			if ( ! $this->should_start_session()) {
93 93
 				return;
94 94
 			}
95 95
 
96 96
 			// Use WP_Session.
97
-			if ( ! defined( 'WP_SESSION_COOKIE' ) ) {
98
-				define( 'WP_SESSION_COOKIE', 'give_wp_session' );
97
+			if ( ! defined('WP_SESSION_COOKIE')) {
98
+				define('WP_SESSION_COOKIE', 'give_wp_session');
99 99
 			}
100 100
 
101
-			if ( ! class_exists( 'Recursive_ArrayAccess' ) ) {
102
-				require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/class-recursive-arrayaccess.php';
101
+			if ( ! class_exists('Recursive_ArrayAccess')) {
102
+				require_once GIVE_PLUGIN_DIR.'includes/libraries/sessions/class-recursive-arrayaccess.php';
103 103
 			}
104 104
 
105
-			if ( ! class_exists( 'WP_Session' ) ) {
106
-				require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/class-wp-session.php';
107
-				require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/wp-session.php';
105
+			if ( ! class_exists('WP_Session')) {
106
+				require_once GIVE_PLUGIN_DIR.'includes/libraries/sessions/class-wp-session.php';
107
+				require_once GIVE_PLUGIN_DIR.'includes/libraries/sessions/wp-session.php';
108 108
 			}
109 109
 
110
-			add_filter( 'wp_session_expiration_variant', array( $this, 'set_expiration_variant_time' ), 99999 );
111
-			add_filter( 'wp_session_expiration', array( $this, 'set_expiration_time' ), 99999 );
110
+			add_filter('wp_session_expiration_variant', array($this, 'set_expiration_variant_time'), 99999);
111
+			add_filter('wp_session_expiration', array($this, 'set_expiration_time'), 99999);
112 112
 
113 113
 		}
114 114
 
115 115
 		// Init Session.
116
-		if ( empty( $this->session ) && ! $this->use_php_sessions ) {
117
-			add_action( 'plugins_loaded', array( $this, 'init' ), - 1 );
116
+		if (empty($this->session) && ! $this->use_php_sessions) {
117
+			add_action('plugins_loaded', array($this, 'init'), - 1);
118 118
 		} else {
119
-			add_action( 'init', array( $this, 'init' ), - 1 );
119
+			add_action('init', array($this, 'init'), - 1);
120 120
 		}
121 121
 
122 122
 		// Set cookie on Donation Completion page.
123
-		add_action( 'give_pre_process_donation', array( $this, 'set_session_cookies' ) );
123
+		add_action('give_pre_process_donation', array($this, 'set_session_cookies'));
124 124
 
125 125
 	}
126 126
 
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function init() {
138 138
 
139
-		if ( $this->use_php_sessions ) {
140
-			$this->session = isset( $_SESSION[ 'give' . $this->prefix ] ) && is_array( $_SESSION[ 'give' . $this->prefix ] ) ? $_SESSION[ 'give' . $this->prefix ] : array();
139
+		if ($this->use_php_sessions) {
140
+			$this->session = isset($_SESSION['give'.$this->prefix]) && is_array($_SESSION['give'.$this->prefix]) ? $_SESSION['give'.$this->prefix] : array();
141 141
 		} else {
142 142
 			$this->session = WP_Session::get_instance();
143 143
 		}
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 	 *
173 173
 	 * @return string      Session variable.
174 174
 	 */
175
-	public function get( $key ) {
176
-		$key = sanitize_key( $key );
175
+	public function get($key) {
176
+		$key = sanitize_key($key);
177 177
 
178
-		return isset( $this->session[ $key ] ) ? maybe_unserialize( $this->session[ $key ] ) : false;
178
+		return isset($this->session[$key]) ? maybe_unserialize($this->session[$key]) : false;
179 179
 
180 180
 	}
181 181
 
@@ -192,21 +192,21 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @return string        Session variable.
194 194
 	 */
195
-	public function set( $key, $value ) {
195
+	public function set($key, $value) {
196 196
 
197
-		$key = sanitize_key( $key );
197
+		$key = sanitize_key($key);
198 198
 
199
-		if ( is_array( $value ) ) {
200
-			$this->session[ $key ] = serialize( $value );
199
+		if (is_array($value)) {
200
+			$this->session[$key] = serialize($value);
201 201
 		} else {
202
-			$this->session[ $key ] = $value;
202
+			$this->session[$key] = $value;
203 203
 		}
204 204
 
205
-		if ( $this->use_php_sessions ) {
206
-			$_SESSION[ 'give' . $this->prefix ] = $this->session;
205
+		if ($this->use_php_sessions) {
206
+			$_SESSION['give'.$this->prefix] = $this->session;
207 207
 		}
208 208
 
209
-		return $this->session[ $key ];
209
+		return $this->session[$key];
210 210
 	}
211 211
 
212 212
 	/**
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 	 * @hook
221 221
 	 */
222 222
 	public function set_session_cookies() {
223
-		if ( ! headers_sent() ) {
224
-			$lifetime = current_time( 'timestamp' ) + $this->set_expiration_time();
225
-			@setcookie( session_name(), session_id(), $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
226
-			@setcookie( session_name() . '_expiration', $lifetime, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
223
+		if ( ! headers_sent()) {
224
+			$lifetime = current_time('timestamp') + $this->set_expiration_time();
225
+			@setcookie(session_name(), session_id(), $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
226
+			@setcookie(session_name().'_expiration', $lifetime, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
227 227
 		}
228 228
 	}
229 229
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function set_expiration_variant_time() {
241 241
 
242
-		return ( ! empty( $this->exp_option ) ? ( intval( $this->exp_option ) - 3600 ) : 30 * 60 * 23 );
242
+		return ( ! empty($this->exp_option) ? (intval($this->exp_option) - 3600) : 30 * 60 * 23);
243 243
 	}
244 244
 
245 245
 	/**
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function set_expiration_time() {
256 256
 
257
-		return ( ! empty( $this->exp_option ) ? intval( $this->exp_option ) : 30 * 60 * 24 );
257
+		return ( ! empty($this->exp_option) ? intval($this->exp_option) : 30 * 60 * 24);
258 258
 	}
259 259
 
260 260
 	/**
@@ -272,21 +272,21 @@  discard block
 block discarded – undo
272 272
 		$ret = false;
273 273
 
274 274
 		// If the database variable is already set, no need to run auto detection.
275
-		$give_use_php_sessions = (bool) get_option( 'give_use_php_sessions' );
275
+		$give_use_php_sessions = (bool) get_option('give_use_php_sessions');
276 276
 
277
-		if ( ! $give_use_php_sessions ) {
277
+		if ( ! $give_use_php_sessions) {
278 278
 
279 279
 			// Attempt to detect if the server supports PHP sessions.
280
-			if ( function_exists( 'session_start' ) && ! ini_get( 'safe_mode' ) ) {
280
+			if (function_exists('session_start') && ! ini_get('safe_mode')) {
281 281
 
282
-				$this->set( 'give_use_php_sessions', 1 );
282
+				$this->set('give_use_php_sessions', 1);
283 283
 
284
-				if ( $this->get( 'give_use_php_sessions' ) ) {
284
+				if ($this->get('give_use_php_sessions')) {
285 285
 
286 286
 					$ret = true;
287 287
 
288 288
 					// Set the database option.
289
-					update_option( 'give_use_php_sessions', true );
289
+					update_option('give_use_php_sessions', true);
290 290
 
291 291
 				}
292 292
 			}
@@ -296,13 +296,13 @@  discard block
 block discarded – undo
296 296
 		}
297 297
 
298 298
 		// Enable or disable PHP Sessions based on the GIVE_USE_PHP_SESSIONS constant.
299
-		if ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ) {
299
+		if (defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS) {
300 300
 			$ret = true;
301
-		} elseif ( defined( 'GIVE_USE_PHP_SESSIONS' ) && ! GIVE_USE_PHP_SESSIONS ) {
301
+		} elseif (defined('GIVE_USE_PHP_SESSIONS') && ! GIVE_USE_PHP_SESSIONS) {
302 302
 			$ret = false;
303 303
 		}
304 304
 
305
-		return (bool) apply_filters( 'give_use_php_sessions', $ret );
305
+		return (bool) apply_filters('give_use_php_sessions', $ret);
306 306
 	}
307 307
 
308 308
 	/**
@@ -319,9 +319,9 @@  discard block
 block discarded – undo
319 319
 
320 320
 		$start_session = true;
321 321
 
322
-		if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
322
+		if ( ! empty($_SERVER['REQUEST_URI'])) {
323 323
 
324
-			$blacklist = apply_filters( 'give_session_start_uri_blacklist', array(
324
+			$blacklist = apply_filters('give_session_start_uri_blacklist', array(
325 325
 				'feed',
326 326
 				'feed',
327 327
 				'feed/rss',
@@ -329,21 +329,21 @@  discard block
 block discarded – undo
329 329
 				'feed/rdf',
330 330
 				'feed/atom',
331 331
 				'comments/feed/',
332
-			) );
333
-			$uri       = ltrim( $_SERVER['REQUEST_URI'], '/' );
334
-			$uri       = untrailingslashit( $uri );
335
-			if ( in_array( $uri, $blacklist ) ) {
332
+			));
333
+			$uri       = ltrim($_SERVER['REQUEST_URI'], '/');
334
+			$uri       = untrailingslashit($uri);
335
+			if (in_array($uri, $blacklist)) {
336 336
 				$start_session = false;
337 337
 			}
338
-			if ( false !== strpos( $uri, 'feed=' ) ) {
338
+			if (false !== strpos($uri, 'feed=')) {
339 339
 				$start_session = false;
340 340
 			}
341
-			if ( is_admin() ) {
341
+			if (is_admin()) {
342 342
 				$start_session = false;
343 343
 			}
344 344
 		}
345 345
 
346
-		return apply_filters( 'give_start_session', $start_session );
346
+		return apply_filters('give_start_session', $start_session);
347 347
 	}
348 348
 
349 349
 	/**
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 	 */
360 360
 	public function maybe_start_session() {
361 361
 
362
-		if ( ! $this->should_start_session() ) {
362
+		if ( ! $this->should_start_session()) {
363 363
 			return;
364 364
 		}
365 365
 
366
-		if ( ! session_id() && ! headers_sent() ) {
366
+		if ( ! session_id() && ! headers_sent()) {
367 367
 			session_start();
368 368
 		}
369 369
 
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 
383 383
 		$expiration = false;
384 384
 
385
-		if ( session_id() && isset( $_COOKIE[ session_name() . '_expiration' ] ) ) {
385
+		if (session_id() && isset($_COOKIE[session_name().'_expiration'])) {
386 386
 
387
-			$expiration = date( 'D, d M Y h:i:s', intval( $_COOKIE[ session_name() . '_expiration' ] ) );
387
+			$expiration = date('D, d M Y h:i:s', intval($_COOKIE[session_name().'_expiration']));
388 388
 
389 389
 		}
390 390
 
Please login to merge, or discard this patch.
includes/emails/actions.php 1 patch
Spacing   +18 added lines, -18 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,17 +23,17 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return void
25 25
  */
26
-function give_trigger_donation_receipt( $payment_id ) {
26
+function give_trigger_donation_receipt($payment_id) {
27 27
 	// Make sure we don't send a receipt while editing a donation.
28
-	if ( isset( $_POST['give-action'] ) && 'edit_payment' == $_POST['give-action'] ) {
28
+	if (isset($_POST['give-action']) && 'edit_payment' == $_POST['give-action']) {
29 29
 		return;
30 30
 	}
31 31
 
32 32
 	// Send email.
33
-	give_email_donation_receipt( $payment_id );
33
+	give_email_donation_receipt($payment_id);
34 34
 }
35 35
 
36
-add_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999, 1 );
36
+add_action('give_complete_donation', 'give_trigger_donation_receipt', 999, 1);
37 37
 
38 38
 /**
39 39
  * Resend the Email Donation Receipt. (This can be done from the Donation History Page)
@@ -44,29 +44,29 @@  discard block
 block discarded – undo
44 44
  *
45 45
  * @return void
46 46
  */
47
-function give_resend_donation_receipt( $data ) {
47
+function give_resend_donation_receipt($data) {
48 48
 
49
-	$purchase_id = absint( $data['purchase_id'] );
49
+	$purchase_id = absint($data['purchase_id']);
50 50
 
51
-	if ( empty( $purchase_id ) ) {
51
+	if (empty($purchase_id)) {
52 52
 		return;
53 53
 	}
54 54
 
55
-	if ( ! current_user_can( 'edit_give_payments', $purchase_id ) ) {
56
-		wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
55
+	if ( ! current_user_can('edit_give_payments', $purchase_id)) {
56
+		wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
57 57
 	}
58 58
 
59
-	give_email_donation_receipt( $purchase_id, false );
59
+	give_email_donation_receipt($purchase_id, false);
60 60
 
61
-	wp_redirect( add_query_arg( array(
61
+	wp_redirect(add_query_arg(array(
62 62
 		'give-message' => 'email_sent',
63 63
 		'give-action'  => false,
64 64
 		'purchase_id'  => false
65
-	) ) );
65
+	)));
66 66
 	exit;
67 67
 }
68 68
 
69
-add_action( 'give_email_links', 'give_resend_donation_receipt' );
69
+add_action('give_email_links', 'give_resend_donation_receipt');
70 70
 
71 71
 /**
72 72
  * Trigger the sending of a Test Email
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
  *
78 78
  * @return void
79 79
  */
80
-function give_send_test_email( $data ) {
81
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give-test-email' ) ) {
80
+function give_send_test_email($data) {
81
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give-test-email')) {
82 82
 		return;
83 83
 	}
84 84
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	give_email_test_donation_receipt();
87 87
 
88 88
 	// Remove the test email query arg.
89
-	wp_redirect( remove_query_arg( 'give_action' ) );
89
+	wp_redirect(remove_query_arg('give_action'));
90 90
 	exit;
91 91
 }
92 92
 
93
-add_action( 'give_send_test_email', 'give_send_test_email' );
93
+add_action('give_send_test_email', 'give_send_test_email');
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-cmb2-backward-compatibility.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 		 *
86 86
 		 * @since  1.8
87 87
 		 *
88
-		 * @param  $setting_tab
88
+		 * @param  string $setting_tab
89 89
 		 *
90 90
 		 * @return string
91 91
 		 */
Please login to merge, or discard this patch.
Spacing   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! class_exists( 'Give_CMB2_Settings_Loader' ) ) :
12
+if ( ! class_exists('Give_CMB2_Settings_Loader')) :
13 13
 
14 14
 	/**
15 15
 	 * This class loads the cmb2 settings.
@@ -52,30 +52,30 @@  discard block
 block discarded – undo
52 52
 
53 53
 			// Get current tab.
54 54
 			$this->current_tab     = give_get_current_setting_tab();
55
-			$this->current_section = empty( $_REQUEST['section'] ) ? ( current( array_keys( $this->get_sections() ) ) ) : sanitize_title( $_REQUEST['section'] );
55
+			$this->current_section = empty($_REQUEST['section']) ? (current(array_keys($this->get_sections()))) : sanitize_title($_REQUEST['section']);
56 56
 
57 57
 			// Tab ID.
58 58
 			$this->id = $this->current_tab;
59 59
 
60 60
 			// Add addon tabs.
61
-			add_filter( 'give-settings_tabs_array', array( $this, 'add_addon_settings_page' ), 999999 );
61
+			add_filter('give-settings_tabs_array', array($this, 'add_addon_settings_page'), 999999);
62 62
 
63 63
 			// Add save hook to addons.
64
-			add_action( 'give-settings_get_settings_pages', array( $this, 'setup_addon_save_hook' ), 999999 );
64
+			add_action('give-settings_get_settings_pages', array($this, 'setup_addon_save_hook'), 999999);
65 65
 
66 66
 			// Add backward compatibility filters plugin settings.
67
-			$setting_tabs = array( 'general', 'gateways', 'display', 'emails', 'addons', 'licenses' );
67
+			$setting_tabs = array('general', 'gateways', 'display', 'emails', 'addons', 'licenses');
68 68
 
69 69
 			// Filter Payment Gateways settings.
70
-			if ( in_array( $this->current_tab, $setting_tabs ) ) {
71
-				add_filter( "give_get_settings_{$this->current_tab}", array(
70
+			if (in_array($this->current_tab, $setting_tabs)) {
71
+				add_filter("give_get_settings_{$this->current_tab}", array(
72 72
 					$this,
73 73
 					'get_filtered_addon_settings',
74
-				), 999999, 1 );
75
-				add_filter( "give_get_sections_{$this->current_tab}", array(
74
+				), 999999, 1);
75
+				add_filter("give_get_sections_{$this->current_tab}", array(
76 76
 					$this,
77 77
 					'get_filtered_addon_sections',
78
-				), 999999, 1 );
78
+				), 999999, 1);
79 79
 			}
80 80
 		}
81 81
 
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
 		 *
89 89
 		 * @return string
90 90
 		 */
91
-		function set_default_setting_tab( $setting_tab ) {
91
+		function set_default_setting_tab($setting_tab) {
92 92
 			$default_tab = '';
93 93
 
94 94
 			// Set default tab to first setting tab.
95
-			if ( $sections = array_keys( $this->get_sections() ) ) {
96
-				$default_tab = current( $sections );
95
+			if ($sections = array_keys($this->get_sections())) {
96
+				$default_tab = current($sections);
97 97
 			}
98 98
 
99 99
 			return $default_tab;
@@ -108,29 +108,29 @@  discard block
 block discarded – undo
108 108
 		 *
109 109
 		 * @return mixed
110 110
 		 */
111
-		function add_addon_settings_page( $pages ) {
111
+		function add_addon_settings_page($pages) {
112 112
 			// Previous setting page.
113 113
 			$previous_pages = $this->prev_settings->give_get_settings_tabs();
114 114
 
115 115
 			// API and System Info setting tab merge to Tools setting tab, so remove them from tabs.
116
-			unset( $previous_pages['api'] );
117
-			unset( $previous_pages['system_info'] );
116
+			unset($previous_pages['api']);
117
+			unset($previous_pages['system_info']);
118 118
 
119 119
 			// Tab is not register.
120
-			$pages_diff = array_keys( array_diff( $previous_pages, $pages ) );
120
+			$pages_diff = array_keys(array_diff($previous_pages, $pages));
121 121
 
122 122
 			// Merge old settings with new settings.
123
-			$pages = array_merge( $pages, $previous_pages );
123
+			$pages = array_merge($pages, $previous_pages);
124 124
 
125
-			if ( in_array( $this->current_tab, $pages_diff ) ) {
125
+			if (in_array($this->current_tab, $pages_diff)) {
126 126
 				// Filter & actions.
127
-				add_filter( "give_default_setting_tab_section_{$this->current_tab}", array(
127
+				add_filter("give_default_setting_tab_section_{$this->current_tab}", array(
128 128
 					$this,
129 129
 					'set_default_setting_tab',
130
-				), 10 );
131
-				add_action( "give-settings_sections_{$this->current_tab}_page", array( $this, 'output_sections' ) );
132
-				add_action( "give-settings_settings_{$this->current_tab}_page", array( $this, 'output' ), 10 );
133
-				add_action( "give-settings_save_{$this->current_tab}", array( $this, 'save' ) );
130
+				), 10);
131
+				add_action("give-settings_sections_{$this->current_tab}_page", array($this, 'output_sections'));
132
+				add_action("give-settings_settings_{$this->current_tab}_page", array($this, 'output'), 10);
133
+				add_action("give-settings_save_{$this->current_tab}", array($this, 'save'));
134 134
 			}
135 135
 
136 136
 			return $pages;
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
 		 *
147 147
 		 * @return mixed
148 148
 		 */
149
-		function setup_addon_save_hook( $pages ) {
149
+		function setup_addon_save_hook($pages) {
150 150
 			$page_ids = array();
151 151
 
152
-			foreach ( $pages as $page ) {
153
-				$page_ids = $page->add_settings_page( $page_ids );
152
+			foreach ($pages as $page) {
153
+				$page_ids = $page->add_settings_page($page_ids);
154 154
 			}
155 155
 
156 156
 			// Previous setting page.
157 157
 			$previous_pages = $this->prev_settings->give_get_settings_tabs();
158 158
 
159 159
 			// API and System Info setting tab merge to Tools setting tab, so remove them from tabs.
160
-			unset( $previous_pages['api'] );
161
-			unset( $previous_pages['system_info'] );
160
+			unset($previous_pages['api']);
161
+			unset($previous_pages['system_info']);
162 162
 
163 163
 			// Tab is not register.
164
-			$pages_diff = array_keys( array_diff( $previous_pages, $page_ids ) );
164
+			$pages_diff = array_keys(array_diff($previous_pages, $page_ids));
165 165
 
166 166
 			// Merge old settings with new settings.
167
-			$pages = array_merge( $page_ids, $previous_pages );
167
+			$pages = array_merge($page_ids, $previous_pages);
168 168
 
169
-			if ( in_array( $this->current_tab, $pages_diff ) ) {
169
+			if (in_array($this->current_tab, $pages_diff)) {
170 170
 				// Filter & actions.
171
-				add_action( "give-settings_save_{$this->current_tab}", array( $this, 'save' ) );
171
+				add_action("give-settings_save_{$this->current_tab}", array($this, 'save'));
172 172
 			}
173 173
 
174 174
 			return $pages;
@@ -183,16 +183,16 @@  discard block
 block discarded – undo
183 183
 		 *
184 184
 		 * @return string
185 185
 		 */
186
-		function get_section_name( $field_name ) {
186
+		function get_section_name($field_name) {
187 187
 			// Bailout.
188
-			if ( empty( $field_name ) ) {
188
+			if (empty($field_name)) {
189 189
 				return $field_name;
190 190
 			}
191 191
 
192
-			$section_name = explode( ' ', $field_name );
192
+			$section_name = explode(' ', $field_name);
193 193
 
194 194
 			// Output.
195
-			return strip_tags( implode( ' ', $section_name ) );
195
+			return strip_tags(implode(' ', $section_name));
196 196
 		}
197 197
 
198 198
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		 *
208 208
 		 * @return mixed
209 209
 		 */
210
-		public function en_translation( $translation, $text ) {
210
+		public function en_translation($translation, $text) {
211 211
 			return $text;
212 212
 		}
213 213
 
@@ -221,52 +221,52 @@  discard block
 block discarded – undo
221 221
 		 *
222 222
 		 * @return mixed
223 223
 		 */
224
-		function get_filtered_addon_sections( $sections = array() ) {
224
+		function get_filtered_addon_sections($sections = array()) {
225 225
 			// New sections.
226 226
 			$new_sections = array();
227
-			$sections_ID  = array_keys( $sections );
228
-			$setting_fields = $this->prev_settings->give_settings( $this->current_tab );
227
+			$sections_ID  = array_keys($sections);
228
+			$setting_fields = $this->prev_settings->give_settings($this->current_tab);
229 229
 
230 230
 			// We need untranslated settings for backward compatibility.
231
-			add_filter( 'gettext', array( $this, 'en_translation' ), 10, 2 );
232
-			$en_setting_fields = $this->prev_settings->give_settings( $this->current_tab );
233
-			remove_filter( 'gettext', array( $this, 'en_translation' ), 10, 2 );
231
+			add_filter('gettext', array($this, 'en_translation'), 10, 2);
232
+			$en_setting_fields = $this->prev_settings->give_settings($this->current_tab);
233
+			remove_filter('gettext', array($this, 'en_translation'), 10, 2);
234 234
 			
235
-			if ( ! empty( $setting_fields ) && ! empty( $setting_fields['fields'] ) ) {
235
+			if ( ! empty($setting_fields) && ! empty($setting_fields['fields'])) {
236 236
 
237
-				foreach ( $setting_fields['fields'] as $index => $field ) {
237
+				foreach ($setting_fields['fields'] as $index => $field) {
238 238
 					// Collect new sections from addons.
239
-					if ( 'give_title' !== $field['type'] ) {
239
+					if ('give_title' !== $field['type']) {
240 240
 						continue;
241 241
 					}
242 242
 
243 243
 					// Untranslated setting name.
244
-					$en_setting_field_name = isset( $en_setting_fields['fields'][ $index ]['name'] ) ? $en_setting_fields['fields'][ $index ]['name'] : '';
244
+					$en_setting_field_name = isset($en_setting_fields['fields'][$index]['name']) ? $en_setting_fields['fields'][$index]['name'] : '';
245 245
 
246 246
 					// Section name.
247
-					$field['name'] = isset( $field['name'] ) ? $field['name'] : '';
248
-					$section_name  = $this->get_section_name( $field['name'] );
247
+					$field['name'] = isset($field['name']) ? $field['name'] : '';
248
+					$section_name  = $this->get_section_name($field['name']);
249 249
 
250 250
 					// Check if section name exit and section title array is not empty.
251
-					if ( ! empty( $sections ) && ! empty( $en_setting_field_name ) ) {
251
+					if ( ! empty($sections) && ! empty($en_setting_field_name)) {
252 252
 
253 253
 						// Bailout: Do not load section if it is already exist.
254 254
 						if (
255
-							in_array( sanitize_title( $en_setting_field_name ), $sections_ID ) // Check section id.
256
-							|| in_array( $section_name, $sections )                            // Check section name.
255
+							in_array(sanitize_title($en_setting_field_name), $sections_ID) // Check section id.
256
+							|| in_array($section_name, $sections)                            // Check section name.
257 257
 						) {
258 258
 							continue;
259 259
 						}
260 260
 					}
261 261
 
262 262
 					// Collect new sections from addons.
263
-					$new_sections[ sanitize_title( $field['name'] ) ] = $section_name;
263
+					$new_sections[sanitize_title($field['name'])] = $section_name;
264 264
 				}
265 265
 			}
266 266
 
267 267
 			// Add new section.
268
-			if ( ! empty( $new_sections ) ) {
269
-				$sections = array_merge( $sections, $new_sections );
268
+			if ( ! empty($new_sections)) {
269
+				$sections = array_merge($sections, $new_sections);
270 270
 			}
271 271
 
272 272
 			// Output.
@@ -284,19 +284,19 @@  discard block
 block discarded – undo
284 284
 		 *
285 285
 		 * @return array
286 286
 		 */
287
-		function get_filtered_addon_settings( $settings, $setting_fields = array() ) {
287
+		function get_filtered_addon_settings($settings, $setting_fields = array()) {
288 288
 			global $wp_filter;
289 289
 
290 290
 			$new_setting_fields = array();
291 291
 
292
-			if ( ! empty( $settings ) ) {
292
+			if ( ! empty($settings)) {
293 293
 				// Bailout: If setting array contain first element of type title then it means it is already created with new setting api (skip this section ).
294
-				if ( isset( $settings[0]['type'] ) && 'title' == $settings[0]['type'] ) {
295
-					foreach ( $settings as $setting ) {
294
+				if (isset($settings[0]['type']) && 'title' == $settings[0]['type']) {
295
+					foreach ($settings as $setting) {
296 296
 						$new_setting_fields[] = $setting;
297 297
 
298 298
 						// We need setting only till first section end.
299
-						if ( 'sectionend' === $setting['type'] ) {
299
+						if ('sectionend' === $setting['type']) {
300 300
 							break;
301 301
 						}
302 302
 					}
@@ -308,24 +308,24 @@  discard block
 block discarded – undo
308 308
 				$prev_title_field_id = '';
309 309
 
310 310
 				// Create new setting fields.
311
-				foreach ( $settings as $index => $field ) {
311
+				foreach ($settings as $index => $field) {
312 312
 
313 313
 					// Bailout: Must need field type to process.
314
-					if ( ! isset( $field['type'] ) ) {
314
+					if ( ! isset($field['type'])) {
315 315
 						continue;
316 316
 					}
317 317
 
318 318
 					// Set wrapper class if any.
319
-					if ( ! empty( $field['row_classes'] ) ) {
319
+					if ( ! empty($field['row_classes'])) {
320 320
 						$field['wrapper_class'] = $field['row_classes'];
321
-						unset( $field['row_classes'] );
321
+						unset($field['row_classes']);
322 322
 					}
323 323
 
324
-					$field['name'] = ! isset( $field['name'] ) ? '' : $field['name'];
325
-					$field['desc'] = ! isset( $field['desc'] ) ? '' : $field['desc'];
324
+					$field['name'] = ! isset($field['name']) ? '' : $field['name'];
325
+					$field['desc'] = ! isset($field['desc']) ? '' : $field['desc'];
326 326
 
327 327
 					// Modify cmb2 setting fields.
328
-					switch ( $field['type'] ) {
328
+					switch ($field['type']) {
329 329
 						case 'text' :
330 330
 						case 'file' :
331 331
 							$field['css'] = 'width:25em;';
@@ -349,18 +349,18 @@  discard block
 block discarded – undo
349 349
 							$field['type'] = 'title';
350 350
 
351 351
 							// Since we are showing sections, so there now ned to show horizontal rules.
352
-							if ( '<hr>' === $field['desc'] ) {
352
+							if ('<hr>' === $field['desc']) {
353 353
 								$field['desc'] = '';
354 354
 							}
355 355
 
356 356
 							break;
357 357
 					}
358 358
 
359
-					if ( 'title' === $field['type'] ) {
359
+					if ('title' === $field['type']) {
360 360
 
361 361
 						// If we do not have first element as title then these field will be skip from frontend
362 362
 						// because there are not belong to any section, so put all abandon fields under first section.
363
-						if ( $index && empty( $prev_title_field_id ) ) {
363
+						if ($index && empty($prev_title_field_id)) {
364 364
 							array_unshift(
365 365
 								$new_setting_fields,
366 366
 								array(
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 							$prev_title_field_id = $field['id'];
375 375
 
376 376
 							continue;
377
-						} elseif ( $index ) {
377
+						} elseif ($index) {
378 378
 							// Section end.
379 379
 							$new_setting_fields[] = array(
380 380
 								'type' => 'sectionend',
@@ -406,52 +406,52 @@  discard block
 block discarded – undo
406 406
 
407 407
 				// Check if setting page has title section or not.
408 408
 				// If setting page does not have title section  then add title section to it and fix section end array id.
409
-				if ( 'title' !== $new_setting_fields[0]['type'] ) {
409
+				if ('title' !== $new_setting_fields[0]['type']) {
410 410
 					array_unshift(
411 411
 						$new_setting_fields,
412 412
 						array(
413
-							'title' => ( isset( $settings['give_title'] ) ? $settings['give_title'] : '' ),
413
+							'title' => (isset($settings['give_title']) ? $settings['give_title'] : ''),
414 414
 							'type'  => 'title',
415
-							'desc'  => ! empty( $setting_fields['desc'] ) ? $setting_fields['desc'] : '',
416
-							'id'    => ( isset( $settings['id'] ) ? $settings['id'] : '' ),
415
+							'desc'  => ! empty($setting_fields['desc']) ? $setting_fields['desc'] : '',
416
+							'id'    => (isset($settings['id']) ? $settings['id'] : ''),
417 417
 						)
418 418
 					);
419 419
 
420 420
 					// Update id in section end array if does not contain.
421
-					if ( empty( $new_setting_fields[ count( $new_setting_fields ) - 1 ]['id'] ) ) {
422
-						$new_setting_fields[ count( $new_setting_fields ) - 1 ]['id'] = ( isset( $settings['id'] ) ? $settings['id'] : '' );
421
+					if (empty($new_setting_fields[count($new_setting_fields) - 1]['id'])) {
422
+						$new_setting_fields[count($new_setting_fields) - 1]['id'] = (isset($settings['id']) ? $settings['id'] : '');
423 423
 					}
424 424
 				}
425 425
 
426 426
 				// Return only section related settings.
427
-				if ( $sections = $this->get_filtered_addon_sections() ) {
428
-					$new_setting_fields = $this->get_section_settings( $new_setting_fields );
427
+				if ($sections = $this->get_filtered_addon_sections()) {
428
+					$new_setting_fields = $this->get_section_settings($new_setting_fields);
429 429
 				}
430 430
 
431 431
 				// Third party plugin backward compatibility.
432
-				$wp_filter_keys = array_keys( $wp_filter );
433
-				foreach ( $new_setting_fields as $index => $field ) {
434
-					if ( ! isset( $field['type'] ) || in_array( $field['type'], array( 'title', 'sectionend' ) ) ) {
432
+				$wp_filter_keys = array_keys($wp_filter);
433
+				foreach ($new_setting_fields as $index => $field) {
434
+					if ( ! isset($field['type']) || in_array($field['type'], array('title', 'sectionend'))) {
435 435
 						continue;
436 436
 					}
437 437
 
438 438
 					$cmb2_filter_name = "cmb2_render_{$field['type']}";
439 439
 
440
-					if ( in_array( $cmb2_filter_name, $wp_filter_keys ) ) {
440
+					if (in_array($cmb2_filter_name, $wp_filter_keys)) {
441 441
 
442
-						if ( 0 >= version_compare( 4.7, get_bloginfo( 'version' ) ) && ! empty( $wp_filter[ $cmb2_filter_name ]->callbacks ) ) {
443
-							$cmb2_filter_arr = current( $wp_filter[ $cmb2_filter_name ]->callbacks );
442
+						if (0 >= version_compare(4.7, get_bloginfo('version')) && ! empty($wp_filter[$cmb2_filter_name]->callbacks)) {
443
+							$cmb2_filter_arr = current($wp_filter[$cmb2_filter_name]->callbacks);
444 444
 						} else {
445
-							$cmb2_filter_arr = current( $wp_filter[ $cmb2_filter_name ] );
445
+							$cmb2_filter_arr = current($wp_filter[$cmb2_filter_name]);
446 446
 						}
447 447
 
448
-						if ( ! empty( $cmb2_filter_arr ) ) {
448
+						if ( ! empty($cmb2_filter_arr)) {
449 449
 							// Note: function can be called either globally or with class object, it depends on how developer invoke it.
450
-							$new_setting_fields[ $index ]['func'] = current( $cmb2_filter_arr );
451
-							add_action( "give_admin_field_{$field['type']}", array(
450
+							$new_setting_fields[$index]['func'] = current($cmb2_filter_arr);
451
+							add_action("give_admin_field_{$field['type']}", array(
452 452
 								$this,
453 453
 								'addon_setting_field',
454
-							), 10, 2 );
454
+							), 10, 2);
455 455
 						}
456 456
 					}
457 457
 				}
@@ -472,31 +472,31 @@  discard block
 block discarded – undo
472 472
 		 *
473 473
 		 * @return array
474 474
 		 */
475
-		function get_section_settings( $tab_settings ) {
475
+		function get_section_settings($tab_settings) {
476 476
 			$current_section = give_get_current_setting_section();
477 477
 
478 478
 			// Note: If we are opening default tab for addon setting then it is possible that we will get empty string as current section
479 479
 			// because default section filter added after save hook fire, so we will always get problem to save first section [default] or if there are only on section
480 480
 			// This is hack to fix this.
481
-			if ( empty( $current_section ) ) {
482
-				$current_section = $this->set_default_setting_tab( $current_section );
481
+			if (empty($current_section)) {
482
+				$current_section = $this->set_default_setting_tab($current_section);
483 483
 			}
484 484
 
485 485
 			$section_start               = false;
486 486
 			$section_end                 = false;
487 487
 			$section_only_setting_fields = array();
488 488
 
489
-			foreach ( $tab_settings as $field ) {
490
-				if ( 'title' == $field['type'] && $current_section == sanitize_title( $field['title'] ) ) {
489
+			foreach ($tab_settings as $field) {
490
+				if ('title' == $field['type'] && $current_section == sanitize_title($field['title'])) {
491 491
 					$section_start = true;
492 492
 				}
493 493
 
494
-				if ( ! $section_start || $section_end ) {
494
+				if ( ! $section_start || $section_end) {
495 495
 					continue;
496 496
 				}
497 497
 
498
-				if ( $section_start && ! $section_end ) {
499
-					if ( 'sectionend' == $field['type'] ) {
498
+				if ($section_start && ! $section_end) {
499
+					if ('sectionend' == $field['type']) {
500 500
 						$section_end = true;
501 501
 					}
502 502
 					$section_only_setting_fields[] = $field;
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 			// Remove title from setting, prevent it from render in setting tab.
507 507
 			$section_only_setting_fields[0]['title'] = '';
508 508
 
509
-			return apply_filters( "give_get_settings_{$this->current_tab}_{$current_section}", $section_only_setting_fields, $tab_settings );
509
+			return apply_filters("give_get_settings_{$this->current_tab}_{$current_section}", $section_only_setting_fields, $tab_settings);
510 510
 		}
511 511
 
512 512
 
@@ -520,17 +520,17 @@  discard block
 block discarded – undo
520 520
 		 *
521 521
 		 * @return void
522 522
 		 */
523
-		function addon_setting_field( $field, $saved_value ) {
523
+		function addon_setting_field($field, $saved_value) {
524 524
 			// Create object for cmb2  function callback backward compatibility.
525 525
 			// Note: Do not call any cmb2 function on these objects
526
-			$field_obj      = (object) array( 'args' => $field );
527
-			$field_type_obj = (object) array( 'field' => $field_obj );
526
+			$field_obj      = (object) array('args' => $field);
527
+			$field_type_obj = (object) array('field' => $field_obj);
528 528
 
529
-			switch ( $this->current_tab ) :
529
+			switch ($this->current_tab) :
530 530
 				case 'licenses':
531 531
 					?>
532 532
 					<div class="give-settings-wrap give-settings-wrap-<?php echo $this->current_tab; ?>">
533
-						<?php $field['func']['function']( $field_obj, $saved_value, '', '', $field_type_obj ); ?>
533
+						<?php $field['func']['function']($field_obj, $saved_value, '', '', $field_type_obj); ?>
534 534
 					</div>
535 535
 					<?php break;
536 536
 
@@ -538,22 +538,22 @@  discard block
 block discarded – undo
538 538
 					$colspan = 'colspan="2"';
539 539
 					?>
540 540
 					<tr valign="top">
541
-						<?php if ( ! empty( $field['name'] ) && ! in_array( $field['name'], array( '&nbsp;' ) ) ) : ?>
541
+						<?php if ( ! empty($field['name']) && ! in_array($field['name'], array('&nbsp;'))) : ?>
542 542
 							<th scope="row" class="titledesc">
543 543
 								<label
544
-										for="<?php echo esc_attr( $field['name'] ); ?>"><?php echo $field['title']; ?></label>
544
+										for="<?php echo esc_attr($field['name']); ?>"><?php echo $field['title']; ?></label>
545 545
 							</th>
546 546
 							<?php $colspan = ''; ?>
547 547
 						<?php endif; ?>
548 548
 						<td class="give-forminp" <?php echo $colspan; ?>>
549 549
 							<?php
550
-							if ( is_array( $field['func']['function'] ) ) {
550
+							if (is_array($field['func']['function'])) {
551 551
 								$classname = $field['func']['function'][0];
552 552
 								$function_name = $field['func']['function'][1];
553
-								$classname->$function_name( $field_obj, $saved_value, '', '', $field_type_obj );
553
+								$classname->$function_name($field_obj, $saved_value, '', '', $field_type_obj);
554 554
 							} else {
555 555
 								$function_name = $field['func']['function'];
556
-								$function_name( $field_obj, $saved_value, '', '', $field_type_obj );
556
+								$function_name($field_obj, $saved_value, '', '', $field_type_obj);
557 557
 							}
558 558
 							?>
559 559
 						</td>
@@ -571,10 +571,10 @@  discard block
 block discarded – undo
571 571
 		public function get_sections() {
572 572
 			$sections = array();
573 573
 
574
-			if ( ( $setting_fields = $this->prev_settings->give_settings( $this->current_tab ) ) && ! empty( $setting_fields['fields'] ) ) {
575
-				foreach ( $setting_fields['fields'] as $field ) {
576
-					if ( 'give_title' == $field['type'] ) {
577
-						$sections[ sanitize_title( $field['name'] ) ] = $this->get_section_name( $field['name'] );
574
+			if (($setting_fields = $this->prev_settings->give_settings($this->current_tab)) && ! empty($setting_fields['fields'])) {
575
+				foreach ($setting_fields['fields'] as $field) {
576
+					if ('give_title' == $field['type']) {
577
+						$sections[sanitize_title($field['name'])] = $this->get_section_name($field['name']);
578 578
 					}
579 579
 				}
580 580
 			}
@@ -594,16 +594,16 @@  discard block
 block discarded – undo
594 594
 
595 595
 			$new_setting_fields = array();
596 596
 
597
-			if ( $setting_fields = $this->prev_settings->give_settings( $this->current_tab ) ) {
598
-				if ( isset( $setting_fields['fields'] ) ) {
597
+			if ($setting_fields = $this->prev_settings->give_settings($this->current_tab)) {
598
+				if (isset($setting_fields['fields'])) {
599 599
 
600 600
 					$tab_data = array(
601 601
 						'id'         => $setting_fields['id'],
602 602
 						'give_title' => $setting_fields['give_title'],
603
-						'desc'       => ( isset( $setting_fields['desc'] ) ? $setting_fields['desc'] : '' ),
603
+						'desc'       => (isset($setting_fields['desc']) ? $setting_fields['desc'] : ''),
604 604
 					);
605 605
 
606
-					$new_setting_fields = $this->get_filtered_addon_settings( $setting_fields['fields'], $tab_data );
606
+					$new_setting_fields = $this->get_filtered_addon_settings($setting_fields['fields'], $tab_data);
607 607
 				}
608 608
 			}
609 609
 
@@ -620,24 +620,24 @@  discard block
 block discarded – undo
620 620
 			$sections = $this->get_sections();
621 621
 
622 622
 			// Show section settings only if setting section exist.
623
-			if ( $this->current_section && ! in_array( $this->current_section, array_keys( $sections ) ) ) {
624
-				echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>';
623
+			if ($this->current_section && ! in_array($this->current_section, array_keys($sections))) {
624
+				echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>';
625 625
 				$GLOBALS['give_hide_save_button'] = true;
626 626
 
627 627
 				return;
628 628
 			}
629 629
 
630 630
 			// Bailout.
631
-			if ( empty( $sections ) ) {
631
+			if (empty($sections)) {
632 632
 				return;
633 633
 			}
634 634
 
635 635
 			echo '<ul class="subsubsub">';
636 636
 
637
-			$array_keys = array_keys( $sections );
637
+			$array_keys = array_keys($sections);
638 638
 
639
-			foreach ( $sections as $id => $label ) {
640
-				echo '<li><a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=' . $this->current_tab . '&section=' . sanitize_title( $id ) ) . '" class="' . ( $this->current_section == $id ? 'current' : '' ) . '">' . strip_tags( $label ) . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';
639
+			foreach ($sections as $id => $label) {
640
+				echo '<li><a href="'.admin_url('edit.php?post_type=give_forms&page=give-settings&tab='.$this->current_tab.'&section='.sanitize_title($id)).'" class="'.($this->current_section == $id ? 'current' : '').'">'.strip_tags($label).'</a> '.(end($array_keys) == $id ? '' : '|').' </li>';
641 641
 			}
642 642
 
643 643
 			echo '</ul><br class="clear" /><hr>';
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 		public function output() {
653 653
 			$settings = $this->get_settings();
654 654
 
655
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
655
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
656 656
 		}
657 657
 
658 658
 		/**
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 		public function save() {
665 665
 			$settings = $this->get_settings();
666 666
 
667
-			Give_Admin_Settings::save_fields( $settings, 'give_settings' );
667
+			Give_Admin_Settings::save_fields($settings, 'give_settings');
668 668
 		}
669 669
 	}
670 670
 endif;
Please login to merge, or discard this patch.
includes/class-give-template-loader.php 1 patch
Spacing   +23 added lines, -23 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
 
@@ -36,29 +36,29 @@  discard block
 block discarded – undo
36 36
 		/**
37 37
 		 * Templates
38 38
 		 */
39
-		add_filter( 'template_include', array( __CLASS__, 'template_loader' ) );
39
+		add_filter('template_include', array(__CLASS__, 'template_loader'));
40 40
 
41 41
 		/**
42 42
 		 * Content Wrappers
43 43
 		 */
44
-		add_action( 'give_before_main_content', 'give_output_content_wrapper', 10 );
45
-		add_action( 'give_after_main_content', 'give_output_content_wrapper_end', 10 );
44
+		add_action('give_before_main_content', 'give_output_content_wrapper', 10);
45
+		add_action('give_after_main_content', 'give_output_content_wrapper_end', 10);
46 46
 
47 47
 		/**
48 48
 		 * Entry Summary Classes
49 49
 		 */
50
-		add_filter( 'give_forms_single_summary_classes', array( $this, 'give_set_single_summary_classes' ) );
50
+		add_filter('give_forms_single_summary_classes', array($this, 'give_set_single_summary_classes'));
51 51
 
52 52
 		/**
53 53
 		 * Sidebar
54 54
 		 */
55
-		add_action( 'give_before_single_form_summary', array( $this, 'give_output_sidebar_option' ), 1 );
55
+		add_action('give_before_single_form_summary', array($this, 'give_output_sidebar_option'), 1);
56 56
 
57 57
 		/**
58 58
 		 * Single Forms Summary Box
59 59
 		 */
60
-		add_action( 'give_single_form_summary', 'give_template_single_title', 5 );
61
-		add_action( 'give_single_form_summary', 'give_get_donation_form', 10 );
60
+		add_action('give_single_form_summary', 'give_template_single_title', 5);
61
+		add_action('give_single_form_summary', 'give_get_donation_form', 10);
62 62
 
63 63
 	}
64 64
 
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return string $classes List of space separated class names.
75 75
 	 */
76
-	public function give_set_single_summary_classes( $classes ) {
76
+	public function give_set_single_summary_classes($classes) {
77 77
 
78 78
 		//Add full width class when feature image is disabled AND no widgets are present
79
-		if ( ! give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
79
+		if ( ! give_is_setting_enabled(give_get_option('form_sidebar'))) {
80 80
 			$classes .= ' give-full-width';
81 81
 		}
82 82
 
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 	public function give_output_sidebar_option() {
98 98
 
99 99
 		//Add full width class when feature image is disabled AND no widgets are present
100
-		if ( give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
101
-			add_action( 'give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5 );
102
-			add_action( 'give_before_single_form_summary', 'give_show_form_images', 10 );
103
-			add_action( 'give_before_single_form_summary', 'give_get_forms_sidebar', 20 );
104
-			add_action( 'give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30 );
100
+		if (give_is_setting_enabled(give_get_option('form_sidebar'))) {
101
+			add_action('give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5);
102
+			add_action('give_before_single_form_summary', 'give_show_form_images', 10);
103
+			add_action('give_before_single_form_summary', 'give_get_forms_sidebar', 20);
104
+			add_action('give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30);
105 105
 		}
106 106
 
107 107
 	}
@@ -123,20 +123,20 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @return string $template
125 125
 	 */
126
-	public static function template_loader( $template ) {
127
-		$find = array( 'give.php' );
126
+	public static function template_loader($template) {
127
+		$find = array('give.php');
128 128
 		$file = '';
129 129
 
130
-		if ( is_single() && get_post_type() == 'give_forms' ) {
130
+		if (is_single() && get_post_type() == 'give_forms') {
131 131
 			$file   = 'single-give-form.php';
132 132
 			$find[] = $file;
133
-			$find[] = apply_filters( 'give_template_path', 'give/' ) . $file;
133
+			$find[] = apply_filters('give_template_path', 'give/').$file;
134 134
 		}
135 135
 
136
-		if ( $file ) {
137
-			$template = locate_template( array_unique( $find ) );
138
-			if ( ! $template ) {
139
-				$template = GIVE_PLUGIN_DIR . '/templates/' . $file;
136
+		if ($file) {
137
+			$template = locate_template(array_unique($find));
138
+			if ( ! $template) {
139
+				$template = GIVE_PLUGIN_DIR.'/templates/'.$file;
140 140
 			}
141 141
 		}
142 142
 
Please login to merge, or discard this patch.
includes/admin/reporting/tools.php 1 patch
Spacing   +26 added lines, -26 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,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_tools_recount_stats_display() {
24 24
 
25
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
25
+	if ( ! current_user_can('manage_give_settings')) {
26 26
 		return;
27 27
 	}
28 28
 
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @since 1.5
33 33
 	 */
34
-	do_action( 'give_tools_recount_stats_before' );
34
+	do_action('give_tools_recount_stats_before');
35 35
 	?>
36 36
 	<div id="poststuff">
37 37
 		<div class="postbox">
38 38
 
39
-			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2>
39
+			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2>
40 40
 
41 41
 			<div class="inside recount-stats-controls">
42
-				<p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p>
42
+				<p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p>
43 43
 				<form method="post" id="give-tools-recount-form" class="give-export-form">
44 44
 
45
-					<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
45
+					<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
46 46
 
47 47
 					<select name="give-export-class" id="recount-stats-type">
48
-						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option>
49
-						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option>
50
-						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option>
51
-						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option>
52
-						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option>
53
-						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option>
54
-						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option>
48
+						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option>
49
+						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option>
50
+						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option>
51
+						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option>
52
+						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option>
53
+						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option>
54
+						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option>
55 55
 						<?php
56 56
 						/**
57 57
 						 * Fires in the recount stats selectbox.
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 						 *
61 61
 						 * @since 1.5
62 62
 						 */
63
-						do_action( 'give_recount_tool_options' );
63
+						do_action('give_recount_tool_options');
64 64
 						?>
65 65
 					</select>
66 66
 
@@ -68,22 +68,22 @@  discard block
 block discarded – undo
68 68
 						<?php
69 69
 						$args = array(
70 70
 							'name'   => 'form_id',
71
-							'number' => - 1,
71
+							'number' => -1,
72 72
 							'chosen' => true,
73 73
 						);
74
-						echo Give()->html->forms_dropdown( $args );
74
+						echo Give()->html->forms_dropdown($args);
75 75
 						?>
76 76
 					</span>
77 77
 
78
-					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/>
78
+					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/>
79 79
 
80 80
 					<br/>
81 81
 
82 82
 					<span class="give-recount-stats-descriptions">
83
-						<span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span>
84
-						<span id="recount-form"><?php esc_html_e( 'Recalculates the donation and income stats for a specific form.', 'give' ); ?></span>
85
-						<span id="recount-all"><?php esc_html_e( 'Recalculates the earnings and sales stats for all forms.', 'give' ); ?></span>
86
-						<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span>
83
+						<span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span>
84
+						<span id="recount-form"><?php esc_html_e('Recalculates the donation and income stats for a specific form.', 'give'); ?></span>
85
+						<span id="recount-all"><?php esc_html_e('Recalculates the earnings and sales stats for all forms.', 'give'); ?></span>
86
+						<span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span>
87 87
 						<?php
88 88
 						/**
89 89
 						 * Fires in the recount stats description area.
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 						 *
93 93
 						 * @since 1.5
94 94
 						 */
95
-						do_action( 'give_recount_tool_descriptions' );
95
+						do_action('give_recount_tool_descriptions');
96 96
 						?>
97
-						<span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST donations, donors, and related log entries.', 'give' ); ?></span>
98
-						<span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL donations, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span>
97
+						<span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST donations, donors, and related log entries.', 'give'); ?></span>
98
+						<span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL donations, donors, and related log entries regardless of test or live mode.', 'give'); ?></span>
99 99
 					</span>
100 100
 
101 101
 					<span class="spinner"></span>
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 				 *
110 110
 				 * @since 1.5
111 111
 				 */
112
-				do_action( 'give_tools_recount_forms' );
112
+				do_action('give_tools_recount_forms');
113 113
 				?>
114 114
 			</div><!-- .inside -->
115 115
 		</div><!-- .postbox -->
@@ -120,5 +120,5 @@  discard block
 block discarded – undo
120 120
 	 *
121 121
 	 * @since 1.5
122 122
 	 */
123
-	do_action( 'give_tools_recount_stats_after' );
123
+	do_action('give_tools_recount_stats_after');
124 124
 }
125 125
\ No newline at end of file
Please login to merge, or discard this patch.
includes/price-functions.php 1 patch
Spacing   +19 added lines, -19 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,13 +23,13 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return bool true if has variable prices, false otherwise
25 25
  */
26
-function give_has_variable_prices( $form_id = 0 ) {
26
+function give_has_variable_prices($form_id = 0) {
27 27
 
28
-	if ( empty( $form_id ) ) {
28
+	if (empty($form_id)) {
29 29
 		return false;
30 30
 	}
31 31
 
32
-	$form = new Give_Donate_Form( $form_id );
32
+	$form = new Give_Donate_Form($form_id);
33 33
 
34 34
 	return $form->has_variable_prices();
35 35
 }
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
  *
45 45
  * @return array Variable prices
46 46
  */
47
-function give_get_variable_prices( $form_id = 0 ) {
47
+function give_get_variable_prices($form_id = 0) {
48 48
 
49
-	if ( empty( $form_id ) ) {
49
+	if (empty($form_id)) {
50 50
 		return false;
51 51
 	}
52 52
 
53
-	$form = new Give_Donate_Form( $form_id );
53
+	$form = new Give_Donate_Form($form_id);
54 54
 
55 55
 	return $form->prices;
56 56
 
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
  *
68 68
  * @return string $default_price
69 69
  */
70
-function give_get_default_multilevel_amount( $form_id ) {
70
+function give_get_default_multilevel_amount($form_id) {
71 71
 	$default_price = '1.00';
72
-	$prices        = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
72
+	$prices        = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
73 73
 
74
-	foreach ( $prices as $price ) {
74
+	foreach ($prices as $price) {
75 75
 
76
-		if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
76
+		if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
77 77
 			$default_price = $price['_give_amount'];
78 78
 		}
79 79
 
@@ -94,19 +94,19 @@  discard block
 block discarded – undo
94 94
  * @return string $default_price
95 95
  * @since      1.0
96 96
  */
97
-function give_get_default_form_amount( $form_id ) {
97
+function give_get_default_form_amount($form_id) {
98 98
 
99
-	if ( give_has_variable_prices( $form_id ) ) {
99
+	if (give_has_variable_prices($form_id)) {
100 100
 
101
-		$default_amount = give_get_default_multilevel_amount( $form_id );
101
+		$default_amount = give_get_default_multilevel_amount($form_id);
102 102
 
103 103
 	} else {
104 104
 
105
-		$default_amount = get_post_meta( $form_id, '_give_set_price', true );
105
+		$default_amount = get_post_meta($form_id, '_give_set_price', true);
106 106
 
107 107
 	}
108 108
 
109
-	return apply_filters( 'give_default_form_amount', $default_amount );
109
+	return apply_filters('give_default_form_amount', $default_amount);
110 110
 
111 111
 }
112 112
 
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
  *
125 125
  * @return bool
126 126
  */
127
-function give_is_custom_price_mode( $form_id = 0 ) {
127
+function give_is_custom_price_mode($form_id = 0) {
128 128
 
129
-	if ( empty( $form_id ) ) {
129
+	if (empty($form_id)) {
130 130
 		return false;
131 131
 	}
132 132
 
133
-	$form = new Give_Donate_Form( $form_id );
133
+	$form = new Give_Donate_Form($form_id);
134 134
 
135 135
 	return $form->is_custom_price_mode();
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.
includes/class-give-roles.php 1 patch
Spacing   +58 added lines, -58 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
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @access public
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_filter( 'give_map_meta_cap', array( $this, 'meta_caps' ), 10, 4 );
38
+		add_filter('give_map_meta_cap', array($this, 'meta_caps'), 10, 4);
39 39
 	}
40 40
 
41 41
 	/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function add_roles() {
52
-		add_role( 'give_manager', esc_html__( 'Give Manager', 'give' ), array(
52
+		add_role('give_manager', esc_html__('Give Manager', 'give'), array(
53 53
 			'read'                   => true,
54 54
 			'edit_posts'             => true,
55 55
 			'delete_posts'           => true,
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
 			'publish_posts'          => true,
79 79
 			'read_private_pages'     => true,
80 80
 			'read_private_posts'     => true
81
-		) );
81
+		));
82 82
 
83
-		add_role( 'give_accountant', esc_html__( 'Give Accountant', 'give' ), array(
83
+		add_role('give_accountant', esc_html__('Give Accountant', 'give'), array(
84 84
 			'read'         => true,
85 85
 			'edit_posts'   => false,
86 86
 			'delete_posts' => false
87
-		) );
87
+		));
88 88
 
89
-		add_role( 'give_worker', esc_html__( 'Give Worker', 'give' ), array(
89
+		add_role('give_worker', esc_html__('Give Worker', 'give'), array(
90 90
 			'read'         => true,
91 91
 			'edit_posts'   => false,
92 92
 			'upload_files' => true,
93 93
 			'delete_posts' => false
94
-		) );
94
+		));
95 95
 
96 96
 	}
97 97
 
@@ -110,38 +110,38 @@  discard block
 block discarded – undo
110 110
 	public function add_caps() {
111 111
 		global $wp_roles;
112 112
 
113
-		if ( class_exists( 'WP_Roles' ) ) {
114
-			if ( ! isset( $wp_roles ) ) {
113
+		if (class_exists('WP_Roles')) {
114
+			if ( ! isset($wp_roles)) {
115 115
 				$wp_roles = new WP_Roles();
116 116
 			}
117 117
 		}
118 118
 
119
-		if ( is_object( $wp_roles ) ) {
120
-			$wp_roles->add_cap( 'give_manager', 'view_give_reports' );
121
-			$wp_roles->add_cap( 'give_manager', 'view_give_sensitive_data' );
122
-			$wp_roles->add_cap( 'give_manager', 'export_give_reports' );
123
-			$wp_roles->add_cap( 'give_manager', 'manage_give_settings' );
119
+		if (is_object($wp_roles)) {
120
+			$wp_roles->add_cap('give_manager', 'view_give_reports');
121
+			$wp_roles->add_cap('give_manager', 'view_give_sensitive_data');
122
+			$wp_roles->add_cap('give_manager', 'export_give_reports');
123
+			$wp_roles->add_cap('give_manager', 'manage_give_settings');
124 124
 
125
-			$wp_roles->add_cap( 'administrator', 'view_give_reports' );
126
-			$wp_roles->add_cap( 'administrator', 'view_give_sensitive_data' );
127
-			$wp_roles->add_cap( 'administrator', 'export_give_reports' );
128
-			$wp_roles->add_cap( 'administrator', 'manage_give_settings' );
125
+			$wp_roles->add_cap('administrator', 'view_give_reports');
126
+			$wp_roles->add_cap('administrator', 'view_give_sensitive_data');
127
+			$wp_roles->add_cap('administrator', 'export_give_reports');
128
+			$wp_roles->add_cap('administrator', 'manage_give_settings');
129 129
 
130 130
 			// Add the main post type capabilities.
131 131
 			$capabilities = $this->get_core_caps();
132
-			foreach ( $capabilities as $cap_group ) {
133
-				foreach ( $cap_group as $cap ) {
134
-					$wp_roles->add_cap( 'administrator', $cap );
135
-					$wp_roles->add_cap( 'give_manager', $cap );
136
-					$wp_roles->add_cap( 'give_worker', $cap );
132
+			foreach ($capabilities as $cap_group) {
133
+				foreach ($cap_group as $cap) {
134
+					$wp_roles->add_cap('administrator', $cap);
135
+					$wp_roles->add_cap('give_manager', $cap);
136
+					$wp_roles->add_cap('give_worker', $cap);
137 137
 				}
138 138
 			}
139 139
 
140
-			$wp_roles->add_cap( 'give_accountant', 'edit_give_forms' );
141
-			$wp_roles->add_cap( 'give_accountant', 'read_private_give_forms' );
142
-			$wp_roles->add_cap( 'give_accountant', 'view_give_reports' );
143
-			$wp_roles->add_cap( 'give_accountant', 'export_give_reports' );
144
-			$wp_roles->add_cap( 'give_accountant', 'edit_give_payments' );
140
+			$wp_roles->add_cap('give_accountant', 'edit_give_forms');
141
+			$wp_roles->add_cap('give_accountant', 'read_private_give_forms');
142
+			$wp_roles->add_cap('give_accountant', 'view_give_reports');
143
+			$wp_roles->add_cap('give_accountant', 'export_give_reports');
144
+			$wp_roles->add_cap('give_accountant', 'edit_give_payments');
145 145
 
146 146
 		}
147 147
 	}
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 	public function get_core_caps() {
160 160
 		$capabilities = array();
161 161
 
162
-		$capability_types = array( 'give_form', 'give_payment' );
162
+		$capability_types = array('give_form', 'give_payment');
163 163
 
164
-		foreach ( $capability_types as $capability_type ) {
165
-			$capabilities[ $capability_type ] = array(
164
+		foreach ($capability_types as $capability_type) {
165
+			$capabilities[$capability_type] = array(
166 166
 				// Post type.
167 167
 				"edit_{$capability_type}",
168 168
 				"read_{$capability_type}",
@@ -208,22 +208,22 @@  discard block
 block discarded – undo
208 208
 	 *
209 209
 	 * @return array  $caps    Meta capabilities.
210 210
 	 */
211
-	public function meta_caps( $caps, $cap, $user_id, $args ) {
211
+	public function meta_caps($caps, $cap, $user_id, $args) {
212 212
 
213
-		switch ( $cap ) {
213
+		switch ($cap) {
214 214
 
215 215
 			case 'view_give_form_stats' :
216 216
 
217
-				if ( empty( $args[0] ) ) {
217
+				if (empty($args[0])) {
218 218
 					break;
219 219
 				}
220 220
 
221
-				$form = get_post( $args[0] );
222
-				if ( empty( $form ) ) {
221
+				$form = get_post($args[0]);
222
+				if (empty($form)) {
223 223
 					break;
224 224
 				}
225 225
 
226
-				if ( user_can( $user_id, 'view_give_reports' ) || $user_id == $form->post_author ) {
226
+				if (user_can($user_id, 'view_give_reports') || $user_id == $form->post_author) {
227 227
 					$caps = array();
228 228
 				}
229 229
 
@@ -250,41 +250,41 @@  discard block
 block discarded – undo
250 250
 
251 251
 		global $wp_roles;
252 252
 
253
-		if ( class_exists( 'WP_Roles' ) ) {
254
-			if ( ! isset( $wp_roles ) ) {
253
+		if (class_exists('WP_Roles')) {
254
+			if ( ! isset($wp_roles)) {
255 255
 				$wp_roles = new WP_Roles();
256 256
 			}
257 257
 		}
258 258
 
259
-		if ( is_object( $wp_roles ) ) {
259
+		if (is_object($wp_roles)) {
260 260
 			// Give Manager Capabilities.
261
-			$wp_roles->remove_cap( 'give_manager', 'view_give_reports' );
262
-			$wp_roles->remove_cap( 'give_manager', 'view_give_sensitive_data' );
263
-			$wp_roles->remove_cap( 'give_manager', 'export_give_reports' );
264
-			$wp_roles->remove_cap( 'give_manager', 'manage_give_settings' );
261
+			$wp_roles->remove_cap('give_manager', 'view_give_reports');
262
+			$wp_roles->remove_cap('give_manager', 'view_give_sensitive_data');
263
+			$wp_roles->remove_cap('give_manager', 'export_give_reports');
264
+			$wp_roles->remove_cap('give_manager', 'manage_give_settings');
265 265
 
266 266
 			// Site Administrator Capabilities.
267
-			$wp_roles->remove_cap( 'administrator', 'view_give_reports' );
268
-			$wp_roles->remove_cap( 'administrator', 'view_give_sensitive_data' );
269
-			$wp_roles->remove_cap( 'administrator', 'export_give_reports' );
270
-			$wp_roles->remove_cap( 'administrator', 'manage_give_settings' );
267
+			$wp_roles->remove_cap('administrator', 'view_give_reports');
268
+			$wp_roles->remove_cap('administrator', 'view_give_sensitive_data');
269
+			$wp_roles->remove_cap('administrator', 'export_give_reports');
270
+			$wp_roles->remove_cap('administrator', 'manage_give_settings');
271 271
 
272 272
 			// Remove the Main Post Type Capabilities.
273 273
 			$capabilities = $this->get_core_caps();
274 274
 
275
-			foreach ( $capabilities as $cap_group ) {
276
-				foreach ( $cap_group as $cap ) {
277
-					$wp_roles->remove_cap( 'give_manager', $cap );
278
-					$wp_roles->remove_cap( 'administrator', $cap );
279
-					$wp_roles->remove_cap( 'give_worker', $cap );
275
+			foreach ($capabilities as $cap_group) {
276
+				foreach ($cap_group as $cap) {
277
+					$wp_roles->remove_cap('give_manager', $cap);
278
+					$wp_roles->remove_cap('administrator', $cap);
279
+					$wp_roles->remove_cap('give_worker', $cap);
280 280
 				}
281 281
 			}
282 282
 
283 283
 			/** Give Accountant Capabilities */
284
-			$wp_roles->remove_cap( 'give_accountant', 'edit_give_forms' );
285
-			$wp_roles->remove_cap( 'give_accountant', 'read_private_give_forms' );
286
-			$wp_roles->remove_cap( 'give_accountant', 'view_give_reports' );
287
-			$wp_roles->remove_cap( 'give_accountant', 'export_give_reports' );
284
+			$wp_roles->remove_cap('give_accountant', 'edit_give_forms');
285
+			$wp_roles->remove_cap('give_accountant', 'read_private_give_forms');
286
+			$wp_roles->remove_cap('give_accountant', 'view_give_reports');
287
+			$wp_roles->remove_cap('give_accountant', 'export_give_reports');
288 288
 
289 289
 		}
290 290
 	}
Please login to merge, or discard this patch.