Completed
Push — master ( 650f94...80ac30 )
by Devin
17:41
created
includes/class-give-cron.php 1 patch
Spacing   +9 added lines, -9 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
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 	 * @see   Give_Cron::weekly_events()
30 30
 	 */
31 31
 	public function __construct() {
32
-		add_filter( 'cron_schedules', array( $this, 'add_schedules' ) );
33
-		add_action( 'wp', array( $this, 'schedule_Events' ) );
32
+		add_filter('cron_schedules', array($this, 'add_schedules'));
33
+		add_action('wp', array($this, 'schedule_Events'));
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	 *
43 43
 	 * @return array
44 44
 	 */
45
-	public function add_schedules( $schedules = array() ) {
45
+	public function add_schedules($schedules = array()) {
46 46
 		// Adds once weekly to the existing schedules.
47 47
 		$schedules['weekly'] = array(
48 48
 			'interval' => 604800,
49
-			'display'  => esc_html__( 'Once Weekly', 'give' )
49
+			'display'  => esc_html__('Once Weekly', 'give')
50 50
 		);
51 51
 
52 52
 		return $schedules;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 * @return void
73 73
 	 */
74 74
 	private function weekly_events() {
75
-		if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) {
76
-			wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' );
75
+		if ( ! wp_next_scheduled('give_weekly_scheduled_events')) {
76
+			wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events');
77 77
 		}
78 78
 	}
79 79
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @return void
86 86
 	 */
87 87
 	private function daily_events() {
88
-		if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) {
89
-			wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' );
88
+		if ( ! wp_next_scheduled('give_daily_scheduled_events')) {
89
+			wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events');
90 90
 		}
91 91
 	}
92 92
 
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 * @param $url
91 91
 	 *
92
-	 * @return mixed
92
+	 * @return string
93 93
 	 */
94 94
 	public function give_update_cmb_meta_box_url( $url ) {
95 95
 		//Path to Give's CMB
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
  * @since 1.0
874 874
  *
875 875
  * @param string          $key The Key to update
876
- * @param string|bool|int $value The value to set the key to
876
+ * @param integer $value The value to set the key to
877 877
  *
878 878
  * @return boolean True if updated, false if not.
879 879
  */
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  * @since      1.3.5
975 975
  *
976 976
  * @param $array
977
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
977
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
978 978
  * @param $insert |array a valid array of options to insert
979 979
  *
980 980
  * @return array
Please login to merge, or discard this patch.
Spacing   +308 added lines, -308 removed lines patch added patch discarded remove patch
@@ -41,26 +41,26 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function __construct() {
43 43
 
44
-		add_action( 'admin_init', array( $this, 'init' ) );
44
+		add_action('admin_init', array($this, 'init'));
45 45
 
46 46
 		//Customize CMB2 URL
47
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
47
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
48 48
 
49 49
 		//Custom CMB2 Settings Fields
50
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
51
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
52
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
53
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
54
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
55
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
56
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
57
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
58
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
50
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
51
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
52
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
53
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
54
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
55
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
56
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
57
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
58
+		add_action('admin_notices', array($this, 'settings_notices'));
59 59
 
60 60
 		// Include CMB CSS in the head to avoid FOUC
61
-		add_action( 'admin_print_styles-give_forms_page_give-settings', array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
61
+		add_action('admin_print_styles-give_forms_page_give-settings', array('CMB2_hookup', 'enqueue_cmb_css'));
62 62
 
63
-		add_filter( 'cmb2_get_metabox_form_format', array( $this, 'give_modify_cmb2_form_output' ), 10, 3 );
63
+		add_filter('cmb2_get_metabox_form_format', array($this, 'give_modify_cmb2_form_output'), 10, 3);
64 64
 
65 65
 	}
66 66
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @since  1.0
72 72
 	 */
73 73
 	public function init() {
74
-		register_setting( $this->key, $this->key );
74
+		register_setting($this->key, $this->key);
75 75
 
76 76
 	}
77 77
 
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return mixed
87 87
 	 */
88
-	public function give_update_cmb_meta_box_url( $url ) {
88
+	public function give_update_cmb_meta_box_url($url) {
89 89
 		//Path to Give's CMB
90
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
90
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
91 91
 	}
92 92
 
93 93
 
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function give_get_settings_tabs() {
101 101
 
102
-		$settings = $this->give_settings( null );
102
+		$settings = $this->give_settings(null);
103 103
 
104 104
 		$tabs             = array();
105
-		$tabs['general']  = esc_html__( 'General', 'give' );
106
-		$tabs['gateways'] = esc_html__( 'Payment Gateways', 'give' );
107
-		$tabs['display']  = esc_html__( 'Display Options', 'give' );
108
-		$tabs['emails']   = esc_html__( 'Emails', 'give' );
105
+		$tabs['general']  = esc_html__('General', 'give');
106
+		$tabs['gateways'] = esc_html__('Payment Gateways', 'give');
107
+		$tabs['display']  = esc_html__('Display Options', 'give');
108
+		$tabs['emails']   = esc_html__('Emails', 'give');
109 109
 
110
-		if ( ! empty( $settings['addons']['fields'] ) ) {
111
-			$tabs['addons'] = esc_html__( 'Add-ons', 'give' );
110
+		if ( ! empty($settings['addons']['fields'])) {
111
+			$tabs['addons'] = esc_html__('Add-ons', 'give');
112 112
 		}
113 113
 
114
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
115
-			$tabs['licenses'] = esc_html__( 'Licenses', 'give' );
114
+		if ( ! empty($settings['licenses']['fields'])) {
115
+			$tabs['licenses'] = esc_html__('Licenses', 'give');
116 116
 		}
117 117
 
118
-		$tabs['advanced']    = esc_html__( 'Advanced', 'give' );
119
-		$tabs['api']         = esc_html__( 'API', 'give' );
120
-		$tabs['system_info'] = esc_html__( 'System Info', 'give' );
118
+		$tabs['advanced']    = esc_html__('Advanced', 'give');
119
+		$tabs['api']         = esc_html__('API', 'give');
120
+		$tabs['system_info'] = esc_html__('System Info', 'give');
121 121
 
122
-		return apply_filters( 'give_settings_tabs', $tabs );
122
+		return apply_filters('give_settings_tabs', $tabs);
123 123
 	}
124 124
 
125 125
 
@@ -129,32 +129,32 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function admin_page_display() {
131 131
 
132
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
132
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
133 133
 
134 134
 		?>
135 135
 
136 136
 		<div class="wrap give_settings_page cmb2_options_page <?php echo $this->key; ?>">
137 137
 
138
-			<h1 class="screen-reader-text"><?php esc_html_e( 'Give Settings', 'give' ); ?></h1>
138
+			<h1 class="screen-reader-text"><?php esc_html_e('Give Settings', 'give'); ?></h1>
139 139
 
140 140
 			<h2 class="nav-tab-wrapper">
141 141
 				<?php
142
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
142
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
143 143
 
144
-					$tab_url = esc_url( add_query_arg( array(
144
+					$tab_url = esc_url(add_query_arg(array(
145 145
 						'settings-updated' => false,
146 146
 						'tab'              => $tab_id
147
-					) ) );
147
+					)));
148 148
 
149 149
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
150 150
 
151
-					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>';
151
+					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>';
152 152
 
153 153
 				}
154 154
 				?>
155 155
 			</h2>
156 156
 
157
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
157
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
158 158
 
159 159
 		</div><!-- .wrap -->
160 160
 
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 	 *
177 177
 	 * @return string
178 178
 	 */
179
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
179
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
180 180
 
181 181
 		//only modify the give settings form
182
-		if ( 'give_settings' == $object_id ) {
182
+		if ('give_settings' == $object_id) {
183 183
 
184
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
184
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div></form>';
185 185
 
186 186
 		}
187 187
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 *
199 199
 	 * @return array
200 200
 	 */
201
-	public function give_settings( $active_tab ) {
201
+	public function give_settings($active_tab) {
202 202
 
203 203
 		$give_settings = array(
204 204
 			/**
@@ -206,99 +206,99 @@  discard block
 block discarded – undo
206 206
 			 */
207 207
 			'general'     => array(
208 208
 				'id'         => 'general_settings',
209
-				'give_title' => esc_html__( 'General Settings', 'give' ),
210
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
211
-				'fields'     => apply_filters( 'give_settings_general', array(
209
+				'give_title' => esc_html__('General Settings', 'give'),
210
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
211
+				'fields'     => apply_filters('give_settings_general', array(
212 212
 						array(
213
-							'name' => esc_html__( 'General Settings', 'give' ),
213
+							'name' => esc_html__('General Settings', 'give'),
214 214
 							'desc' => '',
215 215
 							'type' => 'give_title',
216 216
 							'id'   => 'give_title_general_settings_1'
217 217
 						),
218 218
 						array(
219
-							'name'    => esc_html__( 'Success Page', 'give' ),
219
+							'name'    => esc_html__('Success Page', 'give'),
220 220
 							/* translators: %s: [give_receipt] */
221
-							'desc'    => sprintf( __( 'This is the page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
221
+							'desc'    => sprintf(__('This is the page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
222 222
 							'id'      => 'success_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226
-								'numberposts' => - 1
227
-							) ),
226
+								'numberposts' => -1
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => esc_html__( 'Failed Transaction Page', 'give' ),
231
-							'desc'    => esc_html__( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ),
230
+							'name'    => esc_html__('Failed Transaction Page', 'give'),
231
+							'desc'    => esc_html__('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'),
232 232
 							'id'      => 'failure_page',
233 233
 							'type'    => 'select',
234
-							'options' => give_cmb2_get_post_options( array(
234
+							'options' => give_cmb2_get_post_options(array(
235 235
 								'post_type'   => 'page',
236
-								'numberposts' => - 1
237
-							) ),
236
+								'numberposts' => -1
237
+							)),
238 238
 						),
239 239
 						array(
240
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
240
+							'name'    => esc_html__('Donation History Page', 'give'),
241 241
 							/* translators: %s: [donation_history] */
242
-							'desc'    => sprintf( __( 'This page shows a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
242
+							'desc'    => sprintf(__('This page shows a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
243 243
 							'id'      => 'history_page',
244 244
 							'type'    => 'select',
245
-							'options' => give_cmb2_get_post_options( array(
245
+							'options' => give_cmb2_get_post_options(array(
246 246
 								'post_type'   => 'page',
247
-								'numberposts' => - 1
248
-							) ),
247
+								'numberposts' => -1
248
+							)),
249 249
 						),
250 250
 						array(
251
-							'name'    => esc_html__( 'Base Country', 'give' ),
252
-							'desc'    => esc_html__( 'Where does your site operate from?', 'give' ),
251
+							'name'    => esc_html__('Base Country', 'give'),
252
+							'desc'    => esc_html__('Where does your site operate from?', 'give'),
253 253
 							'id'      => 'base_country',
254 254
 							'type'    => 'select',
255 255
 							'options' => give_get_country_list(),
256 256
 						),
257 257
 						array(
258
-							'name' => esc_html__( 'Currency Settings', 'give' ),
258
+							'name' => esc_html__('Currency Settings', 'give'),
259 259
 							'desc' => '',
260 260
 							'type' => 'give_title',
261 261
 							'id'   => 'give_title_general_settings_2'
262 262
 						),
263 263
 						array(
264
-							'name'    => esc_html__( 'Currency', 'give' ),
265
-							'desc'    => esc_html__( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'give' ),
264
+							'name'    => esc_html__('Currency', 'give'),
265
+							'desc'    => esc_html__('Choose your currency. Note that some payment gateways have currency restrictions.', 'give'),
266 266
 							'id'      => 'currency',
267 267
 							'type'    => 'select',
268 268
 							'options' => give_get_currencies(),
269 269
 							'default' => 'USD',
270 270
 						),
271 271
 						array(
272
-							'name'    => esc_html__( 'Currency Position', 'give' ),
273
-							'desc'    => esc_html__( 'Choose the position of the currency sign.', 'give' ),
272
+							'name'    => esc_html__('Currency Position', 'give'),
273
+							'desc'    => esc_html__('Choose the position of the currency sign.', 'give'),
274 274
 							'id'      => 'currency_position',
275 275
 							'type'    => 'select',
276 276
 							'options' => array(
277 277
 								/* translators: %s: currency symbol */
278
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
278
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
279 279
 								/* translators: %s: currency symbol */
280
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
280
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
281 281
 							),
282 282
 							'default' => 'before',
283 283
 						),
284 284
 						array(
285
-							'name'            => esc_html__( 'Thousands Separator', 'give' ),
286
-							'desc'            => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
285
+							'name'            => esc_html__('Thousands Separator', 'give'),
286
+							'desc'            => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
287 287
 							'id'              => 'thousands_separator',
288 288
 							'type'            => 'text_small',
289 289
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
290 290
 							'default'         => ',',
291 291
 						),
292 292
 						array(
293
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
294
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
293
+							'name'    => esc_html__('Decimal Separator', 'give'),
294
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
295 295
 							'id'      => 'decimal_separator',
296 296
 							'type'    => 'text_small',
297 297
 							'default' => '.',
298 298
 						),
299 299
 						array(
300
-							'name'            => __( 'Number of Decimals', 'give' ),
301
-							'desc'            => __( 'This sets the number of decimal points shown in displayed prices.', 'give' ),
300
+							'name'            => __('Number of Decimals', 'give'),
301
+							'desc'            => __('This sets the number of decimal points shown in displayed prices.', 'give'),
302 302
 							'id'              => 'number_decimals',
303 303
 							'type'            => 'text_small',
304 304
 							'default'         => 2,
@@ -312,83 +312,83 @@  discard block
 block discarded – undo
312 312
 			 */
313 313
 			'gateways'    => array(
314 314
 				'id'         => 'payment_gateways',
315
-				'give_title' => esc_html__( 'Payment Gateways', 'give' ),
316
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
317
-				'fields'     => apply_filters( 'give_settings_gateways', array(
315
+				'give_title' => esc_html__('Payment Gateways', 'give'),
316
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
317
+				'fields'     => apply_filters('give_settings_gateways', array(
318 318
 						array(
319
-							'name' => esc_html__( 'Gateways Settings', 'give' ),
319
+							'name' => esc_html__('Gateways Settings', 'give'),
320 320
 							'desc' => '',
321 321
 							'id'   => 'give_title_gateway_settings_1',
322 322
 							'type' => 'give_title'
323 323
 						),
324 324
 						array(
325
-							'name' => esc_html__( 'Test Mode', 'give' ),
326
-							'desc' => esc_html__( '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' ),
325
+							'name' => esc_html__('Test Mode', 'give'),
326
+							'desc' => esc_html__('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'),
327 327
 							'id'   => 'test_mode',
328 328
 							'type' => 'checkbox'
329 329
 						),
330 330
 						array(
331
-							'name' => esc_html__( 'Enabled Gateways', 'give' ),
332
-							'desc' => esc_html__( 'Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give' ),
331
+							'name' => esc_html__('Enabled Gateways', 'give'),
332
+							'desc' => esc_html__('Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give'),
333 333
 							'id'   => 'gateways',
334 334
 							'type' => 'enabled_gateways'
335 335
 						),
336 336
 						array(
337
-							'name' => esc_html__( 'Default Gateway', 'give' ),
338
-							'desc' => esc_html__( 'This is the gateway that will be selected by default.', 'give' ),
337
+							'name' => esc_html__('Default Gateway', 'give'),
338
+							'desc' => esc_html__('This is the gateway that will be selected by default.', 'give'),
339 339
 							'id'   => 'default_gateway',
340 340
 							'type' => 'default_gateway'
341 341
 						),
342 342
 						array(
343
-							'name' => esc_html__( 'PayPal Standard', 'give' ),
343
+							'name' => esc_html__('PayPal Standard', 'give'),
344 344
 							'desc' => '',
345 345
 							'type' => 'give_title',
346 346
 							'id'   => 'give_title_gateway_settings_2',
347 347
 						),
348 348
 						array(
349
-							'name' => esc_html__( 'PayPal Email', 'give' ),
350
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
349
+							'name' => esc_html__('PayPal Email', 'give'),
350
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
351 351
 							'id'   => 'paypal_email',
352 352
 							'type' => 'text_email',
353 353
 						),
354 354
 						array(
355
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
356
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
355
+							'name' => esc_html__('PayPal Page Style', 'give'),
356
+							'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
357 357
 							'id'   => 'paypal_page_style',
358 358
 							'type' => 'text',
359 359
 						),
360 360
 						array(
361
-							'name'    => esc_html__( 'PayPal Transaction Type', 'give' ),
362
-							'desc'    => esc_html__( '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' ),
361
+							'name'    => esc_html__('PayPal Transaction Type', 'give'),
362
+							'desc'    => esc_html__('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'),
363 363
 							'id'      => 'paypal_button_type',
364 364
 							'type'    => 'radio_inline',
365 365
 							'options' => array(
366
-								'donation' => esc_html__( 'Donation', 'give' ),
367
-								'standard' => esc_html__( 'Standard Transaction', 'give' )
366
+								'donation' => esc_html__('Donation', 'give'),
367
+								'standard' => esc_html__('Standard Transaction', 'give')
368 368
 							),
369 369
 							'default' => 'donation',
370 370
 						),
371 371
 						array(
372
-							'name' => esc_html__( 'Disable PayPal IPN Verification', 'give' ),
373
-							'desc' => esc_html__( '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' ),
372
+							'name' => esc_html__('Disable PayPal IPN Verification', 'give'),
373
+							'desc' => esc_html__('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'),
374 374
 							'id'   => 'disable_paypal_verification',
375 375
 							'type' => 'checkbox'
376 376
 						),
377 377
 						array(
378
-							'name' => esc_html__( 'Offline Donations', 'give' ),
378
+							'name' => esc_html__('Offline Donations', 'give'),
379 379
 							'desc' => '',
380 380
 							'type' => 'give_title',
381 381
 							'id'   => 'give_title_gateway_settings_3',
382 382
 						),
383 383
 						array(
384
-							'name' => esc_html__( 'Collect Billing Details', 'give' ),
385
-							'desc' => esc_html__( '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' ),
384
+							'name' => esc_html__('Collect Billing Details', 'give'),
385
+							'desc' => esc_html__('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'),
386 386
 							'id'   => 'give_offline_donation_enable_billing_fields',
387 387
 							'type' => 'checkbox'
388 388
 						),
389 389
 						array(
390
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
391
-							'desc'    => esc_html__( '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' ),
390
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
391
+							'desc'    => esc_html__('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'),
392 392
 							'id'      => 'global_offline_donation_content',
393 393
 							'default' => give_get_default_offline_donation_content(),
394 394
 							'type'    => 'wysiwyg',
@@ -397,15 +397,15 @@  discard block
 block discarded – undo
397 397
 							)
398 398
 						),
399 399
 						array(
400
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
401
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
400
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
401
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
402 402
 							'id'      => 'offline_donation_subject',
403
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
403
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
404 404
 							'type'    => 'text'
405 405
 						),
406 406
 						array(
407
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
408
-							'desc'    => esc_html__( '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' ),
407
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
408
+							'desc'    => esc_html__('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'),
409 409
 							'id'      => 'global_offline_donation_email',
410 410
 							'default' => give_get_default_offline_donation_email_content(),
411 411
 							'type'    => 'wysiwyg',
@@ -419,100 +419,100 @@  discard block
 block discarded – undo
419 419
 			/** Display Settings */
420 420
 			'display'     => array(
421 421
 				'id'         => 'display_settings',
422
-				'give_title' => esc_html__( 'Display Settings', 'give' ),
423
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
424
-				'fields'     => apply_filters( 'give_settings_display', array(
422
+				'give_title' => esc_html__('Display Settings', 'give'),
423
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
424
+				'fields'     => apply_filters('give_settings_display', array(
425 425
 						array(
426
-							'name' => esc_html__( 'Display Settings', 'give' ),
426
+							'name' => esc_html__('Display Settings', 'give'),
427 427
 							'desc' => '',
428 428
 							'id'   => 'give_title_display_settings_1',
429 429
 							'type' => 'give_title'
430 430
 						),
431 431
 						array(
432
-							'name' => esc_html__( 'Disable CSS', 'give' ),
433
-							'desc' => esc_html__( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
432
+							'name' => esc_html__('Disable CSS', 'give'),
433
+							'desc' => esc_html__('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
434 434
 							'id'   => 'disable_css',
435 435
 							'type' => 'checkbox'
436 436
 						),
437 437
 						array(
438
-							'name' => esc_html__( 'Enable Floating Labels', 'give' ),
438
+							'name' => esc_html__('Enable Floating Labels', 'give'),
439 439
 							/* translators: %s: https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
440
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. <br />Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), array(
440
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. <br />Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), array(
441 441
 								'a' => array(
442 442
 									'href'   => array(),
443 443
 									'target' => array()
444 444
 								)
445
-							) ), esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' ) ),
445
+							)), esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')),
446 446
 							'id'   => 'enable_floatlabels',
447 447
 							'type' => 'checkbox'
448 448
 						),
449 449
 						array(
450
-							'name' => esc_html__( 'Disable Welcome Screen', 'give' ),
450
+							'name' => esc_html__('Disable Welcome Screen', 'give'),
451 451
 							/* translators: %s: about page URL */
452
-							'desc' => sprintf( wp_kses( __( '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 <a href="%s">Welcome Screen</a> if you want in the future.', 'give' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
452
+							'desc' => sprintf(wp_kses(__('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 <a href="%s">Welcome Screen</a> if you want in the future.', 'give'), array('a' => array('href' => array()))), esc_url(admin_url('index.php?page=give-about'))),
453 453
 							'id'   => 'disable_welcome',
454 454
 							'type' => 'checkbox'
455 455
 						),
456 456
 						array(
457
-							'name' => esc_html__( 'Post Types', 'give' ),
457
+							'name' => esc_html__('Post Types', 'give'),
458 458
 							'desc' => '',
459 459
 							'id'   => 'give_title_display_settings_2',
460 460
 							'type' => 'give_title'
461 461
 						),
462 462
 						array(
463
-							'name' => esc_html__( 'Disable Form Single Views', 'give' ),
464
-							'desc' => esc_html__( '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' ),
463
+							'name' => esc_html__('Disable Form Single Views', 'give'),
464
+							'desc' => esc_html__('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'),
465 465
 							'id'   => 'disable_forms_singular',
466 466
 							'type' => 'checkbox'
467 467
 						),
468 468
 						array(
469
-							'name' => esc_html__( 'Disable Form Archives', 'give' ),
470
-							'desc' => esc_html__( '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' ),
469
+							'name' => esc_html__('Disable Form Archives', 'give'),
470
+							'desc' => esc_html__('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'),
471 471
 							'id'   => 'disable_forms_archives',
472 472
 							'type' => 'checkbox'
473 473
 						),
474 474
 						array(
475
-							'name' => esc_html__( 'Disable Form Excerpts', 'give' ),
476
-							'desc' => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
475
+							'name' => esc_html__('Disable Form Excerpts', 'give'),
476
+							'desc' => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
477 477
 							'id'   => 'disable_forms_excerpt',
478 478
 							'type' => 'checkbox'
479 479
 						),
480 480
 
481 481
 						array(
482
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
483
-							'desc'    => esc_html__( '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' ),
482
+							'name'    => esc_html__('Featured Image Size', 'give'),
483
+							'desc'    => esc_html__('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'),
484 484
 							'id'      => 'featured_image_size',
485 485
 							'type'    => 'select',
486 486
 							'default' => 'large',
487 487
 							'options' => give_get_featured_image_sizes()
488 488
 						),
489 489
 						array(
490
-							'name' => esc_html__( 'Disable Form Featured Image', 'give' ),
491
-							'desc' => esc_html__( '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' ),
490
+							'name' => esc_html__('Disable Form Featured Image', 'give'),
491
+							'desc' => esc_html__('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'),
492 492
 							'id'   => 'disable_form_featured_img',
493 493
 							'type' => 'checkbox'
494 494
 						),
495 495
 						array(
496
-							'name' => esc_html__( 'Disable Single Form Sidebar', 'give' ),
497
-							'desc' => esc_html__( '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' ),
496
+							'name' => esc_html__('Disable Single Form Sidebar', 'give'),
497
+							'desc' => esc_html__('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'),
498 498
 							'id'   => 'disable_form_sidebar',
499 499
 							'type' => 'checkbox'
500 500
 						),
501 501
 						array(
502
-							'name' => esc_html__( 'Taxonomies', 'give' ),
502
+							'name' => esc_html__('Taxonomies', 'give'),
503 503
 							'desc' => '',
504 504
 							'id'   => 'give_title_display_settings_3',
505 505
 							'type' => 'give_title'
506 506
 						),
507 507
 						array(
508
-							'name' => esc_html__( 'Enable Form Categories', 'give' ),
509
-							'desc' => esc_html__( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ),
508
+							'name' => esc_html__('Enable Form Categories', 'give'),
509
+							'desc' => esc_html__('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'),
510 510
 							'id'   => 'enable_categories',
511 511
 							'type' => 'checkbox'
512 512
 						),
513 513
 						array(
514
-							'name' => esc_html__( 'Enable Form Tags', 'give' ),
515
-							'desc' => esc_html__( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ),
514
+							'name' => esc_html__('Enable Form Tags', 'give'),
515
+							'desc' => esc_html__('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'),
516 516
 							'id'   => 'enable_tags',
517 517
 							'type' => 'checkbox'
518 518
 						),
@@ -525,95 +525,95 @@  discard block
 block discarded – undo
525 525
 			 */
526 526
 			'emails'      => array(
527 527
 				'id'         => 'email_settings',
528
-				'give_title' => esc_html__( 'Email Settings', 'give' ),
529
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
530
-				'fields'     => apply_filters( 'give_settings_emails', array(
528
+				'give_title' => esc_html__('Email Settings', 'give'),
529
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
530
+				'fields'     => apply_filters('give_settings_emails', array(
531 531
 						array(
532
-							'name' => esc_html__( 'Email Settings', 'give' ),
532
+							'name' => esc_html__('Email Settings', 'give'),
533 533
 							'desc' => '',
534 534
 							'id'   => 'give_title_email_settings_1',
535 535
 							'type' => 'give_title'
536 536
 						),
537 537
 						array(
538 538
 							'id'      => 'email_template',
539
-							'name'    => esc_html__( 'Email Template', 'give' ),
540
-							'desc'    => esc_html__( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
539
+							'name'    => esc_html__('Email Template', 'give'),
540
+							'desc'    => esc_html__('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
541 541
 							'type'    => 'select',
542 542
 							'options' => give_get_email_templates()
543 543
 						),
544 544
 						array(
545 545
 							'id'   => 'email_logo',
546
-							'name' => esc_html__( 'Logo', 'give' ),
547
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
546
+							'name' => esc_html__('Logo', 'give'),
547
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
548 548
 							'type' => 'file'
549 549
 						),
550 550
 						array(
551 551
 							'id'      => 'from_name',
552
-							'name'    => esc_html__( 'From Name', 'give' ),
553
-							'desc'    => esc_html__( 'The name donation receipts are said to come from. This is most likely the name of your organization or website.', 'give' ),
554
-							'default' => get_bloginfo( 'name' ),
552
+							'name'    => esc_html__('From Name', 'give'),
553
+							'desc'    => esc_html__('The name donation receipts are said to come from. This is most likely the name of your organization or website.', 'give'),
554
+							'default' => get_bloginfo('name'),
555 555
 							'type'    => 'text'
556 556
 						),
557 557
 						array(
558 558
 							'id'      => 'from_email',
559
-							'name'    => esc_html__( 'From Email', 'give' ),
560
-							'desc'    => esc_html__( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
561
-							'default' => get_bloginfo( 'admin_email' ),
559
+							'name'    => esc_html__('From Email', 'give'),
560
+							'desc'    => esc_html__('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
561
+							'default' => get_bloginfo('admin_email'),
562 562
 							'type'    => 'text'
563 563
 						),
564 564
 						array(
565
-							'name' => esc_html__( 'Donation Receipt', 'give' ),
565
+							'name' => esc_html__('Donation Receipt', 'give'),
566 566
 							'desc' => '',
567 567
 							'id'   => 'give_title_email_settings_2',
568 568
 							'type' => 'give_title'
569 569
 						),
570 570
 						array(
571 571
 							'id'      => 'donation_subject',
572
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
573
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
574
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
572
+							'name'    => esc_html__('Donation Email Subject', 'give'),
573
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
574
+							'default' => esc_attr__('Donation Receipt', 'give'),
575 575
 							'type'    => 'text'
576 576
 						),
577 577
 						array(
578 578
 							'id'      => 'donation_receipt',
579
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
579
+							'name'    => esc_html__('Donation Receipt', 'give'),
580 580
 							/* translators: %s: emails tags list */
581
-							'desc'    => sprintf( __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ), give_get_emails_tags_list() ),
581
+							'desc'    => sprintf(__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'), give_get_emails_tags_list()),
582 582
 							'type'    => 'wysiwyg',
583 583
 							'default' => give_get_default_donation_receipt_email()
584 584
 						),
585 585
 						array(
586
-							'name' => esc_html__( 'New Donation Notification', 'give' ),
586
+							'name' => esc_html__('New Donation Notification', 'give'),
587 587
 							'desc' => '',
588 588
 							'id'   => 'give_title_email_settings_3',
589 589
 							'type' => 'give_title'
590 590
 						),
591 591
 						array(
592 592
 							'id'      => 'donation_notification_subject',
593
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
594
-							'desc'    => esc_html__( 'Enter the subject line for the donation notification email.', 'give' ),
593
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
594
+							'desc'    => esc_html__('Enter the subject line for the donation notification email.', 'give'),
595 595
 							'type'    => 'text',
596
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' )
596
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give')
597 597
 						),
598 598
 						array(
599 599
 							'id'      => 'donation_notification',
600
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
600
+							'name'    => esc_html__('Donation Notification', 'give'),
601 601
 							/* translators: %s: emails tags list */
602
-							'desc'    => sprintf( __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ), give_get_emails_tags_list() ),
602
+							'desc'    => sprintf(__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'), give_get_emails_tags_list()),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_notification_email()
605 605
 						),
606 606
 						array(
607 607
 							'id'      => 'admin_notice_emails',
608
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
609
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
608
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
609
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
610 610
 							'type'    => 'textarea',
611
-							'default' => get_bloginfo( 'admin_email' )
611
+							'default' => get_bloginfo('admin_email')
612 612
 						),
613 613
 						array(
614 614
 							'id'   => 'disable_admin_notices',
615
-							'name' => esc_html__( 'Disable Admin Notifications', 'give' ),
616
-							'desc' => esc_html__( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
615
+							'name' => esc_html__('Disable Admin Notifications', 'give'),
616
+							'desc' => esc_html__('Check this box if you do not want to receive emails when new donations are made.', 'give'),
617 617
 							'type' => 'checkbox'
618 618
 						)
619 619
 					)
@@ -622,99 +622,99 @@  discard block
 block discarded – undo
622 622
 			/** Extension Settings */
623 623
 			'addons'      => array(
624 624
 				'id'         => 'addons',
625
-				'give_title' => esc_html__( 'Give Add-ons Settings', 'give' ),
626
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
627
-				'fields'     => apply_filters( 'give_settings_addons', array()
625
+				'give_title' => esc_html__('Give Add-ons Settings', 'give'),
626
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
627
+				'fields'     => apply_filters('give_settings_addons', array()
628 628
 				)
629 629
 			),
630 630
 			/** Licenses Settings */
631 631
 			'licenses'    => array(
632 632
 				'id'         => 'licenses',
633
-				'give_title' => esc_html__( 'Give Licenses', 'give' ),
634
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
635
-				'fields'     => apply_filters( 'give_settings_licenses', array()
633
+				'give_title' => esc_html__('Give Licenses', 'give'),
634
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
635
+				'fields'     => apply_filters('give_settings_licenses', array()
636 636
 				)
637 637
 			),
638 638
 			/** Advanced Options */
639 639
 			'advanced'    => array(
640 640
 				'id'         => 'advanced_options',
641
-				'give_title' => esc_html__( 'Advanced Options', 'give' ),
642
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
643
-				'fields'     => apply_filters( 'give_settings_advanced', array(
641
+				'give_title' => esc_html__('Advanced Options', 'give'),
642
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
643
+				'fields'     => apply_filters('give_settings_advanced', array(
644 644
 						array(
645
-							'name' => esc_html__( 'Access Control', 'give' ),
645
+							'name' => esc_html__('Access Control', 'give'),
646 646
 							'desc' => '',
647 647
 							'id'   => 'give_title_session_control_1',
648 648
 							'type' => 'give_title'
649 649
 						),
650 650
 						array(
651 651
 							'id'      => 'session_lifetime',
652
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
653
-							'desc'    => esc_html__( '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' ),
652
+							'name'    => esc_html__('Session Lifetime', 'give'),
653
+							'desc'    => esc_html__('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'),
654 654
 							'type'    => 'select',
655 655
 							'options' => array(
656
-								'86400'  => esc_html__( '24 Hours', 'give' ),
657
-								'172800' => esc_html__( '48 Hours', 'give' ),
658
-								'259200' => esc_html__( '72 Hours', 'give' ),
659
-								'604800' => esc_html__( '1 Week', 'give' ),
656
+								'86400'  => esc_html__('24 Hours', 'give'),
657
+								'172800' => esc_html__('48 Hours', 'give'),
658
+								'259200' => esc_html__('72 Hours', 'give'),
659
+								'604800' => esc_html__('1 Week', 'give'),
660 660
 							)
661 661
 						),
662 662
 						array(
663
-							'name' => esc_html__( 'Email Access', 'give' ),
664
-							'desc' => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
663
+							'name' => esc_html__('Email Access', 'give'),
664
+							'desc' => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
665 665
 							'id'   => 'email_access',
666 666
 							'type' => 'checkbox',
667 667
 						),
668 668
 						array(
669 669
 							'id'      => 'recaptcha_key',
670
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
670
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
671 671
 							/* translators: %s: https://www.google.com/recaptcha/ */
672
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
672
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
673 673
 							'default' => '',
674 674
 							'type'    => 'text'
675 675
 						),
676 676
 						array(
677 677
 							'id'      => 'recaptcha_secret',
678
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
679
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
678
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
679
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
680 680
 							'default' => '',
681 681
 							'type'    => 'text'
682 682
 						),
683 683
 						array(
684
-							'name' => esc_html__( 'Data Control', 'give' ),
684
+							'name' => esc_html__('Data Control', 'give'),
685 685
 							'desc' => '',
686 686
 							'id'   => 'give_title_data_control_2',
687 687
 							'type' => 'give_title'
688 688
 						),
689 689
 						array(
690
-							'name' => esc_html__( 'Remove All Data on Uninstall?', 'give' ),
691
-							'desc' => esc_html__( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ),
690
+							'name' => esc_html__('Remove All Data on Uninstall?', 'give'),
691
+							'desc' => esc_html__('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'),
692 692
 							'id'   => 'uninstall_on_delete',
693 693
 							'type' => 'checkbox'
694 694
 						),
695 695
 						array(
696
-							'name' => esc_html__( 'Filter Control', 'give' ),
696
+							'name' => esc_html__('Filter Control', 'give'),
697 697
 							'desc' => '',
698 698
 							'id'   => 'give_title_filter_control',
699 699
 							'type' => 'give_title'
700 700
 						),
701 701
 						array(
702 702
 							/* translators: %s: the_content */
703
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
703
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
704 704
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
705
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
705
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
706 706
 							'id'   => 'disable_the_content_filter',
707 707
 							'type' => 'checkbox'
708 708
 						),
709 709
 						array(
710
-							'name' => esc_html__( 'Script Loading', 'give' ),
710
+							'name' => esc_html__('Script Loading', 'give'),
711 711
 							'desc' => '',
712 712
 							'id'   => 'give_title_script_control',
713 713
 							'type' => 'give_title'
714 714
 						),
715 715
 						array(
716
-							'name' => esc_html__( 'Load Scripts in Footer?', 'give' ),
717
-							'desc' => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
716
+							'name' => esc_html__('Load Scripts in Footer?', 'give'),
717
+							'desc' => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
718 718
 							'id'   => 'scripts_footer',
719 719
 							'type' => 'checkbox'
720 720
 						)
@@ -724,13 +724,13 @@  discard block
 block discarded – undo
724 724
 			/** API Settings */
725 725
 			'api'         => array(
726 726
 				'id'         => 'api',
727
-				'give_title' => esc_html__( 'API', 'give' ),
728
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
727
+				'give_title' => esc_html__('API', 'give'),
728
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
729 729
 				'show_names' => false, // Hide field names on the left
730
-				'fields'     => apply_filters( 'give_settings_system', array(
730
+				'fields'     => apply_filters('give_settings_system', array(
731 731
 						array(
732 732
 							'id'   => 'api',
733
-							'name' => esc_html__( 'API', 'give' ),
733
+							'name' => esc_html__('API', 'give'),
734 734
 							'type' => 'api'
735 735
 						)
736 736
 					)
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 			/** Licenses Settings */
740 740
 			'system_info' => array(
741 741
 				'id'         => 'system_info',
742
-				'give_title' => esc_html__( 'System Info', 'give' ),
743
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
744
-				'fields'     => apply_filters( 'give_settings_system', array(
742
+				'give_title' => esc_html__('System Info', 'give'),
743
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
744
+				'fields'     => apply_filters('give_settings_system', array(
745 745
 						array(
746 746
 							'id'   => 'system_info',
747
-							'name' => esc_html__( 'System Info', 'give' ),
748
-							'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
747
+							'name' => esc_html__('System Info', 'give'),
748
+							'desc' => esc_html__('Please copy and paste this information in your ticket when contacting support.', 'give'),
749 749
 							'type' => 'system_info'
750 750
 						)
751 751
 					)
@@ -754,15 +754,15 @@  discard block
 block discarded – undo
754 754
 		);
755 755
 
756 756
 		//Return all settings array if no active tab
757
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
757
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
758 758
 
759
-			return apply_filters( 'give_registered_settings', $give_settings );
759
+			return apply_filters('give_registered_settings', $give_settings);
760 760
 
761 761
 		}
762 762
 
763 763
 
764 764
 		// Add other tabs and settings fields as needed
765
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
765
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
766 766
 
767 767
 	}
768 768
 
@@ -771,11 +771,11 @@  discard block
 block discarded – undo
771 771
 	 */
772 772
 	public function settings_notices() {
773 773
 
774
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
774
+		if ( ! isset($_POST['give_settings_saved'])) {
775 775
 			return;
776 776
 		}
777 777
 
778
-		add_settings_error( 'give-notices', 'global-settings-updated', esc_html__( 'Settings updated.', 'give' ), 'updated' );
778
+		add_settings_error('give-notices', 'global-settings-updated', esc_html__('Settings updated.', 'give'), 'updated');
779 779
 
780 780
 	}
781 781
 
@@ -789,17 +789,17 @@  discard block
 block discarded – undo
789 789
 	 *
790 790
 	 * @return mixed          Field value or exception is thrown
791 791
 	 */
792
-	public function __get( $field ) {
792
+	public function __get($field) {
793 793
 
794 794
 		// Allowed fields to retrieve
795
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
795
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
796 796
 			return $this->{$field};
797 797
 		}
798
-		if ( 'option_metabox' === $field ) {
798
+		if ('option_metabox' === $field) {
799 799
 			return $this->option_metabox();
800 800
 		}
801 801
 
802
-		throw new Exception( 'Invalid property: ' . $field );
802
+		throw new Exception('Invalid property: '.$field);
803 803
 	}
804 804
 
805 805
 
@@ -817,12 +817,12 @@  discard block
 block discarded – undo
817 817
  *
818 818
  * @return mixed        Option value
819 819
  */
820
-function give_get_option( $key = '', $default = false ) {
820
+function give_get_option($key = '', $default = false) {
821 821
 	global $give_options;
822
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
823
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
822
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
823
+	$value = apply_filters('give_get_option', $value, $key, $default);
824 824
 
825
-	return apply_filters( 'give_get_option_' . $key, $value, $key, $default );
825
+	return apply_filters('give_get_option_'.$key, $value, $key, $default);
826 826
 }
827 827
 
828 828
 
@@ -840,33 +840,33 @@  discard block
 block discarded – undo
840 840
  *
841 841
  * @return boolean True if updated, false if not.
842 842
  */
843
-function give_update_option( $key = '', $value = false ) {
843
+function give_update_option($key = '', $value = false) {
844 844
 
845 845
 	// If no key, exit
846
-	if ( empty( $key ) ) {
846
+	if (empty($key)) {
847 847
 		return false;
848 848
 	}
849 849
 
850
-	if ( empty( $value ) ) {
851
-		$remove_option = give_delete_option( $key );
850
+	if (empty($value)) {
851
+		$remove_option = give_delete_option($key);
852 852
 
853 853
 		return $remove_option;
854 854
 	}
855 855
 
856 856
 	// First let's grab the current settings
857
-	$options = get_option( 'give_settings' );
857
+	$options = get_option('give_settings');
858 858
 
859 859
 	// Let's let devs alter that value coming in
860
-	$value = apply_filters( 'give_update_option', $value, $key );
860
+	$value = apply_filters('give_update_option', $value, $key);
861 861
 
862 862
 	// Next let's try to update the value
863
-	$options[ $key ] = $value;
864
-	$did_update      = update_option( 'give_settings', $options );
863
+	$options[$key] = $value;
864
+	$did_update      = update_option('give_settings', $options);
865 865
 
866 866
 	// If it updated, let's update the global variable
867
-	if ( $did_update ) {
867
+	if ($did_update) {
868 868
 		global $give_options;
869
-		$give_options[ $key ] = $value;
869
+		$give_options[$key] = $value;
870 870
 	}
871 871
 
872 872
 	return $did_update;
@@ -883,27 +883,27 @@  discard block
 block discarded – undo
883 883
  *
884 884
  * @return boolean True if updated, false if not.
885 885
  */
886
-function give_delete_option( $key = '' ) {
886
+function give_delete_option($key = '') {
887 887
 
888 888
 	// If no key, exit
889
-	if ( empty( $key ) ) {
889
+	if (empty($key)) {
890 890
 		return false;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Next let's try to update the value
897
-	if ( isset( $options[ $key ] ) ) {
897
+	if (isset($options[$key])) {
898 898
 
899
-		unset( $options[ $key ] );
899
+		unset($options[$key]);
900 900
 
901 901
 	}
902 902
 
903
-	$did_update = update_option( 'give_settings', $options );
903
+	$did_update = update_option('give_settings', $options);
904 904
 
905 905
 	// If it updated, let's update the global variable
906
-	if ( $did_update ) {
906
+	if ($did_update) {
907 907
 		global $give_options;
908 908
 		$give_options = $options;
909 909
 	}
@@ -922,9 +922,9 @@  discard block
 block discarded – undo
922 922
  */
923 923
 function give_get_settings() {
924 924
 
925
-	$settings = get_option( 'give_settings' );
925
+	$settings = get_option('give_settings');
926 926
 
927
-	return (array) apply_filters( 'give_get_settings', $settings );
927
+	return (array) apply_filters('give_get_settings', $settings);
928 928
 
929 929
 }
930 930
 
@@ -942,25 +942,25 @@  discard block
 block discarded – undo
942 942
  *
943 943
  * @return array
944 944
  */
945
-function give_settings_array_insert( $array, $position, $insert ) {
946
-	if ( is_int( $position ) ) {
947
-		array_splice( $array, $position, 0, $insert );
945
+function give_settings_array_insert($array, $position, $insert) {
946
+	if (is_int($position)) {
947
+		array_splice($array, $position, 0, $insert);
948 948
 	} else {
949 949
 
950
-		foreach ( $array as $index => $subarray ) {
951
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
950
+		foreach ($array as $index => $subarray) {
951
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
952 952
 				$pos = $index;
953 953
 			}
954 954
 		}
955 955
 
956
-		if ( ! isset( $pos ) ) {
956
+		if ( ! isset($pos)) {
957 957
 			return $array;
958 958
 		}
959 959
 
960 960
 		$array = array_merge(
961
-			array_slice( $array, 0, $pos ),
961
+			array_slice($array, 0, $pos),
962 962
 			$insert,
963
-			array_slice( $array, $pos )
963
+			array_slice($array, $pos)
964 964
 		);
965 965
 	}
966 966
 
@@ -983,31 +983,31 @@  discard block
 block discarded – undo
983 983
  *
984 984
  * @return void
985 985
  */
986
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
986
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
987 987
 
988 988
 	$id                = $field_type_object->field->args['id'];
989 989
 	$field_description = $field_type_object->field->args['desc'];
990
-	$gateways          = give_get_ordered_payment_gateways( give_get_payment_gateways() );
990
+	$gateways          = give_get_ordered_payment_gateways(give_get_payment_gateways());
991 991
 
992 992
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
993 993
 
994
-	foreach ( $gateways as $key => $option ) :
994
+	foreach ($gateways as $key => $option) :
995 995
 
996
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
996
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
997 997
 			$enabled = '1';
998 998
 		} else {
999 999
 			$enabled = null;
1000 1000
 		}
1001 1001
 
1002
-		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;';
1003
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
1002
+		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;';
1003
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1004 1004
 
1005 1005
 	endforeach;
1006 1006
 
1007 1007
 	echo '</ul>';
1008 1008
 
1009
-	if ( $field_description ) {
1010
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1009
+	if ($field_description) {
1010
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1011 1011
 	}
1012 1012
 
1013 1013
 }
@@ -1023,31 +1023,31 @@  discard block
 block discarded – undo
1023 1023
  *
1024 1024
  * @return void
1025 1025
  */
1026
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1026
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1027 1027
 
1028 1028
 	$id                = $field_type_object->field->args['id'];
1029 1029
 	$field_description = $field_type_object->field->args['desc'];
1030 1030
 	$gateways          = give_get_enabled_payment_gateways();
1031 1031
 
1032
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
1032
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
1033 1033
 
1034 1034
 	//Add a field to the Give Form admin single post view of this field
1035
-	if ( $field_type_object->field->object_type === 'post' ) {
1036
-		echo '<option value="global">' . esc_html__( 'Global Default', 'give' ) . '</option>';
1035
+	if ($field_type_object->field->object_type === 'post') {
1036
+		echo '<option value="global">'.esc_html__('Global Default', 'give').'</option>';
1037 1037
 	}
1038 1038
 
1039
-	foreach ( $gateways as $key => $option ) :
1039
+	foreach ($gateways as $key => $option) :
1040 1040
 
1041
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
1041
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
1042 1042
 
1043 1043
 
1044
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1044
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1045 1045
 
1046 1046
 	endforeach;
1047 1047
 
1048 1048
 	echo '</select>';
1049 1049
 
1050
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1050
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1051 1051
 
1052 1052
 }
1053 1053
 
@@ -1062,13 +1062,13 @@  discard block
 block discarded – undo
1062 1062
  *
1063 1063
  * @return void
1064 1064
  */
1065
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1065
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1066 1066
 
1067 1067
 	$id                = $field_type_object->field->args['id'];
1068 1068
 	$title             = $field_type_object->field->args['name'];
1069 1069
 	$field_description = $field_type_object->field->args['desc'];
1070 1070
 
1071
-	echo '<hr>' . $field_description;
1071
+	echo '<hr>'.$field_description;
1072 1072
 
1073 1073
 }
1074 1074
 
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
  *
1084 1084
  * @return void
1085 1085
  */
1086
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1086
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1087 1087
 
1088 1088
 	$id                = $field_type_object->field->args['id'];
1089 1089
 	$title             = $field_type_object->field->args['name'];
@@ -1103,25 +1103,25 @@  discard block
 block discarded – undo
1103 1103
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1104 1104
  * @return array An array of options that matches the CMB2 options array
1105 1105
  */
1106
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1106
+function give_cmb2_get_post_options($query_args, $force = false) {
1107 1107
 
1108
-	$post_options = array( '' => '' ); // Blank option
1108
+	$post_options = array('' => ''); // Blank option
1109 1109
 
1110
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1110
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1111 1111
 		return $post_options;
1112 1112
 	}
1113 1113
 
1114
-	$args = wp_parse_args( $query_args, array(
1114
+	$args = wp_parse_args($query_args, array(
1115 1115
 		'post_type'   => 'page',
1116 1116
 		'numberposts' => 10,
1117
-	) );
1117
+	));
1118 1118
 
1119
-	$posts = get_posts( $args );
1119
+	$posts = get_posts($args);
1120 1120
 
1121
-	if ( $posts ) {
1122
-		foreach ( $posts as $post ) {
1121
+	if ($posts) {
1122
+		foreach ($posts as $post) {
1123 1123
 
1124
-			$post_options[ $post->ID ] = $post->post_title;
1124
+			$post_options[$post->ID] = $post->post_title;
1125 1125
 
1126 1126
 		}
1127 1127
 	}
@@ -1143,21 +1143,21 @@  discard block
 block discarded – undo
1143 1143
 	$get_sizes = get_intermediate_image_sizes();
1144 1144
 
1145 1145
 	// check whether intermediate image sizes exist first
1146
-	if ( empty( $get_sizes ) ) {
1147
-		$get_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1146
+	if (empty($get_sizes)) {
1147
+		$get_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1148 1148
 	}
1149 1149
 
1150
-	foreach ( $get_sizes as $_size ) {
1150
+	foreach ($get_sizes as $_size) {
1151 1151
 
1152
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1153
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1154
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1155
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1152
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1153
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1154
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1155
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1156 1156
 		}
1157 1157
 
1158 1158
 	}
1159 1159
 
1160
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1160
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1161 1161
 }
1162 1162
 
1163 1163
 
@@ -1172,34 +1172,34 @@  discard block
 block discarded – undo
1172 1172
  *
1173 1173
  * @return void
1174 1174
  */
1175
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1175
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1176 1176
 
1177 1177
 	$id                = $field_type_object->field->args['id'];
1178 1178
 	$field_description = $field_type_object->field->args['desc'];
1179
-	$license_status    = get_option( $field_type_object->field->args['options']['is_valid_license_option'] );
1179
+	$license_status    = get_option($field_type_object->field->args['options']['is_valid_license_option']);
1180 1180
 	$field_classes     = 'regular-text give-license-field';
1181
-	$type              = empty( $escaped_value ) ? 'text' : 'password';
1181
+	$type              = empty($escaped_value) ? 'text' : 'password';
1182 1182
 
1183
-	if ( $license_status === 'valid' ) {
1183
+	if ($license_status === 'valid') {
1184 1184
 		$field_classes .= ' give-license-active';
1185 1185
 	}
1186 1186
 
1187
-	$html = $field_type_object->input( array(
1187
+	$html = $field_type_object->input(array(
1188 1188
 		'class' => $field_classes,
1189 1189
 		'type'  => $type
1190
-	) );
1190
+	));
1191 1191
 
1192 1192
 	//License is active so show deactivate button
1193
-	if ( $license_status === 'valid' ) {
1194
-		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1193
+	if ($license_status === 'valid') {
1194
+		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1195 1195
 	} else {
1196 1196
 		//This license is not valid so delete it
1197
-		give_delete_option( $id );
1197
+		give_delete_option($id);
1198 1198
 	}
1199 1199
 
1200
-	$html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1200
+	$html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1201 1201
 
1202
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1202
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1203 1203
 
1204 1204
 	echo $html;
1205 1205
 }
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
  */
1214 1214
 function give_api_callback() {
1215 1215
 
1216
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1216
+	if ( ! current_user_can('manage_give_settings')) {
1217 1217
 		return;
1218 1218
 	}
1219 1219
 
@@ -1222,9 +1222,9 @@  discard block
 block discarded – undo
1222 1222
 	 *
1223 1223
 	 * @since 1.0
1224 1224
 	 */
1225
-	do_action( 'give_tools_api_keys_before' );
1225
+	do_action('give_tools_api_keys_before');
1226 1226
 
1227
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1227
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1228 1228
 
1229 1229
 	$api_keys_table = new Give_API_Keys_Table();
1230 1230
 	$api_keys_table->prepare_items();
@@ -1233,9 +1233,9 @@  discard block
 block discarded – undo
1233 1233
 	<span class="cmb2-metabox-description api-description">
1234 1234
 		<?php echo sprintf(
1235 1235
 		/* translators: 1: https://givewp.com/documentation/give-api-reference/ 2: https://givewp.com/addons/zapier/ */
1236
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1237
-			esc_url( 'https://givewp.com/documentation/give-api-reference/' ),
1238
-			esc_url( 'https://givewp.com/addons/zapier/' )
1236
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1237
+			esc_url('https://givewp.com/documentation/give-api-reference/'),
1238
+			esc_url('https://givewp.com/addons/zapier/')
1239 1239
 		); ?>
1240 1240
 	</span>
1241 1241
 	<?php
@@ -1245,10 +1245,10 @@  discard block
 block discarded – undo
1245 1245
 	 *
1246 1246
 	 * @since 1.0
1247 1247
 	 */
1248
-	do_action( 'give_tools_api_keys_after' );
1248
+	do_action('give_tools_api_keys_after');
1249 1249
 }
1250 1250
 
1251
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1251
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1252 1252
 
1253 1253
 /**
1254 1254
  * Hook Callback
@@ -1261,8 +1261,8 @@  discard block
 block discarded – undo
1261 1261
  *
1262 1262
  * @return void
1263 1263
  */
1264
-function give_hook_callback( $args ) {
1265
-	do_action( 'give_' . $args['id'] );
1264
+function give_hook_callback($args) {
1265
+	do_action('give_'.$args['id']);
1266 1266
 }
1267 1267
 
1268 1268
 /**
@@ -1273,10 +1273,10 @@  discard block
 block discarded – undo
1273 1273
  * This prevents fatal error conflicts with other themes and users of the CMB2 WP.org plugin.
1274 1274
  */
1275 1275
 
1276
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1277
-	require_once WP_PLUGIN_DIR . '/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
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1281
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1276
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1277
+	require_once WP_PLUGIN_DIR.'/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
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1281
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1282 1282
 }
1283 1283
\ No newline at end of file
Please login to merge, or discard this patch.
includes/formatting.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
  * @param $field_args
243 243
  * @param $field
244 244
  *
245
- * @return bool
245
+ * @return false|null
246 246
  */
247 247
 function give_format_admin_multilevel_amount( $field_args, $field ) {
248 248
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
  * @param array  $field_args
392 392
  * @param object $field
393 393
  *
394
- * @return mixed
394
+ * @return string
395 395
  */
396 396
 function give_sanitize_thousand_separator( $value, $field_args, $field ){
397 397
     return $value;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
  * @param array  $field_args
423 423
  * @param object $field
424 424
  *
425
- * @return mixed
425
+ * @return string
426 426
  */
427 427
 function give_sanitize_price_field_value( $value, $field_args, $field ){
428 428
     return give_sanitize_amount( $value );
Please login to merge, or discard this patch.
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return mixed
24 24
  */
25 25
 function give_get_price_decimals() {
26
-	return apply_filters( 'give_sanitize_amount_decimals', give_get_option( 'number_decimals', 0 ) );
26
+	return apply_filters('give_sanitize_amount_decimals', give_get_option('number_decimals', 0));
27 27
 }
28 28
 
29 29
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * @return mixed
35 35
  */
36 36
 function give_get_price_thousand_separator() {
37
-	return give_get_option( 'thousands_separator', ',' );
37
+	return give_get_option('thousands_separator', ',');
38 38
 }
39 39
 
40 40
 /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  * @return mixed
46 46
  */
47 47
 function give_get_price_decimal_separator() {
48
-	return give_get_option( 'decimal_separator', '.' );
48
+	return give_get_option('decimal_separator', '.');
49 49
 }
50 50
 
51 51
 /**
@@ -62,67 +62,67 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string $amount Newly sanitized amount
64 64
  */
65
-function give_sanitize_amount( $number, $dp = false, $trim_zeros = false ) {
65
+function give_sanitize_amount($number, $dp = false, $trim_zeros = false) {
66 66
 
67 67
 	// Bailout.
68
-	if ( empty( $number ) ) {
68
+	if (empty($number)) {
69 69
 		return $number;
70 70
 	}
71 71
 
72 72
 	// Remove slash from amount.
73 73
 	// If thousand or decimal separator is set to ' then in $_POST or $_GET param we will get an escaped number.
74 74
 	// To prevent notices and warning remove slash from amount/number.
75
-	$number = wp_unslash( $number );
75
+	$number = wp_unslash($number);
76 76
 
77 77
 	$thousand_separator = give_get_price_thousand_separator();
78 78
 
79 79
 	$locale   = localeconv();
80
-	$decimals = array( give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point'] );
80
+	$decimals = array(give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point']);
81 81
 
82 82
 	// Remove locale from string
83
-	if ( ! is_float( $number ) ) {
84
-		$number = str_replace( $decimals, '.', $number );
83
+	if ( ! is_float($number)) {
84
+		$number = str_replace($decimals, '.', $number);
85 85
 	}
86 86
 
87 87
 	// Remove thousand amount formatting if amount has.
88 88
 	// This condition use to add backward compatibility to version before 1.6, because before version 1.6 we were saving formatted amount to db.
89 89
 	// Do not replace thousand separator from price if it is same as decimal separator, because it will be already replace by above code.
90
-	if ( ! in_array( $thousand_separator, $decimals ) && ( false !== strpos( $number, $thousand_separator ) ) ) {
91
-		$number = str_replace( $thousand_separator, '', $number );
92
-	} elseif ( in_array( $thousand_separator, $decimals ) ) {
93
-		$number = preg_replace( '/\.(?=.*\.)/', '', $number );
90
+	if ( ! in_array($thousand_separator, $decimals) && (false !== strpos($number, $thousand_separator))) {
91
+		$number = str_replace($thousand_separator, '', $number);
92
+	} elseif (in_array($thousand_separator, $decimals)) {
93
+		$number = preg_replace('/\.(?=.*\.)/', '', $number);
94 94
 	}
95 95
 
96 96
 	// Remove non numeric entity before decimal separator.
97
-	$number     = preg_replace( '/[^0-9\.]/', '', $number );
97
+	$number     = preg_replace('/[^0-9\.]/', '', $number);
98 98
 	$default_dp = give_get_price_decimals();
99 99
 
100 100
 	// Reset negative amount to zero.
101
-	if ( 0 > $number ) {
102
-		$number = number_format( 0, $default_dp, '.' );
101
+	if (0 > $number) {
102
+		$number = number_format(0, $default_dp, '.');
103 103
 	}
104 104
 
105 105
 	// If number does not have decimal then add number of decimals to it.
106 106
 	if (
107
-		false === strpos( $number, '.' )
108
-		|| ( $default_dp > strlen( substr( $number, strpos( $number, '.' ) + 1 ) ) )
107
+		false === strpos($number, '.')
108
+		|| ($default_dp > strlen(substr($number, strpos($number, '.') + 1)))
109 109
 	) {
110
-		$number = number_format( $number, $default_dp, '.', '' );
110
+		$number = number_format($number, $default_dp, '.', '');
111 111
 	}
112 112
 
113 113
 	// Format number by custom number of decimals.
114
-	if ( false !== $dp ) {
115
-		$dp     = intval( empty( $dp ) ? $default_dp : $dp );
116
-		$dp     = apply_filters( 'give_sanitize_amount_decimals', $dp, $number );
117
-		$number = number_format( floatval( $number ), $dp, '.', '' );
114
+	if (false !== $dp) {
115
+		$dp     = intval(empty($dp) ? $default_dp : $dp);
116
+		$dp     = apply_filters('give_sanitize_amount_decimals', $dp, $number);
117
+		$number = number_format(floatval($number), $dp, '.', '');
118 118
 	}
119 119
 
120 120
 	// Trim zeros.
121
-	if ( $trim_zeros && strstr( $number, '.' ) ) {
122
-		$number = rtrim( rtrim( $number, '0' ), '.' );
121
+	if ($trim_zeros && strstr($number, '.')) {
122
+		$number = rtrim(rtrim($number, '0'), '.');
123 123
 	}
124 124
 
125
-	return apply_filters( 'give_sanitize_amount', $number );
125
+	return apply_filters('give_sanitize_amount', $number);
126 126
 }
127 127
 
128 128
 /**
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
  *
136 136
  * @return string $amount   Newly formatted amount or Price Not Available
137 137
  */
138
-function give_format_amount( $amount, $decimals = true ) {
139
-	$thousands_sep = give_get_option( 'thousands_separator', ',' );
140
-	$decimal_sep   = give_get_option( 'decimal_separator', '.' );
138
+function give_format_amount($amount, $decimals = true) {
139
+	$thousands_sep = give_get_option('thousands_separator', ',');
140
+	$decimal_sep   = give_get_option('decimal_separator', '.');
141 141
 
142
-	if ( empty( $amount ) ) {
142
+	if (empty($amount)) {
143 143
 		$amount = 0;
144 144
 	} else {
145 145
 		// Sanitize amount before formatting.
146
-		$amount = give_sanitize_amount( $amount );
146
+		$amount = give_sanitize_amount($amount);
147 147
 	}
148 148
 
149 149
 	$decimals = $decimals ? give_get_price_decimals() : 0;
150 150
 
151
-	$formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep );
151
+	$formatted = number_format($amount, $decimals, $decimal_sep, $thousands_sep);
152 152
 
153
-	return apply_filters( 'give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep );
153
+	return apply_filters('give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep);
154 154
 }
155 155
 
156 156
 
@@ -167,33 +167,33 @@  discard block
 block discarded – undo
167 167
  *
168 168
  * @return float|string  formatted amount number with large number names.
169 169
  */
170
-function give_human_format_large_amount( $amount ) {
170
+function give_human_format_large_amount($amount) {
171 171
 
172 172
 	// Get thousand separator.
173 173
 	$thousands_sep = give_get_price_thousand_separator();
174 174
 
175 175
 	// Sanitize amount.
176
-	$sanitize_amount = give_sanitize_amount( $amount );
176
+	$sanitize_amount = give_sanitize_amount($amount);
177 177
 
178 178
 	// Explode amount to calculate name of large numbers.
179
-	$amount_array = explode( $thousands_sep, $amount );
179
+	$amount_array = explode($thousands_sep, $amount);
180 180
 
181 181
 	// Calculate amount parts count.
182
-	$amount_count_parts = count( $amount_array );
182
+	$amount_count_parts = count($amount_array);
183 183
 
184 184
 	// Human format amount (default).
185 185
 	$human_format_amount = $amount;
186 186
 
187 187
 	// Calculate large number formatted amount.
188
-	if ( 4 < $amount_count_parts ) {
189
-		$human_format_amount = sprintf( esc_html__( '%s trillion', 'give' ), round( ( $sanitize_amount / 1000000000000 ), 2 ) );
190
-	} elseif ( 3 < $amount_count_parts ) {
191
-		$human_format_amount = sprintf( esc_html__( '%s billion', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
192
-	} elseif ( 2 < $amount_count_parts ) {
193
-		$human_format_amount = sprintf( esc_html__( '%s million', 'give' ), round( ( $sanitize_amount / 1000000 ), 2 ) );
188
+	if (4 < $amount_count_parts) {
189
+		$human_format_amount = sprintf(esc_html__('%s trillion', 'give'), round(($sanitize_amount / 1000000000000), 2));
190
+	} elseif (3 < $amount_count_parts) {
191
+		$human_format_amount = sprintf(esc_html__('%s billion', 'give'), round(($sanitize_amount / 1000000000), 2));
192
+	} elseif (2 < $amount_count_parts) {
193
+		$human_format_amount = sprintf(esc_html__('%s million', 'give'), round(($sanitize_amount / 1000000), 2));
194 194
 	}
195 195
 
196
-	return apply_filters( 'give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount );
196
+	return apply_filters('give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount);
197 197
 }
198 198
 
199 199
 /**
@@ -206,15 +206,15 @@  discard block
 block discarded – undo
206 206
  *
207 207
  * @return string $amount Newly formatted amount or Price Not Available
208 208
  */
209
-function give_format_decimal( $amount, $dp = false ) {
209
+function give_format_decimal($amount, $dp = false) {
210 210
 	$decimal_separator = give_get_price_decimal_separator();
211
-	$formatted_amount  = give_sanitize_amount( $amount, $dp );
211
+	$formatted_amount  = give_sanitize_amount($amount, $dp);
212 212
 
213
-	if ( false !== strpos( $formatted_amount, '.' ) ) {
214
-		$formatted_amount = str_replace( '.', $decimal_separator, $formatted_amount );
213
+	if (false !== strpos($formatted_amount, '.')) {
214
+		$formatted_amount = str_replace('.', $decimal_separator, $formatted_amount);
215 215
 	}
216 216
 
217
-	return apply_filters( 'give_format_decimal', $formatted_amount, $amount, $decimal_separator );
217
+	return apply_filters('give_format_decimal', $formatted_amount, $amount, $decimal_separator);
218 218
 }
219 219
 
220 220
 
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
  *
229 229
  * @return bool
230 230
  */
231
-function give_format_admin_multilevel_amount( $field_args, $field ) {
231
+function give_format_admin_multilevel_amount($field_args, $field) {
232 232
 
233
-	if ( empty( $field->value ) ) {
233
+	if (empty($field->value)) {
234 234
 		return false;
235 235
 	}
236 236
 
237
-	$field->value = give_format_decimal( $field->value );
237
+	$field->value = give_format_decimal($field->value);
238 238
 }
239 239
 
240 240
 /**
@@ -247,24 +247,24 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return mixed|string|void
249 249
  */
250
-function give_currency_filter( $price = '', $currency = '' ) {
250
+function give_currency_filter($price = '', $currency = '') {
251 251
 
252
-	if ( empty( $currency ) ) {
252
+	if (empty($currency)) {
253 253
 		$currency = give_get_currency();
254 254
 	}
255 255
 
256
-	$position = give_get_option( 'currency_position', 'before' );
256
+	$position = give_get_option('currency_position', 'before');
257 257
 
258 258
 	$negative = $price < 0;
259 259
 
260
-	if ( $negative ) {
260
+	if ($negative) {
261 261
 		// Remove proceeding "-".
262
-		$price = substr( $price, 1 );
262
+		$price = substr($price, 1);
263 263
 	}
264 264
 
265
-	$symbol = give_currency_symbol( $currency );
265
+	$symbol = give_currency_symbol($currency);
266 266
 
267
-	switch ( $currency ):
267
+	switch ($currency):
268 268
 		case 'GBP' :
269 269
 		case 'BRL' :
270 270
 		case 'EUR' :
@@ -293,13 +293,13 @@  discard block
 block discarded – undo
293 293
 		case 'MAD' :
294 294
 		case 'KRW' :
295 295
 		case 'ZAR' :
296
-			$formatted = ( 'before' === $position ? $symbol . $price : $price . $symbol );
296
+			$formatted = ('before' === $position ? $symbol.$price : $price.$symbol);
297 297
 			break;
298 298
 		case 'NOK' :
299
-			$formatted = ( 'before' === $position ? $symbol . ' ' . $price : $price . ' ' . $symbol );
299
+			$formatted = ('before' === $position ? $symbol.' '.$price : $price.' '.$symbol);
300 300
 			break;
301 301
 		default :
302
-			$formatted = ( 'before' === $position ? $currency . ' ' . $price : $price . ' ' . $currency );
302
+			$formatted = ('before' === $position ? $currency.' '.$price : $price.' '.$currency);
303 303
 			break;
304 304
 	endswitch;
305 305
 
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
 	 *           filter name will be give_usd_currency_filter_after
316 316
 	 *
317 317
 	 */
318
-	$formatted = apply_filters( 'give_' . strtolower( $currency ) . "_currency_filter_{$position}", $formatted, $currency, $price );
318
+	$formatted = apply_filters('give_'.strtolower($currency)."_currency_filter_{$position}", $formatted, $currency, $price);
319 319
 
320
-	if ( $negative ) {
320
+	if ($negative) {
321 321
 		// Prepend the minus sign before the currency sign.
322
-		$formatted = '-' . $formatted;
322
+		$formatted = '-'.$formatted;
323 323
 	}
324 324
 
325 325
 	return $formatted;
@@ -335,22 +335,22 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function give_currency_decimal_filter() {
337 337
 
338
-	remove_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
338
+	remove_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
339 339
 
340 340
 	// Set default number of decimals.
341 341
 	$decimals = give_get_price_decimals();
342 342
 
343
-	add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
343
+	add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
344 344
 
345 345
 
346 346
 	// Get number of decimals with backward compatibility ( version < 1.6 )
347
-	if ( 1 <= func_num_args() ) {
348
-		$decimals = ( false === func_get_arg( 0 ) ? $decimals : absint( func_get_arg( 0 ) ) );
347
+	if (1 <= func_num_args()) {
348
+		$decimals = (false === func_get_arg(0) ? $decimals : absint(func_get_arg(0)));
349 349
 	}
350 350
 
351 351
 	$currency = give_get_currency();
352 352
 
353
-	switch ( $currency ) {
353
+	switch ($currency) {
354 354
 		case 'RIAL' :
355 355
 		case 'JPY' :
356 356
 		case 'TWD' :
@@ -360,11 +360,11 @@  discard block
 block discarded – undo
360 360
 			break;
361 361
 	}
362 362
 
363
-	return apply_filters( 'give_currency_decimal_count', $decimals, $currency );
363
+	return apply_filters('give_currency_decimal_count', $decimals, $currency);
364 364
 }
365 365
 
366
-add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
367
-add_filter( 'give_format_amount_decimals', 'give_currency_decimal_filter' );
366
+add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
367
+add_filter('give_format_amount_decimals', 'give_currency_decimal_filter');
368 368
 
369 369
 /**
370 370
  * Sanitize thousand separator
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
  *
378 378
  * @return mixed
379 379
  */
380
-function give_sanitize_thousand_separator( $value, $field_args, $field ) {
381
-	return stripslashes( $value );
380
+function give_sanitize_thousand_separator($value, $field_args, $field) {
381
+	return stripslashes($value);
382 382
 }
383 383
 
384 384
 
@@ -393,8 +393,8 @@  discard block
 block discarded – undo
393 393
  *
394 394
  * @return mixed
395 395
  */
396
-function give_sanitize_number_decimals( $value, $field_args, $field ) {
397
-	return absint( $value );
396
+function give_sanitize_number_decimals($value, $field_args, $field) {
397
+	return absint($value);
398 398
 }
399 399
 
400 400
 /**
@@ -408,8 +408,8 @@  discard block
 block discarded – undo
408 408
  *
409 409
  * @return mixed
410 410
  */
411
-function give_sanitize_price_field_value( $value, $field_args, $field ) {
412
-	return give_sanitize_amount( $value );
411
+function give_sanitize_price_field_value($value, $field_args, $field) {
412
+	return give_sanitize_amount($value);
413 413
 }
414 414
 
415 415
 
@@ -423,29 +423,29 @@  discard block
 block discarded – undo
423 423
  *
424 424
  * @return void
425 425
  */
426
-function give_cmb_amount_field_render_row_cb( $field_args, $field ) {
426
+function give_cmb_amount_field_render_row_cb($field_args, $field) {
427 427
 
428 428
 	// Get args.
429
-	$id                = $field->args( 'id' );
430
-	$label             = $field->args( 'name' );
431
-	$name              = $field->args( '_name' );
432
-	$description       = $field->args( 'description' );
433
-	$attributes        = $field->args( 'attributes' );
429
+	$id                = $field->args('id');
430
+	$label             = $field->args('name');
431
+	$name              = $field->args('_name');
432
+	$description       = $field->args('description');
433
+	$attributes        = $field->args('attributes');
434 434
 	$attributes_string = '';
435 435
 	$row_class         = $field->row_classes();
436 436
 
437 437
 	// Get attributes.
438
-	if ( ! empty( $attributes ) ) {
439
-		foreach ( $attributes as $attribute_name => $attribute_val ) {
438
+	if ( ! empty($attributes)) {
439
+		foreach ($attributes as $attribute_name => $attribute_val) {
440 440
 			$attributes_string[] = "$attribute_name=\"$attribute_val\"";
441 441
 		}
442 442
 
443
-		$attributes_string = implode( ' ', $attributes_string );
443
+		$attributes_string = implode(' ', $attributes_string);
444 444
 	}
445 445
 
446 446
 	// Get row class.
447
-	if ( ! empty( $row_class ) && is_array( $row_class ) ) {
448
-		$row_class = implode( ' ', $row_class );
447
+	if ( ! empty($row_class) && is_array($row_class)) {
448
+		$row_class = implode(' ', $row_class);
449 449
 	}
450 450
 	?>
451 451
 	<div class="cmb-row <?php echo $row_class; ?>">
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
 			<label for="<?php echo $id; ?>"><?php echo $label; ?></label>
454 454
 		</div>
455 455
 		<div class="cmb-td">
456
-			<?php echo( give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '' ); ?>
456
+			<?php echo(give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : ''); ?>
457 457
 			<input id="<?php echo $id; ?>" type="text" name="<?php echo $name; ?>" <?php echo $attributes_string ?>/>
458
-			<?php echo( give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '' ); ?>
458
+			<?php echo(give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : ''); ?>
459 459
 
460 460
 			<span class="cmb2-metabox-description"><?php echo $description; ?></span>
461 461
 		</div>
Please login to merge, or discard this patch.
includes/ajax-functions.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -408,30 +408,30 @@
 block discarded – undo
408 408
 		die( '-2' );
409 409
 	}
410 410
 
411
-    if ( ! give_has_variable_prices( $form_id ) ) {
412
-        esc_html_e( 'n/a', 'give' );
413
-    } else {
414
-        // Payment object.
415
-        $payment = new Give_Payment( $payment_id );
416
-
417
-        // Payment meta.
418
-        $payment_meta = $payment->get_meta();
419
-
420
-
421
-        // Variable price dropdown options.
422
-        $variable_price_dropdown_option =  array(
423
-            'id'                => $form_id,
424
-            'name'              => 'give-variable-price',
425
-            'chosen'            => true,
426
-            'show_option_all'   => '',
427
-            'selected'          => $payment_meta['price_id'],
428
-        );
429
-
430
-        // Render variable prices select tag html.
431
-        give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
432
-    }
433
-
434
-    give_die();
411
+	if ( ! give_has_variable_prices( $form_id ) ) {
412
+		esc_html_e( 'n/a', 'give' );
413
+	} else {
414
+		// Payment object.
415
+		$payment = new Give_Payment( $payment_id );
416
+
417
+		// Payment meta.
418
+		$payment_meta = $payment->get_meta();
419
+
420
+
421
+		// Variable price dropdown options.
422
+		$variable_price_dropdown_option =  array(
423
+			'id'                => $form_id,
424
+			'name'              => 'give-variable-price',
425
+			'chosen'            => true,
426
+			'show_option_all'   => '',
427
+			'selected'          => $payment_meta['price_id'],
428
+		);
429
+
430
+		// Render variable prices select tag html.
431
+		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
432
+	}
433
+
434
+	give_die();
435 435
 }
436 436
 
437 437
 add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -26,27 +26,27 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 
39 39
 		} else {
40 40
 
41
-			if ( $airplane->check_status() == 'on' ) {
41
+			if ($airplane->check_status() == 'on') {
42 42
 				return true;
43 43
 			}
44 44
 		}
45 45
 	}
46 46
 
47
-	add_filter( 'block_local_requests', '__return_false' );
47
+	add_filter('block_local_requests', '__return_false');
48 48
 
49
-	if ( get_transient( '_give_ajax_works' ) ) {
49
+	if (get_transient('_give_ajax_works')) {
50 50
 		return true;
51 51
 	}
52 52
 
@@ -58,35 +58,35 @@  discard block
 block discarded – undo
58 58
 		)
59 59
 	);
60 60
 
61
-	$ajax  = wp_remote_post( give_get_ajax_url(), $params );
61
+	$ajax  = wp_remote_post(give_get_ajax_url(), $params);
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 
86 86
 	}
87 87
 
88
-	if ( $works ) {
89
-		set_transient( '_give_ajax_works', '1', DAY_IN_SECONDS );
88
+	if ($works) {
89
+		set_transient('_give_ajax_works', '1', DAY_IN_SECONDS);
90 90
 	}
91 91
 
92 92
 	return $works;
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
  * @return string
102 102
  */
103 103
 function give_get_ajax_url() {
104
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
104
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
105 105
 
106 106
 	$current_url = give_get_current_page_url();
107
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
107
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
108 108
 
109
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
110
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
109
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
110
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
111 111
 	}
112 112
 
113
-	return apply_filters( 'give_ajax_url', $ajax_url );
113
+	return apply_filters('give_ajax_url', $ajax_url);
114 114
 }
115 115
 
116 116
 /**
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
  * @return void
122 122
  */
123 123
 function give_load_checkout_login_fields() {
124
-	do_action( 'give_purchase_form_login_fields' );
124
+	do_action('give_purchase_form_login_fields');
125 125
 	give_die();
126 126
 }
127 127
 
128
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
128
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
129 129
 
130 130
 /**
131 131
  * Load Checkout Fields
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
  * @return void
136 136
  */
137 137
 function give_load_checkout_fields() {
138
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
138
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
139 139
 
140 140
 	ob_start();
141 141
 
142
-	do_action( 'give_purchase_form_register_login_fields', $form_id );
142
+	do_action('give_purchase_form_register_login_fields', $form_id);
143 143
 
144 144
 	$fields = ob_get_clean();
145 145
 
146
-	wp_send_json( array(
147
-		'fields' => wp_json_encode( $fields ),
148
-		'submit' => wp_json_encode( give_checkout_button_purchase( $form_id ) ),
149
-	) );
146
+	wp_send_json(array(
147
+		'fields' => wp_json_encode($fields),
148
+		'submit' => wp_json_encode(give_checkout_button_purchase($form_id)),
149
+	));
150 150
 }
151 151
 
152
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
153
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
152
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
153
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
154 154
 
155 155
 /**
156 156
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
  * @return void
161 161
  */
162 162
 function give_ajax_get_form_title() {
163
-	if ( isset( $_POST['form_id'] ) ) {
164
-		$title = get_the_title( $_POST['form_id'] );
165
-		if ( $title ) {
163
+	if (isset($_POST['form_id'])) {
164
+		$title = get_the_title($_POST['form_id']);
165
+		if ($title) {
166 166
 			echo $title;
167 167
 		} else {
168 168
 			echo 'fail';
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	give_die();
172 172
 }
173 173
 
174
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
175
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
174
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
175
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
176 176
 
177 177
 /**
178 178
  * Retrieve a states drop down
@@ -183,23 +183,23 @@  discard block
 block discarded – undo
183 183
  */
184 184
 function give_ajax_get_states_field() {
185 185
 
186
-	if ( empty( $_POST['country'] ) ) {
186
+	if (empty($_POST['country'])) {
187 187
 		$_POST['country'] = give_get_country();
188 188
 	}
189
-	$states = give_get_states( $_POST['country'] );
189
+	$states = give_get_states($_POST['country']);
190 190
 
191
-	if ( ! empty( $states ) ) {
191
+	if ( ! empty($states)) {
192 192
 
193 193
 		$args = array(
194 194
 			'name'             => $_POST['field_name'],
195 195
 			'id'               => $_POST['field_name'],
196
-			'class'            => $_POST['field_name'] . '  give-select',
197
-			'options'          => give_get_states( $_POST['country'] ),
196
+			'class'            => $_POST['field_name'].'  give-select',
197
+			'options'          => give_get_states($_POST['country']),
198 198
 			'show_option_all'  => false,
199 199
 			'show_option_none' => false
200 200
 		);
201 201
 
202
-		$response = Give()->html->select( $args );
202
+		$response = Give()->html->select($args);
203 203
 
204 204
 	} else {
205 205
 
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 	give_die();
212 212
 }
213 213
 
214
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
215
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
214
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
215
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
216 216
 
217 217
 /**
218 218
  * Retrieve a states drop down
@@ -224,17 +224,17 @@  discard block
 block discarded – undo
224 224
 function give_ajax_form_search() {
225 225
 	global $wpdb;
226 226
 
227
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
227
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
228 228
 	$results = array();
229
-	if ( current_user_can( 'edit_give_forms' ) ) {
230
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
229
+	if (current_user_can('edit_give_forms')) {
230
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
231 231
 	} else {
232
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" );
232
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50");
233 233
 	}
234 234
 
235
-	if ( $items ) {
235
+	if ($items) {
236 236
 
237
-		foreach ( $items as $item ) {
237
+		foreach ($items as $item) {
238 238
 
239 239
 			$results[] = array(
240 240
 				'id'   => $item->ID,
@@ -246,18 +246,18 @@  discard block
 block discarded – undo
246 246
 
247 247
 		$items[] = array(
248 248
 			'id'   => 0,
249
-			'name' => esc_html__( 'No results found', 'give' )
249
+			'name' => esc_html__('No results found', 'give')
250 250
 		);
251 251
 
252 252
 	}
253 253
 
254
-	echo json_encode( $results );
254
+	echo json_encode($results);
255 255
 
256 256
 	give_die();
257 257
 }
258 258
 
259
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
260
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
259
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
260
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
261 261
 
262 262
 /**
263 263
  * Search the donors database via Ajax
@@ -269,21 +269,21 @@  discard block
 block discarded – undo
269 269
 function give_ajax_donor_search() {
270 270
 	global $wpdb;
271 271
 
272
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
272
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
273 273
 	$results = array();
274
-	if ( ! current_user_can( 'view_give_reports' ) ) {
274
+	if ( ! current_user_can('view_give_reports')) {
275 275
 		$donors = array();
276 276
 	} else {
277
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
277
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
278 278
 	}
279 279
 
280
-	if ( $donors ) {
280
+	if ($donors) {
281 281
 
282
-		foreach ( $donors as $donor ) {
282
+		foreach ($donors as $donor) {
283 283
 
284 284
 			$results[] = array(
285 285
 				'id'   => $donor->id,
286
-				'name' => $donor->name . '(' . $donor->email . ')'
286
+				'name' => $donor->name.'('.$donor->email.')'
287 287
 			);
288 288
 		}
289 289
 
@@ -291,17 +291,17 @@  discard block
 block discarded – undo
291 291
 
292 292
 		$donors[] = array(
293 293
 			'id'   => 0,
294
-			'name' => esc_html__( 'No results found', 'give' )
294
+			'name' => esc_html__('No results found', 'give')
295 295
 		);
296 296
 
297 297
 	}
298 298
 
299
-	echo json_encode( $results );
299
+	echo json_encode($results);
300 300
 
301 301
 	give_die();
302 302
 }
303 303
 
304
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
304
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
305 305
 
306 306
 
307 307
 /**
@@ -313,42 +313,42 @@  discard block
 block discarded – undo
313 313
  */
314 314
 function give_ajax_search_users() {
315 315
 
316
-	if ( current_user_can( 'manage_give_settings' ) ) {
316
+	if (current_user_can('manage_give_settings')) {
317 317
 
318
-		$search_query = trim( $_POST['user_name'] );
319
-		$exclude      = trim( $_POST['exclude'] );
318
+		$search_query = trim($_POST['user_name']);
319
+		$exclude      = trim($_POST['exclude']);
320 320
 
321 321
 		$get_users_args = array(
322 322
 			'number' => 9999,
323
-			'search' => $search_query . '*'
323
+			'search' => $search_query.'*'
324 324
 		);
325 325
 
326
-		if ( ! empty( $exclude ) ) {
327
-			$exclude_array             = explode( ',', $exclude );
326
+		if ( ! empty($exclude)) {
327
+			$exclude_array             = explode(',', $exclude);
328 328
 			$get_users_args['exclude'] = $exclude_array;
329 329
 		}
330 330
 
331
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
331
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
332 332
 
333
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search_query );
333
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search_query);
334 334
 
335 335
 		$user_list = '<ul>';
336
-		if ( $found_users ) {
337
-			foreach ( $found_users as $user ) {
338
-				$user_list .= '<li><a href="#" data-userid="' . esc_attr( $user->ID ) . '" data-login="' . esc_attr( $user->user_login ) . '">' . esc_html( $user->user_login ) . '</a></li>';
336
+		if ($found_users) {
337
+			foreach ($found_users as $user) {
338
+				$user_list .= '<li><a href="#" data-userid="'.esc_attr($user->ID).'" data-login="'.esc_attr($user->user_login).'">'.esc_html($user->user_login).'</a></li>';
339 339
 			}
340 340
 		} else {
341
-			$user_list .= '<li>' . esc_html__( 'No users found', 'give' ) . '</li>';
341
+			$user_list .= '<li>'.esc_html__('No users found', 'give').'</li>';
342 342
 		}
343 343
 		$user_list .= '</ul>';
344 344
 
345
-		echo json_encode( array( 'results' => $user_list ) );
345
+		echo json_encode(array('results' => $user_list));
346 346
 
347 347
 	}
348 348
 	die();
349 349
 }
350 350
 
351
-add_action( 'wp_ajax_give_search_users', 'give_ajax_search_users' );
351
+add_action('wp_ajax_give_search_users', 'give_ajax_search_users');
352 352
 
353 353
 
354 354
 /**
@@ -360,32 +360,32 @@  discard block
 block discarded – undo
360 360
  */
361 361
 function give_check_for_form_price_variations() {
362 362
 
363
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
364
-		die( '-1' );
363
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
364
+		die('-1');
365 365
 	}
366 366
 
367
-	$form_id = intval( $_POST['form_id'] );
368
-	$form    = get_post( $form_id );
367
+	$form_id = intval($_POST['form_id']);
368
+	$form    = get_post($form_id);
369 369
 
370
-	if ( 'give_forms' != $form->post_type ) {
371
-		die( '-2' );
370
+	if ('give_forms' != $form->post_type) {
371
+		die('-2');
372 372
 	}
373 373
 
374
-	if ( give_has_variable_prices( $form_id ) ) {
375
-		$variable_prices = give_get_variable_prices( $form_id );
374
+	if (give_has_variable_prices($form_id)) {
375
+		$variable_prices = give_get_variable_prices($form_id);
376 376
 
377
-		if ( $variable_prices ) {
377
+		if ($variable_prices) {
378 378
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
379 379
 
380
-			if ( isset( $_POST['all_prices'] ) ) {
381
-				$ajax_response .= '<option value="">' . esc_html__( 'All Levels', 'give' ) . '</option>';
380
+			if (isset($_POST['all_prices'])) {
381
+				$ajax_response .= '<option value="">'.esc_html__('All Levels', 'give').'</option>';
382 382
 			}
383 383
 
384
-			foreach ( $variable_prices as $key => $price ) {
384
+			foreach ($variable_prices as $key => $price) {
385 385
 
386
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) );
386
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount']));
387 387
 				
388
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
388
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
389 389
 			}
390 390
 			$ajax_response .= '</select>';
391 391
 			echo $ajax_response;
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 	give_die();
397 397
 }
398 398
 
399
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
399
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
400 400
 
401 401
 
402 402
 /**
@@ -407,30 +407,30 @@  discard block
 block discarded – undo
407 407
  * @return void
408 408
  */
409 409
 function give_check_for_form_price_variations_html() {
410
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
410
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
411 411
 		wp_die();
412 412
 	}
413 413
 
414
-	$form_id = intval( $_POST['form_id'] );
415
-	$payment_id = intval( $_POST['payment_id'] );
416
-	$form    = get_post( $form_id );
414
+	$form_id = intval($_POST['form_id']);
415
+	$payment_id = intval($_POST['payment_id']);
416
+	$form    = get_post($form_id);
417 417
 
418
-	if ( 'give_forms' != $form->post_type ) {
418
+	if ('give_forms' != $form->post_type) {
419 419
 		wp_die();
420 420
 	}
421 421
 
422
-    if ( ! give_has_variable_prices( $form_id ) ) {
423
-        esc_html_e( 'n/a', 'give' );
422
+    if ( ! give_has_variable_prices($form_id)) {
423
+        esc_html_e('n/a', 'give');
424 424
     } else {
425 425
         // Payment object.
426
-        $payment = new Give_Payment( $payment_id );
426
+        $payment = new Give_Payment($payment_id);
427 427
 
428 428
         // Payment meta.
429 429
         $payment_meta = $payment->get_meta();
430 430
 
431 431
 
432 432
         // Variable price dropdown options.
433
-        $variable_price_dropdown_option =  array(
433
+        $variable_price_dropdown_option = array(
434 434
             'id'                => $form_id,
435 435
             'name'              => 'give-variable-price',
436 436
             'chosen'            => true,
@@ -439,10 +439,10 @@  discard block
 block discarded – undo
439 439
         );
440 440
 
441 441
         // Render variable prices select tag html.
442
-        give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
442
+        give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
443 443
     }
444 444
 
445 445
     give_die();
446 446
 }
447 447
 
448
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
448
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
Please login to merge, or discard this patch.
includes/class-give-db-customer-meta.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		/* @var WPDB $wpdb */
32 32
 		global $wpdb;
33 33
 
34
-		$this->table_name  = $wpdb->prefix . 'give_customermeta';
34
+		$this->table_name  = $wpdb->prefix.'give_customermeta';
35 35
 		$this->primary_key = 'meta_id';
36 36
 		$this->version     = '1.0';
37 37
 
38
-		add_action( 'plugins_loaded', array( $this, 'register_table' ), 11 );
38
+		add_action('plugins_loaded', array($this, 'register_table'), 11);
39 39
 
40 40
 	}
41 41
 
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 	 * @access  private
80 80
 	 * @since   1.6
81 81
 	 */
82
-	public function get_meta( $customer_id = 0, $meta_key = '', $single = false ) {
83
-		$customer_id = $this->sanitize_customer_id( $customer_id );
84
-		if ( false === $customer_id ) {
82
+	public function get_meta($customer_id = 0, $meta_key = '', $single = false) {
83
+		$customer_id = $this->sanitize_customer_id($customer_id);
84
+		if (false === $customer_id) {
85 85
 			return false;
86 86
 		}
87 87
 
88
-		return get_metadata( 'customer', $customer_id, $meta_key, $single );
88
+		return get_metadata('customer', $customer_id, $meta_key, $single);
89 89
 	}
90 90
 
91 91
 	/**
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
 	 * @access  private
104 104
 	 * @since   1.6
105 105
 	 */
106
-	public function add_meta( $customer_id = 0, $meta_key = '', $meta_value, $unique = false ) {
107
-		$customer_id = $this->sanitize_customer_id( $customer_id );
108
-		if ( false === $customer_id ) {
106
+	public function add_meta($customer_id = 0, $meta_key = '', $meta_value, $unique = false) {
107
+		$customer_id = $this->sanitize_customer_id($customer_id);
108
+		if (false === $customer_id) {
109 109
 			return false;
110 110
 		}
111 111
 
112
-		return add_metadata( 'customer', $customer_id, $meta_key, $meta_value, $unique );
112
+		return add_metadata('customer', $customer_id, $meta_key, $meta_value, $unique);
113 113
 	}
114 114
 
115 115
 	/**
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 	 * @access  private
133 133
 	 * @since   1.6
134 134
 	 */
135
-	public function update_meta( $customer_id = 0, $meta_key = '', $meta_value, $prev_value = '' ) {
136
-		$customer_id = $this->sanitize_customer_id( $customer_id );
137
-		if ( false === $customer_id ) {
135
+	public function update_meta($customer_id = 0, $meta_key = '', $meta_value, $prev_value = '') {
136
+		$customer_id = $this->sanitize_customer_id($customer_id);
137
+		if (false === $customer_id) {
138 138
 			return false;
139 139
 		}
140 140
 
141
-		return update_metadata( 'customer', $customer_id, $meta_key, $meta_value, $prev_value );
141
+		return update_metadata('customer', $customer_id, $meta_key, $meta_value, $prev_value);
142 142
 	}
143 143
 
144 144
 	/**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 	 * @access  private
160 160
 	 * @since   1.6
161 161
 	 */
162
-	public function delete_meta( $customer_id = 0, $meta_key = '', $meta_value = '' ) {
163
-		return delete_metadata( 'customer', $customer_id, $meta_key, $meta_value );
162
+	public function delete_meta($customer_id = 0, $meta_key = '', $meta_value = '') {
163
+		return delete_metadata('customer', $customer_id, $meta_key, $meta_value);
164 164
 	}
165 165
 
166 166
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function create_table() {
173 173
 
174
-		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
174
+		require_once(ABSPATH.'wp-admin/includes/upgrade.php');
175 175
 
176 176
 		$sql = "CREATE TABLE {$this->table_name} (
177 177
 			meta_id bigint(20) NOT NULL AUTO_INCREMENT,
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
 			KEY meta_key (meta_key)
184 184
 			) CHARACTER SET utf8 COLLATE utf8_general_ci;";
185 185
 
186
-		dbDelta( $sql );
186
+		dbDelta($sql);
187 187
 
188
-		update_option( $this->table_name . '_db_version', $this->version );
188
+		update_option($this->table_name.'_db_version', $this->version);
189 189
 	}
190 190
 
191 191
 	/**
@@ -197,23 +197,23 @@  discard block
 block discarded – undo
197 197
 	 *
198 198
 	 * @return int|bool                The normalized customer ID or false if it's found to not be valid.
199 199
 	 */
200
-	private function sanitize_customer_id( $customer_id ) {
201
-		if ( ! is_numeric( $customer_id ) ) {
200
+	private function sanitize_customer_id($customer_id) {
201
+		if ( ! is_numeric($customer_id)) {
202 202
 			return false;
203 203
 		}
204 204
 
205 205
 		$customer_id = (int) $customer_id;
206 206
 
207 207
 		// We were given a non positive number
208
-		if ( absint( $customer_id ) !== $customer_id ) {
208
+		if (absint($customer_id) !== $customer_id) {
209 209
 			return false;
210 210
 		}
211 211
 
212
-		if ( empty( $customer_id ) ) {
212
+		if (empty($customer_id)) {
213 213
 			return false;
214 214
 		}
215 215
 
216
-		return absint( $customer_id );
216
+		return absint($customer_id);
217 217
 
218 218
 	}
219 219
 
Please login to merge, or discard this patch.
includes/payments/actions.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -209,14 +209,14 @@
 block discarded – undo
209 209
 	remove_filter( 'posts_where', 'give_filter_where_older_than_week' );
210 210
 
211 211
 	if ( $payments ) {
212
-        /**
213
-         * Filter payment gateways:  Used to set payment gateways which can be skip while transferring pending payment to abandon.
214
-         *
215
-         * @since 1.6
216
-         *
217
-         * @param array $skip_payment_gateways Array of payment gateways
218
-         */
219
-	    $skip_payment_gateways = apply_filters( 'give_mark_abandoned_donation_gateways', array( 'offline' ) );
212
+		/**
213
+		 * Filter payment gateways:  Used to set payment gateways which can be skip while transferring pending payment to abandon.
214
+		 *
215
+		 * @since 1.6
216
+		 *
217
+		 * @param array $skip_payment_gateways Array of payment gateways
218
+		 */
219
+		$skip_payment_gateways = apply_filters( 'give_mark_abandoned_donation_gateways', array( 'offline' ) );
220 220
 
221 221
 		foreach ( $payments as $payment ) {
222 222
 			$gateway = give_get_payment_gateway( $payment );
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 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
 
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @return void
30 30
  */
31
-function give_complete_purchase( $payment_id, $new_status, $old_status ) {
31
+function give_complete_purchase($payment_id, $new_status, $old_status) {
32 32
 
33 33
 	// Make sure that payments are only completed once
34
-	if ( $old_status == 'publish' || $old_status == 'complete' ) {
34
+	if ($old_status == 'publish' || $old_status == 'complete') {
35 35
 		return;
36 36
 	}
37 37
 
38 38
 	// Make sure the payment completion is only processed when new status is complete
39
-	if ( $new_status != 'publish' && $new_status != 'complete' ) {
39
+	if ($new_status != 'publish' && $new_status != 'complete') {
40 40
 		return;
41 41
 	}
42 42
 	
43
-	$payment = new Give_Payment( $payment_id );
43
+	$payment = new Give_Payment($payment_id);
44 44
 
45
-	$creation_date  = get_post_field( 'post_date', $payment_id, 'raw' );
45
+	$creation_date  = get_post_field('post_date', $payment_id, 'raw');
46 46
 	$payment_meta   = $payment->payment_meta;
47 47
 	$completed_date = $payment->completed_date;
48 48
 	$user_info      = $payment->user_info;
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	$price_id       = $payment->price_id;
52 52
 	$form_id        = $payment->form_id;
53 53
 
54
-	do_action( 'give_pre_complete_purchase', $payment_id );
54
+	do_action('give_pre_complete_purchase', $payment_id);
55 55
 
56 56
 	// Ensure these actions only run once, ever
57
-	if ( empty( $completed_date ) ) {
57
+	if (empty($completed_date)) {
58 58
 
59
-		give_record_sale_in_log( $form_id, $payment_id, $price_id, $creation_date );
60
-		do_action( 'give_complete_form_donation', $form_id, $payment_id, $payment_meta );
59
+		give_record_sale_in_log($form_id, $payment_id, $price_id, $creation_date);
60
+		do_action('give_complete_form_donation', $form_id, $payment_id, $payment_meta);
61 61
 
62 62
 	}
63 63
 
64 64
 	// Increase the earnings for this form ID
65
-	give_increase_earnings( $form_id, $amount );
66
-	give_increase_purchase_count( $form_id );
65
+	give_increase_earnings($form_id, $amount);
66
+	give_increase_purchase_count($form_id);
67 67
 
68 68
 	// Clear the total earnings cache
69
-	delete_transient( 'give_earnings_total' );
69
+	delete_transient('give_earnings_total');
70 70
 	// Clear the This Month earnings (this_monththis_month is NOT a typo)
71
-	delete_transient( md5( 'give_earnings_this_monththis_month' ) );
72
-	delete_transient( md5( 'give_earnings_todaytoday' ) );
71
+	delete_transient(md5('give_earnings_this_monththis_month'));
72
+	delete_transient(md5('give_earnings_todaytoday'));
73 73
 	
74 74
 	// Increase the donor's purchase stats
75
-	$customer = new Give_Customer( $customer_id );
75
+	$customer = new Give_Customer($customer_id);
76 76
 	$customer->increase_purchase_count();
77
-	$customer->increase_value( $amount );
77
+	$customer->increase_value($amount);
78 78
 
79
-	give_increase_total_earnings( $amount );
79
+	give_increase_total_earnings($amount);
80 80
 
81 81
 	// Ensure this action only runs once ever
82
-	if ( empty( $completed_date ) ) {
82
+	if (empty($completed_date)) {
83 83
 
84 84
 		// Save the completed date
85
-		$payment->completed_date = current_time( 'mysql' );
85
+		$payment->completed_date = current_time('mysql');
86 86
 		$payment->save();
87 87
 
88 88
 		/**
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 		 *
93 93
 		 * @param int $payment_id The ID of the payment.
94 94
 		 */
95
-		do_action( 'give_complete_purchase', $payment_id );
95
+		do_action('give_complete_purchase', $payment_id);
96 96
 	}
97 97
 
98 98
 }
99 99
 
100
-add_action( 'give_update_payment_status', 'give_complete_purchase', 100, 3 );
100
+add_action('give_update_payment_status', 'give_complete_purchase', 100, 3);
101 101
 
102 102
 
103 103
 /**
@@ -111,24 +111,24 @@  discard block
 block discarded – undo
111 111
  *
112 112
  * @return void
113 113
  */
114
-function give_record_status_change( $payment_id, $new_status, $old_status ) {
114
+function give_record_status_change($payment_id, $new_status, $old_status) {
115 115
 
116 116
 	// Get the list of statuses so that status in the payment note can be translated
117 117
 	$stati      = give_get_payment_statuses();
118
-	$old_status = isset( $stati[ $old_status ] ) ? $stati[ $old_status ] : $old_status;
119
-	$new_status = isset( $stati[ $new_status ] ) ? $stati[ $new_status ] : $new_status;
118
+	$old_status = isset($stati[$old_status]) ? $stati[$old_status] : $old_status;
119
+	$new_status = isset($stati[$new_status]) ? $stati[$new_status] : $new_status;
120 120
 
121 121
 	$status_change = sprintf(
122 122
 		/* translators: 1: old status 2: new status */
123
-		esc_html__( 'Status changed from %1$s to %2$s.', 'give' ),
123
+		esc_html__('Status changed from %1$s to %2$s.', 'give'),
124 124
 		$old_status,
125 125
 		$new_status
126 126
 	);
127 127
 
128
-	give_insert_payment_note( $payment_id, $status_change );
128
+	give_insert_payment_note($payment_id, $status_change);
129 129
 }
130 130
 
131
-add_action( 'give_update_payment_status', 'give_record_status_change', 100, 3 );
131
+add_action('give_update_payment_status', 'give_record_status_change', 100, 3);
132 132
 
133 133
 
134 134
 /**
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
  *
146 146
  * @return void
147 147
  */
148
-function give_clear_user_history_cache( $payment_id, $new_status, $old_status ) {
148
+function give_clear_user_history_cache($payment_id, $new_status, $old_status) {
149 149
 
150
-	$payment = new Give_Payment( $payment_id );
150
+	$payment = new Give_Payment($payment_id);
151 151
 
152
-	if ( ! empty( $payment->user_id ) ) {
153
-		delete_transient( 'give_user_' . $payment->user_id . '_purchases' );
152
+	if ( ! empty($payment->user_id)) {
153
+		delete_transient('give_user_'.$payment->user_id.'_purchases');
154 154
 	}
155 155
 
156 156
 }
157 157
 
158
-add_action( 'give_update_payment_status', 'give_clear_user_history_cache', 10, 3 );
158
+add_action('give_update_payment_status', 'give_clear_user_history_cache', 10, 3);
159 159
 
160 160
 /**
161 161
  * Update Old Payments Totals
@@ -170,25 +170,25 @@  discard block
 block discarded – undo
170 170
  *
171 171
  * @return void
172 172
  */
173
-function give_update_old_payments_with_totals( $data ) {
174
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_upgrade_payments_nonce' ) ) {
173
+function give_update_old_payments_with_totals($data) {
174
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give_upgrade_payments_nonce')) {
175 175
 		return;
176 176
 	}
177 177
 
178
-	if ( get_option( 'give_payment_totals_upgraded' ) ) {
178
+	if (get_option('give_payment_totals_upgraded')) {
179 179
 		return;
180 180
 	}
181 181
 
182
-	$payments = give_get_payments( array(
182
+	$payments = give_get_payments(array(
183 183
 		'offset' => 0,
184
-		'number' => - 1,
184
+		'number' => -1,
185 185
 		'mode'   => 'all'
186
-	) );
186
+	));
187 187
 
188
-	if ( $payments ) {
189
-		foreach ( $payments as $payment ) {
188
+	if ($payments) {
189
+		foreach ($payments as $payment) {
190 190
 
191
-			$payment = new Give_Payment( $payment->ID );
191
+			$payment = new Give_Payment($payment->ID);
192 192
 			$meta    = $payment->get_meta();
193 193
 
194 194
 			$payment->total = $meta['amount'];
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
 		}
198 198
 	}
199 199
 
200
-	add_option( 'give_payment_totals_upgraded', 1 );
200
+	add_option('give_payment_totals_upgraded', 1);
201 201
 }
202 202
 
203
-add_action( 'give_upgrade_payments', 'give_update_old_payments_with_totals' );
203
+add_action('give_upgrade_payments', 'give_update_old_payments_with_totals');
204 204
 
205 205
 /**
206 206
  * Mark Abandoned Donations
@@ -214,17 +214,17 @@  discard block
 block discarded – undo
214 214
 function give_mark_abandoned_donations() {
215 215
 	$args = array(
216 216
 		'status' => 'pending',
217
-		'number' => - 1,
217
+		'number' => -1,
218 218
 		'output' => 'give_payments',
219 219
 	);
220 220
 
221
-	add_filter( 'posts_where', 'give_filter_where_older_than_week' );
221
+	add_filter('posts_where', 'give_filter_where_older_than_week');
222 222
 
223
-	$payments = give_get_payments( $args );
223
+	$payments = give_get_payments($args);
224 224
 
225
-	remove_filter( 'posts_where', 'give_filter_where_older_than_week' );
225
+	remove_filter('posts_where', 'give_filter_where_older_than_week');
226 226
 
227
-	if ( $payments ) {
227
+	if ($payments) {
228 228
         /**
229 229
          * Filter payment gateways:  Used to set payment gateways which can be skip while transferring pending payment to abandon.
230 230
          *
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
          *
233 233
          * @param array $skip_payment_gateways Array of payment gateways
234 234
          */
235
-	    $skip_payment_gateways = apply_filters( 'give_mark_abandoned_donation_gateways', array( 'offline' ) );
235
+	    $skip_payment_gateways = apply_filters('give_mark_abandoned_donation_gateways', array('offline'));
236 236
 
237
-		foreach ( $payments as $payment ) {
238
-			$gateway = give_get_payment_gateway( $payment );
237
+		foreach ($payments as $payment) {
238
+			$gateway = give_get_payment_gateway($payment);
239 239
 
240 240
 			// Skip payment gateways.
241
-			if ( in_array( $gateway, $skip_payment_gateways ) ) {
241
+			if (in_array($gateway, $skip_payment_gateways)) {
242 242
 				continue;
243 243
 			}
244 244
 
@@ -248,4 +248,4 @@  discard block
 block discarded – undo
248 248
 	}
249 249
 }
250 250
 
251
-add_action( 'give_weekly_scheduled_events', 'give_mark_abandoned_donations' );
251
+add_action('give_weekly_scheduled_events', 'give_mark_abandoned_donations');
Please login to merge, or discard this patch.
includes/template-functions.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -46,27 +46,27 @@
 block discarded – undo
46 46
  * @param string $default_path (default: '')
47 47
  */
48 48
 function give_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
49
-    if ( ! empty( $args ) && is_array( $args ) ) {
50
-        extract( $args );
51
-    }
49
+	if ( ! empty( $args ) && is_array( $args ) ) {
50
+		extract( $args );
51
+	}
52 52
 
53
-    $template_names = array( $template_name . '.php' );
53
+	$template_names = array( $template_name . '.php' );
54 54
 
55
-    $located = give_locate_template( $template_names, $template_path, $default_path );
55
+	$located = give_locate_template( $template_names, $template_path, $default_path );
56 56
 
57
-    if ( ! file_exists( $located ) ) {
58
-        give_output_error( sprintf( __( 'Error: %s template does not find.', 'give' ), $located ), true );
59
-        return;
60
-    }
57
+	if ( ! file_exists( $located ) ) {
58
+		give_output_error( sprintf( __( 'Error: %s template does not find.', 'give' ), $located ), true );
59
+		return;
60
+	}
61 61
 
62
-    // Allow 3rd party plugin filter template file from their plugin.
63
-    $located = apply_filters( 'give_get_template', $located, $template_name, $args, $template_path, $default_path );
62
+	// Allow 3rd party plugin filter template file from their plugin.
63
+	$located = apply_filters( 'give_get_template', $located, $template_name, $args, $template_path, $default_path );
64 64
 
65
-    do_action( 'give_before_template_part', $template_name, $template_path, $located, $args );
65
+	do_action( 'give_before_template_part', $template_name, $template_path, $located, $args );
66 66
 
67
-    include( $located );
67
+	include( $located );
68 68
 
69
-    do_action( 'give_after_template_part', $template_name, $template_path, $located, $args );
69
+	do_action( 'give_after_template_part', $template_name, $template_path, $located, $args );
70 70
 }
71 71
 
72 72
 /**
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 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
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @return string
22 22
  */
23 23
 function give_get_templates_dir() {
24
-	return GIVE_PLUGIN_DIR . 'templates';
24
+	return GIVE_PLUGIN_DIR.'templates';
25 25
 }
26 26
 
27 27
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  * @return string
32 32
  */
33 33
 function give_get_templates_url() {
34
-	return GIVE_PLUGIN_URL . 'templates';
34
+	return GIVE_PLUGIN_URL.'templates';
35 35
 }
36 36
 
37 37
 /**
@@ -45,28 +45,28 @@  discard block
 block discarded – undo
45 45
  * @param string $template_path (default: '')
46 46
  * @param string $default_path (default: '')
47 47
  */
48
-function give_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
49
-    if ( ! empty( $args ) && is_array( $args ) ) {
50
-        extract( $args );
48
+function give_get_template($template_name, $args = array(), $template_path = '', $default_path = '') {
49
+    if ( ! empty($args) && is_array($args)) {
50
+        extract($args);
51 51
     }
52 52
 
53
-    $template_names = array( $template_name . '.php' );
53
+    $template_names = array($template_name.'.php');
54 54
 
55
-    $located = give_locate_template( $template_names, $template_path, $default_path );
55
+    $located = give_locate_template($template_names, $template_path, $default_path);
56 56
 
57
-    if ( ! file_exists( $located ) ) {
58
-        give_output_error( sprintf( __( 'Error: %s template does not find.', 'give' ), $located ), true );
57
+    if ( ! file_exists($located)) {
58
+        give_output_error(sprintf(__('Error: %s template does not find.', 'give'), $located), true);
59 59
         return;
60 60
     }
61 61
 
62 62
     // Allow 3rd party plugin filter template file from their plugin.
63
-    $located = apply_filters( 'give_get_template', $located, $template_name, $args, $template_path, $default_path );
63
+    $located = apply_filters('give_get_template', $located, $template_name, $args, $template_path, $default_path);
64 64
 
65
-    do_action( 'give_before_template_part', $template_name, $template_path, $located, $args );
65
+    do_action('give_before_template_part', $template_name, $template_path, $located, $args);
66 66
 
67
-    include( $located );
67
+    include($located);
68 68
 
69
-    do_action( 'give_after_template_part', $template_name, $template_path, $located, $args );
69
+    do_action('give_after_template_part', $template_name, $template_path, $located, $args);
70 70
 }
71 71
 
72 72
 /**
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
  * @uses  load_template()
87 87
  * @uses  get_template_part()
88 88
  */
89
-function give_get_template_part( $slug, $name = null, $load = true ) {
89
+function give_get_template_part($slug, $name = null, $load = true) {
90 90
 
91 91
 	// Execute code for this part
92
-	do_action( 'get_template_part_' . $slug, $slug, $name );
92
+	do_action('get_template_part_'.$slug, $slug, $name);
93 93
 
94 94
 	// Setup possible parts
95 95
 	$templates = array();
96
-	if ( isset( $name ) ) {
97
-		$templates[] = $slug . '-' . $name . '.php';
96
+	if (isset($name)) {
97
+		$templates[] = $slug.'-'.$name.'.php';
98 98
 	}
99
-	$templates[] = $slug . '.php';
99
+	$templates[] = $slug.'.php';
100 100
 
101 101
 	// Allow template parts to be filtered
102
-	$templates = apply_filters( 'give_get_template_part', $templates, $slug, $name );
102
+	$templates = apply_filters('give_get_template_part', $templates, $slug, $name);
103 103
 
104 104
 	// Return the part that is found
105
-	return give_locate_template( $templates, $load, false );
105
+	return give_locate_template($templates, $load, false);
106 106
 }
107 107
 
108 108
 /**
@@ -123,37 +123,37 @@  discard block
 block discarded – undo
123 123
  *
124 124
  * @return string The template filename if one is located.
125 125
  */
126
-function give_locate_template( $template_names, $load = false, $require_once = true ) {
126
+function give_locate_template($template_names, $load = false, $require_once = true) {
127 127
 	// No file found yet
128 128
 	$located = false;
129 129
 
130 130
 	// Try to find a template file
131
-	foreach ( (array) $template_names as $template_name ) {
131
+	foreach ((array) $template_names as $template_name) {
132 132
 
133 133
 		// Continue if template is empty
134
-		if ( empty( $template_name ) ) {
134
+		if (empty($template_name)) {
135 135
 			continue;
136 136
 		}
137 137
 
138 138
 		// Trim off any slashes from the template name
139
-		$template_name = ltrim( $template_name, '/' );
139
+		$template_name = ltrim($template_name, '/');
140 140
 
141 141
 		// try locating this template file by looping through the template paths
142
-		foreach ( give_get_theme_template_paths() as $template_path ) {
142
+		foreach (give_get_theme_template_paths() as $template_path) {
143 143
 
144
-			if ( file_exists( $template_path . $template_name ) ) {
145
-				$located = $template_path . $template_name;
144
+			if (file_exists($template_path.$template_name)) {
145
+				$located = $template_path.$template_name;
146 146
 				break;
147 147
 			}
148 148
 		}
149 149
 
150
-		if ( $located ) {
150
+		if ($located) {
151 151
 			break;
152 152
 		}
153 153
 	}
154 154
 
155
-	if ( ( true == $load ) && ! empty( $located ) ) {
156
-		load_template( $located, $require_once );
155
+	if ((true == $load) && ! empty($located)) {
156
+		load_template($located, $require_once);
157 157
 	}
158 158
 
159 159
 	return $located;
@@ -170,17 +170,17 @@  discard block
 block discarded – undo
170 170
 	$template_dir = give_get_theme_template_dir_name();
171 171
 
172 172
 	$file_paths = array(
173
-		1   => trailingslashit( get_stylesheet_directory() ) . $template_dir,
174
-		10  => trailingslashit( get_template_directory() ) . $template_dir,
173
+		1   => trailingslashit(get_stylesheet_directory()).$template_dir,
174
+		10  => trailingslashit(get_template_directory()).$template_dir,
175 175
 		100 => give_get_templates_dir()
176 176
 	);
177 177
 
178
-	$file_paths = apply_filters( 'give_template_paths', $file_paths );
178
+	$file_paths = apply_filters('give_template_paths', $file_paths);
179 179
 
180 180
 	// sort the file paths based on priority
181
-	ksort( $file_paths, SORT_NUMERIC );
181
+	ksort($file_paths, SORT_NUMERIC);
182 182
 
183
-	return array_map( 'trailingslashit', $file_paths );
183
+	return array_map('trailingslashit', $file_paths);
184 184
 }
185 185
 
186 186
 /**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
  * @return string
193 193
  */
194 194
 function give_get_theme_template_dir_name() {
195
-	return trailingslashit( apply_filters( 'give_templates_dir', 'give' ) );
195
+	return trailingslashit(apply_filters('give_templates_dir', 'give'));
196 196
 }
197 197
 
198 198
 /**
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
  * @return void
203 203
  */
204 204
 function give_version_in_header() {
205
-	echo '<meta name="generator" content="Give v' . GIVE_VERSION . '" />' . "\n";
205
+	echo '<meta name="generator" content="Give v'.GIVE_VERSION.'" />'."\n";
206 206
 }
207 207
 
208
-add_action( 'wp_head', 'give_version_in_header' );
208
+add_action('wp_head', 'give_version_in_header');
209 209
 
210 210
 /**
211 211
  * Determines if we're currently on the Donations History page.
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function give_is_donation_history_page() {
217 217
 
218
-	$ret = is_page( give_get_option( 'history_page' ) );
218
+	$ret = is_page(give_get_option('history_page'));
219 219
 
220
-	return apply_filters( 'give_is_donation_history_page', $ret );
220
+	return apply_filters('give_is_donation_history_page', $ret);
221 221
 }
222 222
 
223 223
 /**
@@ -229,25 +229,25 @@  discard block
 block discarded – undo
229 229
  *
230 230
  * @return array Modified array of classes
231 231
  */
232
-function give_add_body_classes( $class ) {
232
+function give_add_body_classes($class) {
233 233
 	$classes = (array) $class;
234 234
 
235
-	if ( give_is_success_page() ) {
235
+	if (give_is_success_page()) {
236 236
 		$classes[] = 'give-success';
237 237
 		$classes[] = 'give-page';
238 238
 	}
239 239
 
240
-	if ( give_is_failed_transaction_page() ) {
240
+	if (give_is_failed_transaction_page()) {
241 241
 		$classes[] = 'give-failed-transaction';
242 242
 		$classes[] = 'give-page';
243 243
 	}
244 244
 
245
-	if ( give_is_donation_history_page() ) {
245
+	if (give_is_donation_history_page()) {
246 246
 		$classes[] = 'give-donation-history';
247 247
 		$classes[] = 'give-page';
248 248
 	}
249 249
 
250
-	if ( give_is_test_mode() ) {
250
+	if (give_is_test_mode()) {
251 251
 		$classes[] = 'give-test-mode';
252 252
 		$classes[] = 'give-page';
253 253
 	}
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	//Theme-specific Classes used to prevent conflicts via CSS
256 256
 	$current_theme = wp_get_theme();
257 257
 
258
-	switch ( $current_theme->template ) {
258
+	switch ($current_theme->template) {
259 259
 
260 260
 		case 'Divi':
261 261
 			$classes[] = 'give-divi';
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 
270 270
 	}
271 271
 
272
-	return array_unique( $classes );
272
+	return array_unique($classes);
273 273
 }
274 274
 
275
-add_filter( 'body_class', 'give_add_body_classes' );
275
+add_filter('body_class', 'give_add_body_classes');
276 276
 
277 277
 
278 278
 /**
@@ -288,22 +288,22 @@  discard block
 block discarded – undo
288 288
  *
289 289
  * @return array
290 290
  */
291
-function give_add_post_class( $classes, $class = '', $post_id = '' ) {
292
-	if ( ! $post_id || 'give_forms' !== get_post_type( $post_id ) ) {
291
+function give_add_post_class($classes, $class = '', $post_id = '') {
292
+	if ( ! $post_id || 'give_forms' !== get_post_type($post_id)) {
293 293
 		return $classes;
294 294
 	}
295 295
 
296 296
 	//@TODO: Add classes for custom taxonomy and form configurations (multi vs single donations, etc).
297 297
 
298
-	if ( false !== ( $key = array_search( 'hentry', $classes ) ) ) {
299
-		unset( $classes[ $key ] );
298
+	if (false !== ($key = array_search('hentry', $classes))) {
299
+		unset($classes[$key]);
300 300
 	}
301 301
 
302 302
 	return $classes;
303 303
 }
304 304
 
305 305
 
306
-add_filter( 'post_class', 'give_add_post_class', 20, 3 );
306
+add_filter('post_class', 'give_add_post_class', 20, 3);
307 307
 
308 308
 /**
309 309
  * Get the placeholder image URL for forms etc
@@ -313,85 +313,85 @@  discard block
 block discarded – undo
313 313
  */
314 314
 function give_get_placeholder_img_src() {
315 315
 
316
-	$placeholder_url = '//placehold.it/600x600&text=' . urlencode( esc_attr__( 'Give Placeholder Image', 'give' ) );
316
+	$placeholder_url = '//placehold.it/600x600&text='.urlencode(esc_attr__('Give Placeholder Image', 'give'));
317 317
 
318
-	return apply_filters( 'give_placeholder_img_src', $placeholder_url );
318
+	return apply_filters('give_placeholder_img_src', $placeholder_url);
319 319
 }
320 320
 
321 321
 
322 322
 /**
323 323
  * Global
324 324
  */
325
-if ( ! function_exists( 'give_output_content_wrapper' ) ) {
325
+if ( ! function_exists('give_output_content_wrapper')) {
326 326
 
327 327
 	/**
328 328
 	 * Output the start of the page wrapper.
329 329
 	 */
330 330
 	function give_output_content_wrapper() {
331
-		give_get_template_part( 'global/wrapper-start' );
331
+		give_get_template_part('global/wrapper-start');
332 332
 	}
333 333
 }
334
-if ( ! function_exists( 'give_output_content_wrapper_end' ) ) {
334
+if ( ! function_exists('give_output_content_wrapper_end')) {
335 335
 
336 336
 	/**
337 337
 	 * Output the end of the page wrapper.
338 338
 	 */
339 339
 	function give_output_content_wrapper_end() {
340
-		give_get_template_part( 'global/wrapper-end' );
340
+		give_get_template_part('global/wrapper-end');
341 341
 	}
342 342
 }
343 343
 
344 344
 /**
345 345
  * Single Give Form
346 346
  */
347
-if ( ! function_exists( 'give_left_sidebar_pre_wrap' ) ) {
347
+if ( ! function_exists('give_left_sidebar_pre_wrap')) {
348 348
 	function give_left_sidebar_pre_wrap() {
349
-		echo apply_filters( 'give_left_sidebar_pre_wrap', '<div id="give-sidebar-left" class="give-sidebar give-single-form-sidebar-left">' );
349
+		echo apply_filters('give_left_sidebar_pre_wrap', '<div id="give-sidebar-left" class="give-sidebar give-single-form-sidebar-left">');
350 350
 	}
351 351
 }
352 352
 
353
-if ( ! function_exists( 'give_left_sidebar_post_wrap' ) ) {
353
+if ( ! function_exists('give_left_sidebar_post_wrap')) {
354 354
 	function give_left_sidebar_post_wrap() {
355
-		echo apply_filters( 'give_left_sidebar_post_wrap', '</div>' );
355
+		echo apply_filters('give_left_sidebar_post_wrap', '</div>');
356 356
 	}
357 357
 }
358 358
 
359
-if ( ! function_exists( 'give_get_forms_sidebar' ) ) {
359
+if ( ! function_exists('give_get_forms_sidebar')) {
360 360
 	function give_get_forms_sidebar() {
361
-		give_get_template_part( 'single-give-form/sidebar' );
361
+		give_get_template_part('single-give-form/sidebar');
362 362
 	}
363 363
 }
364 364
 
365
-if ( ! function_exists( 'give_show_form_images' ) ) {
365
+if ( ! function_exists('give_show_form_images')) {
366 366
 
367 367
 	/**
368 368
 	 * Output the product image before the single product summary.
369 369
 	 */
370 370
 	function give_show_form_images() {
371
-		$featured_image_option = give_get_option( 'disable_form_featured_img' );
372
-		if ( $featured_image_option !== 'on' ) {
373
-			give_get_template_part( 'single-give-form/featured-image' );
371
+		$featured_image_option = give_get_option('disable_form_featured_img');
372
+		if ($featured_image_option !== 'on') {
373
+			give_get_template_part('single-give-form/featured-image');
374 374
 		}
375 375
 	}
376 376
 }
377 377
 
378
-if ( ! function_exists( 'give_template_single_title' ) ) {
378
+if ( ! function_exists('give_template_single_title')) {
379 379
 
380 380
 	/**
381 381
 	 * Output the product title.
382 382
 	 */
383 383
 	function give_template_single_title() {
384
-		give_get_template_part( 'single-give-form/title' );
384
+		give_get_template_part('single-give-form/title');
385 385
 	}
386 386
 }
387 387
 
388
-if ( ! function_exists( 'give_show_avatars' ) ) {
388
+if ( ! function_exists('give_show_avatars')) {
389 389
 
390 390
 	/**
391 391
 	 * Output the product title.
392 392
 	 */
393 393
 	function give_show_avatars() {
394
-		echo do_shortcode( '[give_donators_gravatars]' );
394
+		echo do_shortcode('[give_donators_gravatars]');
395 395
 	}
396 396
 }
397 397
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
  * Conditional Functions
400 400
  */
401 401
 
402
-if ( ! function_exists( 'is_give_form' ) ) {
402
+if ( ! function_exists('is_give_form')) {
403 403
 
404 404
 	/**
405 405
 	 * is_give_form
@@ -411,11 +411,11 @@  discard block
 block discarded – undo
411 411
 	 * @return bool
412 412
 	 */
413 413
 	function is_give_form() {
414
-		return is_singular( array( 'give_form' ) );
414
+		return is_singular(array('give_form'));
415 415
 	}
416 416
 }
417 417
 
418
-if ( ! function_exists( 'is_give_category' ) ) {
418
+if ( ! function_exists('is_give_category')) {
419 419
 
420 420
 	/**
421 421
 	 * is_give_category
@@ -430,12 +430,12 @@  discard block
 block discarded – undo
430 430
 	 *
431 431
 	 * @return bool
432 432
 	 */
433
-	function is_give_category( $term = '' ) {
434
-		return is_tax( 'give_forms_category', $term );
433
+	function is_give_category($term = '') {
434
+		return is_tax('give_forms_category', $term);
435 435
 	}
436 436
 }
437 437
 
438
-if ( ! function_exists( 'is_give_tag' ) ) {
438
+if ( ! function_exists('is_give_tag')) {
439 439
 
440 440
 	/**
441 441
 	 * is_give_tag
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
 	 *
451 451
 	 * @return bool
452 452
 	 */
453
-	function is_give_tag( $term = '' ) {
454
-		return is_tax( 'give_forms_tag', $term );
453
+	function is_give_tag($term = '') {
454
+		return is_tax('give_forms_tag', $term);
455 455
 	}
456 456
 }
457 457
 
458
-if ( ! function_exists( 'is_give_taxonomy' ) ) {
458
+if ( ! function_exists('is_give_taxonomy')) {
459 459
 
460 460
 	/**
461 461
 	 * is_give_taxonomy
@@ -467,6 +467,6 @@  discard block
 block discarded – undo
467 467
 	 * @return bool
468 468
 	 */
469 469
 	function is_give_taxonomy() {
470
-		return is_tax( get_object_taxonomies( 'give_form' ) );
470
+		return is_tax(get_object_taxonomies('give_form'));
471 471
 	}
472 472
 }
Please login to merge, or discard this patch.
includes/class-give-html-elements.php 1 patch
Spacing   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 *
34 34
 	 * @return string $output Give transactions dropdown
35 35
 	 */
36
-	public function transactions_dropdown( $args = array() ) {
36
+	public function transactions_dropdown($args = array()) {
37 37
 
38 38
 		$defaults = array(
39 39
 			'name'        => 'transactions',
@@ -44,36 +44,36 @@  discard block
 block discarded – undo
44 44
 			'chosen'      => false,
45 45
 			'number'      => 30,
46 46
 			/* translators: %s: transaction singular label */
47
-			'placeholder' => esc_html__( 'Select a transaction', 'give' )
47
+			'placeholder' => esc_html__('Select a transaction', 'give')
48 48
 		);
49 49
 
50
-		$args = wp_parse_args( $args, $defaults );
50
+		$args = wp_parse_args($args, $defaults);
51 51
 
52 52
 
53
-		$payments = new Give_Payments_Query( array(
53
+		$payments = new Give_Payments_Query(array(
54 54
 			'number' => $args['number']
55
-		) );
55
+		));
56 56
 
57 57
 		$payments = $payments->get_payments();
58 58
 
59 59
 		$options = array();
60 60
 
61 61
 		//Provide nice human readable options.
62
-		if ( $payments ) {
62
+		if ($payments) {
63 63
 			$options[0] =
64 64
 				/* translators: %s: transaction singular label */
65
-				esc_html__( 'Select a transaction', 'give' );
66
-			foreach ( $payments as $payment ) {
65
+				esc_html__('Select a transaction', 'give');
66
+			foreach ($payments as $payment) {
67 67
 
68
-				$options[ absint( $payment->ID ) ] = esc_html( '#' . $payment->ID . ' - ' . $payment->email . ' - ' . $payment->form_title);
68
+				$options[absint($payment->ID)] = esc_html('#'.$payment->ID.' - '.$payment->email.' - '.$payment->form_title);
69 69
 
70 70
 			}
71 71
 		} else {
72
-			$options[0] = esc_html__( 'No Transactions Found', 'give' );
72
+			$options[0] = esc_html__('No Transactions Found', 'give');
73 73
 		}
74 74
 
75 75
 
76
-		$output = $this->select( array(
76
+		$output = $this->select(array(
77 77
 			'name'             => $args['name'],
78 78
 			'selected'         => $args['selected'],
79 79
 			'id'               => $args['id'],
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			'select_atts'      => $args['select_atts'],
86 86
 			'show_option_all'  => false,
87 87
 			'show_option_none' => false
88
-		) );
88
+		));
89 89
 
90 90
 		return $output;
91 91
 	}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @return string $output Give forms dropdown
102 102
 	 */
103
-	public function forms_dropdown( $args = array() ) {
103
+	public function forms_dropdown($args = array()) {
104 104
 
105 105
 		$defaults = array(
106 106
 			'name'        => 'forms',
@@ -111,47 +111,47 @@  discard block
 block discarded – undo
111 111
 			'chosen'      => false,
112 112
 			'number'      => 30,
113 113
 			/* translators: %s: form singular label */
114
-			'placeholder' => sprintf( esc_html__( 'Select a %s', 'give' ), give_get_forms_label_singular() )
114
+			'placeholder' => sprintf(esc_html__('Select a %s', 'give'), give_get_forms_label_singular())
115 115
 		);
116 116
 
117
-		$args = wp_parse_args( $args, $defaults );
117
+		$args = wp_parse_args($args, $defaults);
118 118
 
119
-		$forms = get_posts( array(
119
+		$forms = get_posts(array(
120 120
 			'post_type'      => 'give_forms',
121 121
 			'orderby'        => 'title',
122 122
 			'order'          => 'ASC',
123 123
 			'posts_per_page' => $args['number']
124
-		) );
124
+		));
125 125
 
126 126
 		$options = array();
127 127
 
128
-		if ( $forms ) {
128
+		if ($forms) {
129 129
 			$options[0] = sprintf(
130 130
 			/* translators: %s: form singular label */
131
-				esc_html__( 'Select a %s', 'give' ),
131
+				esc_html__('Select a %s', 'give'),
132 132
 				give_get_forms_label_singular()
133 133
 			);
134
-			foreach ( $forms as $form ) {
135
-				$options[ absint( $form->ID ) ] = esc_html( $form->post_title );
134
+			foreach ($forms as $form) {
135
+				$options[absint($form->ID)] = esc_html($form->post_title);
136 136
 			}
137 137
 		} else {
138
-			$options[0] = esc_html__( 'No Give Donation Forms Found', 'give' );
138
+			$options[0] = esc_html__('No Give Donation Forms Found', 'give');
139 139
 		}
140 140
 
141 141
 		// This ensures that any selected forms are included in the drop down
142
-		if ( is_array( $args['selected'] ) ) {
143
-			foreach ( $args['selected'] as $item ) {
144
-				if ( ! in_array( $item, $options ) ) {
145
-					$options[ $item ] = get_the_title( $item );
142
+		if (is_array($args['selected'])) {
143
+			foreach ($args['selected'] as $item) {
144
+				if ( ! in_array($item, $options)) {
145
+					$options[$item] = get_the_title($item);
146 146
 				}
147 147
 			}
148
-		} elseif ( is_numeric( $args['selected'] ) && $args['selected'] !== 0 ) {
149
-			if ( ! in_array( $args['selected'], $options ) ) {
150
-				$options[ $args['selected'] ] = get_the_title( $args['selected'] );
148
+		} elseif (is_numeric($args['selected']) && $args['selected'] !== 0) {
149
+			if ( ! in_array($args['selected'], $options)) {
150
+				$options[$args['selected']] = get_the_title($args['selected']);
151 151
 			}
152 152
 		}
153 153
 
154
-		$output = $this->select( array(
154
+		$output = $this->select(array(
155 155
 			'name'             => $args['name'],
156 156
 			'selected'         => $args['selected'],
157 157
 			'id'               => $args['id'],
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			'placeholder'      => $args['placeholder'],
163 163
 			'show_option_all'  => false,
164 164
 			'show_option_none' => false
165
-		) );
165
+		));
166 166
 
167 167
 		return $output;
168 168
 	}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	 *
178 178
 	 * @return string $output Donor dropdown
179 179
 	 */
180
-	public function donor_dropdown( $args = array() ) {
180
+	public function donor_dropdown($args = array()) {
181 181
 
182 182
 		$defaults = array(
183 183
 			'name'        => 'customers',
@@ -186,38 +186,38 @@  discard block
 block discarded – undo
186 186
 			'multiple'    => false,
187 187
 			'selected'    => 0,
188 188
 			'chosen'      => true,
189
-			'placeholder' => esc_attr__( 'Select a Donor', 'give' ),
189
+			'placeholder' => esc_attr__('Select a Donor', 'give'),
190 190
 			'number'      => 30
191 191
 		);
192 192
 
193
-		$args = wp_parse_args( $args, $defaults );
193
+		$args = wp_parse_args($args, $defaults);
194 194
 
195
-		$customers = Give()->customers->get_customers( array(
195
+		$customers = Give()->customers->get_customers(array(
196 196
 			'number' => $args['number']
197
-		) );
197
+		));
198 198
 
199 199
 		$options = array();
200 200
 
201
-		if ( $customers ) {
202
-			$options[0] = esc_html__( 'No donor attached', 'give' );
203
-			foreach ( $customers as $customer ) {
204
-				$options[ absint( $customer->id ) ] = esc_html( $customer->name . ' (' . $customer->email . ')' );
201
+		if ($customers) {
202
+			$options[0] = esc_html__('No donor attached', 'give');
203
+			foreach ($customers as $customer) {
204
+				$options[absint($customer->id)] = esc_html($customer->name.' ('.$customer->email.')');
205 205
 			}
206 206
 		} else {
207
-			$options[0] = esc_html__( 'No donors found', 'give' );
207
+			$options[0] = esc_html__('No donors found', 'give');
208 208
 		}
209 209
 
210
-		if ( ! empty( $args['selected'] ) ) {
210
+		if ( ! empty($args['selected'])) {
211 211
 
212 212
 			// If a selected customer has been specified, we need to ensure it's in the initial list of customers displayed.
213 213
 
214
-			if ( ! array_key_exists( $args['selected'], $options ) ) {
214
+			if ( ! array_key_exists($args['selected'], $options)) {
215 215
 
216
-				$customer = new Give_Customer( $args['selected'] );
216
+				$customer = new Give_Customer($args['selected']);
217 217
 
218
-				if ( $customer ) {
218
+				if ($customer) {
219 219
 
220
-					$options[ absint( $args['selected'] ) ] = esc_html( $customer->name . ' (' . $customer->email . ')' );
220
+					$options[absint($args['selected'])] = esc_html($customer->name.' ('.$customer->email.')');
221 221
 
222 222
 				}
223 223
 
@@ -225,17 +225,17 @@  discard block
 block discarded – undo
225 225
 
226 226
 		}
227 227
 
228
-		$output = $this->select( array(
228
+		$output = $this->select(array(
229 229
 			'name'             => $args['name'],
230 230
 			'selected'         => $args['selected'],
231 231
 			'id'               => $args['id'],
232
-			'class'            => $args['class'] . ' give-customer-select',
232
+			'class'            => $args['class'].' give-customer-select',
233 233
 			'options'          => $options,
234 234
 			'multiple'         => $args['multiple'],
235 235
 			'chosen'           => $args['chosen'],
236 236
 			'show_option_all'  => false,
237 237
 			'show_option_none' => false
238
-		) );
238
+		));
239 239
 
240 240
 		return $output;
241 241
 	}
@@ -252,21 +252,21 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @return string $output Category dropdown.
254 254
 	 */
255
-	public function category_dropdown( $name = 'give_forms_categories', $selected = 0 ) {
256
-		$categories = get_terms( 'give_forms_category', apply_filters( 'give_forms_category_dropdown', array() ) );
255
+	public function category_dropdown($name = 'give_forms_categories', $selected = 0) {
256
+		$categories = get_terms('give_forms_category', apply_filters('give_forms_category_dropdown', array()));
257 257
 		$options    = array();
258 258
 
259
-		foreach ( $categories as $category ) {
260
-			$options[ absint( $category->term_id ) ] = esc_html( $category->name );
259
+		foreach ($categories as $category) {
260
+			$options[absint($category->term_id)] = esc_html($category->name);
261 261
 		}
262 262
 
263
-		$output = $this->select( array(
263
+		$output = $this->select(array(
264 264
 			'name'             => $name,
265 265
 			'selected'         => $selected,
266 266
 			'options'          => $options,
267
-			'show_option_all'  => esc_html__( 'All Categories', 'give' ),
267
+			'show_option_all'  => esc_html__('All Categories', 'give'),
268 268
 			'show_option_none' => false
269
-		) );
269
+		));
270 270
 
271 271
 		return $output;
272 272
 	}
@@ -284,25 +284,25 @@  discard block
 block discarded – undo
284 284
 	 *
285 285
 	 * @return string $output Year dropdown.
286 286
 	 */
287
-	public function year_dropdown( $name = 'year', $selected = 0, $years_before = 5, $years_after = 0 ) {
288
-		$current    = date( 'Y' );
289
-		$start_year = $current - absint( $years_before );
290
-		$end_year   = $current + absint( $years_after );
291
-		$selected   = empty( $selected ) ? date( 'Y' ) : $selected;
287
+	public function year_dropdown($name = 'year', $selected = 0, $years_before = 5, $years_after = 0) {
288
+		$current    = date('Y');
289
+		$start_year = $current - absint($years_before);
290
+		$end_year   = $current + absint($years_after);
291
+		$selected   = empty($selected) ? date('Y') : $selected;
292 292
 		$options    = array();
293 293
 
294
-		while ( $start_year <= $end_year ) {
295
-			$options[ absint( $start_year ) ] = $start_year;
296
-			$start_year ++;
294
+		while ($start_year <= $end_year) {
295
+			$options[absint($start_year)] = $start_year;
296
+			$start_year++;
297 297
 		}
298 298
 
299
-		$output = $this->select( array(
299
+		$output = $this->select(array(
300 300
 			'name'             => $name,
301 301
 			'selected'         => $selected,
302 302
 			'options'          => $options,
303 303
 			'show_option_all'  => false,
304 304
 			'show_option_none' => false
305
-		) );
305
+		));
306 306
 
307 307
 		return $output;
308 308
 	}
@@ -319,23 +319,23 @@  discard block
 block discarded – undo
319 319
 	 *
320 320
 	 * @return string $output Month dropdown.
321 321
 	 */
322
-	public function month_dropdown( $name = 'month', $selected = 0 ) {
322
+	public function month_dropdown($name = 'month', $selected = 0) {
323 323
 		$month    = 1;
324 324
 		$options  = array();
325
-		$selected = empty( $selected ) ? date( 'n' ) : $selected;
325
+		$selected = empty($selected) ? date('n') : $selected;
326 326
 
327
-		while ( $month <= 12 ) {
328
-			$options[ absint( $month ) ] = give_month_num_to_name( $month );
329
-			$month ++;
327
+		while ($month <= 12) {
328
+			$options[absint($month)] = give_month_num_to_name($month);
329
+			$month++;
330 330
 		}
331 331
 
332
-		$output = $this->select( array(
332
+		$output = $this->select(array(
333 333
 			'name'             => $name,
334 334
 			'selected'         => $selected,
335 335
 			'options'          => $options,
336 336
 			'show_option_all'  => false,
337 337
 			'show_option_none' => false
338
-		) );
338
+		));
339 339
 
340 340
 		return $output;
341 341
 	}
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 *
351 351
 	 * @return string
352 352
 	 */
353
-	public function select( $args = array() ) {
353
+	public function select($args = array()) {
354 354
 		$defaults = array(
355 355
 			'options'          => array(),
356 356
 			'name'             => null,
@@ -361,61 +361,61 @@  discard block
 block discarded – undo
361 361
 			'placeholder'      => null,
362 362
 			'multiple'         => false,
363 363
 			'select_atts'      => false,
364
-			'show_option_all'  => esc_html__( 'All', 'give' ),
365
-			'show_option_none' => esc_html__( 'None', 'give' )
364
+			'show_option_all'  => esc_html__('All', 'give'),
365
+			'show_option_none' => esc_html__('None', 'give')
366 366
 		);
367 367
 
368
-		$args = wp_parse_args( $args, $defaults );
368
+		$args = wp_parse_args($args, $defaults);
369 369
 
370 370
 
371
-		if ( $args['multiple'] ) {
371
+		if ($args['multiple']) {
372 372
 			$multiple = ' MULTIPLE';
373 373
 		} else {
374 374
 			$multiple = '';
375 375
 		}
376 376
 
377
-		if ( $args['chosen'] ) {
377
+		if ($args['chosen']) {
378 378
 			$args['class'] .= ' give-select-chosen';
379 379
 		}
380 380
 
381
-		if ( $args['placeholder'] ) {
381
+		if ($args['placeholder']) {
382 382
 			$placeholder = $args['placeholder'];
383 383
 		} else {
384 384
 			$placeholder = '';
385 385
 		}
386 386
 
387 387
 
388
-		$output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( sanitize_key( str_replace( '-', '_', $args['id'] ) ) ) . '" class="give-select ' . esc_attr( $args['class'] ) . '"' . $multiple . ' ' . $args['select_atts'] . ' data-placeholder="' . $placeholder . '">';
388
+		$output = '<select name="'.esc_attr($args['name']).'" id="'.esc_attr(sanitize_key(str_replace('-', '_', $args['id']))).'" class="give-select '.esc_attr($args['class']).'"'.$multiple.' '.$args['select_atts'].' data-placeholder="'.$placeholder.'">';
389 389
 
390
-		if ( $args['show_option_all'] ) {
391
-			if ( $args['multiple'] ) {
392
-				$selected = selected( true, in_array( 0, $args['selected'] ), false );
390
+		if ($args['show_option_all']) {
391
+			if ($args['multiple']) {
392
+				$selected = selected(true, in_array(0, $args['selected']), false);
393 393
 			} else {
394
-				$selected = selected( $args['selected'], 0, false );
394
+				$selected = selected($args['selected'], 0, false);
395 395
 			}
396
-			$output .= '<option value="all"' . $selected . '>' . esc_html( $args['show_option_all'] ) . '</option>';
396
+			$output .= '<option value="all"'.$selected.'>'.esc_html($args['show_option_all']).'</option>';
397 397
 		}
398 398
 
399
-		if ( ! empty( $args['options'] ) ) {
399
+		if ( ! empty($args['options'])) {
400 400
 
401
-			if ( $args['show_option_none'] ) {
402
-				if ( $args['multiple'] ) {
403
-					$selected = selected( true, in_array( - 1, $args['selected'] ), false );
401
+			if ($args['show_option_none']) {
402
+				if ($args['multiple']) {
403
+					$selected = selected(true, in_array( -1, $args['selected'] ), false);
404 404
 				} else {
405
-					$selected = selected( $args['selected'], - 1, false );
405
+					$selected = selected($args['selected'], - 1, false);
406 406
 				}
407
-				$output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
407
+				$output .= '<option value="-1"'.$selected.'>'.esc_html($args['show_option_none']).'</option>';
408 408
 			}
409 409
 
410
-			foreach ( $args['options'] as $key => $option ) {
410
+			foreach ($args['options'] as $key => $option) {
411 411
 
412
-				if ( $args['multiple'] && is_array( $args['selected'] ) ) {
413
-					$selected = selected( true, in_array( $key, $args['selected'] ), false );
412
+				if ($args['multiple'] && is_array($args['selected'])) {
413
+					$selected = selected(true, in_array($key, $args['selected']), false);
414 414
 				} else {
415
-					$selected = selected( $args['selected'], $key, false );
415
+					$selected = selected($args['selected'], $key, false);
416 416
 				}
417 417
 
418
-				$output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>';
418
+				$output .= '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option).'</option>';
419 419
 			}
420 420
 		}
421 421
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 *
435 435
 	 * @return string
436 436
 	 */
437
-	public function checkbox( $args = array() ) {
437
+	public function checkbox($args = array()) {
438 438
 		$defaults = array(
439 439
 			'name'    => null,
440 440
 			'current' => null,
@@ -445,16 +445,16 @@  discard block
 block discarded – undo
445 445
 			)
446 446
 		);
447 447
 
448
-		$args = wp_parse_args( $args, $defaults );
448
+		$args = wp_parse_args($args, $defaults);
449 449
 
450 450
 		$options = '';
451
-		if ( ! empty( $args['options']['disabled'] ) ) {
451
+		if ( ! empty($args['options']['disabled'])) {
452 452
 			$options .= ' disabled="disabled"';
453
-		} elseif ( ! empty( $args['options']['readonly'] ) ) {
453
+		} elseif ( ! empty($args['options']['readonly'])) {
454 454
 			$options .= ' readonly';
455 455
 		}
456 456
 
457
-		$output = '<input type="checkbox"' . $options . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['name'] ) . '" class="' . $args['class'] . ' ' . esc_attr( $args['name'] ) . '" ' . checked( 1, $args['current'], false ) . ' />';
457
+		$output = '<input type="checkbox"'.$options.' name="'.esc_attr($args['name']).'" id="'.esc_attr($args['name']).'" class="'.$args['class'].' '.esc_attr($args['name']).'" '.checked(1, $args['current'], false).' />';
458 458
 
459 459
 		return $output;
460 460
 	}
@@ -469,22 +469,22 @@  discard block
 block discarded – undo
469 469
 	 *
470 470
 	 * @return string Text field.
471 471
 	 */
472
-	public function text( $args = array() ) {
472
+	public function text($args = array()) {
473 473
 		// Backwards compatibility
474
-		if ( func_num_args() > 1 ) {
474
+		if (func_num_args() > 1) {
475 475
 			$args = func_get_args();
476 476
 
477 477
 			$name  = $args[0];
478
-			$value = isset( $args[1] ) ? $args[1] : '';
479
-			$label = isset( $args[2] ) ? $args[2] : '';
480
-			$desc  = isset( $args[3] ) ? $args[3] : '';
478
+			$value = isset($args[1]) ? $args[1] : '';
479
+			$label = isset($args[2]) ? $args[2] : '';
480
+			$desc  = isset($args[3]) ? $args[3] : '';
481 481
 		}
482 482
 
483 483
 		$defaults = array(
484
-			'name'         => isset( $name ) ? $name : 'text',
485
-			'value'        => isset( $value ) ? $value : null,
486
-			'label'        => isset( $label ) ? $label : null,
487
-			'desc'         => isset( $desc ) ? $desc : null,
484
+			'name'         => isset($name) ? $name : 'text',
485
+			'value'        => isset($value) ? $value : null,
486
+			'label'        => isset($label) ? $label : null,
487
+			'desc'         => isset($desc) ? $desc : null,
488 488
 			'placeholder'  => '',
489 489
 			'class'        => 'regular-text',
490 490
 			'disabled'     => false,
@@ -492,29 +492,29 @@  discard block
 block discarded – undo
492 492
 			'data'         => false
493 493
 		);
494 494
 
495
-		$args = wp_parse_args( $args, $defaults );
495
+		$args = wp_parse_args($args, $defaults);
496 496
 
497 497
 		$disabled = '';
498
-		if ( $args['disabled'] ) {
498
+		if ($args['disabled']) {
499 499
 			$disabled = ' disabled="disabled"';
500 500
 		}
501 501
 
502 502
 		$data = '';
503
-		if ( ! empty( $args['data'] ) ) {
504
-			foreach ( $args['data'] as $key => $value ) {
505
-				$data .= 'data-' . $key . '="' . $value . '" ';
503
+		if ( ! empty($args['data'])) {
504
+			foreach ($args['data'] as $key => $value) {
505
+				$data .= 'data-'.$key.'="'.$value.'" ';
506 506
 			}
507 507
 		}
508 508
 
509
-		$output = '<span id="give-' . sanitize_key( $args['name'] ) . '-wrap">';
509
+		$output = '<span id="give-'.sanitize_key($args['name']).'-wrap">';
510 510
 
511
-		$output .= '<label class="give-label" for="give-' . sanitize_key( $args['name'] ) . '">' . esc_html( $args['label'] ) . '</label>';
511
+		$output .= '<label class="give-label" for="give-'.sanitize_key($args['name']).'">'.esc_html($args['label']).'</label>';
512 512
 
513
-		if ( ! empty( $args['desc'] ) ) {
514
-			$output .= '<span class="give-description">' . esc_html( $args['desc'] ) . '</span>';
513
+		if ( ! empty($args['desc'])) {
514
+			$output .= '<span class="give-description">'.esc_html($args['desc']).'</span>';
515 515
 		}
516 516
 
517
-		$output .= '<input type="text" name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['name'] ) . '" autocomplete="' . esc_attr( $args['autocomplete'] ) . '" value="' . esc_attr( $args['value'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" class="' . $args['class'] . '" ' . $data . '' . $disabled . '/>';
517
+		$output .= '<input type="text" name="'.esc_attr($args['name']).'" id="'.esc_attr($args['name']).'" autocomplete="'.esc_attr($args['autocomplete']).'" value="'.esc_attr($args['value']).'" placeholder="'.esc_attr($args['placeholder']).'" class="'.$args['class'].'" '.$data.''.$disabled.'/>';
518 518
 
519 519
 		$output .= '</span>';
520 520
 
@@ -531,15 +531,15 @@  discard block
 block discarded – undo
531 531
 	 *
532 532
 	 * @return string Datepicker field.
533 533
 	 */
534
-	public function date_field( $args = array() ) {
534
+	public function date_field($args = array()) {
535 535
 
536
-		if ( empty( $args['class'] ) ) {
536
+		if (empty($args['class'])) {
537 537
 			$args['class'] = 'give_datepicker';
538
-		} elseif ( ! strpos( $args['class'], 'give_datepicker' ) ) {
538
+		} elseif ( ! strpos($args['class'], 'give_datepicker')) {
539 539
 			$args['class'] .= ' give_datepicker';
540 540
 		}
541 541
 
542
-		return $this->text( $args );
542
+		return $this->text($args);
543 543
 	}
544 544
 
545 545
 
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 	 *
554 554
 	 * @return string textarea
555 555
 	 */
556
-	public function textarea( $args = array() ) {
556
+	public function textarea($args = array()) {
557 557
 		$defaults = array(
558 558
 			'name'     => 'textarea',
559 559
 			'value'    => null,
@@ -563,21 +563,21 @@  discard block
 block discarded – undo
563 563
 			'disabled' => false
564 564
 		);
565 565
 
566
-		$args = wp_parse_args( $args, $defaults );
566
+		$args = wp_parse_args($args, $defaults);
567 567
 
568 568
 		$disabled = '';
569
-		if ( $args['disabled'] ) {
569
+		if ($args['disabled']) {
570 570
 			$disabled = ' disabled="disabled"';
571 571
 		}
572 572
 
573
-		$output = '<span id="give-' . sanitize_key( $args['name'] ) . '-wrap">';
573
+		$output = '<span id="give-'.sanitize_key($args['name']).'-wrap">';
574 574
 
575
-		$output .= '<label class="give-label" for="give-' . sanitize_key( $args['name'] ) . '">' . esc_html( $args['label'] ) . '</label>';
575
+		$output .= '<label class="give-label" for="give-'.sanitize_key($args['name']).'">'.esc_html($args['label']).'</label>';
576 576
 
577
-		$output .= '<textarea name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['name'] ) . '" class="' . $args['class'] . '"' . $disabled . '>' . esc_attr( $args['value'] ) . '</textarea>';
577
+		$output .= '<textarea name="'.esc_attr($args['name']).'" id="'.esc_attr($args['name']).'" class="'.$args['class'].'"'.$disabled.'>'.esc_attr($args['value']).'</textarea>';
578 578
 
579
-		if ( ! empty( $args['desc'] ) ) {
580
-			$output .= '<span class="give-description">' . esc_html( $args['desc'] ) . '</span>';
579
+		if ( ! empty($args['desc'])) {
580
+			$output .= '<span class="give-description">'.esc_html($args['desc']).'</span>';
581 581
 		}
582 582
 
583 583
 		$output .= '</span>';
@@ -595,12 +595,12 @@  discard block
 block discarded – undo
595 595
 	 *
596 596
 	 * @return string text field with ajax search.
597 597
 	 */
598
-	public function ajax_user_search( $args = array() ) {
598
+	public function ajax_user_search($args = array()) {
599 599
 
600 600
 		$defaults = array(
601 601
 			'name'         => 'user_id',
602 602
 			'value'        => null,
603
-			'placeholder'  => esc_attr__( 'Enter username', 'give' ),
603
+			'placeholder'  => esc_attr__('Enter username', 'give'),
604 604
 			'label'        => null,
605 605
 			'desc'         => null,
606 606
 			'class'        => '',
@@ -609,13 +609,13 @@  discard block
 block discarded – undo
609 609
 			'data'         => false
610 610
 		);
611 611
 
612
-		$args = wp_parse_args( $args, $defaults );
612
+		$args = wp_parse_args($args, $defaults);
613 613
 
614
-		$args['class'] = 'give-ajax-user-search ' . $args['class'];
614
+		$args['class'] = 'give-ajax-user-search '.$args['class'];
615 615
 
616 616
 		$output = '<span class="give_user_search_wrap">';
617
-		$output .= $this->text( $args );
618
-		$output .= '<span class="give_user_search_results hidden"><a class="give-ajax-user-cancel" title="' . esc_attr__( 'Cancel', 'give' ) . '" aria-label="' . esc_attr__( 'Cancel', 'give' ) . '" href="#">x</a><span></span></span>';
617
+		$output .= $this->text($args);
618
+		$output .= '<span class="give_user_search_results hidden"><a class="give-ajax-user-cancel" title="'.esc_attr__('Cancel', 'give').'" aria-label="'.esc_attr__('Cancel', 'give').'" href="#">x</a><span></span></span>';
619 619
 		$output .= '</span>';
620 620
 
621 621
 		return $output;
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	public function admin_menus() {
52 52
 		// About Page
53 53
 		add_dashboard_page(
54
-			esc_html__( 'Welcome to Give', 'give' ),
55
-			esc_html__( 'Welcome to Give', 'give' ),
54
+			esc_html__('Welcome to Give', 'give'),
55
+			esc_html__('Welcome to Give', 'give'),
56 56
 			$this->minimum_capability,
57 57
 			'give-about',
58
-			array( $this, 'about_screen' )
58
+			array($this, 'about_screen')
59 59
 		);
60 60
 
61 61
 		// Changelog Page
62 62
 		add_dashboard_page(
63
-			esc_html__( 'Give Changelog', 'give' ),
64
-			esc_html__( 'Give Changelog', 'give' ),
63
+			esc_html__('Give Changelog', 'give'),
64
+			esc_html__('Give Changelog', 'give'),
65 65
 			$this->minimum_capability,
66 66
 			'give-changelog',
67
-			array( $this, 'changelog_screen' )
67
+			array($this, 'changelog_screen')
68 68
 		);
69 69
 
70 70
 		// Getting Started Page
71 71
 		add_dashboard_page(
72
-			esc_html__( 'Getting started with Give', 'give' ),
73
-			esc_html__( 'Getting started with Give', 'give' ),
72
+			esc_html__('Getting started with Give', 'give'),
73
+			esc_html__('Getting started with Give', 'give'),
74 74
 			$this->minimum_capability,
75 75
 			'give-getting-started',
76
-			array( $this, 'getting_started_screen' )
76
+			array($this, 'getting_started_screen')
77 77
 		);
78 78
 
79 79
 		// Credits Page
80 80
 		add_dashboard_page(
81
-			esc_html__( 'The people that build Give', 'give' ),
82
-			esc_html__( 'The people that build Give', 'give' ),
81
+			esc_html__('The people that build Give', 'give'),
82
+			esc_html__('The people that build Give', 'give'),
83 83
 			$this->minimum_capability,
84 84
 			'give-credits',
85
-			array( $this, 'credits_screen' )
85
+			array($this, 'credits_screen')
86 86
 		);
87 87
 	}
88 88
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function admin_head() {
97 97
 
98
-		remove_submenu_page( 'index.php', 'give-about' );
99
-		remove_submenu_page( 'index.php', 'give-changelog' );
100
-		remove_submenu_page( 'index.php', 'give-getting-started' );
101
-		remove_submenu_page( 'index.php', 'give-credits' );
98
+		remove_submenu_page('index.php', 'give-about');
99
+		remove_submenu_page('index.php', 'give-changelog');
100
+		remove_submenu_page('index.php', 'give-getting-started');
101
+		remove_submenu_page('index.php', 'give-credits');
102 102
 
103 103
 		// Badge for welcome page
104
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
104
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
105 105
 
106 106
 		?>
107 107
 		<style type="text/css" media="screen">
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 	 * @return void
216 216
 	 */
217 217
 	public function tabs() {
218
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
218
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
219 219
 		?>
220 220
 		<h2 class="nav-tab-wrapper">
221
-			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
222
-				<?php esc_html_e( 'About Give', 'give' ); ?>
221
+			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
222
+				<?php esc_html_e('About Give', 'give'); ?>
223 223
 			</a>
224
-			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
225
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
224
+			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
225
+				<?php esc_html_e('Getting Started', 'give'); ?>
226 226
 			</a>
227
-			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
228
-				<?php esc_html_e( 'Credits', 'give' ); ?>
227
+			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
228
+				<?php esc_html_e('Credits', 'give'); ?>
229 229
 			</a>
230
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
230
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
+				<?php esc_html_e('Add-ons', 'give'); ?>
232 232
 			</a>
233 233
 		</h2>
234 234
 	<?php
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 */
244 244
 	public function about_screen() {
245
-		list( $display_version ) = explode( '-', GIVE_VERSION );
245
+		list($display_version) = explode('-', GIVE_VERSION);
246 246
 		?>
247 247
 		<div class="wrap about-wrap">
248 248
 			<h1 class="welcome-h1"><?php
249 249
 				printf(
250 250
 					/* translators: %s: Give version */
251
-					esc_html__( 'Welcome to Give %s', 'give' ),
251
+					esc_html__('Welcome to Give %s', 'give'),
252 252
 					$display_version
253 253
 				);
254 254
 			?></h1>
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 			<p class="about-text"><?php
259 259
 				printf(
260 260
 					/* translators: 1: https://givewp.com/documenation/ 2: title attribute text */
261
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
262
-					esc_url( 'https://givewp.com/documenation/' ),
263
-					esc_attr__( 'View the Give plugin documentation online', 'give' )
261
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
262
+					esc_url('https://givewp.com/documenation/'),
263
+					esc_attr__('View the Give plugin documentation online', 'give')
264 264
 				);
265 265
 			?></p>
266 266
 
267
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
267
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
268 268
 
269 269
 			<?php give_get_newsletter() ?>
270 270
 
271 271
 			<div class="give-badge"><?php
272 272
 				printf(
273 273
 					/* translators: %s: Give version */
274
-					esc_html__( 'Version %s', 'give' ),
274
+					esc_html__('Version %s', 'give'),
275 275
 					$display_version
276 276
 				);
277 277
 			?></div>
@@ -281,15 +281,15 @@  discard block
 block discarded – undo
281 281
 			<div class="feature-section clearfix introduction">
282 282
 
283 283
 				<div class="video feature-section-item">
284
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
284
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
285 285
 
286 286
 				</div>
287 287
 
288 288
 				<div class="content feature-section-item last-feature">
289 289
 
290
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
290
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
291 291
 
292
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
292
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
293 293
 					<a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More
294 294
 						<span class="dashicons dashicons-external"></span></a>
295 295
 
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 
303 303
 				<div class="content feature-section-item">
304 304
 
305
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
305
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
306 306
 
307
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
307
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
308 308
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation
309 309
 						<span class="dashicons dashicons-external"></span></a>
310 310
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 				<div class="content  feature-section-item last-feature">
314 314
 
315
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
315
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
316 316
 
317 317
 				</div>
318 318
 
@@ -332,22 +332,22 @@  discard block
 block discarded – undo
332 332
 	 * @return void
333 333
 	 */
334 334
 	public function changelog_screen() {
335
-		list( $display_version ) = explode( '-', GIVE_VERSION );
335
+		list($display_version) = explode('-', GIVE_VERSION);
336 336
 		?>
337 337
 		<div class="wrap about-wrap">
338
-			<h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1>
338
+			<h1><?php esc_html_e('Give Changelog', 'give'); ?></h1>
339 339
 
340 340
 			<p class="about-text"><?php
341 341
 				printf(
342 342
 					/* translators: %s: Give version */
343
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
343
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
344 344
 					$display_version
345 345
 				);
346 346
 			?></p>
347 347
 			<div class="give-badge"><?php
348 348
 				printf(
349 349
 					/* translators: %s: Give version */
350
-					esc_html__( 'Version %s', 'give' ),
350
+					esc_html__('Version %s', 'give'),
351 351
 					$display_version
352 352
 				);
353 353
 			?></div>
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			<?php $this->tabs(); ?>
356 356
 
357 357
 			<div class="changelog">
358
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
358
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
359 359
 
360 360
 				<div class="feature-section">
361 361
 					<?php echo $this->parse_readme(); ?>
@@ -363,10 +363,10 @@  discard block
 block discarded – undo
363 363
 			</div>
364 364
 
365 365
 			<div class="return-to-dashboard">
366
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
366
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
367 367
 					'post_type' => 'give_forms',
368 368
 					'page'      => 'give-settings'
369
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a>
369
+				), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a>
370 370
 			</div>
371 371
 		</div>
372 372
 	<?php
@@ -380,45 +380,45 @@  discard block
 block discarded – undo
380 380
 	 * @return void
381 381
 	 */
382 382
 	public function getting_started_screen() {
383
-		list( $display_version ) = explode( '-', GIVE_VERSION );
383
+		list($display_version) = explode('-', GIVE_VERSION);
384 384
 		?>
385 385
 		<div class="wrap about-wrap get-started">
386 386
 			<h1 class="welcome-h1"><?php
387 387
 				printf(
388 388
 					/* translators: %s: Give version */
389
-					esc_html__( 'Give %s - Getting Started Guide', 'give' ),
389
+					esc_html__('Give %s - Getting Started Guide', 'give'),
390 390
 					$display_version
391 391
 				);
392 392
 			?></h1>
393 393
 
394 394
 			<?php give_social_media_elements() ?>
395 395
 
396
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
396
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
397 397
 
398
-			<p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p>
398
+			<p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p>
399 399
 
400 400
 			<?php give_get_newsletter() ?>
401 401
 
402 402
 			<div class="give-badge"><?php
403 403
 				printf(
404 404
 					/* translators: %s: Give version */
405
-					esc_html__( 'Version %s', 'give' ),
405
+					esc_html__('Version %s', 'give'),
406 406
 					$display_version
407 407
 				);
408 408
 			?></div>
409 409
 
410 410
 			<?php $this->tabs(); ?>
411 411
 
412
-			<p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p>
412
+			<p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p>
413 413
 
414 414
 			<div class="feature-section clearfix">
415 415
 
416 416
 				<div class="content feature-section-item">
417
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
417
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
418 418
 
419
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p>
419
+					<p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p>
420 420
 
421
-					<p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p>
421
+					<p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p>
422 422
 				</div>
423 423
 
424 424
 				<div class="content feature-section-item last-feature">
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
 				</div>
436 436
 
437 437
 				<div class="content feature-section-item last-feature">
438
-					<h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3>
438
+					<h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3>
439 439
 
440
-					<p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p>
440
+					<p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p>
441 441
 				</div>
442 442
 
443 443
 			</div>
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
 			<div class="feature-section clearfix">
447 447
 
448 448
 				<div class="content feature-section-item add-content">
449
-					<h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3>
449
+					<h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3>
450 450
 
451
-					<p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p>
451
+					<p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p>
452 452
 
453
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
453
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
454 454
 				</div>
455 455
 
456 456
 				<div class="content feature-section-item last-feature">
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
 				</div>
468 468
 
469 469
 				<div class="content feature-section-item last-feature">
470
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
470
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
471 471
 
472
-					<p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p>
472
+					<p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p>
473 473
 				</div>
474 474
 
475 475
 
@@ -489,38 +489,38 @@  discard block
 block discarded – undo
489 489
 	 * @return void
490 490
 	 */
491 491
 	public function credits_screen() {
492
-		list( $display_version ) = explode( '-', GIVE_VERSION );
492
+		list($display_version) = explode('-', GIVE_VERSION);
493 493
 		?>
494 494
 		<div class="wrap about-wrap">
495 495
 			<h1 class="welcome-h1"><?php
496 496
 				printf(
497 497
 					/* translators: %s: Give version */
498
-					esc_html__( 'Give %s - Credits', 'give' ),
498
+					esc_html__('Give %s - Credits', 'give'),
499 499
 					$display_version
500 500
 				);
501 501
 			?></h1>
502 502
 
503 503
 			<?php give_social_media_elements() ?>
504 504
 
505
-			<p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></p>
505
+			<p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></p>
506 506
 
507
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
507
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
508 508
 
509
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
509
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
510 510
 
511 511
 			<?php give_get_newsletter() ?>
512 512
 
513 513
 			<div class="give-badge"><?php
514 514
 				printf(
515 515
 					/* translators: %s: Give version */
516
-					esc_html__( 'Version %s', 'give' ),
516
+					esc_html__('Version %s', 'give'),
517 517
 					$display_version
518 518
 				);
519 519
 			?></div>
520 520
 
521 521
 			<?php $this->tabs(); ?>
522 522
 
523
-			<p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p>
523
+			<p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p>
524 524
 
525 525
 			<?php echo $this->contributors(); ?>
526 526
 		</div>
@@ -535,21 +535,21 @@  discard block
 block discarded – undo
535 535
 	 * @return string $readme HTML formatted readme file
536 536
 	 */
537 537
 	public function parse_readme() {
538
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
538
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
539 539
 
540
-		if ( ! $file ) {
541
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
540
+		if ( ! $file) {
541
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
542 542
 		} else {
543
-			$readme = file_get_contents( $file );
544
-			$readme = nl2br( esc_html( $readme ) );
545
-			$readme = explode( '== Changelog ==', $readme );
546
-			$readme = end( $readme );
547
-
548
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
549
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
550
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
551
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
552
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
543
+			$readme = file_get_contents($file);
544
+			$readme = nl2br(esc_html($readme));
545
+			$readme = explode('== Changelog ==', $readme);
546
+			$readme = end($readme);
547
+
548
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
549
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
550
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
551
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
552
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
553 553
 		}
554 554
 
555 555
 		return $readme;
@@ -566,27 +566,27 @@  discard block
 block discarded – undo
566 566
 	public function contributors() {
567 567
 		$contributors = $this->get_contributors();
568 568
 
569
-		if ( empty( $contributors ) ) {
569
+		if (empty($contributors)) {
570 570
 			return '';
571 571
 		}
572 572
 
573 573
 		$contributor_list = '<ul class="wp-people-group">';
574 574
 
575
-		foreach ( $contributors as $contributor ) {
575
+		foreach ($contributors as $contributor) {
576 576
 			$contributor_list .= '<li class="wp-person">';
577
-			$contributor_list .= sprintf( '<a href="%s" title="%s">',
578
-				esc_url( 'https://github.com/' . $contributor->login ),
577
+			$contributor_list .= sprintf('<a href="%s" title="%s">',
578
+				esc_url('https://github.com/'.$contributor->login),
579 579
 				esc_html(
580 580
 					sprintf(
581 581
 						/* translators: %s: github contributor */
582
-						esc_html__( 'View %s', 'give' ),
582
+						esc_html__('View %s', 'give'),
583 583
 						$contributor->login
584 584
 					)
585 585
 				)
586 586
 			);
587
-			$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
587
+			$contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login));
588 588
 			$contributor_list .= '</a>';
589
-			$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
589
+			$contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login));
590 590
 			$contributor_list .= '</a>';
591 591
 			$contributor_list .= '</li>';
592 592
 		}
@@ -604,25 +604,25 @@  discard block
 block discarded – undo
604 604
 	 * @return array $contributors List of contributors
605 605
 	 */
606 606
 	public function get_contributors() {
607
-		$contributors = get_transient( 'give_contributors' );
607
+		$contributors = get_transient('give_contributors');
608 608
 
609
-		if ( false !== $contributors ) {
609
+		if (false !== $contributors) {
610 610
 			return $contributors;
611 611
 		}
612 612
 
613
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
613
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
614 614
 
615
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
615
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
616 616
 			return array();
617 617
 		}
618 618
 
619
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
619
+		$contributors = json_decode(wp_remote_retrieve_body($response));
620 620
 
621
-		if ( ! is_array( $contributors ) ) {
621
+		if ( ! is_array($contributors)) {
622 622
 			return array();
623 623
 		}
624 624
 
625
-		set_transient( 'give_contributors', $contributors, 3600 );
625
+		set_transient('give_contributors', $contributors, 3600);
626 626
 
627 627
 		return $contributors;
628 628
 	}
@@ -641,24 +641,24 @@  discard block
 block discarded – undo
641 641
 
642 642
 
643 643
 		// Bail if no activation redirect
644
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
644
+		if ( ! get_transient('_give_activation_redirect')) {
645 645
 			return;
646 646
 		}
647 647
 
648 648
 		// Delete the redirect transient
649
-		delete_transient( '_give_activation_redirect' );
649
+		delete_transient('_give_activation_redirect');
650 650
 
651 651
 		// Bail if activating from network, or bulk
652
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
652
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
653 653
 			return;
654 654
 		}
655 655
 
656
-		$upgrade = get_option( 'give_version_upgraded_from' );
656
+		$upgrade = get_option('give_version_upgraded_from');
657 657
 
658
-		if ( ! $upgrade ) { // First time install
659
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
658
+		if ( ! $upgrade) { // First time install
659
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
660 660
 			exit;
661
-		} elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings
661
+		} elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings
662 662
 
663 663
 		} else { // Welcome is NOT disabled in settings
664 664
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.