Completed
Push — master ( 829642...835e66 )
by Devin
9s
created
includes/admin/class-give-settings.php 1 patch
Spacing   +309 added lines, -309 removed lines patch added patch discarded remove patch
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function __construct() {
51 51
 
52
-		add_action( 'admin_init', array( $this, 'init' ) );
52
+		add_action('admin_init', array($this, 'init'));
53 53
 
54 54
 		//Customize CMB2 URL
55
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
55
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
56 56
 
57 57
 		//Custom CMB2 Settings Fields
58
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
59
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
60
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
61
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
62
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
63
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
64
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
65
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
66
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
58
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
59
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
60
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
61
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
62
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
63
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
64
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
65
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
66
+		add_action('admin_notices', array($this, 'settings_notices'));
67 67
 
68 68
 		// Include CMB CSS in the head to avoid FOUC
69
-		add_action( 'admin_print_styles-give_forms_page_give-settings', array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
69
+		add_action('admin_print_styles-give_forms_page_give-settings', array('CMB2_hookup', 'enqueue_cmb_css'));
70 70
 
71
-		add_filter( 'cmb2_get_metabox_form_format', array( $this, 'give_modify_cmb2_form_output' ), 10, 3 );
71
+		add_filter('cmb2_get_metabox_form_format', array($this, 'give_modify_cmb2_form_output'), 10, 3);
72 72
 
73 73
 	}
74 74
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @since  1.0
79 79
 	 */
80 80
 	public function init() {
81
-		register_setting( $this->key, $this->key );
81
+		register_setting($this->key, $this->key);
82 82
 
83 83
 	}
84 84
 
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	 *
93 93
 	 * @return mixed
94 94
 	 */
95
-	public function give_update_cmb_meta_box_url( $url ) {
95
+	public function give_update_cmb_meta_box_url($url) {
96 96
 		//Path to Give's CMB
97
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
97
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
98 98
 	}
99 99
 
100 100
 
@@ -106,27 +106,27 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function give_get_settings_tabs() {
108 108
 
109
-		$settings = $this->give_settings( null );
109
+		$settings = $this->give_settings(null);
110 110
 
111 111
 		$tabs             = array();
112
-		$tabs['general']  = __( 'General', 'give' );
113
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
114
-		$tabs['display']  = __( 'Display Options', 'give' );
115
-		$tabs['emails']   = __( 'Emails', 'give' );
112
+		$tabs['general']  = __('General', 'give');
113
+		$tabs['gateways'] = __('Payment Gateways', 'give');
114
+		$tabs['display']  = __('Display Options', 'give');
115
+		$tabs['emails']   = __('Emails', 'give');
116 116
 
117
-		if ( ! empty( $settings['addons']['fields'] ) ) {
118
-			$tabs['addons'] = __( 'Add-ons', 'give' );
117
+		if ( ! empty($settings['addons']['fields'])) {
118
+			$tabs['addons'] = __('Add-ons', 'give');
119 119
 		}
120 120
 
121
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
122
-			$tabs['licenses'] = __( 'Licenses', 'give' );
121
+		if ( ! empty($settings['licenses']['fields'])) {
122
+			$tabs['licenses'] = __('Licenses', 'give');
123 123
 		}
124 124
 
125
-		$tabs['advanced']    = __( 'Advanced', 'give' );
126
-		$tabs['api']         = __( 'API', 'give' );
127
-		$tabs['system_info'] = __( 'System Info', 'give' );
125
+		$tabs['advanced']    = __('Advanced', 'give');
126
+		$tabs['api']         = __('API', 'give');
127
+		$tabs['system_info'] = __('System Info', 'give');
128 128
 
129
-		return apply_filters( 'give_settings_tabs', $tabs );
129
+		return apply_filters('give_settings_tabs', $tabs);
130 130
 	}
131 131
 
132 132
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function admin_page_display() {
138 138
 
139
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
139
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
140 140
 
141 141
 		?>
142 142
 
@@ -144,20 +144,20 @@  discard block
 block discarded – undo
144 144
 
145 145
 			<h1 class="nav-tab-wrapper">
146 146
 				<?php
147
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
147
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
148 148
 
149 149
 					//Support legacy tab creation conditions based off $_GET parameter
150 150
 					//We pass the $_GET['tab'] to conditions executed later
151 151
 					$_GET['tab'] = $tab_id;
152 152
 
153
-					$tab_url = esc_url( add_query_arg( array(
153
+					$tab_url = esc_url(add_query_arg(array(
154 154
 						'settings-updated' => false,
155 155
 						'tab'              => $tab_id
156
-					) ) );
156
+					)));
157 157
 
158
-					$active       = $active_tab == $tab_id ? ' nav-tab-active' : '';
158
+					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
159 159
 
160
-					echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
160
+					echo '<a href="'.esc_url($tab_url).'" title="'.esc_attr($tab_name).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
161 161
 
162 162
 				}
163 163
 				?>
@@ -165,20 +165,20 @@  discard block
 block discarded – undo
165 165
 
166 166
 			<?php
167 167
 			//Loop through and output settings
168
-			foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
168
+			foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
169 169
 
170 170
 				//Support legacy tab creation conditions based off $_GET parameter
171 171
 				//We 'trick' the conditions into thinking this is the tab
172 172
 				$_GET['tab'] = $tab_id;
173 173
 
174
-				$tab_settings = $this->give_settings( $tab_id );
174
+				$tab_settings = $this->give_settings($tab_id);
175 175
 
176 176
 				//Pass active tab within $tab_settings so we can hide with CSS via PHP
177
-				if ( $active_tab == $tab_id ) {
177
+				if ($active_tab == $tab_id) {
178 178
 					$tab_settings['active_tab'] = true;
179 179
 				}
180 180
 
181
-				cmb2_metabox_form( $tab_settings, $this->key );
181
+				cmb2_metabox_form($tab_settings, $this->key);
182 182
 
183 183
 			} ?>
184 184
 
@@ -196,34 +196,34 @@  discard block
 block discarded – undo
196 196
 	 * @since 1.5 Modified to CSS hide non-active tabs
197 197
 	 * @since 1.0
198 198
 	 */
199
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
199
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
200 200
 
201 201
 
202
-		$pagenow = isset( $_GET['page'] ) ? $_GET['page'] : '';
202
+		$pagenow = isset($_GET['page']) ? $_GET['page'] : '';
203 203
 
204 204
 		//only modify the give settings form
205
-		if ( 'give_settings' == $object_id && $pagenow == 'give-settings' ) {
205
+		if ('give_settings' == $object_id && $pagenow == 'give-settings') {
206 206
 
207 207
 			$style = '';
208
-			if ( ! isset( $cmb->meta_box['active_tab'] ) ) {
208
+			if ( ! isset($cmb->meta_box['active_tab'])) {
209 209
 				$style = 'style="display:none;"';
210 210
 			}
211 211
 
212 212
 			//Set ID based off tab name - protects backwards compatibility
213
-			$tab_id = isset( $_GET['tab'] ) ? $_GET['tab'] : $cmb->meta_box['id'];
213
+			$tab_id = isset($_GET['tab']) ? $_GET['tab'] : $cmb->meta_box['id'];
214 214
 
215
-			$save_button = apply_filters( 'give_save_button_markup', '<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div>' );
215
+			$save_button = apply_filters('give_save_button_markup', '<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div>');
216 216
 
217 217
 			//Filter so some tabs won't have save settings
218
-			$no_save_button = apply_filters( 'give_settings_no_save_output', array(
218
+			$no_save_button = apply_filters('give_settings_no_save_output', array(
219 219
 				'system_info'
220
-			) );
220
+			));
221 221
 
222
-			if ( in_array( $tab_id, $no_save_button ) ) {
222
+			if (in_array($tab_id, $no_save_button)) {
223 223
 				$save_button = '';
224 224
 			}
225 225
 
226
-			$form_format = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data" ' . $style . ' data-tab="' . $tab_id . '"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s' . $save_button . '</form>';
226
+			$form_format = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data" '.$style.' data-tab="'.$tab_id.'"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s'.$save_button.'</form>';
227 227
 
228 228
 		}
229 229
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 *
241 241
 	 * @return array
242 242
 	 */
243
-	public function give_settings( $active_tab ) {
243
+	public function give_settings($active_tab) {
244 244
 
245 245
 		$give_settings = array(
246 246
 			/**
@@ -248,60 +248,60 @@  discard block
 block discarded – undo
248 248
 			 */
249 249
 			'general'     => array(
250 250
 				'id'         => 'general_settings',
251
-				'give_title' => __( 'General Settings', 'give' ),
252
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
253
-				'fields'     => apply_filters( 'give_settings_general', array(
251
+				'give_title' => __('General Settings', 'give'),
252
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
253
+				'fields'     => apply_filters('give_settings_general', array(
254 254
 						array(
255
-							'name' => __( 'General Settings', 'give' ),
255
+							'name' => __('General Settings', 'give'),
256 256
 							'desc' => '',
257 257
 							'type' => 'give_title',
258 258
 							'id'   => 'give_title_general_settings_1'
259 259
 						),
260 260
 						array(
261
-							'name'    => __( 'Success Page', 'give' ),
262
-							'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>' ),
261
+							'name'    => __('Success Page', 'give'),
262
+							'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>'),
263 263
 							'id'      => 'success_page',
264 264
 							'type'    => 'select',
265
-							'options' => give_cmb2_get_post_options( array(
265
+							'options' => give_cmb2_get_post_options(array(
266 266
 								'post_type'   => 'page',
267
-								'numberposts' => - 1
268
-							) ),
267
+								'numberposts' => -1
268
+							)),
269 269
 						),
270 270
 						array(
271
-							'name'    => __( 'Failed Transaction Page', 'give' ),
272
-							'desc'    => __( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ),
271
+							'name'    => __('Failed Transaction Page', 'give'),
272
+							'desc'    => __('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'),
273 273
 							'id'      => 'failure_page',
274 274
 							'type'    => 'select',
275
-							'options' => give_cmb2_get_post_options( array(
275
+							'options' => give_cmb2_get_post_options(array(
276 276
 								'post_type'   => 'page',
277
-								'numberposts' => - 1
278
-							) ),
277
+								'numberposts' => -1
278
+							)),
279 279
 						),
280 280
 						array(
281
-							'name'    => __( 'Donation History Page', 'give' ),
282
-							'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>' ),
281
+							'name'    => __('Donation History Page', 'give'),
282
+							'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>'),
283 283
 							'id'      => 'history_page',
284 284
 							'type'    => 'select',
285
-							'options' => give_cmb2_get_post_options( array(
285
+							'options' => give_cmb2_get_post_options(array(
286 286
 								'post_type'   => 'page',
287
-								'numberposts' => - 1
288
-							) ),
287
+								'numberposts' => -1
288
+							)),
289 289
 						),
290 290
 						array(
291
-							'name'    => __( 'Base Country', 'give' ),
292
-							'desc'    => __( 'Where does your site operate from?', 'give' ),
291
+							'name'    => __('Base Country', 'give'),
292
+							'desc'    => __('Where does your site operate from?', 'give'),
293 293
 							'id'      => 'base_country',
294 294
 							'type'    => 'select',
295 295
 							'options' => give_get_country_list(),
296 296
 						),
297 297
 						array(
298
-							'name' => __( 'Currency Settings', 'give' ),
298
+							'name' => __('Currency Settings', 'give'),
299 299
 							'desc' => '',
300 300
 							'type' => 'give_title',
301 301
 							'id'   => 'give_title_general_settings_2'
302 302
 						),
303 303
 						array(
304
-							'name'    => __( 'Currency', 'give' ),
304
+							'name'    => __('Currency', 'give'),
305 305
 							'desc'    => 'Choose your currency. Note that some payment gateways have currency restrictions.',
306 306
 							'id'      => 'currency',
307 307
 							'type'    => 'select',
@@ -309,26 +309,26 @@  discard block
 block discarded – undo
309 309
 							'default' => 'USD',
310 310
 						),
311 311
 						array(
312
-							'name'    => __( 'Currency Position', 'give' ),
312
+							'name'    => __('Currency Position', 'give'),
313 313
 							'desc'    => 'Choose the position of the currency sign.',
314 314
 							'id'      => 'currency_position',
315 315
 							'type'    => 'select',
316 316
 							'options' => array(
317
-								'before' => sprintf( __( 'Before - %1$s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
318
-								'after'  => sprintf( __( 'After - 10%1$s', 'give' ), give_currency_symbol( give_get_currency() ) )
317
+								'before' => sprintf(__('Before - %1$s10', 'give'), give_currency_symbol(give_get_currency())),
318
+								'after'  => sprintf(__('After - 10%1$s', 'give'), give_currency_symbol(give_get_currency()))
319 319
 							),
320 320
 							'default' => 'before',
321 321
 						),
322 322
 						array(
323
-							'name'    => __( 'Thousands Separator', 'give' ),
324
-							'desc'    => __( 'The symbol (typically , or .) to separate thousands', 'give' ),
323
+							'name'    => __('Thousands Separator', 'give'),
324
+							'desc'    => __('The symbol (typically , or .) to separate thousands', 'give'),
325 325
 							'id'      => 'thousands_separator',
326 326
 							'type'    => 'text_small',
327 327
 							'default' => ',',
328 328
 						),
329 329
 						array(
330
-							'name'    => __( 'Decimal Separator', 'give' ),
331
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points', 'give' ),
330
+							'name'    => __('Decimal Separator', 'give'),
331
+							'desc'    => __('The symbol (usually , or .) to separate decimal points', 'give'),
332 332
 							'id'      => 'decimal_separator',
333 333
 							'type'    => 'text_small',
334 334
 							'default' => '.',
@@ -341,83 +341,83 @@  discard block
 block discarded – undo
341 341
 			 */
342 342
 			'gateways'    => array(
343 343
 				'id'         => 'payment_gateways',
344
-				'give_title' => __( 'Payment Gateways', 'give' ),
345
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
346
-				'fields'     => apply_filters( 'give_settings_gateways', array(
344
+				'give_title' => __('Payment Gateways', 'give'),
345
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
346
+				'fields'     => apply_filters('give_settings_gateways', array(
347 347
 						array(
348
-							'name' => __( 'Gateways Settings', 'give' ),
348
+							'name' => __('Gateways Settings', 'give'),
349 349
 							'desc' => '',
350 350
 							'id'   => 'give_title_gateway_settings_1',
351 351
 							'type' => 'give_title'
352 352
 						),
353 353
 						array(
354
-							'name' => __( 'Test Mode', 'give' ),
355
-							'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' ),
354
+							'name' => __('Test Mode', 'give'),
355
+							'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'),
356 356
 							'id'   => 'test_mode',
357 357
 							'type' => 'checkbox'
358 358
 						),
359 359
 						array(
360
-							'name' => __( 'Enabled Gateways', 'give' ),
361
-							'desc' => __( 'Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give' ),
360
+							'name' => __('Enabled Gateways', 'give'),
361
+							'desc' => __('Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give'),
362 362
 							'id'   => 'gateways',
363 363
 							'type' => 'enabled_gateways'
364 364
 						),
365 365
 						array(
366
-							'name' => __( 'Default Gateway', 'give' ),
367
-							'desc' => __( 'This is the gateway that will be selected by default.', 'give' ),
366
+							'name' => __('Default Gateway', 'give'),
367
+							'desc' => __('This is the gateway that will be selected by default.', 'give'),
368 368
 							'id'   => 'default_gateway',
369 369
 							'type' => 'default_gateway'
370 370
 						),
371 371
 						array(
372
-							'name' => __( 'PayPal Standard', 'give' ),
372
+							'name' => __('PayPal Standard', 'give'),
373 373
 							'desc' => '',
374 374
 							'type' => 'give_title',
375 375
 							'id'   => 'give_title_gateway_settings_2',
376 376
 						),
377 377
 						array(
378
-							'name' => __( 'PayPal Email', 'give' ),
379
-							'desc' => __( 'Enter your PayPal account\'s email', 'give' ),
378
+							'name' => __('PayPal Email', 'give'),
379
+							'desc' => __('Enter your PayPal account\'s email', 'give'),
380 380
 							'id'   => 'paypal_email',
381 381
 							'type' => 'text_email',
382 382
 						),
383 383
 						array(
384
-							'name' => __( 'PayPal Page Style', 'give' ),
385
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default', 'give' ),
384
+							'name' => __('PayPal Page Style', 'give'),
385
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default', 'give'),
386 386
 							'id'   => 'paypal_page_style',
387 387
 							'type' => 'text',
388 388
 						),
389 389
 						array(
390
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
391
-							'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' ),
390
+							'name'    => __('PayPal Transaction Type', 'give'),
391
+							'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'),
392 392
 							'id'      => 'paypal_button_type',
393 393
 							'type'    => 'radio_inline',
394 394
 							'options' => array(
395
-								'donation' => __( 'Donation', 'give' ),
396
-								'standard' => __( 'Standard Transaction', 'give' )
395
+								'donation' => __('Donation', 'give'),
396
+								'standard' => __('Standard Transaction', 'give')
397 397
 							),
398 398
 							'default' => 'donation',
399 399
 						),
400 400
 						array(
401
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
402
-							'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' ),
401
+							'name' => __('Disable PayPal IPN Verification', 'give'),
402
+							'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'),
403 403
 							'id'   => 'disable_paypal_verification',
404 404
 							'type' => 'checkbox'
405 405
 						),
406 406
 						array(
407
-							'name' => __( 'Offline Donations', 'give' ),
407
+							'name' => __('Offline Donations', 'give'),
408 408
 							'desc' => '',
409 409
 							'type' => 'give_title',
410 410
 							'id'   => 'give_title_gateway_settings_3',
411 411
 						),
412 412
 						array(
413
-							'name' => __( 'Collect Billing Details', 'give' ),
414
-							'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' ),
413
+							'name' => __('Collect Billing Details', 'give'),
414
+							'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'),
415 415
 							'id'   => 'give_offline_donation_enable_billing_fields',
416 416
 							'type' => 'checkbox'
417 417
 						),
418 418
 						array(
419
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
420
-							'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' ),
419
+							'name'    => __('Offline Donation Instructions', 'give'),
420
+							'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'),
421 421
 							'id'      => 'global_offline_donation_content',
422 422
 							'default' => give_get_default_offline_donation_content(),
423 423
 							'type'    => 'wysiwyg',
@@ -426,15 +426,15 @@  discard block
 block discarded – undo
426 426
 							)
427 427
 						),
428 428
 						array(
429
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
430
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
429
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
430
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
431 431
 							'id'      => 'offline_donation_subject',
432
-							'default' => __( '{donation} - Offline Donation Instructions', 'give' ),
432
+							'default' => __('{donation} - Offline Donation Instructions', 'give'),
433 433
 							'type'    => 'text'
434 434
 						),
435 435
 						array(
436
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
437
-							'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' ),
436
+							'name'    => __('Offline Donation Email Instructions', 'give'),
437
+							'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'),
438 438
 							'id'      => 'global_offline_donation_email',
439 439
 							'default' => give_get_default_offline_donation_email_content(),
440 440
 							'type'    => 'wysiwyg',
@@ -448,93 +448,93 @@  discard block
 block discarded – undo
448 448
 			/** Display Settings */
449 449
 			'display'     => array(
450 450
 				'id'         => 'display_settings',
451
-				'give_title' => __( 'Display Settings', 'give' ),
452
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
453
-				'fields'     => apply_filters( 'give_settings_display', array(
451
+				'give_title' => __('Display Settings', 'give'),
452
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
453
+				'fields'     => apply_filters('give_settings_display', array(
454 454
 						array(
455
-							'name' => __( 'Display Settings', 'give' ),
455
+							'name' => __('Display Settings', 'give'),
456 456
 							'desc' => '',
457 457
 							'id'   => 'give_title_display_settings_1',
458 458
 							'type' => 'give_title'
459 459
 						),
460 460
 						array(
461
-							'name' => __( 'Disable CSS', 'give' ),
462
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
461
+							'name' => __('Disable CSS', 'give'),
462
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
463 463
 							'id'   => 'disable_css',
464 464
 							'type' => 'checkbox'
465 465
 						),
466 466
 						array(
467
-							'name' => __( 'Enable Floating Labels', 'give' ),
468
-							'desc' => sprintf( esc_html__( 'Enable this option if you would like to enable %1$sfloating labels%2$s in Give\'s donation forms. %3$sBe aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), '<a href="' . esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) . '" target="_blank">', '</a>', '<br />' ),
467
+							'name' => __('Enable Floating Labels', 'give'),
468
+							'desc' => sprintf(esc_html__('Enable this option if you would like to enable %1$sfloating labels%2$s in Give\'s donation forms. %3$sBe aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), '<a href="'.esc_url("http://bradfrost.com/blog/post/float-label-pattern/").'" target="_blank">', '</a>', '<br />'),
469 469
 							'id'   => 'enable_floatlabels',
470 470
 							'type' => 'checkbox'
471 471
 						),
472 472
 						array(
473
-							'name' => __( 'Disable Welcome Screen', 'give' ),
474
-							'desc' => sprintf( esc_html__( '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 %1$shere%2$s if you want in the future.', 'give' ), '<a href="' . esc_url( admin_url( 'index.php?page=give-about' ) ) . '">', '</a>' ),
473
+							'name' => __('Disable Welcome Screen', 'give'),
474
+							'desc' => sprintf(esc_html__('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 %1$shere%2$s if you want in the future.', 'give'), '<a href="'.esc_url(admin_url('index.php?page=give-about')).'">', '</a>'),
475 475
 							'id'   => 'disable_welcome',
476 476
 							'type' => 'checkbox'
477 477
 						),
478 478
 						array(
479
-							'name' => __( 'Post Types', 'give' ),
479
+							'name' => __('Post Types', 'give'),
480 480
 							'desc' => '',
481 481
 							'id'   => 'give_title_display_settings_2',
482 482
 							'type' => 'give_title'
483 483
 						),
484 484
 						array(
485
-							'name' => __( 'Disable Form Single Views', 'give' ),
486
-							'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' ),
485
+							'name' => __('Disable Form Single Views', 'give'),
486
+							'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'),
487 487
 							'id'   => 'disable_forms_singular',
488 488
 							'type' => 'checkbox'
489 489
 						),
490 490
 						array(
491
-							'name' => __( 'Disable Form Archives', 'give' ),
492
-							'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' ),
491
+							'name' => __('Disable Form Archives', 'give'),
492
+							'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'),
493 493
 							'id'   => 'disable_forms_archives',
494 494
 							'type' => 'checkbox'
495 495
 						),
496 496
 						array(
497
-							'name' => __( 'Disable Form Excerpts', 'give' ),
498
-							'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' ),
497
+							'name' => __('Disable Form Excerpts', 'give'),
498
+							'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'),
499 499
 							'id'   => 'disable_forms_excerpt',
500 500
 							'type' => 'checkbox'
501 501
 						),
502 502
 
503 503
 						array(
504
-							'name'    => __( 'Featured Image Size', 'give' ),
505
-							'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' ),
504
+							'name'    => __('Featured Image Size', 'give'),
505
+							'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'),
506 506
 							'id'      => 'featured_image_size',
507 507
 							'type'    => 'select',
508 508
 							'default' => 'large',
509 509
 							'options' => give_get_featured_image_sizes()
510 510
 						),
511 511
 						array(
512
-							'name' => __( 'Disable Form Featured Image', 'give' ),
513
-							'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' ),
512
+							'name' => __('Disable Form Featured Image', 'give'),
513
+							'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'),
514 514
 							'id'   => 'disable_form_featured_img',
515 515
 							'type' => 'checkbox'
516 516
 						),
517 517
 						array(
518
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
519
-							'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' ),
518
+							'name' => __('Disable Single Form Sidebar', 'give'),
519
+							'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'),
520 520
 							'id'   => 'disable_form_sidebar',
521 521
 							'type' => 'checkbox'
522 522
 						),
523 523
 						array(
524
-							'name' => __( 'Taxonomies', 'give' ),
524
+							'name' => __('Taxonomies', 'give'),
525 525
 							'desc' => '',
526 526
 							'id'   => 'give_title_display_settings_3',
527 527
 							'type' => 'give_title'
528 528
 						),
529 529
 						array(
530
-							'name' => __( 'Enable Form Categories', 'give' ),
531
-							'desc' => __( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ),
530
+							'name' => __('Enable Form Categories', 'give'),
531
+							'desc' => __('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'),
532 532
 							'id'   => 'enable_categories',
533 533
 							'type' => 'checkbox'
534 534
 						),
535 535
 						array(
536
-							'name' => __( 'Enable Form Tags', 'give' ),
537
-							'desc' => __( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ),
536
+							'name' => __('Enable Form Tags', 'give'),
537
+							'desc' => __('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'),
538 538
 							'id'   => 'enable_tags',
539 539
 							'type' => 'checkbox'
540 540
 						),
@@ -547,93 +547,93 @@  discard block
 block discarded – undo
547 547
 			 */
548 548
 			'emails'      => array(
549 549
 				'id'         => 'email_settings',
550
-				'give_title' => __( 'Email Settings', 'give' ),
551
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
552
-				'fields'     => apply_filters( 'give_settings_emails', array(
550
+				'give_title' => __('Email Settings', 'give'),
551
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
552
+				'fields'     => apply_filters('give_settings_emails', array(
553 553
 						array(
554
-							'name' => __( 'Email Settings', 'give' ),
554
+							'name' => __('Email Settings', 'give'),
555 555
 							'desc' => '',
556 556
 							'id'   => 'give_title_email_settings_1',
557 557
 							'type' => 'give_title'
558 558
 						),
559 559
 						array(
560 560
 							'id'      => 'email_template',
561
-							'name'    => __( 'Email Template', 'give' ),
562
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
561
+							'name'    => __('Email Template', 'give'),
562
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
563 563
 							'type'    => 'select',
564 564
 							'options' => give_get_email_templates()
565 565
 						),
566 566
 						array(
567 567
 							'id'   => 'email_logo',
568
-							'name' => __( 'Logo', 'give' ),
569
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
568
+							'name' => __('Logo', 'give'),
569
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
570 570
 							'type' => 'file'
571 571
 						),
572 572
 						array(
573 573
 							'id'      => 'from_name',
574
-							'name'    => __( 'From Name', 'give' ),
575
-							'desc'    => __( 'The name donation receipts are said to come from. This should probably be your site or shop name.', 'give' ),
576
-							'default' => get_bloginfo( 'name' ),
574
+							'name'    => __('From Name', 'give'),
575
+							'desc'    => __('The name donation receipts are said to come from. This should probably be your site or shop name.', 'give'),
576
+							'default' => get_bloginfo('name'),
577 577
 							'type'    => 'text'
578 578
 						),
579 579
 						array(
580 580
 							'id'      => 'from_email',
581
-							'name'    => __( 'From Email', 'give' ),
582
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
583
-							'default' => get_bloginfo( 'admin_email' ),
581
+							'name'    => __('From Email', 'give'),
582
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
583
+							'default' => get_bloginfo('admin_email'),
584 584
 							'type'    => 'text'
585 585
 						),
586 586
 						array(
587
-							'name' => __( 'Donation Receipt', 'give' ),
587
+							'name' => __('Donation Receipt', 'give'),
588 588
 							'desc' => '',
589 589
 							'id'   => 'give_title_email_settings_2',
590 590
 							'type' => 'give_title'
591 591
 						),
592 592
 						array(
593 593
 							'id'      => 'donation_subject',
594
-							'name'    => __( 'Donation Email Subject', 'give' ),
595
-							'desc'    => __( 'Enter the subject line for the donation receipt email', 'give' ),
596
-							'default' => __( 'Donation Receipt', 'give' ),
594
+							'name'    => __('Donation Email Subject', 'give'),
595
+							'desc'    => __('Enter the subject line for the donation receipt email', 'give'),
596
+							'default' => __('Donation Receipt', 'give'),
597 597
 							'type'    => 'text'
598 598
 						),
599 599
 						array(
600 600
 							'id'      => 'donation_receipt',
601
-							'name'    => __( 'Donation Receipt', 'give' ),
602
-							'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(),
601
+							'name'    => __('Donation Receipt', 'give'),
602
+							'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(),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_receipt_email()
605 605
 						),
606 606
 						array(
607
-							'name' => __( 'New Donation Notification', 'give' ),
607
+							'name' => __('New Donation Notification', 'give'),
608 608
 							'desc' => '',
609 609
 							'id'   => 'give_title_email_settings_3',
610 610
 							'type' => 'give_title'
611 611
 						),
612 612
 						array(
613 613
 							'id'      => 'donation_notification_subject',
614
-							'name'    => __( 'Donation Notification Subject', 'give' ),
615
-							'desc'    => __( 'Enter the subject line for the donation notification email', 'give' ),
614
+							'name'    => __('Donation Notification Subject', 'give'),
615
+							'desc'    => __('Enter the subject line for the donation notification email', 'give'),
616 616
 							'type'    => 'text',
617
-							'default' => __( 'New Donation - #{payment_id}', 'give' )
617
+							'default' => __('New Donation - #{payment_id}', 'give')
618 618
 						),
619 619
 						array(
620 620
 							'id'      => 'donation_notification',
621
-							'name'    => __( 'Donation Notification', 'give' ),
622
-							'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(),
621
+							'name'    => __('Donation Notification', 'give'),
622
+							'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(),
623 623
 							'type'    => 'wysiwyg',
624 624
 							'default' => give_get_default_donation_notification_email()
625 625
 						),
626 626
 						array(
627 627
 							'id'      => 'admin_notice_emails',
628
-							'name'    => __( 'Donation Notification Emails', 'give' ),
629
-							'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>' ),
628
+							'name'    => __('Donation Notification Emails', 'give'),
629
+							'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>'),
630 630
 							'type'    => 'textarea',
631
-							'default' => get_bloginfo( 'admin_email' )
631
+							'default' => get_bloginfo('admin_email')
632 632
 						),
633 633
 						array(
634 634
 							'id'   => 'disable_admin_notices',
635
-							'name' => __( 'Disable Admin Notifications', 'give' ),
636
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
635
+							'name' => __('Disable Admin Notifications', 'give'),
636
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
637 637
 							'type' => 'checkbox'
638 638
 						)
639 639
 					)
@@ -642,96 +642,96 @@  discard block
 block discarded – undo
642 642
 			/** Extension Settings */
643 643
 			'addons'      => array(
644 644
 				'id'         => 'addons',
645
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
646
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
647
-				'fields'     => apply_filters( 'give_settings_addons', array()
645
+				'give_title' => __('Give Add-ons Settings', 'give'),
646
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
647
+				'fields'     => apply_filters('give_settings_addons', array()
648 648
 				)
649 649
 			),
650 650
 			/** Licenses Settings */
651 651
 			'licenses'    => array(
652 652
 				'id'         => 'licenses',
653
-				'give_title' => __( 'Give Licenses', 'give' ),
654
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
655
-				'fields'     => apply_filters( 'give_settings_licenses', array()
653
+				'give_title' => __('Give Licenses', 'give'),
654
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
655
+				'fields'     => apply_filters('give_settings_licenses', array()
656 656
 				)
657 657
 			),
658 658
 			/** Advanced Options */
659 659
 			'advanced'    => array(
660 660
 				'id'         => 'advanced_options',
661
-				'give_title' => __( 'Advanced Options', 'give' ),
662
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
663
-				'fields'     => apply_filters( 'give_settings_advanced', array(
661
+				'give_title' => __('Advanced Options', 'give'),
662
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
663
+				'fields'     => apply_filters('give_settings_advanced', array(
664 664
 						array(
665
-							'name' => __( 'Access Control', 'give' ),
665
+							'name' => __('Access Control', 'give'),
666 666
 							'desc' => '',
667 667
 							'id'   => 'give_title_session_control_1',
668 668
 							'type' => 'give_title'
669 669
 						),
670 670
 						array(
671 671
 							'id'      => 'session_lifetime',
672
-							'name'    => __( 'Session Lifetime', 'give' ),
673
-							'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 as long as they are using the same browser they used when donating.', 'give' ),
672
+							'name'    => __('Session Lifetime', 'give'),
673
+							'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 as long as they are using the same browser they used when donating.', 'give'),
674 674
 							'type'    => 'select',
675 675
 							'options' => array(
676
-								'86400'  => __( '24 Hours', 'give' ),
677
-								'172800' => __( '48 Hours', 'give' ),
678
-								'259200' => __( '72 Hours', 'give' ),
679
-								'604800' => __( '1 Week', 'give' ),
676
+								'86400'  => __('24 Hours', 'give'),
677
+								'172800' => __('48 Hours', 'give'),
678
+								'259200' => __('72 Hours', 'give'),
679
+								'604800' => __('1 Week', 'give'),
680 680
 							)
681 681
 						),
682 682
 						array(
683
-							'name' => __( 'Email Access', 'give' ),
684
-							'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
683
+							'name' => __('Email Access', 'give'),
684
+							'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
685 685
 							'id'   => 'email_access',
686 686
 							'type' => 'checkbox',
687 687
 						),
688 688
 						array(
689 689
 							'id'      => 'recaptcha_key',
690
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
691
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to %1$sthe reCAPTCHA website%2$s and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), '<a href="https://www.google.com/recaptcha/" target="_blank">', '</a>' ),
690
+							'name'    => __('reCAPTCHA Site Key', 'give'),
691
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to %1$sthe reCAPTCHA website%2$s and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), '<a href="https://www.google.com/recaptcha/" target="_blank">', '</a>'),
692 692
 							'default' => '',
693 693
 							'type'    => 'text'
694 694
 						),
695 695
 						array(
696 696
 							'id'      => 'recaptcha_secret',
697
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
698
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
697
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
698
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
699 699
 							'default' => '',
700 700
 							'type'    => 'text'
701 701
 						),
702 702
 						array(
703
-							'name' => __( 'Data Control', 'give' ),
703
+							'name' => __('Data Control', 'give'),
704 704
 							'desc' => '',
705 705
 							'id'   => 'give_title_data_control_2',
706 706
 							'type' => 'give_title'
707 707
 						),
708 708
 						array(
709
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
710
-							'desc' => __( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ),
709
+							'name' => __('Remove All Data on Uninstall?', 'give'),
710
+							'desc' => __('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'),
711 711
 							'id'   => 'uninstall_on_delete',
712 712
 							'type' => 'checkbox'
713 713
 						),
714 714
 						array(
715
-							'name' => __( 'Filter Control', 'give' ),
715
+							'name' => __('Filter Control', 'give'),
716 716
 							'desc' => '',
717 717
 							'id'   => 'give_title_filter_control',
718 718
 							'type' => 'give_title'
719 719
 						),
720 720
 						array(
721
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
722
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
721
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
722
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
723 723
 							'id'   => 'disable_the_content_filter',
724 724
 							'type' => 'checkbox'
725 725
 						),
726 726
 						array(
727
-							'name' => __( 'Script Loading', 'give' ),
727
+							'name' => __('Script Loading', 'give'),
728 728
 							'desc' => '',
729 729
 							'id'   => 'give_title_script_control',
730 730
 							'type' => 'give_title'
731 731
 						),
732 732
 						array(
733
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
734
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
733
+							'name' => __('Load Scripts in Footer?', 'give'),
734
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
735 735
 							'id'   => 'scripts_footer',
736 736
 							'type' => 'checkbox'
737 737
 						)
@@ -741,13 +741,13 @@  discard block
 block discarded – undo
741 741
 			/** API Settings */
742 742
 			'api'         => array(
743 743
 				'id'         => 'api',
744
-				'give_title' => __( 'API', 'give' ),
745
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
744
+				'give_title' => __('API', 'give'),
745
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
746 746
 				'show_names' => false, // Hide field names on the left
747
-				'fields'     => apply_filters( 'give_settings_system', array(
747
+				'fields'     => apply_filters('give_settings_system', array(
748 748
 						array(
749 749
 							'id'   => 'api',
750
-							'name' => __( 'API', 'give' ),
750
+							'name' => __('API', 'give'),
751 751
 							'type' => 'api'
752 752
 						)
753 753
 					)
@@ -756,13 +756,13 @@  discard block
 block discarded – undo
756 756
 			/** Licenses Settings */
757 757
 			'system_info' => array(
758 758
 				'id'         => 'system_info',
759
-				'give_title' => __( 'System Info', 'give' ),
760
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
761
-				'fields'     => apply_filters( 'give_settings_system', array(
759
+				'give_title' => __('System Info', 'give'),
760
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
761
+				'fields'     => apply_filters('give_settings_system', array(
762 762
 						array(
763 763
 							'id'   => 'system_info',
764
-							'name' => __( 'System Info', 'give' ),
765
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
764
+							'name' => __('System Info', 'give'),
765
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
766 766
 							'type' => 'system_info'
767 767
 						)
768 768
 					)
@@ -771,15 +771,15 @@  discard block
 block discarded – undo
771 771
 		);
772 772
 
773 773
 		//Return all settings array if no active tab
774
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
774
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
775 775
 
776
-			return apply_filters( 'give_registered_settings', $give_settings );
776
+			return apply_filters('give_registered_settings', $give_settings);
777 777
 			
778 778
 		}
779 779
 
780 780
 
781 781
 		// Add other tabs and settings fields as needed
782
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
782
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
783 783
 
784 784
 	}
785 785
 
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
 	 */
789 789
 	public function settings_notices() {
790 790
 
791
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
791
+		if ( ! isset($_POST['give_settings_saved'])) {
792 792
 			return;
793 793
 		}
794 794
 
795
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
795
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
796 796
 
797 797
 	}
798 798
 
@@ -806,17 +806,17 @@  discard block
 block discarded – undo
806 806
 	 *
807 807
 	 * @return mixed          Field value or exception is thrown
808 808
 	 */
809
-	public function __get( $field ) {
809
+	public function __get($field) {
810 810
 
811 811
 		// Allowed fields to retrieve
812
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
812
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
813 813
 			return $this->{$field};
814 814
 		}
815
-		if ( 'option_metabox' === $field ) {
815
+		if ('option_metabox' === $field) {
816 816
 			return $this->option_metabox();
817 817
 		}
818 818
 
819
-		throw new Exception( 'Invalid property: ' . $field );
819
+		throw new Exception('Invalid property: '.$field);
820 820
 	}
821 821
 
822 822
 
@@ -833,12 +833,12 @@  discard block
 block discarded – undo
833 833
  *
834 834
  * @return mixed        Option value
835 835
  */
836
-function give_get_option( $key = '', $default = false ) {
836
+function give_get_option($key = '', $default = false) {
837 837
 	global $give_options;
838
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
839
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
838
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
839
+	$value = apply_filters('give_get_option', $value, $key, $default);
840 840
 
841
-	return apply_filters( 'give_get_option_' . $key, $value, $key, $default );
841
+	return apply_filters('give_get_option_'.$key, $value, $key, $default);
842 842
 }
843 843
 
844 844
 
@@ -856,33 +856,33 @@  discard block
 block discarded – undo
856 856
  *
857 857
  * @return boolean True if updated, false if not.
858 858
  */
859
-function give_update_option( $key = '', $value = false ) {
859
+function give_update_option($key = '', $value = false) {
860 860
 
861 861
 	// If no key, exit
862
-	if ( empty( $key ) ) {
862
+	if (empty($key)) {
863 863
 		return false;
864 864
 	}
865 865
 
866
-	if ( empty( $value ) ) {
867
-		$remove_option = give_delete_option( $key );
866
+	if (empty($value)) {
867
+		$remove_option = give_delete_option($key);
868 868
 
869 869
 		return $remove_option;
870 870
 	}
871 871
 
872 872
 	// First let's grab the current settings
873
-	$options = get_option( 'give_settings' );
873
+	$options = get_option('give_settings');
874 874
 
875 875
 	// Let's let devs alter that value coming in
876
-	$value = apply_filters( 'give_update_option', $value, $key );
876
+	$value = apply_filters('give_update_option', $value, $key);
877 877
 
878 878
 	// Next let's try to update the value
879
-	$options[ $key ] = $value;
880
-	$did_update      = update_option( 'give_settings', $options );
879
+	$options[$key] = $value;
880
+	$did_update      = update_option('give_settings', $options);
881 881
 
882 882
 	// If it updated, let's update the global variable
883
-	if ( $did_update ) {
883
+	if ($did_update) {
884 884
 		global $give_options;
885
-		$give_options[ $key ] = $value;
885
+		$give_options[$key] = $value;
886 886
 	}
887 887
 
888 888
 	return $did_update;
@@ -899,27 +899,27 @@  discard block
 block discarded – undo
899 899
  *
900 900
  * @return boolean True if updated, false if not.
901 901
  */
902
-function give_delete_option( $key = '' ) {
902
+function give_delete_option($key = '') {
903 903
 
904 904
 	// If no key, exit
905
-	if ( empty( $key ) ) {
905
+	if (empty($key)) {
906 906
 		return false;
907 907
 	}
908 908
 
909 909
 	// First let's grab the current settings
910
-	$options = get_option( 'give_settings' );
910
+	$options = get_option('give_settings');
911 911
 
912 912
 	// Next let's try to update the value
913
-	if ( isset( $options[ $key ] ) ) {
913
+	if (isset($options[$key])) {
914 914
 
915
-		unset( $options[ $key ] );
915
+		unset($options[$key]);
916 916
 
917 917
 	}
918 918
 
919
-	$did_update = update_option( 'give_settings', $options );
919
+	$did_update = update_option('give_settings', $options);
920 920
 
921 921
 	// If it updated, let's update the global variable
922
-	if ( $did_update ) {
922
+	if ($did_update) {
923 923
 		global $give_options;
924 924
 		$give_options = $options;
925 925
 	}
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
  */
939 939
 function give_get_settings() {
940 940
 
941
-	$settings = get_option( 'give_settings' );
941
+	$settings = get_option('give_settings');
942 942
 
943
-	return (array) apply_filters( 'give_get_settings', $settings );
943
+	return (array) apply_filters('give_get_settings', $settings);
944 944
 
945 945
 }
946 946
 
@@ -958,25 +958,25 @@  discard block
 block discarded – undo
958 958
  *
959 959
  * @return array
960 960
  */
961
-function give_settings_array_insert( $array, $position, $insert ) {
962
-	if ( is_int( $position ) ) {
963
-		array_splice( $array, $position, 0, $insert );
961
+function give_settings_array_insert($array, $position, $insert) {
962
+	if (is_int($position)) {
963
+		array_splice($array, $position, 0, $insert);
964 964
 	} else {
965 965
 
966
-		foreach ( $array as $index => $subarray ) {
967
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
966
+		foreach ($array as $index => $subarray) {
967
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
968 968
 				$pos = $index;
969 969
 			}
970 970
 		}
971 971
 
972
-		if ( ! isset( $pos ) ) {
972
+		if ( ! isset($pos)) {
973 973
 			return $array;
974 974
 		}
975 975
 
976 976
 		$array = array_merge(
977
-			array_slice( $array, 0, $pos ),
977
+			array_slice($array, 0, $pos),
978 978
 			$insert,
979
-			array_slice( $array, $pos )
979
+			array_slice($array, $pos)
980 980
 		);
981 981
 	}
982 982
 
@@ -999,31 +999,31 @@  discard block
 block discarded – undo
999 999
  *
1000 1000
  * @return void
1001 1001
  */
1002
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1002
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1003 1003
 
1004 1004
 	$id                = $field_type_object->field->args['id'];
1005 1005
 	$field_description = $field_type_object->field->args['desc'];
1006
-	$gateways          = give_get_ordered_payment_gateways( give_get_payment_gateways() );
1006
+	$gateways          = give_get_ordered_payment_gateways(give_get_payment_gateways());
1007 1007
 
1008 1008
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
1009 1009
 
1010
-	foreach ( $gateways as $key => $option ) :
1010
+	foreach ($gateways as $key => $option) :
1011 1011
 
1012
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
1012
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
1013 1013
 			$enabled = '1';
1014 1014
 		} else {
1015 1015
 			$enabled = null;
1016 1016
 		}
1017 1017
 
1018
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
1019
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
1018
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
1019
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1020 1020
 
1021 1021
 	endforeach;
1022 1022
 
1023 1023
 	echo '</ul>';
1024 1024
 
1025
-	if ( $field_description ) {
1026
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1025
+	if ($field_description) {
1026
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1027 1027
 	}
1028 1028
 
1029 1029
 }
@@ -1039,31 +1039,31 @@  discard block
 block discarded – undo
1039 1039
  *
1040 1040
  * @return void
1041 1041
  */
1042
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1042
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1043 1043
 
1044 1044
 	$id                = $field_type_object->field->args['id'];
1045 1045
 	$field_description = $field_type_object->field->args['desc'];
1046 1046
 	$gateways          = give_get_enabled_payment_gateways();
1047 1047
 
1048
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
1048
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
1049 1049
 
1050 1050
 	//Add a field to the Give Form admin single post view of this field
1051
-	if ( $field_type_object->field->object_type === 'post' ) {
1052
-		echo '<option value="global">' . __( 'Global Default', 'give' ) . '</option>';
1051
+	if ($field_type_object->field->object_type === 'post') {
1052
+		echo '<option value="global">'.__('Global Default', 'give').'</option>';
1053 1053
 	}
1054 1054
 
1055
-	foreach ( $gateways as $key => $option ) :
1055
+	foreach ($gateways as $key => $option) :
1056 1056
 
1057
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
1057
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
1058 1058
 
1059 1059
 
1060
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1060
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1061 1061
 
1062 1062
 	endforeach;
1063 1063
 
1064 1064
 	echo '</select>';
1065 1065
 
1066
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1066
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1067 1067
 
1068 1068
 }
1069 1069
 
@@ -1078,13 +1078,13 @@  discard block
 block discarded – undo
1078 1078
  *
1079 1079
  * @return void
1080 1080
  */
1081
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1081
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1082 1082
 
1083 1083
 	$id                = $field_type_object->field->args['id'];
1084 1084
 	$title             = $field_type_object->field->args['name'];
1085 1085
 	$field_description = $field_type_object->field->args['desc'];
1086 1086
 
1087
-	echo '<hr>' . $field_description;
1087
+	echo '<hr>'.$field_description;
1088 1088
 
1089 1089
 }
1090 1090
 
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
  *
1100 1100
  * @return void
1101 1101
  */
1102
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1102
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1103 1103
 
1104 1104
 	$id                = $field_type_object->field->args['id'];
1105 1105
 	$title             = $field_type_object->field->args['name'];
@@ -1119,25 +1119,25 @@  discard block
 block discarded – undo
1119 1119
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1120 1120
  * @return array An array of options that matches the CMB2 options array
1121 1121
  */
1122
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1122
+function give_cmb2_get_post_options($query_args, $force = false) {
1123 1123
 
1124
-	$post_options = array( '' => '' ); // Blank option
1124
+	$post_options = array('' => ''); // Blank option
1125 1125
 
1126
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1126
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1127 1127
 		return $post_options;
1128 1128
 	}
1129 1129
 
1130
-	$args = wp_parse_args( $query_args, array(
1130
+	$args = wp_parse_args($query_args, array(
1131 1131
 		'post_type'   => 'page',
1132 1132
 		'numberposts' => 10,
1133
-	) );
1133
+	));
1134 1134
 
1135
-	$posts = get_posts( $args );
1135
+	$posts = get_posts($args);
1136 1136
 
1137
-	if ( $posts ) {
1138
-		foreach ( $posts as $post ) {
1137
+	if ($posts) {
1138
+		foreach ($posts as $post) {
1139 1139
 
1140
-			$post_options[ $post->ID ] = $post->post_title;
1140
+			$post_options[$post->ID] = $post->post_title;
1141 1141
 
1142 1142
 		}
1143 1143
 	}
@@ -1157,17 +1157,17 @@  discard block
 block discarded – undo
1157 1157
 	global $_wp_additional_image_sizes;
1158 1158
 	$sizes = array();
1159 1159
 
1160
-	foreach ( get_intermediate_image_sizes() as $_size ) {
1160
+	foreach (get_intermediate_image_sizes() as $_size) {
1161 1161
 
1162
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1163
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1164
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1165
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1162
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1163
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1164
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1165
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1166 1166
 		}
1167 1167
 
1168 1168
 	}
1169 1169
 
1170
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1170
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1171 1171
 }
1172 1172
 
1173 1173
 
@@ -1181,34 +1181,34 @@  discard block
 block discarded – undo
1181 1181
  *
1182 1182
  * @return void
1183 1183
  */
1184
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1184
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1185 1185
 
1186 1186
 	$id                = $field_type_object->field->args['id'];
1187 1187
 	$field_description = $field_type_object->field->args['desc'];
1188
-	$license_status    = get_option( $field_type_object->field->args['options']['is_valid_license_option'] );
1188
+	$license_status    = get_option($field_type_object->field->args['options']['is_valid_license_option']);
1189 1189
 	$field_classes     = 'regular-text give-license-field';
1190
-	$type              = empty( $escaped_value ) ? 'text' : 'password';
1190
+	$type              = empty($escaped_value) ? 'text' : 'password';
1191 1191
 
1192
-	if ( $license_status === 'valid' ) {
1192
+	if ($license_status === 'valid') {
1193 1193
 		$field_classes .= ' give-license-active';
1194 1194
 	}
1195 1195
 
1196
-	$html = $field_type_object->input( array(
1196
+	$html = $field_type_object->input(array(
1197 1197
 		'class' => $field_classes,
1198 1198
 		'type'  => $type
1199
-	) );
1199
+	));
1200 1200
 
1201 1201
 	//License is active so show deactivate button
1202
-	if ( $license_status === 'valid' ) {
1203
-		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . __( 'Deactivate License', 'give' ) . '"/>';
1202
+	if ($license_status === 'valid') {
1203
+		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.__('Deactivate License', 'give').'"/>';
1204 1204
 	} else {
1205 1205
 		//This license is not valid so delete it
1206
-		give_delete_option( $id );
1206
+		give_delete_option($id);
1207 1207
 	}
1208 1208
 
1209
-	$html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1209
+	$html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1210 1210
 
1211
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1211
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1212 1212
 
1213 1213
 	echo $html;
1214 1214
 }
@@ -1222,13 +1222,13 @@  discard block
 block discarded – undo
1222 1222
  */
1223 1223
 function give_api_callback() {
1224 1224
 
1225
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1225
+	if ( ! current_user_can('manage_give_settings')) {
1226 1226
 		return;
1227 1227
 	}
1228 1228
 
1229
-	do_action( 'give_tools_api_keys_before' );
1229
+	do_action('give_tools_api_keys_before');
1230 1230
 
1231
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1231
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1232 1232
 
1233 1233
 	$api_keys_table = new Give_API_Keys_Table();
1234 1234
 	$api_keys_table->prepare_items();
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 	?>
1237 1237
 	<span class="cmb2-metabox-description api-description">
1238 1238
 		<?php echo sprintf(
1239
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the %2$sGive REST API%1$s to retrieve donation data in JSON or XML for external applications or devices, such as %3$sZapier%1$s.', 'give' ),
1239
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the %2$sGive REST API%1$s to retrieve donation data in JSON or XML for external applications or devices, such as %3$sZapier%1$s.', 'give'),
1240 1240
 			'</a>',
1241 1241
 			'<a href="https://givewp.com/documentation/give-api-reference/" target="_blank">',
1242 1242
 			'<a href="https://givewp.com/addons/zapier/" target="_blank">'
@@ -1244,10 +1244,10 @@  discard block
 block discarded – undo
1244 1244
 	</span>
1245 1245
 	<?php
1246 1246
 
1247
-	do_action( 'give_tools_api_keys_after' );
1247
+	do_action('give_tools_api_keys_after');
1248 1248
 }
1249 1249
 
1250
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1250
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1251 1251
 
1252 1252
 /**
1253 1253
  * Hook Callback
@@ -1260,8 +1260,8 @@  discard block
 block discarded – undo
1260 1260
  *
1261 1261
  * @return void
1262 1262
  */
1263
-function give_hook_callback( $args ) {
1264
-	do_action( 'give_' . $args['id'] );
1263
+function give_hook_callback($args) {
1264
+	do_action('give_'.$args['id']);
1265 1265
 }
1266 1266
 
1267 1267
 /**
@@ -1271,10 +1271,10 @@  discard block
 block discarded – undo
1271 1271
  *
1272 1272
  */
1273 1273
 
1274
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1275
-	require_once WP_PLUGIN_DIR . '/cmb2/init.php';
1276
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1277
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
1278
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1279
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1274
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1275
+	require_once WP_PLUGIN_DIR.'/cmb2/init.php';
1276
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1277
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php';
1278
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1279
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1280 1280
 }
1281 1281
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/customers/class-customer-table.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		global $status, $page;
63 63
 
64 64
 		// Set parent defaults
65
-		parent::__construct( array(
66
-			'singular' => __( 'Donor', 'give' ),     // Singular name of the listed records
67
-			'plural'   => __( 'Donors', 'give' ),    // Plural name of the listed records
65
+		parent::__construct(array(
66
+			'singular' => __('Donor', 'give'), // Singular name of the listed records
67
+			'plural'   => __('Donors', 'give'), // Plural name of the listed records
68 68
 			'ajax'     => false                       // Does this table support ajax?
69
-		) );
69
+		));
70 70
 
71 71
 	}
72 72
 
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return void
83 83
 	 */
84
-	public function search_box( $text, $input_id ) {
85
-		$input_id = $input_id . '-search-input';
84
+	public function search_box($text, $input_id) {
85
+		$input_id = $input_id.'-search-input';
86 86
 
87
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
88
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
87
+		if ( ! empty($_REQUEST['orderby'])) {
88
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
89 89
 		}
90
-		if ( ! empty( $_REQUEST['order'] ) ) {
91
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
90
+		if ( ! empty($_REQUEST['order'])) {
91
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
92 92
 		}
93 93
 		?>
94 94
 		<p class="search-box">
95 95
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
96 96
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
97
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?>
97
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?>
98 98
 		</p>
99 99
 	<?php
100 100
 	}
@@ -110,42 +110,42 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string Column Name
112 112
 	 */
113
-	public function column_default( $item, $column_name ) {
114
-		switch ( $column_name ) {
113
+	public function column_default($item, $column_name) {
114
+		switch ($column_name) {
115 115
 
116 116
 			case 'num_purchases' :
117
-				$value = '<a href="' .
118
-				         admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
119
-				         ) . '">' . esc_html( $item['num_purchases'] ) . '</a>';
117
+				$value = '<a href="'.
118
+				         admin_url('/edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($item['email'])
119
+				         ).'">'.esc_html($item['num_purchases']).'</a>';
120 120
 				break;
121 121
 
122 122
 			case 'amount_spent' :
123
-				$value = give_currency_filter( give_format_amount( $item[ $column_name ] ) );
123
+				$value = give_currency_filter(give_format_amount($item[$column_name]));
124 124
 				break;
125 125
 
126 126
 			case 'date_created' :
127
-				$value = date_i18n( get_option( 'date_format' ), strtotime( $item['date_created'] ) );
127
+				$value = date_i18n(get_option('date_format'), strtotime($item['date_created']));
128 128
 				break;
129 129
 
130 130
 			default:
131
-				$value = isset( $item[ $column_name ] ) ? $item[ $column_name ] : null;
131
+				$value = isset($item[$column_name]) ? $item[$column_name] : null;
132 132
 				break;
133 133
 		}
134 134
 
135
-		return apply_filters( 'give_report_column_' . $column_name, $value, $item['id'] );
135
+		return apply_filters('give_report_column_'.$column_name, $value, $item['id']);
136 136
 
137 137
 	}
138 138
 
139
-	public function column_name( $item ) {
140
-		$name = '#' . $item['id'] . ' ';
141
-		$name .= ! empty( $item['name'] ) ? $item['name'] : '<em>' . __( 'Unnamed Donor', 'give' ) . '</em>';
142
-		$view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $item['id'] );
139
+	public function column_name($item) {
140
+		$name = '#'.$item['id'].' ';
141
+		$name .= ! empty($item['name']) ? $item['name'] : '<em>'.__('Unnamed Donor', 'give').'</em>';
142
+		$view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$item['id']);
143 143
 		$actions  = array(
144
-			'view'   => sprintf( '<a href="%1$s">%2$s</a>', $view_url, __( 'View Donor', 'give' ) ),
145
-			'delete' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $item['id'] ), __( 'Delete', 'give' ) )
144
+			'view'   => sprintf('<a href="%1$s">%2$s</a>', $view_url, __('View Donor', 'give')),
145
+			'delete' => sprintf('<a href="%1$s">%2$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$item['id']), __('Delete', 'give'))
146 146
 		);
147 147
 
148
-		return '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>' . $this->row_actions( $actions );
148
+		return '<a href="'.esc_url($view_url).'">'.$name.'</a>'.$this->row_actions($actions);
149 149
 	}
150 150
 
151 151
 	/**
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function get_columns() {
159 159
 		$columns = array(
160
-			'name'          => __( 'Name', 'give' ),
161
-			'email'         => __( 'Email', 'give' ),
162
-			'num_purchases' => __( 'Donations', 'give' ),
163
-			'amount_spent'  => __( 'Total Donated', 'give' ),
164
-			'date_created'  => __( 'Date Created', 'give' )
160
+			'name'          => __('Name', 'give'),
161
+			'email'         => __('Email', 'give'),
162
+			'num_purchases' => __('Donations', 'give'),
163
+			'amount_spent'  => __('Total Donated', 'give'),
164
+			'date_created'  => __('Date Created', 'give')
165 165
 		);
166 166
 
167
-		return apply_filters( 'give_report_customer_columns', $columns );
167
+		return apply_filters('give_report_customer_columns', $columns);
168 168
 
169 169
 	}
170 170
 
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function get_sortable_columns() {
179 179
 		return array(
180
-			'date_created'  => array( 'date_created', true ),
181
-			'name'          => array( 'name', true ),
182
-			'num_purchases' => array( 'purchase_count', false ),
183
-			'amount_spent'  => array( 'purchase_value', false ),
180
+			'date_created'  => array('date_created', true),
181
+			'name'          => array('name', true),
182
+			'num_purchases' => array('purchase_count', false),
183
+			'amount_spent'  => array('purchase_value', false),
184 184
 		);
185 185
 	}
186 186
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 * @since  1.0
192 192
 	 * @return void
193 193
 	 */
194
-	public function bulk_actions( $which = '' ) {
194
+	public function bulk_actions($which = '') {
195 195
 		// These aren't really bulk actions but this outputs the markup in the right place
196 196
 	}
197 197
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * @return int Current page number
204 204
 	 */
205 205
 	public function get_paged() {
206
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
206
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
207 207
 	}
208 208
 
209 209
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 * @return mixed string If search is present, false otherwise
215 215
 	 */
216 216
 	public function get_search() {
217
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
217
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
218 218
 	}
219 219
 
220 220
 	/**
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$data    = array();
233 233
 		$paged   = $this->get_paged();
234
-		$offset  = $this->per_page * ( $paged - 1 );
234
+		$offset  = $this->per_page * ($paged - 1);
235 235
 		$search  = $this->get_search();
236
-		$order   = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC';
237
-		$orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id';
236
+		$order   = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC';
237
+		$orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id';
238 238
 
239 239
 		$args = array(
240 240
 			'number'  => $this->per_page,
@@ -243,21 +243,21 @@  discard block
 block discarded – undo
243 243
 			'orderby' => $orderby
244 244
 		);
245 245
 
246
-		if ( is_email( $search ) ) {
246
+		if (is_email($search)) {
247 247
 			$args['email'] = $search;
248
-		} elseif ( is_numeric( $search ) ) {
248
+		} elseif (is_numeric($search)) {
249 249
 			$args['id'] = $search;
250 250
 		} else {
251 251
 			$args['name'] = $search;
252 252
 		}
253 253
 
254
-		$customers = Give()->customers->get_customers( $args );
254
+		$customers = Give()->customers->get_customers($args);
255 255
 
256
-		if ( $customers ) {
256
+		if ($customers) {
257 257
 
258
-			foreach ( $customers as $customer ) {
258
+			foreach ($customers as $customer) {
259 259
 
260
-				$user_id = ! empty( $customer->user_id ) ? intval( $customer->user_id ) : 0;
260
+				$user_id = ! empty($customer->user_id) ? intval($customer->user_id) : 0;
261 261
 
262 262
 				$data[] = array(
263 263
 					'id'            => $customer->id,
@@ -291,16 +291,16 @@  discard block
 block discarded – undo
291 291
 		$hidden   = array(); // No hidden columns
292 292
 		$sortable = $this->get_sortable_columns();
293 293
 
294
-		$this->_column_headers = array( $columns, $hidden, $sortable );
294
+		$this->_column_headers = array($columns, $hidden, $sortable);
295 295
 
296 296
 		$this->items = $this->reports_data();
297 297
 
298 298
 		$this->total = give_count_total_customers();
299 299
 
300
-		$this->set_pagination_args( array(
300
+		$this->set_pagination_args(array(
301 301
 			'total_items' => $this->total,
302 302
 			'per_page'    => $this->per_page,
303
-			'total_pages' => ceil( $this->total / $this->per_page )
304
-		) );
303
+			'total_pages' => ceil($this->total / $this->per_page)
304
+		));
305 305
 	}
306 306
 }
307 307
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/reporting/class-gateway-error-logs-list-table.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Exit if accessed directly
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
16 16
 // Load WP_List_Table if not loaded
17
-if ( ! class_exists( 'WP_List_Table' ) ) {
18
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
17
+if ( ! class_exists('WP_List_Table')) {
18
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
19 19
 }
20 20
 
21 21
 /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		global $status, $page;
46 46
 
47 47
 		// Set parent defaults
48
-		parent::__construct( array(
49
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
50
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
48
+		parent::__construct(array(
49
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
50
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
51 51
 			'ajax'     => false                        // Does this table support ajax?
52
-		) );
52
+		));
53 53
 	}
54 54
 
55 55
 	/**
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return string Column Name
65 65
 	 */
66
-	public function column_default( $item, $column_name ) {
67
-		switch ( $column_name ) {
66
+	public function column_default($item, $column_name) {
67
+		switch ($column_name) {
68 68
 			case 'ID' :
69 69
 				return $item['ID_label'];
70 70
 			case 'error' :
71
-				return get_the_title( $item['ID'] ) ? get_the_title( $item['ID'] ) : __( 'Payment Error', 'give' );
71
+				return get_the_title($item['ID']) ? get_the_title($item['ID']) : __('Payment Error', 'give');
72 72
 			default:
73
-				return $item[ $column_name ];
73
+				return $item[$column_name];
74 74
 		}
75 75
 	}
76 76
 
@@ -84,29 +84,29 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @return void
86 86
 	 */
87
-	public function column_message( $item ) {
87
+	public function column_message($item) {
88 88
 
89 89
 		?>
90
-		<a href="#TB_inline?width=640&amp;inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox" title="<?php _e( 'View Log Message', 'give' ); ?> "><?php _e( 'View Log Message', 'give' ); ?></a>
90
+		<a href="#TB_inline?width=640&amp;inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox" title="<?php _e('View Log Message', 'give'); ?> "><?php _e('View Log Message', 'give'); ?></a>
91 91
 		<div id="log-message-<?php echo $item['ID']; ?>" style="display:none;">
92 92
 			<?php
93 93
 
94
-			$log_message = get_post_field( 'post_content', $item['ID'] );
94
+			$log_message = get_post_field('post_content', $item['ID']);
95 95
 
96
-			$serialized  = strpos( $log_message, '{"' );
96
+			$serialized  = strpos($log_message, '{"');
97 97
 
98 98
 			// Check to see if the log message contains serialized information
99
-			if ( $serialized !== false ) {
100
-				$length = strlen( $log_message ) - $serialized;
101
-				$intro  = substr( $log_message, 0, - $length );
102
-				$data   = substr( $log_message, $serialized, strlen( $log_message ) - 1 );
99
+			if ($serialized !== false) {
100
+				$length = strlen($log_message) - $serialized;
101
+				$intro  = substr($log_message, 0, - $length);
102
+				$data   = substr($log_message, $serialized, strlen($log_message) - 1);
103 103
 
104
-				echo wpautop( $intro );
105
-				echo wpautop( '<strong>' . __( 'Log data:', 'give' ) . '</strong>' );
106
-				echo '<div style="word-wrap: break-word;">' . wpautop( $data ) . '</div>';
104
+				echo wpautop($intro);
105
+				echo wpautop('<strong>'.__('Log data:', 'give').'</strong>');
106
+				echo '<div style="word-wrap: break-word;">'.wpautop($data).'</div>';
107 107
 			} else {
108 108
 				// No serialized data found
109
-				echo wpautop( $log_message );
109
+				echo wpautop($log_message);
110 110
 			}
111 111
 			?>
112 112
 		</div>
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function get_columns() {
124 124
 		$columns = array(
125
-			'ID'         => __( 'Log ID', 'give' ),
126
-			'payment_id' => __( 'Payment ID', 'give' ),
127
-			'error'      => __( 'Error', 'give' ),
128
-			'message'    => __( 'Error Message', 'give' ),
129
-			'gateway'    => __( 'Gateway', 'give' ),
130
-			'date'       => __( 'Date', 'give' )
125
+			'ID'         => __('Log ID', 'give'),
126
+			'payment_id' => __('Payment ID', 'give'),
127
+			'error'      => __('Error', 'give'),
128
+			'message'    => __('Error Message', 'give'),
129
+			'gateway'    => __('Gateway', 'give'),
130
+			'date'       => __('Date', 'give')
131 131
 		);
132 132
 
133 133
 		return $columns;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @return int Current page number
142 142
 	 */
143 143
 	public function get_paged() {
144
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
144
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
145 145
 	}
146 146
 
147 147
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * @since  1.0
152 152
 	 * @return void
153 153
 	 */
154
-	public function bulk_actions( $which = '' ) {
154
+	public function bulk_actions($which = '') {
155 155
 		give_log_views();
156 156
 	}
157 157
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		global $give_logs;
168 168
 
169 169
 		// Prevent the queries from getting cached. Without this there are occasional memory issues for some installs
170
-		wp_suspend_cache_addition( true );
170
+		wp_suspend_cache_addition(true);
171 171
 
172 172
 		$logs_data = array();
173 173
 		$paged     = $this->get_paged();
@@ -176,17 +176,17 @@  discard block
 block discarded – undo
176 176
 			'paged'    => $paged
177 177
 		);
178 178
 
179
-		$logs = $give_logs->get_connected_logs( $log_query );
179
+		$logs = $give_logs->get_connected_logs($log_query);
180 180
 
181
-		if ( $logs ) {
182
-			foreach ( $logs as $log ) {
181
+		if ($logs) {
182
+			foreach ($logs as $log) {
183 183
 
184 184
 				$logs_data[] = array(
185 185
 					'ID'         => $log->ID,
186
-					'ID_label'   => '<span class=\'give-item-label give-item-label-gray\'>' . $log->ID . '</span>',
186
+					'ID_label'   => '<span class=\'give-item-label give-item-label-gray\'>'.$log->ID.'</span>',
187 187
 					'payment_id' => $log->post_parent,
188 188
 					'error'      => 'error',
189
-					'gateway'    => give_get_payment_gateway( $log->post_parent ),
189
+					'gateway'    => give_get_payment_gateway($log->post_parent),
190 190
 					'date'       => $log->post_date
191 191
 				);
192 192
 			}
@@ -207,19 +207,19 @@  discard block
 block discarded – undo
207 207
 	 *
208 208
 	 * @param string $which
209 209
 	 */
210
-	protected function display_tablenav( $which ) {
211
-		if ( 'top' === $which ) {
212
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
210
+	protected function display_tablenav($which) {
211
+		if ('top' === $which) {
212
+			wp_nonce_field('bulk-'.$this->_args['plural']);
213 213
 		}
214 214
 		?>
215
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
215
+		<div class="tablenav <?php echo esc_attr($which); ?>">
216 216
 
217 217
 			<div class="alignleft actions bulkactions">
218
-				<?php $this->bulk_actions( $which ); ?>
218
+				<?php $this->bulk_actions($which); ?>
219 219
 			</div>
220 220
 			<?php
221
-			$this->extra_tablenav( $which );
222
-			$this->pagination( $which );
221
+			$this->extra_tablenav($which);
222
+			$this->pagination($which);
223 223
 			?>
224 224
 
225 225
 			<br class="clear"/>
@@ -246,15 +246,15 @@  discard block
 block discarded – undo
246 246
 		$columns               = $this->get_columns();
247 247
 		$hidden                = array(); // No hidden columns
248 248
 		$sortable              = $this->get_sortable_columns();
249
-		$this->_column_headers = array( $columns, $hidden, $sortable );
249
+		$this->_column_headers = array($columns, $hidden, $sortable);
250 250
 		$current_page          = $this->get_pagenum();
251 251
 		$this->items           = $this->get_logs();
252
-		$total_items           = $give_logs->get_log_count( 0, 'gateway_error' );
252
+		$total_items           = $give_logs->get_log_count(0, 'gateway_error');
253 253
 
254
-		$this->set_pagination_args( array(
254
+		$this->set_pagination_args(array(
255 255
 				'total_items' => $total_items,
256 256
 				'per_page'    => $this->per_page,
257
-				'total_pages' => ceil( $total_items / $this->per_page )
257
+				'total_pages' => ceil($total_items / $this->per_page)
258 258
 			)
259 259
 		);
260 260
 	}
Please login to merge, or discard this patch.
includes/emails/template.php 1 patch
Spacing   +71 added lines, -71 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
 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
  *
42 42
  * @return string $message Fully formatted message
43 43
  */
44
-function give_email_template_tags( $message, $payment_data, $payment_id, $admin_notice = false ) {
45
-	return give_do_email_tags( $message, $payment_id );
44
+function give_email_template_tags($message, $payment_data, $payment_id, $admin_notice = false) {
45
+	return give_do_email_tags($message, $payment_id);
46 46
 }
47 47
 
48 48
 /**
@@ -54,40 +54,40 @@  discard block
 block discarded – undo
54 54
  *
55 55
  * @return string $message Fully formatted message
56 56
  */
57
-function give_email_preview_template_tags( $message ) {
57
+function give_email_preview_template_tags($message) {
58 58
 
59
-	$price = give_currency_filter( give_format_amount( 10.50 ) );
59
+	$price = give_currency_filter(give_format_amount(10.50));
60 60
 
61 61
 	$gateway = 'PayPal';
62 62
 
63
-	$receipt_id = strtolower( md5( uniqid() ) );
63
+	$receipt_id = strtolower(md5(uniqid()));
64 64
 
65
-	$notes = __( 'These are some sample notes added to a donation.', 'give' );
65
+	$notes = __('These are some sample notes added to a donation.', 'give');
66 66
 
67
-	$payment_id = rand( 1, 100 );
67
+	$payment_id = rand(1, 100);
68 68
 
69 69
 	$receipt_link = sprintf(
70 70
 		'<a href="%1$s">%2$s</a>',
71
-		esc_url( add_query_arg( array( 'payment_key' => $receipt_id, 'give_action' => 'view_receipt' ), home_url() ) ),
72
-		__( 'View the receipt in your browser', 'give' )
71
+		esc_url(add_query_arg(array('payment_key' => $receipt_id, 'give_action' => 'view_receipt'), home_url())),
72
+		__('View the receipt in your browser', 'give')
73 73
 	);
74 74
 
75 75
 	$user = wp_get_current_user();
76 76
 
77
-	$message = str_replace( '{name}', $user->display_name, $message );
78
-	$message = str_replace( '{fullname}', $user->display_name, $message );
79
-	$message = str_replace( '{username}', $user->user_login, $message );
80
-	$message = str_replace( '{date}', date( get_option( 'date_format' ), current_time( 'timestamp' ) ), $message );
81
-	$message = str_replace( '{price}', $price, $message );
82
-	$message = str_replace( '{donation}', 'Sample Donation Form Title', $message );
83
-	$message = str_replace( '{receipt_id}', $receipt_id, $message );
84
-	$message = str_replace( '{payment_method}', $gateway, $message );
85
-	$message = str_replace( '{sitename}', get_bloginfo( 'name' ), $message );
86
-	$message = str_replace( '{product_notes}', $notes, $message );
87
-	$message = str_replace( '{payment_id}', $payment_id, $message );
88
-	$message = str_replace( '{receipt_link}', $receipt_link, $message );
89
-
90
-	return wpautop( apply_filters( 'give_email_preview_template_tags', $message ) );
77
+	$message = str_replace('{name}', $user->display_name, $message);
78
+	$message = str_replace('{fullname}', $user->display_name, $message);
79
+	$message = str_replace('{username}', $user->user_login, $message);
80
+	$message = str_replace('{date}', date(get_option('date_format'), current_time('timestamp')), $message);
81
+	$message = str_replace('{price}', $price, $message);
82
+	$message = str_replace('{donation}', 'Sample Donation Form Title', $message);
83
+	$message = str_replace('{receipt_id}', $receipt_id, $message);
84
+	$message = str_replace('{payment_method}', $gateway, $message);
85
+	$message = str_replace('{sitename}', get_bloginfo('name'), $message);
86
+	$message = str_replace('{product_notes}', $notes, $message);
87
+	$message = str_replace('{payment_id}', $payment_id, $message);
88
+	$message = str_replace('{receipt_link}', $receipt_link, $message);
89
+
90
+	return wpautop(apply_filters('give_email_preview_template_tags', $message));
91 91
 }
92 92
 
93 93
 /**
@@ -100,20 +100,20 @@  discard block
 block discarded – undo
100 100
  * @since  1.0
101 101
  * @return array|bool
102 102
  */
103
-add_filter( 'give_settings_emails', 'give_email_template_preview' );
103
+add_filter('give_settings_emails', 'give_email_template_preview');
104 104
 
105
-function give_email_template_preview( $array ) {
105
+function give_email_template_preview($array) {
106 106
 
107
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
107
+	if ( ! current_user_can('manage_give_settings')) {
108 108
 		return false;
109 109
 	}
110 110
 	$custom_field = array(
111
-		'name' => __( 'Preview Email', 'give' ),
112
-		'desc' => __( 'Click the buttons to preview emails.', 'give' ),
111
+		'name' => __('Preview Email', 'give'),
112
+		'desc' => __('Click the buttons to preview emails.', 'give'),
113 113
 		'id'   => 'give_email_preview_buttons',
114 114
 		'type' => 'email_preview_buttons'
115 115
 	);
116
-	array_splice( $array, 5, 0, array( $custom_field ) );
116
+	array_splice($array, 5, 0, array($custom_field));
117 117
 
118 118
 	return $array; // splice in at position 3;
119 119
 }
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 function give_email_preview_buttons_callback() {
130 130
 	ob_start();
131 131
 	?>
132
-	<a href="<?php echo esc_url( add_query_arg( array( 'give_action' => 'preview_email' ), home_url() ) ); ?>" class="button-secondary" target="_blank" title="<?php _e( 'Donation Receipt Preview', 'give' ); ?> "><?php _e( 'Preview Donation Receipt', 'give' ); ?></a>
133
-	<a href="<?php echo wp_nonce_url( add_query_arg( array(
132
+	<a href="<?php echo esc_url(add_query_arg(array('give_action' => 'preview_email'), home_url())); ?>" class="button-secondary" target="_blank" title="<?php _e('Donation Receipt Preview', 'give'); ?> "><?php _e('Preview Donation Receipt', 'give'); ?></a>
133
+	<a href="<?php echo wp_nonce_url(add_query_arg(array(
134 134
 		'give_action'  => 'send_test_email',
135 135
 		'give-message' => 'sent-test-email'
136
-	) ), 'give-test-email' ); ?>" title="<?php _e( 'This will send a demo donation receipt to the emails listed below.', 'give' ); ?>" class="button-secondary"><?php _e( 'Send Test Email', 'give' ); ?></a>
136
+	)), 'give-test-email'); ?>" title="<?php _e('This will send a demo donation receipt to the emails listed below.', 'give'); ?>" class="button-secondary"><?php _e('Send Test Email', 'give'); ?></a>
137 137
 	<?php
138 138
 	echo ob_get_clean();
139 139
 }
@@ -146,27 +146,27 @@  discard block
 block discarded – undo
146 146
  */
147 147
 function give_display_email_template_preview() {
148 148
 
149
-	if ( empty( $_GET['give_action'] ) ) {
149
+	if (empty($_GET['give_action'])) {
150 150
 		return;
151 151
 	}
152 152
 
153
-	if ( 'preview_email' !== $_GET['give_action'] ) {
153
+	if ('preview_email' !== $_GET['give_action']) {
154 154
 		return;
155 155
 	}
156 156
 
157
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
157
+	if ( ! current_user_can('manage_give_settings')) {
158 158
 		return;
159 159
 	}
160 160
 
161
-	Give()->emails->heading = __( 'Donation Receipt', 'give' );
161
+	Give()->emails->heading = __('Donation Receipt', 'give');
162 162
 
163
-	echo Give()->emails->build_email( give_email_preview_template_tags( give_get_email_body_content( 0, array() ) ) );
163
+	echo Give()->emails->build_email(give_email_preview_template_tags(give_get_email_body_content(0, array())));
164 164
 
165 165
 	exit;
166 166
 
167 167
 }
168 168
 
169
-add_action( 'template_redirect', 'give_display_email_template_preview' );
169
+add_action('template_redirect', 'give_display_email_template_preview');
170 170
 
171 171
 /**
172 172
  * Email Template Body
@@ -178,19 +178,19 @@  discard block
 block discarded – undo
178 178
  *
179 179
  * @return string $email_body Body of the email
180 180
  */
181
-function give_get_email_body_content( $payment_id = 0, $payment_data = array() ) {
181
+function give_get_email_body_content($payment_id = 0, $payment_data = array()) {
182 182
 
183 183
 	global $give_options;
184 184
 
185 185
 	$default_email_body = give_get_default_donation_receipt_email();
186 186
 
187
-	$email = isset( $give_options['donation_receipt'] ) ? stripslashes( $give_options['donation_receipt'] ) : $default_email_body;
187
+	$email = isset($give_options['donation_receipt']) ? stripslashes($give_options['donation_receipt']) : $default_email_body;
188 188
 
189
-	$email_body = wpautop( $email );
189
+	$email_body = wpautop($email);
190 190
 
191
-	$email_body = apply_filters( 'give_donation_receipt_' . Give()->emails->get_template(), $email_body, $payment_id, $payment_data );
191
+	$email_body = apply_filters('give_donation_receipt_'.Give()->emails->get_template(), $email_body, $payment_id, $payment_data);
192 192
 
193
-	return apply_filters( 'give_donation_receipt', $email_body, $payment_id, $payment_data );
193
+	return apply_filters('give_donation_receipt', $email_body, $payment_id, $payment_data);
194 194
 }
195 195
 
196 196
 
@@ -206,37 +206,37 @@  discard block
 block discarded – undo
206 206
  *
207 207
  * @return string $email_body Body of the email
208 208
  */
209
-function give_get_donation_notification_body_content( $payment_id = 0, $payment_data = array() ) {
209
+function give_get_donation_notification_body_content($payment_id = 0, $payment_data = array()) {
210 210
 	global $give_options;
211 211
 
212
-	$user_info = maybe_unserialize( $payment_data['user_info'] );
213
-	$email     = give_get_payment_user_email( $payment_id );
212
+	$user_info = maybe_unserialize($payment_data['user_info']);
213
+	$email     = give_get_payment_user_email($payment_id);
214 214
 
215
-	if ( isset( $user_info['id'] ) && $user_info['id'] > 0 ) {
216
-		$user_data = get_userdata( $user_info['id'] );
215
+	if (isset($user_info['id']) && $user_info['id'] > 0) {
216
+		$user_data = get_userdata($user_info['id']);
217 217
 		$name      = $user_data->display_name;
218
-	} elseif ( isset( $user_info['first_name'] ) && isset( $user_info['last_name'] ) ) {
219
-		$name = $user_info['first_name'] . ' ' . $user_info['last_name'];
218
+	} elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
219
+		$name = $user_info['first_name'].' '.$user_info['last_name'];
220 220
 	} else {
221 221
 		$name = $email;
222 222
 	}
223 223
 
224
-	$gateway = give_get_gateway_admin_label( get_post_meta( $payment_id, '_give_payment_gateway', true ) );
224
+	$gateway = give_get_gateway_admin_label(get_post_meta($payment_id, '_give_payment_gateway', true));
225 225
 
226
-	$default_email_body = __( 'Hello', 'give' ) . "\n\n" . __( 'A donation has been made', 'give' ) . ".\n\n";
227
-	$default_email_body .= sprintf( __( '%s sold:', 'give' ), give_get_forms_label_plural() ) . "\n\n";
226
+	$default_email_body = __('Hello', 'give')."\n\n".__('A donation has been made', 'give').".\n\n";
227
+	$default_email_body .= sprintf(__('%s sold:', 'give'), give_get_forms_label_plural())."\n\n";
228 228
 
229
-	$default_email_body .= __( 'Donor: ', 'give' ) . " " . html_entity_decode( $name, ENT_COMPAT, 'UTF-8' ) . "\n";
230
-	$default_email_body .= __( 'Amount: ', 'give' ) . " " . html_entity_decode( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ), ENT_COMPAT, 'UTF-8' ) . "\n";
231
-	$default_email_body .= __( 'Payment Method: ', 'give' ) . " " . $gateway . "\n\n";
229
+	$default_email_body .= __('Donor: ', 'give')." ".html_entity_decode($name, ENT_COMPAT, 'UTF-8')."\n";
230
+	$default_email_body .= __('Amount: ', 'give')." ".html_entity_decode(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id))), ENT_COMPAT, 'UTF-8')."\n";
231
+	$default_email_body .= __('Payment Method: ', 'give')." ".$gateway."\n\n";
232 232
 
233
-	$default_email_body .= __( 'Thank you', 'give' );
233
+	$default_email_body .= __('Thank you', 'give');
234 234
 
235
-	$email = isset( $give_options['donation_notification'] ) ? stripslashes( $give_options['donation_notification'] ) : $default_email_body;
235
+	$email = isset($give_options['donation_notification']) ? stripslashes($give_options['donation_notification']) : $default_email_body;
236 236
 
237
-	$email_body = give_do_email_tags( $email, $payment_id );
237
+	$email_body = give_do_email_tags($email, $payment_id);
238 238
 
239
-	return apply_filters( 'give_donation_notification', wpautop( $email_body ), $payment_id, $payment_data );
239
+	return apply_filters('give_donation_notification', wpautop($email_body), $payment_id, $payment_data);
240 240
 }
241 241
 
242 242
 /**
@@ -249,15 +249,15 @@  discard block
 block discarded – undo
249 249
  * @since  1.0
250 250
  */
251 251
 function give_render_receipt_in_browser() {
252
-	if ( ! isset( $_GET['payment_key'] ) ) {
253
-		wp_die( __( 'Missing donation payment key.', 'give' ), __( 'Error', 'give' ) );
252
+	if ( ! isset($_GET['payment_key'])) {
253
+		wp_die(__('Missing donation payment key.', 'give'), __('Error', 'give'));
254 254
 	}
255 255
 
256
-	$key = urlencode( $_GET['payment_key'] );
256
+	$key = urlencode($_GET['payment_key']);
257 257
 
258 258
 	ob_start();
259 259
 	//Disallows caching of the page
260
-	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
260
+	header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
261 261
 	header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
262 262
 	header("Cache-Control: post-check=0, pre-check=0", false);
263 263
 	header("Pragma: no-cache"); // HTTP/1.0
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	<!DOCTYPE html>
267 267
 	<html lang="en">
268 268
 		<head>
269
-			<title><?php _e( 'Donation Receipt', 'give' ); ?></title>
269
+			<title><?php _e('Donation Receipt', 'give'); ?></title>
270 270
 			<meta charset="utf-8" />
271 271
 
272 272
 			<!-- Further disallowing of caching of this page -->
@@ -280,12 +280,12 @@  discard block
 block discarded – undo
280 280
 
281 281
 			<?php wp_head(); ?>
282 282
 		</head>
283
-		<body class="<?php echo apply_filters( 'give_receipt_page_body_class', 'give_receipt_page' ); ?>">
283
+		<body class="<?php echo apply_filters('give_receipt_page_body_class', 'give_receipt_page'); ?>">
284 284
 
285 285
 			<div id="give_receipt_wrapper">
286
-				<?php do_action( 'give_render_receipt_in_browser_before' ); ?>
287
-				<?php echo do_shortcode( '[give_receipt payment_key=' . $key . ']' ); ?>
288
-				<?php do_action( 'give_render_receipt_in_browser_after' ); ?>
286
+				<?php do_action('give_render_receipt_in_browser_before'); ?>
287
+				<?php echo do_shortcode('[give_receipt payment_key='.$key.']'); ?>
288
+				<?php do_action('give_render_receipt_in_browser_after'); ?>
289 289
 			</div>
290 290
 
291 291
 			<?php wp_footer(); ?>
@@ -296,4 +296,4 @@  discard block
 block discarded – undo
296 296
 	die();
297 297
 }
298 298
 
299
-add_action( 'give_view_receipt', 'give_render_receipt_in_browser' );
299
+add_action('give_view_receipt', 'give_render_receipt_in_browser');
Please login to merge, or discard this patch.
includes/emails/class-give-email-tags.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  */
24 24
 
25 25
 // Exit if accessed directly
26
-if ( ! defined( 'ABSPATH' ) ) {
26
+if ( ! defined('ABSPATH')) {
27 27
 	exit;
28 28
 }
29 29
 
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 	 * @param string $tag Email tag to be replace in email
55 55
 	 * @param callable $func Hook to run when email tag is found
56 56
 	 */
57
-	public function add( $tag, $description, $func ) {
58
-		if ( is_callable( $func ) ) {
59
-			$this->tags[ $tag ] = array(
57
+	public function add($tag, $description, $func) {
58
+		if (is_callable($func)) {
59
+			$this->tags[$tag] = array(
60 60
 				'tag'         => $tag,
61 61
 				'description' => $description,
62 62
 				'func'        => $func
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	 *
72 72
 	 * @param string $tag Email tag to remove hook from
73 73
 	 */
74
-	public function remove( $tag ) {
75
-		unset( $this->tags[ $tag ] );
74
+	public function remove($tag) {
75
+		unset($this->tags[$tag]);
76 76
 	}
77 77
 
78 78
 	/**
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @return bool
86 86
 	 */
87
-	public function email_tag_exists( $tag ) {
88
-		return array_key_exists( $tag, $this->tags );
87
+	public function email_tag_exists($tag) {
88
+		return array_key_exists($tag, $this->tags);
89 89
 	}
90 90
 
91 91
 	/**
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 	 *
110 110
 	 * @return string Content with email tags filtered out.
111 111
 	 */
112
-	public function do_tags( $content, $payment_id ) {
112
+	public function do_tags($content, $payment_id) {
113 113
 
114 114
 		// Check if there is atleast one tag added
115
-		if ( empty( $this->tags ) || ! is_array( $this->tags ) ) {
115
+		if (empty($this->tags) || ! is_array($this->tags)) {
116 116
 			return $content;
117 117
 		}
118 118
 
119 119
 		$this->payment_id = $payment_id;
120 120
 
121
-		$new_content = preg_replace_callback( "/{([A-z0-9\-\_]+)}/s", array( $this, 'do_tag' ), $content );
121
+		$new_content = preg_replace_callback("/{([A-z0-9\-\_]+)}/s", array($this, 'do_tag'), $content);
122 122
 
123 123
 		$this->payment_id = null;
124 124
 
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 	 *
135 135
 	 * @return mixed
136 136
 	 */
137
-	public function do_tag( $m ) {
137
+	public function do_tag($m) {
138 138
 
139 139
 		// Get tag
140 140
 		$tag = $m[1];
141 141
 
142 142
 		// Return tag if tag not set
143
-		if ( ! $this->email_tag_exists( $tag ) ) {
143
+		if ( ! $this->email_tag_exists($tag)) {
144 144
 			return $m[0];
145 145
 		}
146 146
 
147
-		return call_user_func( $this->tags[ $tag ]['func'], $this->payment_id, $tag );
147
+		return call_user_func($this->tags[$tag]['func'], $this->payment_id, $tag);
148 148
 	}
149 149
 
150 150
 }
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
  * @param string $description Description of the email tag added
159 159
  * @param callable $func Hook to run when email tag is found
160 160
  */
161
-function give_add_email_tag( $tag, $description, $func ) {
162
-	Give()->email_tags->add( $tag, $description, $func );
161
+function give_add_email_tag($tag, $description, $func) {
162
+	Give()->email_tags->add($tag, $description, $func);
163 163
 }
164 164
 
165 165
 /**
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
  *
170 170
  * @param string $tag Email tag to remove hook from
171 171
  */
172
-function give_remove_email_tag( $tag ) {
173
-	Give()->email_tags->remove( $tag );
172
+function give_remove_email_tag($tag) {
173
+	Give()->email_tags->remove($tag);
174 174
 }
175 175
 
176 176
 /**
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
  *
183 183
  * @return bool
184 184
  */
185
-function give_email_tag_exists( $tag ) {
186
-	return Give()->email_tags->email_tag_exists( $tag );
185
+function give_email_tag_exists($tag) {
186
+	return Give()->email_tags->email_tag_exists($tag);
187 187
 }
188 188
 
189 189
 /**
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 	$email_tags = give_get_email_tags();
213 213
 
214 214
 	// Check
215
-	if ( count( $email_tags ) > 0 ) {
215
+	if (count($email_tags) > 0) {
216 216
 
217 217
 		// Loop
218
-		foreach ( $email_tags as $email_tag ) {
218
+		foreach ($email_tags as $email_tag) {
219 219
 
220 220
 			// Add email tag to list
221
-			$list .= '<code>{' . $email_tag['tag'] . '}</code> - ' . $email_tag['description'] . '<br/>';
221
+			$list .= '<code>{'.$email_tag['tag'].'}</code> - '.$email_tag['description'].'<br/>';
222 222
 
223 223
 		}
224 224
 
@@ -238,13 +238,13 @@  discard block
 block discarded – undo
238 238
  *
239 239
  * @return string Content with email tags filtered out.
240 240
  */
241
-function give_do_email_tags( $content, $payment_id ) {
241
+function give_do_email_tags($content, $payment_id) {
242 242
 
243 243
 	// Replace all tags
244
-	$content = Give()->email_tags->do_tags( $content, $payment_id );
244
+	$content = Give()->email_tags->do_tags($content, $payment_id);
245 245
 
246 246
 	// Maintaining backwards compatibility
247
-	$content = apply_filters( 'give_email_template_tags', $content, give_get_payment_meta( $payment_id ), $payment_id );
247
+	$content = apply_filters('give_email_template_tags', $content, give_get_payment_meta($payment_id), $payment_id);
248 248
 
249 249
 	// Return content
250 250
 	return $content;
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
  * @since 1.0
257 257
  */
258 258
 function give_load_email_tags() {
259
-	do_action( 'give_add_email_tags' );
259
+	do_action('give_add_email_tags');
260 260
 }
261 261
 
262
-add_action( 'init', 'give_load_email_tags', - 999 );
262
+add_action('init', 'give_load_email_tags', - 999);
263 263
 
264 264
 /**
265 265
  * Add default Give email template tags
@@ -272,82 +272,82 @@  discard block
 block discarded – undo
272 272
 	$email_tags = array(
273 273
 		array(
274 274
 			'tag'         => 'donation',
275
-			'description' => __( 'The name of completed donation form and the donation level chosen if applicable.', 'give' ),
275
+			'description' => __('The name of completed donation form and the donation level chosen if applicable.', 'give'),
276 276
 			'function'    => 'give_email_tag_donation'
277 277
 		),
278 278
 		array(
279 279
 			'tag'         => 'name',
280
-			'description' => __( 'The donor\'s first name', 'give' ),
280
+			'description' => __('The donor\'s first name', 'give'),
281 281
 			'function'    => 'give_email_tag_first_name'
282 282
 		),
283 283
 		array(
284 284
 			'tag'         => 'fullname',
285
-			'description' => __( 'The donor\'s full name, first and last', 'give' ),
285
+			'description' => __('The donor\'s full name, first and last', 'give'),
286 286
 			'function'    => 'give_email_tag_fullname'
287 287
 		),
288 288
 		array(
289 289
 			'tag'         => 'username',
290
-			'description' => __( 'The donor\'s user name on the site, if they registered an account', 'give' ),
290
+			'description' => __('The donor\'s user name on the site, if they registered an account', 'give'),
291 291
 			'function'    => 'give_email_tag_username'
292 292
 		),
293 293
 		array(
294 294
 			'tag'         => 'user_email',
295
-			'description' => __( 'The donor\'s email address', 'give' ),
295
+			'description' => __('The donor\'s email address', 'give'),
296 296
 			'function'    => 'give_email_tag_user_email'
297 297
 		),
298 298
 		array(
299 299
 			'tag'         => 'billing_address',
300
-			'description' => __( 'The donor\'s billing address', 'give' ),
300
+			'description' => __('The donor\'s billing address', 'give'),
301 301
 			'function'    => 'give_email_tag_billing_address'
302 302
 		),
303 303
 		array(
304 304
 			'tag'         => 'date',
305
-			'description' => __( 'The date of the donation', 'give' ),
305
+			'description' => __('The date of the donation', 'give'),
306 306
 			'function'    => 'give_email_tag_date'
307 307
 		),
308 308
 		array(
309 309
 			'tag'         => 'price',
310
-			'description' => __( 'The total price of the donation', 'give' ),
310
+			'description' => __('The total price of the donation', 'give'),
311 311
 			'function'    => 'give_email_tag_price'
312 312
 		),
313 313
 		array(
314 314
 			'tag'         => 'payment_id',
315
-			'description' => __( 'The unique ID number for this donation', 'give' ),
315
+			'description' => __('The unique ID number for this donation', 'give'),
316 316
 			'function'    => 'give_email_tag_payment_id'
317 317
 		),
318 318
 		array(
319 319
 			'tag'         => 'receipt_id',
320
-			'description' => __( 'The unique ID number for this donation receipt', 'give' ),
320
+			'description' => __('The unique ID number for this donation receipt', 'give'),
321 321
 			'function'    => 'give_email_tag_receipt_id'
322 322
 		),
323 323
 		array(
324 324
 			'tag'         => 'payment_method',
325
-			'description' => __( 'The method of payment used for this donation', 'give' ),
325
+			'description' => __('The method of payment used for this donation', 'give'),
326 326
 			'function'    => 'give_email_tag_payment_method'
327 327
 		),
328 328
 		array(
329 329
 			'tag'         => 'sitename',
330
-			'description' => __( 'Your site name', 'give' ),
330
+			'description' => __('Your site name', 'give'),
331 331
 			'function'    => 'give_email_tag_sitename'
332 332
 		),
333 333
 		array(
334 334
 			'tag'         => 'receipt_link',
335
-			'description' => __( 'Adds a link so users can view their receipt directly on your website if they are unable to view it in the browser correctly.', 'give' ),
335
+			'description' => __('Adds a link so users can view their receipt directly on your website if they are unable to view it in the browser correctly.', 'give'),
336 336
 			'function'    => 'give_email_tag_receipt_link'
337 337
 		),
338 338
 	);
339 339
 
340 340
 	// Apply give_email_tags filter
341
-	$email_tags = apply_filters( 'give_email_tags', $email_tags );
341
+	$email_tags = apply_filters('give_email_tags', $email_tags);
342 342
 
343 343
 	// Add email tags
344
-	foreach ( $email_tags as $email_tag ) {
345
-		give_add_email_tag( $email_tag['tag'], $email_tag['description'], $email_tag['function'] );
344
+	foreach ($email_tags as $email_tag) {
345
+		give_add_email_tag($email_tag['tag'], $email_tag['description'], $email_tag['function']);
346 346
 	}
347 347
 
348 348
 }
349 349
 
350
-add_action( 'give_add_email_tags', 'give_setup_email_tags' );
350
+add_action('give_add_email_tags', 'give_setup_email_tags');
351 351
 
352 352
 
353 353
 /**
@@ -358,15 +358,15 @@  discard block
 block discarded – undo
358 358
  *
359 359
  * @return string name
360 360
  */
361
-function give_email_tag_first_name( $payment_id ) {
362
-	$payment   = new Give_Payment( $payment_id );
361
+function give_email_tag_first_name($payment_id) {
362
+	$payment   = new Give_Payment($payment_id);
363 363
 	$user_info = $payment->user_info;
364 364
 
365
-	if ( empty( $user_info ) ) {
365
+	if (empty($user_info)) {
366 366
 		return '';
367 367
 	}
368 368
 
369
-	$email_name = give_get_email_names( $user_info );
369
+	$email_name = give_get_email_names($user_info);
370 370
 
371 371
 	return $email_name['name'];
372 372
 }
@@ -379,15 +379,15 @@  discard block
 block discarded – undo
379 379
  *
380 380
  * @return string fullname
381 381
  */
382
-function give_email_tag_fullname( $payment_id ) {
383
-	$payment   = new Give_Payment( $payment_id );
382
+function give_email_tag_fullname($payment_id) {
383
+	$payment   = new Give_Payment($payment_id);
384 384
 	$user_info = $payment->user_info;
385 385
 
386
-	if ( empty( $user_info ) ) {
386
+	if (empty($user_info)) {
387 387
 		return '';
388 388
 	}
389 389
 
390
-	$email_name = give_get_email_names( $user_info );
390
+	$email_name = give_get_email_names($user_info);
391 391
 
392 392
 	return $email_name['fullname'];
393 393
 }
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
  *
401 401
  * @return string username
402 402
  */
403
-function give_email_tag_username( $payment_id ) {
404
-	$payment   = new Give_Payment( $payment_id );
403
+function give_email_tag_username($payment_id) {
404
+	$payment   = new Give_Payment($payment_id);
405 405
 	$user_info = $payment->user_info;
406 406
 
407
-	if ( empty( $user_info ) ) {
407
+	if (empty($user_info)) {
408 408
 		return '';
409 409
 	}
410 410
 
411
-	$email_name = give_get_email_names( $user_info );
411
+	$email_name = give_get_email_names($user_info);
412 412
 
413 413
 	return $email_name['username'];
414 414
 }
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
  *
422 422
  * @return string user_email
423 423
  */
424
-function give_email_tag_user_email( $payment_id ) {
425
-	$payment = new Give_Payment( $payment_id );
424
+function give_email_tag_user_email($payment_id) {
425
+	$payment = new Give_Payment($payment_id);
426 426
 
427 427
 	return $payment->email;
428 428
 }
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
  *
436 436
  * @return string billing_address
437 437
  */
438
-function give_email_tag_billing_address( $payment_id ) {
438
+function give_email_tag_billing_address($payment_id) {
439 439
 
440
-	$user_info    = give_get_payment_meta_user_info( $payment_id );
441
-	$user_address = ! empty( $user_info['address'] ) ? $user_info['address'] : array(
440
+	$user_info    = give_get_payment_meta_user_info($payment_id);
441
+	$user_address = ! empty($user_info['address']) ? $user_info['address'] : array(
442 442
 		'line1'   => '',
443 443
 		'line2'   => '',
444 444
 		'city'    => '',
@@ -447,11 +447,11 @@  discard block
 block discarded – undo
447 447
 		'zip'     => ''
448 448
 	);
449 449
 
450
-	$return = $user_address['line1'] . "\n";
451
-	if ( ! empty( $user_address['line2'] ) ) {
452
-		$return .= $user_address['line2'] . "\n";
450
+	$return = $user_address['line1']."\n";
451
+	if ( ! empty($user_address['line2'])) {
452
+		$return .= $user_address['line2']."\n";
453 453
 	}
454
-	$return .= $user_address['city'] . ' ' . $user_address['zip'] . ' ' . $user_address['state'] . "\n";
454
+	$return .= $user_address['city'].' '.$user_address['zip'].' '.$user_address['state']."\n";
455 455
 	$return .= $user_address['country'];
456 456
 
457 457
 	return $return;
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
  *
466 466
  * @return string date
467 467
  */
468
-function give_email_tag_date( $payment_id ) {
469
-	$payment = new Give_Payment( $payment_id );
468
+function give_email_tag_date($payment_id) {
469
+	$payment = new Give_Payment($payment_id);
470 470
 
471
-	return date_i18n( get_option( 'date_format' ), strtotime( $payment->date ) );
471
+	return date_i18n(get_option('date_format'), strtotime($payment->date));
472 472
 }
473 473
 
474 474
 /**
@@ -479,11 +479,11 @@  discard block
 block discarded – undo
479 479
  *
480 480
  * @return string price
481 481
  */
482
-function give_email_tag_price( $payment_id ) {
483
-	$payment = new Give_Payment( $payment_id );
484
-	$price   = give_currency_filter( give_format_amount( $payment->total ), $payment->currency );
482
+function give_email_tag_price($payment_id) {
483
+	$payment = new Give_Payment($payment_id);
484
+	$price   = give_currency_filter(give_format_amount($payment->total), $payment->currency);
485 485
 
486
-	return html_entity_decode( $price, ENT_COMPAT, 'UTF-8' );
486
+	return html_entity_decode($price, ENT_COMPAT, 'UTF-8');
487 487
 }
488 488
 
489 489
 /**
@@ -494,8 +494,8 @@  discard block
 block discarded – undo
494 494
  *
495 495
  * @return int payment_id
496 496
  */
497
-function give_email_tag_payment_id( $payment_id ) {
498
-	$payment = new Give_Payment( $payment_id );
497
+function give_email_tag_payment_id($payment_id) {
498
+	$payment = new Give_Payment($payment_id);
499 499
 
500 500
 	return $payment->number;
501 501
 }
@@ -508,8 +508,8 @@  discard block
 block discarded – undo
508 508
  *
509 509
  * @return string receipt_id
510 510
  */
511
-function give_email_tag_receipt_id( $payment_id ) {
512
-	$payment = new Give_Payment( $payment_id );
511
+function give_email_tag_receipt_id($payment_id) {
512
+	$payment = new Give_Payment($payment_id);
513 513
 
514 514
 	return $payment->key;
515 515
 }
@@ -523,11 +523,11 @@  discard block
 block discarded – undo
523 523
  *
524 524
  * @return string $form_title
525 525
  */
526
-function give_email_tag_donation( $payment_id ) {
527
-	$payment    = new Give_Payment( $payment_id );
528
-	$form_title = give_get_payment_form_title( $payment->meta, false, '-' );
526
+function give_email_tag_donation($payment_id) {
527
+	$payment    = new Give_Payment($payment_id);
528
+	$form_title = give_get_payment_form_title($payment->meta, false, '-');
529 529
 
530
-	return ! empty( $form_title ) ? $form_title : __( 'There was an error retrieving this donation title', 'give' );
530
+	return ! empty($form_title) ? $form_title : __('There was an error retrieving this donation title', 'give');
531 531
 
532 532
 }
533 533
 
@@ -539,10 +539,10 @@  discard block
 block discarded – undo
539 539
  *
540 540
  * @return string gateway
541 541
  */
542
-function give_email_tag_payment_method( $payment_id ) {
543
-	$payment = new Give_Payment( $payment_id );
542
+function give_email_tag_payment_method($payment_id) {
543
+	$payment = new Give_Payment($payment_id);
544 544
 
545
-	return give_get_gateway_checkout_label( $payment->gateway );
545
+	return give_get_gateway_checkout_label($payment->gateway);
546 546
 }
547 547
 
548 548
 /**
@@ -553,8 +553,8 @@  discard block
 block discarded – undo
553 553
  *
554 554
  * @return string sitename
555 555
  */
556
-function give_email_tag_sitename( $payment_id ) {
557
-	return wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
556
+function give_email_tag_sitename($payment_id) {
557
+	return wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
558 558
 }
559 559
 
560 560
 /**
@@ -566,19 +566,19 @@  discard block
 block discarded – undo
566 566
  *
567 567
  * @return string receipt_link
568 568
  */
569
-function give_email_tag_receipt_link( $payment_id ) {
569
+function give_email_tag_receipt_link($payment_id) {
570 570
 
571
-	$receipt_url = esc_url( add_query_arg( array(
572
-		'payment_key' => give_get_payment_key( $payment_id ),
571
+	$receipt_url = esc_url(add_query_arg(array(
572
+		'payment_key' => give_get_payment_key($payment_id),
573 573
 		'give_action' => 'view_receipt'
574
-	), home_url() ) );
575
-	$formatted   = sprintf(
574
+	), home_url()));
575
+	$formatted = sprintf(
576 576
 		'<a href="%1$s">%2$s</a>',
577 577
 		$receipt_url,
578
-		__( 'View it in your browser', 'give' )
578
+		__('View it in your browser', 'give')
579 579
 	);
580 580
 
581
-	if ( give_get_option( 'email_template' ) !== 'none' ) {
581
+	if (give_get_option('email_template') !== 'none') {
582 582
 		return $formatted;
583 583
 	} else {
584 584
 		return $receipt_url;
Please login to merge, or discard this patch.