Completed
Push — master ( c0aaa9...03e0ea )
by Devin
15:21
created
includes/admin/register-settings.php 1 patch
Spacing   +294 added lines, -294 removed lines patch added patch discarded remove patch
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function __construct() {
45 45
 
46
-		add_action( 'admin_init', array( $this, 'init' ) );
46
+		add_action('admin_init', array($this, 'init'));
47 47
 
48 48
 		//Customize CMB2 URL
49
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
49
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
50 50
 
51 51
 		//Custom CMB2 Settings Fields
52
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
53
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
54
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
55
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
56
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
57
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
58
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
59
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
60
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
52
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
53
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
54
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
55
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
56
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
57
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
58
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
59
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
60
+		add_action('admin_notices', array($this, 'settings_notices'));
61 61
 
62 62
 		// Include CMB CSS in the head to avoid FOUC
63
-		add_action( "admin_print_styles-give_forms_page_give-settings", array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
63
+		add_action("admin_print_styles-give_forms_page_give-settings", array('CMB2_hookup', 'enqueue_cmb_css'));
64 64
 
65 65
 	}
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @since  1.0
70 70
 	 */
71 71
 	public function init() {
72
-		register_setting( $this->key, $this->key );
72
+		register_setting($this->key, $this->key);
73 73
 
74 74
 	}
75 75
 
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return mixed
85 85
 	 */
86
-	public function give_update_cmb_meta_box_url( $url ) {
86
+	public function give_update_cmb_meta_box_url($url) {
87 87
 		//Path to Give's CMB
88
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
88
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
89 89
 	}
90 90
 
91 91
 
@@ -97,27 +97,27 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function give_get_settings_tabs() {
99 99
 
100
-		$settings = $this->give_settings( null );
100
+		$settings = $this->give_settings(null);
101 101
 
102 102
 		$tabs             = array();
103
-		$tabs['general']  = __( 'General', 'give' );
104
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
105
-		$tabs['display']  = __( 'Display Options', 'give' );
106
-		$tabs['emails']   = __( 'Emails', 'give' );
103
+		$tabs['general']  = __('General', 'give');
104
+		$tabs['gateways'] = __('Payment Gateways', 'give');
105
+		$tabs['display']  = __('Display Options', 'give');
106
+		$tabs['emails']   = __('Emails', 'give');
107 107
 
108
-		if ( ! empty( $settings['addons']['fields'] ) ) {
109
-			$tabs['addons'] = __( 'Add-ons', 'give' );
108
+		if ( ! empty($settings['addons']['fields'])) {
109
+			$tabs['addons'] = __('Add-ons', 'give');
110 110
 		}
111 111
 
112
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
113
-			$tabs['licenses'] = __( 'Licenses', 'give' );
112
+		if ( ! empty($settings['licenses']['fields'])) {
113
+			$tabs['licenses'] = __('Licenses', 'give');
114 114
 		}
115 115
 
116
-		$tabs['advanced']    = __( 'Advanced', 'give' );
117
-		$tabs['api']         = __( 'API', 'give' );
118
-		$tabs['system_info'] = __( 'System Info', 'give' );
116
+		$tabs['advanced']    = __('Advanced', 'give');
117
+		$tabs['api']         = __('API', 'give');
118
+		$tabs['system_info'] = __('System Info', 'give');
119 119
 
120
-		return apply_filters( 'give_settings_tabs', $tabs );
120
+		return apply_filters('give_settings_tabs', $tabs);
121 121
 	}
122 122
 
123 123
 
@@ -127,31 +127,31 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function admin_page_display() {
129 129
 
130
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
130
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
131 131
 
132 132
 		?>
133 133
 
134 134
 		<div class="wrap give_settings_page cmb2_options_page <?php echo $this->key; ?>">
135 135
 			<h1 class="nav-tab-wrapper">
136 136
 				<?php
137
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
137
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
138 138
 
139
-					$tab_url = esc_url( add_query_arg( array(
139
+					$tab_url = esc_url(add_query_arg(array(
140 140
 						'settings-updated' => false,
141 141
 						'tab'              => $tab_id
142
-					) ) );
142
+					)));
143 143
 
144 144
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
145 145
 
146
-					echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '">';
147
-					echo esc_html( $tab_name );
146
+					echo '<a href="'.esc_url($tab_url).'" title="'.esc_attr($tab_name).'" class="nav-tab'.$active.'">';
147
+					echo esc_html($tab_name);
148 148
 
149 149
 					echo '</a>';
150 150
 				}
151 151
 				?>
152 152
 			</h1>
153 153
 
154
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
154
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
155 155
 
156 156
 		</div><!-- .wrap -->
157 157
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 *
168 168
 	 * @return array
169 169
 	 */
170
-	public function give_settings( $active_tab ) {
170
+	public function give_settings($active_tab) {
171 171
 
172 172
 		$give_settings = array(
173 173
 			/**
@@ -175,60 +175,60 @@  discard block
 block discarded – undo
175 175
 			 */
176 176
 			'general'     => array(
177 177
 				'id'         => 'options_page',
178
-				'give_title' => __( 'General Settings', 'give' ),
179
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
180
-				'fields'     => apply_filters( 'give_settings_general', array(
178
+				'give_title' => __('General Settings', 'give'),
179
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
180
+				'fields'     => apply_filters('give_settings_general', array(
181 181
 						array(
182
-							'name' => __( 'General Settings', 'give' ),
182
+							'name' => __('General Settings', 'give'),
183 183
 							'desc' => '',
184 184
 							'type' => 'give_title',
185 185
 							'id'   => 'give_title_general_settings_1'
186 186
 						),
187 187
 						array(
188
-							'name'    => __( 'Success Page', 'give' ),
189
-							'desc'    => sprintf( __( 'This is the page donors are sent to after completing their donations. The %1$s[give_receipt]%2$s shortcode should be on this page.', 'give' ), '<code>', '</code>' ),
188
+							'name'    => __('Success Page', 'give'),
189
+							'desc'    => sprintf(__('This is the page donors are sent to after completing their donations. The %1$s[give_receipt]%2$s shortcode should be on this page.', 'give'), '<code>', '</code>'),
190 190
 							'id'      => 'success_page',
191 191
 							'type'    => 'select',
192
-							'options' => give_cmb2_get_post_options( array(
192
+							'options' => give_cmb2_get_post_options(array(
193 193
 								'post_type'   => 'page',
194
-								'numberposts' => - 1
195
-							) ),
194
+								'numberposts' => -1
195
+							)),
196 196
 						),
197 197
 						array(
198
-							'name'    => __( 'Failed Transaction Page', 'give' ),
199
-							'desc'    => __( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ),
198
+							'name'    => __('Failed Transaction Page', 'give'),
199
+							'desc'    => __('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'),
200 200
 							'id'      => 'failure_page',
201 201
 							'type'    => 'select',
202
-							'options' => give_cmb2_get_post_options( array(
202
+							'options' => give_cmb2_get_post_options(array(
203 203
 								'post_type'   => 'page',
204
-								'numberposts' => - 1
205
-							) ),
204
+								'numberposts' => -1
205
+							)),
206 206
 						),
207 207
 						array(
208
-							'name'    => __( 'Donation History Page', 'give' ),
209
-							'desc'    => sprintf( __( 'This page shows a complete donation history for the current user. The %1$s[donation_history]%2$s shortcode should be on this page.', 'give' ), '<code>', '</code>' ),
208
+							'name'    => __('Donation History Page', 'give'),
209
+							'desc'    => sprintf(__('This page shows a complete donation history for the current user. The %1$s[donation_history]%2$s shortcode should be on this page.', 'give'), '<code>', '</code>'),
210 210
 							'id'      => 'history_page',
211 211
 							'type'    => 'select',
212
-							'options' => give_cmb2_get_post_options( array(
212
+							'options' => give_cmb2_get_post_options(array(
213 213
 								'post_type'   => 'page',
214
-								'numberposts' => - 1
215
-							) ),
214
+								'numberposts' => -1
215
+							)),
216 216
 						),
217 217
 						array(
218
-							'name'    => __( 'Base Country', 'give' ),
219
-							'desc'    => __( 'Where does your site operate from?', 'give' ),
218
+							'name'    => __('Base Country', 'give'),
219
+							'desc'    => __('Where does your site operate from?', 'give'),
220 220
 							'id'      => 'base_country',
221 221
 							'type'    => 'select',
222 222
 							'options' => give_get_country_list(),
223 223
 						),
224 224
 						array(
225
-							'name' => __( 'Currency Settings', 'give' ),
225
+							'name' => __('Currency Settings', 'give'),
226 226
 							'desc' => '',
227 227
 							'type' => 'give_title',
228 228
 							'id'   => 'give_title_general_settings_2'
229 229
 						),
230 230
 						array(
231
-							'name'    => __( 'Currency', 'give' ),
231
+							'name'    => __('Currency', 'give'),
232 232
 							'desc'    => 'Choose your currency. Note that some payment gateways have currency restrictions.',
233 233
 							'id'      => 'currency',
234 234
 							'type'    => 'select',
@@ -236,26 +236,26 @@  discard block
 block discarded – undo
236 236
 							'default' => 'USD',
237 237
 						),
238 238
 						array(
239
-							'name'    => __( 'Currency Position', 'give' ),
239
+							'name'    => __('Currency Position', 'give'),
240 240
 							'desc'    => 'Choose the position of the currency sign.',
241 241
 							'id'      => 'currency_position',
242 242
 							'type'    => 'select',
243 243
 							'options' => array(
244
-								'before' => sprintf( __( 'Before - %1$s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
245
-								'after'  => sprintf( __( 'After - 10%1$s', 'give' ), give_currency_symbol( give_get_currency() ) )
244
+								'before' => sprintf(__('Before - %1$s10', 'give'), give_currency_symbol(give_get_currency())),
245
+								'after'  => sprintf(__('After - 10%1$s', 'give'), give_currency_symbol(give_get_currency()))
246 246
 							),
247 247
 							'default' => 'before',
248 248
 						),
249 249
 						array(
250
-							'name'    => __( 'Thousands Separator', 'give' ),
251
-							'desc'    => __( 'The symbol (typically , or .) to separate thousands', 'give' ),
250
+							'name'    => __('Thousands Separator', 'give'),
251
+							'desc'    => __('The symbol (typically , or .) to separate thousands', 'give'),
252 252
 							'id'      => 'thousands_separator',
253 253
 							'type'    => 'text_small',
254 254
 							'default' => ',',
255 255
 						),
256 256
 						array(
257
-							'name'    => __( 'Decimal Separator', 'give' ),
258
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points', 'give' ),
257
+							'name'    => __('Decimal Separator', 'give'),
258
+							'desc'    => __('The symbol (usually , or .) to separate decimal points', 'give'),
259 259
 							'id'      => 'decimal_separator',
260 260
 							'type'    => 'text_small',
261 261
 							'default' => '.',
@@ -268,83 +268,83 @@  discard block
 block discarded – undo
268 268
 			 */
269 269
 			'gateways'    => array(
270 270
 				'id'         => 'options_page',
271
-				'give_title' => __( 'Payment Gateways', 'give' ),
272
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
273
-				'fields'     => apply_filters( 'give_settings_gateways', array(
271
+				'give_title' => __('Payment Gateways', 'give'),
272
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
273
+				'fields'     => apply_filters('give_settings_gateways', array(
274 274
 						array(
275
-							'name' => __( 'Gateways Settings', 'give' ),
275
+							'name' => __('Gateways Settings', 'give'),
276 276
 							'desc' => '',
277 277
 							'id'   => 'give_title_gateway_settings_1',
278 278
 							'type' => 'give_title'
279 279
 						),
280 280
 						array(
281
-							'name' => __( 'Test Mode', 'give' ),
282
-							'desc' => __( 'While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
281
+							'name' => __('Test Mode', 'give'),
282
+							'desc' => __('While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
283 283
 							'id'   => 'test_mode',
284 284
 							'type' => 'checkbox'
285 285
 						),
286 286
 						array(
287
-							'name' => __( 'Enabled Gateways', 'give' ),
288
-							'desc' => __( 'Choose the payment gateways you would like enabled.', 'give' ),
287
+							'name' => __('Enabled Gateways', 'give'),
288
+							'desc' => __('Choose the payment gateways you would like enabled.', 'give'),
289 289
 							'id'   => 'gateways',
290 290
 							'type' => 'enabled_gateways'
291 291
 						),
292 292
 						array(
293
-							'name' => __( 'Default Gateway', 'give' ),
294
-							'desc' => __( 'This is the gateway that will be selected by default.', 'give' ),
293
+							'name' => __('Default Gateway', 'give'),
294
+							'desc' => __('This is the gateway that will be selected by default.', 'give'),
295 295
 							'id'   => 'default_gateway',
296 296
 							'type' => 'default_gateway'
297 297
 						),
298 298
 						array(
299
-							'name' => __( 'PayPal Standard', 'give' ),
299
+							'name' => __('PayPal Standard', 'give'),
300 300
 							'desc' => '',
301 301
 							'type' => 'give_title',
302 302
 							'id'   => 'give_title_gateway_settings_2',
303 303
 						),
304 304
 						array(
305
-							'name' => __( 'PayPal Email', 'give' ),
306
-							'desc' => __( 'Enter your PayPal account\'s email', 'give' ),
305
+							'name' => __('PayPal Email', 'give'),
306
+							'desc' => __('Enter your PayPal account\'s email', 'give'),
307 307
 							'id'   => 'paypal_email',
308 308
 							'type' => 'text_email',
309 309
 						),
310 310
 						array(
311
-							'name' => __( 'PayPal Page Style', 'give' ),
312
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default', 'give' ),
311
+							'name' => __('PayPal Page Style', 'give'),
312
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default', 'give'),
313 313
 							'id'   => 'paypal_page_style',
314 314
 							'type' => 'text',
315 315
 						),
316 316
 						array(
317
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
318
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
317
+							'name'    => __('PayPal Transaction Type', 'give'),
318
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
319 319
 							'id'      => 'paypal_button_type',
320 320
 							'type'    => 'radio_inline',
321 321
 							'options' => array(
322
-								'donation' => __( 'Donation', 'give' ),
323
-								'standard' => __( 'Standard Transaction', 'give' )
322
+								'donation' => __('Donation', 'give'),
323
+								'standard' => __('Standard Transaction', 'give')
324 324
 							),
325 325
 							'default' => 'donation',
326 326
 						),
327 327
 						array(
328
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
329
-							'desc' => __( 'If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give' ),
328
+							'name' => __('Disable PayPal IPN Verification', 'give'),
329
+							'desc' => __('If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give'),
330 330
 							'id'   => 'disable_paypal_verification',
331 331
 							'type' => 'checkbox'
332 332
 						),
333 333
 						array(
334
-							'name' => __( 'Offline Donations', 'give' ),
334
+							'name' => __('Offline Donations', 'give'),
335 335
 							'desc' => '',
336 336
 							'type' => 'give_title',
337 337
 							'id'   => 'give_title_gateway_settings_3',
338 338
 						),
339 339
 						array(
340
-							'name' => __( 'Collect Billing Details', 'give' ),
341
-							'desc' => __( 'This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give' ),
340
+							'name' => __('Collect Billing Details', 'give'),
341
+							'desc' => __('This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give'),
342 342
 							'id'   => 'give_offline_donation_enable_billing_fields',
343 343
 							'type' => 'checkbox'
344 344
 						),
345 345
 						array(
346
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
347
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
346
+							'name'    => __('Offline Donation Instructions', 'give'),
347
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
348 348
 							'id'      => 'global_offline_donation_content',
349 349
 							'default' => give_get_default_offline_donation_content(),
350 350
 							'type'    => 'wysiwyg',
@@ -353,15 +353,15 @@  discard block
 block discarded – undo
353 353
 							)
354 354
 						),
355 355
 						array(
356
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
357
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
356
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
357
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
358 358
 							'id'      => 'offline_donation_subject',
359
-							'default' => __( '{donation} - Offline Donation Instructions', 'give' ),
359
+							'default' => __('{donation} - Offline Donation Instructions', 'give'),
360 360
 							'type'    => 'text'
361 361
 						),
362 362
 						array(
363
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
364
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
363
+							'name'    => __('Offline Donation Email Instructions', 'give'),
364
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
365 365
 							'id'      => 'global_offline_donation_email',
366 366
 							'default' => give_get_default_offline_donation_email_content(),
367 367
 							'type'    => 'wysiwyg',
@@ -375,93 +375,93 @@  discard block
 block discarded – undo
375 375
 			/** Display Settings */
376 376
 			'display'     => array(
377 377
 				'id'         => 'options_page',
378
-				'give_title' => __( 'Display Settings', 'give' ),
379
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
380
-				'fields'     => apply_filters( 'give_settings_display', array(
378
+				'give_title' => __('Display Settings', 'give'),
379
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
380
+				'fields'     => apply_filters('give_settings_display', array(
381 381
 						array(
382
-							'name' => __( 'Display Settings', 'give' ),
382
+							'name' => __('Display Settings', 'give'),
383 383
 							'desc' => '',
384 384
 							'id'   => 'give_title_display_settings_1',
385 385
 							'type' => 'give_title'
386 386
 						),
387 387
 						array(
388
-							'name' => __( 'Disable CSS', 'give' ),
389
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
388
+							'name' => __('Disable CSS', 'give'),
389
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
390 390
 							'id'   => 'disable_css',
391 391
 							'type' => 'checkbox'
392 392
 						),
393 393
 						array(
394
-							'name' => __( 'Enable Floating Labels', 'give' ),
395
-							'desc' => sprintf( __( 'Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) ),
394
+							'name' => __('Enable Floating Labels', 'give'),
395
+							'desc' => sprintf(__('Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url("http://bradfrost.com/blog/post/float-label-pattern/")),
396 396
 							'id'   => 'enable_floatlabels',
397 397
 							'type' => 'checkbox'
398 398
 						),
399 399
 						array(
400
-							'name' => __( 'Disable Welcome Screen', 'give' ),
401
-							'desc' => sprintf( __( 'Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the Welcome Screen <a href="%s">here</a> if you want in the future.', 'give' ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
400
+							'name' => __('Disable Welcome Screen', 'give'),
401
+							'desc' => sprintf(__('Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the Welcome Screen <a href="%s">here</a> if you want in the future.', 'give'), esc_url(admin_url('index.php?page=give-about'))),
402 402
 							'id'   => 'disable_welcome',
403 403
 							'type' => 'checkbox'
404 404
 						),
405 405
 						array(
406
-							'name' => __( 'Post Types', 'give' ),
406
+							'name' => __('Post Types', 'give'),
407 407
 							'desc' => '',
408 408
 							'id'   => 'give_title_display_settings_2',
409 409
 							'type' => 'give_title'
410 410
 						),
411 411
 						array(
412
-							'name' => __( 'Disable Form Single Views', 'give' ),
413
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
412
+							'name' => __('Disable Form Single Views', 'give'),
413
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
414 414
 							'id'   => 'disable_forms_singular',
415 415
 							'type' => 'checkbox'
416 416
 						),
417 417
 						array(
418
-							'name' => __( 'Disable Form Archives', 'give' ),
419
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
418
+							'name' => __('Disable Form Archives', 'give'),
419
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
420 420
 							'id'   => 'disable_forms_archives',
421 421
 							'type' => 'checkbox'
422 422
 						),
423 423
 						array(
424
-							'name' => __( 'Disable Form Excerpts', 'give' ),
425
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
424
+							'name' => __('Disable Form Excerpts', 'give'),
425
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
426 426
 							'id'   => 'disable_forms_excerpt',
427 427
 							'type' => 'checkbox'
428 428
 						),
429 429
 
430 430
 						array(
431
-							'name'    => __( 'Featured Image Size', 'give' ),
432
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give' ),
431
+							'name'    => __('Featured Image Size', 'give'),
432
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give'),
433 433
 							'id'      => 'featured_image_size',
434 434
 							'type'    => 'select',
435 435
 							'default' => 'large',
436 436
 							'options' => give_get_featured_image_sizes()
437 437
 						),
438 438
 						array(
439
-							'name' => __( 'Disable Form Featured Image', 'give' ),
440
-							'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
439
+							'name' => __('Disable Form Featured Image', 'give'),
440
+							'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
441 441
 							'id'   => 'disable_form_featured_img',
442 442
 							'type' => 'checkbox'
443 443
 						),
444 444
 						array(
445
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
446
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
445
+							'name' => __('Disable Single Form Sidebar', 'give'),
446
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
447 447
 							'id'   => 'disable_form_sidebar',
448 448
 							'type' => 'checkbox'
449 449
 						),
450 450
 						array(
451
-							'name' => __( 'Taxonomies', 'give' ),
451
+							'name' => __('Taxonomies', 'give'),
452 452
 							'desc' => '',
453 453
 							'id'   => 'give_title_display_settings_3',
454 454
 							'type' => 'give_title'
455 455
 						),
456 456
 						array(
457
-							'name' => __( 'Enable Form Categories', 'give' ),
458
-							'desc' => __( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ),
457
+							'name' => __('Enable Form Categories', 'give'),
458
+							'desc' => __('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'),
459 459
 							'id'   => 'enable_categories',
460 460
 							'type' => 'checkbox'
461 461
 						),
462 462
 						array(
463
-							'name' => __( 'Enable Form Tags', 'give' ),
464
-							'desc' => __( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ),
463
+							'name' => __('Enable Form Tags', 'give'),
464
+							'desc' => __('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'),
465 465
 							'id'   => 'enable_tags',
466 466
 							'type' => 'checkbox'
467 467
 						),
@@ -474,93 +474,93 @@  discard block
 block discarded – undo
474 474
 			 */
475 475
 			'emails'      => array(
476 476
 				'id'         => 'options_page',
477
-				'give_title' => __( 'Give Email Settings', 'give' ),
478
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
479
-				'fields'     => apply_filters( 'give_settings_emails', array(
477
+				'give_title' => __('Give Email Settings', 'give'),
478
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
479
+				'fields'     => apply_filters('give_settings_emails', array(
480 480
 						array(
481
-							'name' => __( 'Email Settings', 'give' ),
481
+							'name' => __('Email Settings', 'give'),
482 482
 							'desc' => '',
483 483
 							'id'   => 'give_title_email_settings_1',
484 484
 							'type' => 'give_title'
485 485
 						),
486 486
 						array(
487 487
 							'id'      => 'email_template',
488
-							'name'    => __( 'Email Template', 'give' ),
489
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
488
+							'name'    => __('Email Template', 'give'),
489
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
490 490
 							'type'    => 'select',
491 491
 							'options' => give_get_email_templates()
492 492
 						),
493 493
 						array(
494 494
 							'id'   => 'email_logo',
495
-							'name' => __( 'Logo', 'give' ),
496
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
495
+							'name' => __('Logo', 'give'),
496
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
497 497
 							'type' => 'file'
498 498
 						),
499 499
 						array(
500 500
 							'id'      => 'from_name',
501
-							'name'    => __( 'From Name', 'give' ),
502
-							'desc'    => __( 'The name donation receipts are said to come from. This should probably be your site or shop name.', 'give' ),
503
-							'default' => get_bloginfo( 'name' ),
501
+							'name'    => __('From Name', 'give'),
502
+							'desc'    => __('The name donation receipts are said to come from. This should probably be your site or shop name.', 'give'),
503
+							'default' => get_bloginfo('name'),
504 504
 							'type'    => 'text'
505 505
 						),
506 506
 						array(
507 507
 							'id'      => 'from_email',
508
-							'name'    => __( 'From Email', 'give' ),
509
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
510
-							'default' => get_bloginfo( 'admin_email' ),
508
+							'name'    => __('From Email', 'give'),
509
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
510
+							'default' => get_bloginfo('admin_email'),
511 511
 							'type'    => 'text'
512 512
 						),
513 513
 						array(
514
-							'name' => __( 'Donation Receipt', 'give' ),
514
+							'name' => __('Donation Receipt', 'give'),
515 515
 							'desc' => '',
516 516
 							'id'   => 'give_title_email_settings_2',
517 517
 							'type' => 'give_title'
518 518
 						),
519 519
 						array(
520 520
 							'id'      => 'donation_subject',
521
-							'name'    => __( 'Donation Email Subject', 'give' ),
522
-							'desc'    => __( 'Enter the subject line for the donation receipt email', 'give' ),
523
-							'default' => __( 'Donation Receipt', 'give' ),
521
+							'name'    => __('Donation Email Subject', 'give'),
522
+							'desc'    => __('Enter the subject line for the donation receipt email', 'give'),
523
+							'default' => __('Donation Receipt', 'give'),
524 524
 							'type'    => 'text'
525 525
 						),
526 526
 						array(
527 527
 							'id'      => 'donation_receipt',
528
-							'name'    => __( 'Donation Receipt', 'give' ),
529
-							'desc'    => __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags:', 'give' ) . '<br/>' . give_get_emails_tags_list(),
528
+							'name'    => __('Donation Receipt', 'give'),
529
+							'desc'    => __('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags:', 'give').'<br/>'.give_get_emails_tags_list(),
530 530
 							'type'    => 'wysiwyg',
531
-							'default' => __( "Dear", "give" ) . " {name},\n\n" . __( "Thank you for your donation. Your generosity is appreciated! Please click on the link below to view your receipt.", "give" ) . "\n\n{receipt_link}\n\nSincerely,\n{sitename}"
531
+							'default' => __("Dear", "give")." {name},\n\n".__("Thank you for your donation. Your generosity is appreciated! Please click on the link below to view your receipt.", "give")."\n\n{receipt_link}\n\nSincerely,\n{sitename}"
532 532
 						),
533 533
 						array(
534
-							'name' => __( 'New Donation Notification', 'give' ),
534
+							'name' => __('New Donation Notification', 'give'),
535 535
 							'desc' => '',
536 536
 							'id'   => 'give_title_email_settings_3',
537 537
 							'type' => 'give_title'
538 538
 						),
539 539
 						array(
540 540
 							'id'      => 'donation_notification_subject',
541
-							'name'    => __( 'Donation Notification Subject', 'give' ),
542
-							'desc'    => __( 'Enter the subject line for the donation notification email', 'give' ),
541
+							'name'    => __('Donation Notification Subject', 'give'),
542
+							'desc'    => __('Enter the subject line for the donation notification email', 'give'),
543 543
 							'type'    => 'text',
544
-							'default' => __( 'New Donation - #{payment_id}', 'give' )
544
+							'default' => __('New Donation - #{payment_id}', 'give')
545 545
 						),
546 546
 						array(
547 547
 							'id'      => 'donation_notification',
548
-							'name'    => __( 'Donation Notification', 'give' ),
549
-							'desc'    => __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags:', 'give' ) . '<br/>' . give_get_emails_tags_list(),
548
+							'name'    => __('Donation Notification', 'give'),
549
+							'desc'    => __('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags:', 'give').'<br/>'.give_get_emails_tags_list(),
550 550
 							'type'    => 'wysiwyg',
551 551
 							'default' => give_get_default_donation_notification_email()
552 552
 						),
553 553
 						array(
554 554
 							'id'      => 'admin_notice_emails',
555
-							'name'    => __( 'Donation Notification Emails', 'give' ),
556
-							'desc'    => sprintf( __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give' ), '<span class="give-underline">', '</span>' ),
555
+							'name'    => __('Donation Notification Emails', 'give'),
556
+							'desc'    => sprintf(__('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give'), '<span class="give-underline">', '</span>'),
557 557
 							'type'    => 'textarea',
558
-							'default' => get_bloginfo( 'admin_email' )
558
+							'default' => get_bloginfo('admin_email')
559 559
 						),
560 560
 						array(
561 561
 							'id'   => 'disable_admin_notices',
562
-							'name' => __( 'Disable Admin Notifications', 'give' ),
563
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
562
+							'name' => __('Disable Admin Notifications', 'give'),
563
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
564 564
 							'type' => 'checkbox'
565 565
 						)
566 566
 					)
@@ -569,76 +569,76 @@  discard block
 block discarded – undo
569 569
 			/** Extension Settings */
570 570
 			'addons'      => array(
571 571
 				'id'         => 'options_page',
572
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
573
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
574
-				'fields'     => apply_filters( 'give_settings_addons', array()
572
+				'give_title' => __('Give Add-ons Settings', 'give'),
573
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
574
+				'fields'     => apply_filters('give_settings_addons', array()
575 575
 				)
576 576
 			),
577 577
 			/** Licenses Settings */
578 578
 			'licenses'    => array(
579 579
 				'id'         => 'options_page',
580
-				'give_title' => __( 'Give Licenses', 'give' ),
581
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
582
-				'fields'     => apply_filters( 'give_settings_licenses', array()
580
+				'give_title' => __('Give Licenses', 'give'),
581
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
582
+				'fields'     => apply_filters('give_settings_licenses', array()
583 583
 				)
584 584
 			),
585 585
 			/** Advanced Options */
586 586
 			'advanced'    => array(
587 587
 				'id'         => 'options_page',
588
-				'give_title' => __( 'Advanced Options', 'give' ),
589
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
590
-				'fields'     => apply_filters( 'give_settings_advanced', array(
588
+				'give_title' => __('Advanced Options', 'give'),
589
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
590
+				'fields'     => apply_filters('give_settings_advanced', array(
591 591
 						array(
592
-							'name' => __( 'Session Control', 'give' ),
592
+							'name' => __('Session Control', 'give'),
593 593
 							'desc' => '',
594 594
 							'id'   => 'give_title_session_control_1',
595 595
 							'type' => 'give_title'
596 596
 						),
597 597
 						array(
598 598
 							'id'      => 'session_lifetime',
599
-							'name'    => __( 'Session Lifetime', 'give' ),
600
-							'desc'    => __( 'Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in.', 'give' ),
599
+							'name'    => __('Session Lifetime', 'give'),
600
+							'desc'    => __('Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in.', 'give'),
601 601
 							'type'    => 'select',
602 602
 							'options' => array(
603
-								'86400'  => __( '24 Hours', 'give' ),
604
-								'172800' => __( '48 Hours', 'give' ),
605
-								'259200' => __( '72 Hours', 'give' ),
606
-								'604800' => __( '1 Week', 'give' ),
603
+								'86400'  => __('24 Hours', 'give'),
604
+								'172800' => __('48 Hours', 'give'),
605
+								'259200' => __('72 Hours', 'give'),
606
+								'604800' => __('1 Week', 'give'),
607 607
 							)
608 608
 						),
609 609
 						array(
610
-							'name' => __( 'Data Control', 'give' ),
610
+							'name' => __('Data Control', 'give'),
611 611
 							'desc' => '',
612 612
 							'id'   => 'give_title_data_control_2',
613 613
 							'type' => 'give_title'
614 614
 						),
615 615
 						array(
616
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
617
-							'desc' => __( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ),
616
+							'name' => __('Remove All Data on Uninstall?', 'give'),
617
+							'desc' => __('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'),
618 618
 							'id'   => 'uninstall_on_delete',
619 619
 							'type' => 'checkbox'
620 620
 						),
621 621
 						array(
622
-							'name' => __( 'Filter Control', 'give' ),
622
+							'name' => __('Filter Control', 'give'),
623 623
 							'desc' => '',
624 624
 							'id'   => 'give_title_filter_control',
625 625
 							'type' => 'give_title'
626 626
 						),
627 627
 						array(
628
-							'name' => __( 'Disable <code>the_content</code> filter', 'give' ),
629
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%s" target="_blank">Learn more</a> about the_content filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ) ),
628
+							'name' => __('Disable <code>the_content</code> filter', 'give'),
629
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%s" target="_blank">Learn more</a> about the_content filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content')),
630 630
 							'id'   => 'disable_the_content_filter',
631 631
 							'type' => 'checkbox'
632 632
 						),
633 633
 						array(
634
-							'name' => __( 'Script Loading', 'give' ),
634
+							'name' => __('Script Loading', 'give'),
635 635
 							'desc' => '',
636 636
 							'id'   => 'give_title_script_control',
637 637
 							'type' => 'give_title'
638 638
 						),
639 639
 						array(
640
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
641
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
640
+							'name' => __('Load Scripts in Footer?', 'give'),
641
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
642 642
 							'id'   => 'scripts_footer',
643 643
 							'type' => 'checkbox'
644 644
 						)
@@ -648,13 +648,13 @@  discard block
 block discarded – undo
648 648
 			/** API Settings */
649 649
 			'api'         => array(
650 650
 				'id'         => 'options_page',
651
-				'give_title' => __( 'API', 'give' ),
652
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
651
+				'give_title' => __('API', 'give'),
652
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
653 653
 				'show_names' => false, // Hide field names on the left
654
-				'fields'     => apply_filters( 'give_settings_system', array(
654
+				'fields'     => apply_filters('give_settings_system', array(
655 655
 						array(
656 656
 							'id'   => 'api',
657
-							'name' => __( 'API', 'give' ),
657
+							'name' => __('API', 'give'),
658 658
 							'type' => 'api'
659 659
 						)
660 660
 					)
@@ -663,13 +663,13 @@  discard block
 block discarded – undo
663 663
 			/** Licenses Settings */
664 664
 			'system_info' => array(
665 665
 				'id'         => 'options_page',
666
-				'give_title' => __( 'System Info', 'give' ),
667
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
668
-				'fields'     => apply_filters( 'give_settings_system', array(
666
+				'give_title' => __('System Info', 'give'),
667
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
668
+				'fields'     => apply_filters('give_settings_system', array(
669 669
 						array(
670 670
 							'id'   => 'system_info',
671
-							'name' => __( 'System Info', 'give' ),
672
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
671
+							'name' => __('System Info', 'give'),
672
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
673 673
 							'type' => 'system_info'
674 674
 						)
675 675
 					)
@@ -678,12 +678,12 @@  discard block
 block discarded – undo
678 678
 		);
679 679
 
680 680
 		//Return all settings array if necessary
681
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
682
-			return apply_filters( 'give_registered_settings', $give_settings );
681
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
682
+			return apply_filters('give_registered_settings', $give_settings);
683 683
 		}
684 684
 
685 685
 		// Add other tabs and settings fields as needed
686
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
686
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
687 687
 
688 688
 	}
689 689
 
@@ -692,11 +692,11 @@  discard block
 block discarded – undo
692 692
 	 */
693 693
 	public function settings_notices() {
694 694
 
695
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
695
+		if ( ! isset($_POST['give_settings_saved'])) {
696 696
 			return;
697 697
 		}
698 698
 
699
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
699
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
700 700
 
701 701
 	}
702 702
 
@@ -710,17 +710,17 @@  discard block
 block discarded – undo
710 710
 	 *
711 711
 	 * @return mixed          Field value or exception is thrown
712 712
 	 */
713
-	public function __get( $field ) {
713
+	public function __get($field) {
714 714
 
715 715
 		// Allowed fields to retrieve
716
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
716
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
717 717
 			return $this->{$field};
718 718
 		}
719
-		if ( 'option_metabox' === $field ) {
719
+		if ('option_metabox' === $field) {
720 720
 			return $this->option_metabox();
721 721
 		}
722 722
 
723
-		throw new Exception( 'Invalid property: ' . $field );
723
+		throw new Exception('Invalid property: '.$field);
724 724
 	}
725 725
 
726 726
 
@@ -737,12 +737,12 @@  discard block
 block discarded – undo
737 737
  *
738 738
  * @return mixed        Option value
739 739
  */
740
-function give_get_option( $key = '', $default = false ) {
740
+function give_get_option($key = '', $default = false) {
741 741
 	global $give_options;
742
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
743
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
742
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
743
+	$value = apply_filters('give_get_option', $value, $key, $default);
744 744
 
745
-	return apply_filters( 'give_get_option_' . $key, $value, $key, $default );
745
+	return apply_filters('give_get_option_'.$key, $value, $key, $default);
746 746
 }
747 747
 
748 748
 
@@ -760,33 +760,33 @@  discard block
 block discarded – undo
760 760
  *
761 761
  * @return boolean True if updated, false if not.
762 762
  */
763
-function give_update_option( $key = '', $value = false ) {
763
+function give_update_option($key = '', $value = false) {
764 764
 
765 765
 	// If no key, exit
766
-	if ( empty( $key ) ) {
766
+	if (empty($key)) {
767 767
 		return false;
768 768
 	}
769 769
 
770
-	if ( empty( $value ) ) {
771
-		$remove_option = give_delete_option( $key );
770
+	if (empty($value)) {
771
+		$remove_option = give_delete_option($key);
772 772
 
773 773
 		return $remove_option;
774 774
 	}
775 775
 
776 776
 	// First let's grab the current settings
777
-	$options = get_option( 'give_settings' );
777
+	$options = get_option('give_settings');
778 778
 
779 779
 	// Let's let devs alter that value coming in
780
-	$value = apply_filters( 'give_update_option', $value, $key );
780
+	$value = apply_filters('give_update_option', $value, $key);
781 781
 
782 782
 	// Next let's try to update the value
783
-	$options[ $key ] = $value;
784
-	$did_update      = update_option( 'give_settings', $options );
783
+	$options[$key] = $value;
784
+	$did_update      = update_option('give_settings', $options);
785 785
 
786 786
 	// If it updated, let's update the global variable
787
-	if ( $did_update ) {
787
+	if ($did_update) {
788 788
 		global $give_options;
789
-		$give_options[ $key ] = $value;
789
+		$give_options[$key] = $value;
790 790
 	}
791 791
 
792 792
 	return $did_update;
@@ -803,27 +803,27 @@  discard block
 block discarded – undo
803 803
  *
804 804
  * @return boolean True if updated, false if not.
805 805
  */
806
-function give_delete_option( $key = '' ) {
806
+function give_delete_option($key = '') {
807 807
 
808 808
 	// If no key, exit
809
-	if ( empty( $key ) ) {
809
+	if (empty($key)) {
810 810
 		return false;
811 811
 	}
812 812
 
813 813
 	// First let's grab the current settings
814
-	$options = get_option( 'give_settings' );
814
+	$options = get_option('give_settings');
815 815
 
816 816
 	// Next let's try to update the value
817
-	if ( isset( $options[ $key ] ) ) {
817
+	if (isset($options[$key])) {
818 818
 
819
-		unset( $options[ $key ] );
819
+		unset($options[$key]);
820 820
 
821 821
 	}
822 822
 
823
-	$did_update = update_option( 'give_settings', $options );
823
+	$did_update = update_option('give_settings', $options);
824 824
 
825 825
 	// If it updated, let's update the global variable
826
-	if ( $did_update ) {
826
+	if ($did_update) {
827 827
 		global $give_options;
828 828
 		$give_options = $options;
829 829
 	}
@@ -842,9 +842,9 @@  discard block
 block discarded – undo
842 842
  */
843 843
 function give_get_settings() {
844 844
 
845
-	$settings = get_option( 'give_settings' );
845
+	$settings = get_option('give_settings');
846 846
 
847
-	return (array) apply_filters( 'give_get_settings', $settings );
847
+	return (array) apply_filters('give_get_settings', $settings);
848 848
 
849 849
 }
850 850
 
@@ -862,25 +862,25 @@  discard block
 block discarded – undo
862 862
  *
863 863
  * @return array
864 864
  */
865
-function give_settings_array_insert( $array, $position, $insert ) {
866
-	if ( is_int( $position ) ) {
867
-		array_splice( $array, $position, 0, $insert );
865
+function give_settings_array_insert($array, $position, $insert) {
866
+	if (is_int($position)) {
867
+		array_splice($array, $position, 0, $insert);
868 868
 	} else {
869 869
 
870
-		foreach ( $array as $index => $subarray ) {
871
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
870
+		foreach ($array as $index => $subarray) {
871
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
872 872
 				$pos = $index;
873 873
 			}
874 874
 		}
875 875
 
876
-		if ( ! isset( $pos ) ) {
876
+		if ( ! isset($pos)) {
877 877
 			return $array;
878 878
 		}
879 879
 
880 880
 		$array = array_merge(
881
-			array_slice( $array, 0, $pos ),
881
+			array_slice($array, 0, $pos),
882 882
 			$insert,
883
-			array_slice( $array, $pos )
883
+			array_slice($array, $pos)
884 884
 		);
885 885
 	}
886 886
 
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
  *
904 904
  * @return void
905 905
  */
906
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
906
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
907 907
 
908 908
 	$id                = $field_type_object->field->args['id'];
909 909
 	$field_description = $field_type_object->field->args['desc'];
@@ -911,21 +911,21 @@  discard block
 block discarded – undo
911 911
 
912 912
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
913 913
 
914
-	foreach ( $gateways as $key => $option ) :
914
+	foreach ($gateways as $key => $option) :
915 915
 
916
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
916
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
917 917
 			$enabled = '1';
918 918
 		} else {
919 919
 			$enabled = null;
920 920
 		}
921 921
 
922
-		echo '<li><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
923
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
922
+		echo '<li><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
923
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
924 924
 
925 925
 	endforeach;
926 926
 
927
-	if ( $field_description ) {
928
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
927
+	if ($field_description) {
928
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
929 929
 	}
930 930
 
931 931
 	echo '</ul>';
@@ -944,31 +944,31 @@  discard block
 block discarded – undo
944 944
  *
945 945
  * @return void
946 946
  */
947
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
947
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
948 948
 
949 949
 	$id                = $field_type_object->field->args['id'];
950 950
 	$field_description = $field_type_object->field->args['desc'];
951 951
 	$gateways          = give_get_enabled_payment_gateways();
952 952
 
953
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
953
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
954 954
 
955 955
 	//Add a field to the Give Form admin single post view of this field
956
-	if ( $field_type_object->field->object_type === 'post' ) {
957
-		echo '<option value="global">' . __( 'Global Default', 'give' ) . '</option>';
956
+	if ($field_type_object->field->object_type === 'post') {
957
+		echo '<option value="global">'.__('Global Default', 'give').'</option>';
958 958
 	}
959 959
 
960
-	foreach ( $gateways as $key => $option ) :
960
+	foreach ($gateways as $key => $option) :
961 961
 
962
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
962
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
963 963
 
964 964
 
965
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
965
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
966 966
 
967 967
 	endforeach;
968 968
 
969 969
 	echo '</select>';
970 970
 
971
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
971
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
972 972
 
973 973
 }
974 974
 
@@ -983,13 +983,13 @@  discard block
 block discarded – undo
983 983
  *
984 984
  * @return void
985 985
  */
986
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
986
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
987 987
 
988 988
 	$id                = $field_type_object->field->args['id'];
989 989
 	$title             = $field_type_object->field->args['name'];
990 990
 	$field_description = $field_type_object->field->args['desc'];
991 991
 
992
-	echo '<hr>' . $field_description;
992
+	echo '<hr>'.$field_description;
993 993
 
994 994
 }
995 995
 
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
  *
1005 1005
  * @return void
1006 1006
  */
1007
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1007
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1008 1008
 
1009 1009
 	$id                = $field_type_object->field->args['id'];
1010 1010
 	$title             = $field_type_object->field->args['name'];
@@ -1024,25 +1024,25 @@  discard block
 block discarded – undo
1024 1024
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1025 1025
  * @return array An array of options that matches the CMB2 options array
1026 1026
  */
1027
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1027
+function give_cmb2_get_post_options($query_args, $force = false) {
1028 1028
 
1029
-	$post_options = array( '' => '' ); // Blank option
1029
+	$post_options = array('' => ''); // Blank option
1030 1030
 
1031
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1031
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1032 1032
 		return $post_options;
1033 1033
 	}
1034 1034
 
1035
-	$args = wp_parse_args( $query_args, array(
1035
+	$args = wp_parse_args($query_args, array(
1036 1036
 		'post_type'   => 'page',
1037 1037
 		'numberposts' => 10,
1038
-	) );
1038
+	));
1039 1039
 
1040
-	$posts = get_posts( $args );
1040
+	$posts = get_posts($args);
1041 1041
 
1042
-	if ( $posts ) {
1043
-		foreach ( $posts as $post ) {
1042
+	if ($posts) {
1043
+		foreach ($posts as $post) {
1044 1044
 
1045
-			$post_options[ $post->ID ] = $post->post_title;
1045
+			$post_options[$post->ID] = $post->post_title;
1046 1046
 
1047 1047
 		}
1048 1048
 	}
@@ -1059,14 +1059,14 @@  discard block
 block discarded – undo
1059 1059
  * @since 1.0
1060 1060
  */
1061 1061
 
1062
-add_filter( 'cmb2_get_metabox_form_format', 'give_modify_cmb2_form_output', 10, 3 );
1062
+add_filter('cmb2_get_metabox_form_format', 'give_modify_cmb2_form_output', 10, 3);
1063 1063
 
1064
-function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
1064
+function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
1065 1065
 
1066 1066
 	//only modify the give settings form
1067
-	if ( 'give_settings' == $object_id && 'options_page' == $cmb->cmb_id ) {
1067
+	if ('give_settings' == $object_id && 'options_page' == $cmb->cmb_id) {
1068 1068
 
1069
-		return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
1069
+		return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div></form>';
1070 1070
 	}
1071 1071
 
1072 1072
 	return $form_format;
@@ -1084,17 +1084,17 @@  discard block
 block discarded – undo
1084 1084
 	global $_wp_additional_image_sizes;
1085 1085
 	$sizes = array();
1086 1086
 
1087
-	foreach ( get_intermediate_image_sizes() as $_size ) {
1087
+	foreach (get_intermediate_image_sizes() as $_size) {
1088 1088
 		
1089
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1090
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1091
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1092
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1089
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1090
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1091
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1092
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1093 1093
 		}
1094 1094
 
1095 1095
 	}
1096 1096
 
1097
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1097
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1098 1098
 }
1099 1099
 
1100 1100
 
@@ -1108,35 +1108,35 @@  discard block
 block discarded – undo
1108 1108
  *
1109 1109
  * @return void
1110 1110
  */
1111
-if ( ! function_exists( 'give_license_key_callback' ) ) {
1112
-	function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1111
+if ( ! function_exists('give_license_key_callback')) {
1112
+	function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1113 1113
 
1114 1114
 		$id                = $field_type_object->field->args['id'];
1115 1115
 		$field_description = $field_type_object->field->args['desc'];
1116
-		$license_status    = get_option( $field_type_object->field->args['options']['is_valid_license_option'] );
1116
+		$license_status    = get_option($field_type_object->field->args['options']['is_valid_license_option']);
1117 1117
 		$field_classes     = 'regular-text give-license-field';
1118
-		$type              = empty( $escaped_value ) ? 'text' : 'password';
1118
+		$type              = empty($escaped_value) ? 'text' : 'password';
1119 1119
 
1120
-		if ( $license_status === 'valid' ) {
1120
+		if ($license_status === 'valid') {
1121 1121
 			$field_classes .= ' give-license-active';
1122 1122
 		}
1123 1123
 
1124
-		$html = $field_type_object->input( array(
1124
+		$html = $field_type_object->input(array(
1125 1125
 			'class' => $field_classes,
1126 1126
 			'type'  => $type
1127
-		) );
1127
+		));
1128 1128
 
1129 1129
 		//License is active so show deactivate button
1130
-		if ( $license_status === 'valid' ) {
1131
-			$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . __( 'Deactivate License', 'give' ) . '"/>';
1130
+		if ($license_status === 'valid') {
1131
+			$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.__('Deactivate License', 'give').'"/>';
1132 1132
 		} else {
1133 1133
 			//This license is not valid so delete it
1134
-			give_delete_option( $id );
1134
+			give_delete_option($id);
1135 1135
 		}
1136 1136
 
1137
-		$html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1137
+		$html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1138 1138
 
1139
-		wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1139
+		wp_nonce_field($id.'-nonce', $id.'-nonce');
1140 1140
 
1141 1141
 		echo $html;
1142 1142
 	}
@@ -1151,13 +1151,13 @@  discard block
 block discarded – undo
1151 1151
  */
1152 1152
 function give_api_callback() {
1153 1153
 
1154
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1154
+	if ( ! current_user_can('manage_give_settings')) {
1155 1155
 		return;
1156 1156
 	}
1157 1157
 
1158
-	do_action( 'give_tools_api_keys_before' );
1158
+	do_action('give_tools_api_keys_before');
1159 1159
 
1160
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1160
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1161 1161
 
1162 1162
 	$api_keys_table = new Give_API_Keys_Table();
1163 1163
 	$api_keys_table->prepare_items();
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 	?>
1166 1166
 	<p>
1167 1167
 		<?php printf(
1168
-			__( 'API keys allow users to use the <a href="%s">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%s">Zapier</a>.', 'give' ),
1168
+			__('API keys allow users to use the <a href="%s">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%s">Zapier</a>.', 'give'),
1169 1169
 			'https://givewp.com/documentation/give-api-reference/',
1170 1170
 			'https://givewp.com/addons/zapier/'
1171 1171
 		); ?>
@@ -1178,10 +1178,10 @@  discard block
 block discarded – undo
1178 1178
 	</style>
1179 1179
 	<?php
1180 1180
 
1181
-	do_action( 'give_tools_api_keys_after' );
1181
+	do_action('give_tools_api_keys_after');
1182 1182
 }
1183 1183
 
1184
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1184
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1185 1185
 
1186 1186
 /**
1187 1187
  * Hook Callback
@@ -1194,8 +1194,8 @@  discard block
 block discarded – undo
1194 1194
  *
1195 1195
  * @return void
1196 1196
  */
1197
-function give_hook_callback( $args ) {
1198
-	do_action( 'give_' . $args['id'] );
1197
+function give_hook_callback($args) {
1198
+	do_action('give_'.$args['id']);
1199 1199
 }
1200 1200
 
1201 1201
 /**
@@ -1205,10 +1205,10 @@  discard block
 block discarded – undo
1205 1205
  *
1206 1206
  */
1207 1207
 
1208
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1209
-	require_once WP_PLUGIN_DIR . '/cmb2/init.php';
1210
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1211
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
1212
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1213
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1208
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1209
+	require_once WP_PLUGIN_DIR.'/cmb2/init.php';
1210
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1211
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php';
1212
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1213
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1214 1214
 }
1215 1215
\ No newline at end of file
Please login to merge, or discard this patch.