Test Failed
Pull Request — master (#1937)
by
unknown
05:41
created
includes/post-types.php 1 patch
Spacing   +144 added lines, -144 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,36 +23,36 @@  discard block
 block discarded – undo
23 23
 function give_setup_post_types() {
24 24
 
25 25
 	// Give Forms single post and archive options.
26
-	$give_forms_singular = give_is_setting_enabled( give_get_option( 'forms_singular' ) );
27
-	$give_forms_archives = give_is_setting_enabled( give_get_option( 'forms_archives' ) );
26
+	$give_forms_singular = give_is_setting_enabled(give_get_option('forms_singular'));
27
+	$give_forms_archives = give_is_setting_enabled(give_get_option('forms_archives'));
28 28
 
29
-	$give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations';
29
+	$give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations';
30 30
 	// Support for old 'GIVE_FORMS_SLUG' constant
31
-	if ( defined( 'GIVE_FORMS_SLUG' ) ) {
31
+	if (defined('GIVE_FORMS_SLUG')) {
32 32
 		$give_forms_slug = GIVE_FORMS_SLUG;
33 33
 	}
34 34
 
35
-	$give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array(
35
+	$give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array(
36 36
 		'slug'       => $give_forms_slug,
37 37
 		'with_front' => false,
38 38
 	);
39 39
 
40
-	$give_forms_labels = apply_filters( 'give_forms_labels', array(
41
-		'name'               => __( 'Donation Forms', 'give' ),
42
-		'singular_name'      => __( 'Form', 'give' ),
43
-		'add_new'            => __( 'Add Form', 'give' ),
44
-		'add_new_item'       => __( 'Add New Donation Form', 'give' ),
45
-		'edit_item'          => __( 'Edit Donation Form', 'give' ),
46
-		'new_item'           => __( 'New Form', 'give' ),
47
-		'all_items'          => __( 'All Forms', 'give' ),
48
-		'view_item'          => __( 'View Form', 'give' ),
49
-		'search_items'       => __( 'Search Forms', 'give' ),
50
-		'not_found'          => __( 'No forms found.', 'give' ),
51
-		'not_found_in_trash' => __( 'No forms found in Trash.', 'give' ),
40
+	$give_forms_labels = apply_filters('give_forms_labels', array(
41
+		'name'               => __('Donation Forms', 'give'),
42
+		'singular_name'      => __('Form', 'give'),
43
+		'add_new'            => __('Add Form', 'give'),
44
+		'add_new_item'       => __('Add New Donation Form', 'give'),
45
+		'edit_item'          => __('Edit Donation Form', 'give'),
46
+		'new_item'           => __('New Form', 'give'),
47
+		'all_items'          => __('All Forms', 'give'),
48
+		'view_item'          => __('View Form', 'give'),
49
+		'search_items'       => __('Search Forms', 'give'),
50
+		'not_found'          => __('No forms found.', 'give'),
51
+		'not_found_in_trash' => __('No forms found in Trash.', 'give'),
52 52
 		'parent_item_colon'  => '',
53
-		'menu_name'          => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ),
54
-		'name_admin_bar'     => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ),
55
-	) );
53
+		'menu_name'          => apply_filters('give_menu_name', __('Donations', 'give')),
54
+		'name_admin_bar'     => apply_filters('give_name_admin_bar_name', __('Donation Form', 'give')),
55
+	));
56 56
 
57 57
 	// Default give_forms supports.
58 58
 	$give_form_supports = array(
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	);
65 65
 
66 66
 	// Has the user disabled the excerpt?
67
-	if ( ! give_is_setting_enabled( give_get_option( 'forms_excerpt' ) ) ) {
68
-		unset( $give_form_supports[2] );
67
+	if ( ! give_is_setting_enabled(give_get_option('forms_excerpt'))) {
68
+		unset($give_form_supports[2]);
69 69
 	}
70 70
 
71 71
 	// Has user disabled the featured image?
72
-	if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
73
-		unset( $give_form_supports[1] );
74
-		remove_action( 'give_before_single_form_summary', 'give_show_form_images' );
72
+	if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) {
73
+		unset($give_form_supports[1]);
74
+		remove_action('give_before_single_form_summary', 'give_show_form_images');
75 75
 	}
76 76
 
77 77
 	$give_forms_args = array(
@@ -87,42 +87,42 @@  discard block
 block discarded – undo
87 87
 		'has_archive'        => $give_forms_archives,
88 88
 		'menu_icon'          => 'dashicons-give',
89 89
 		'hierarchical'       => false,
90
-		'supports'           => apply_filters( 'give_forms_supports', $give_form_supports ),
90
+		'supports'           => apply_filters('give_forms_supports', $give_form_supports),
91 91
 	);
92
-	register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) );
92
+	register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args));
93 93
 
94 94
 	/** Donation Post Type */
95 95
 	$payment_labels = array(
96
-		'name'               => _x( 'Donations', 'post type general name', 'give' ),
97
-		'singular_name'      => _x( 'Donation', 'post type singular name', 'give' ),
98
-		'add_new'            => __( 'Add New', 'give' ),
99
-		'add_new_item'       => __( 'Add New Donation', 'give' ),
100
-		'edit_item'          => __( 'Edit Donation', 'give' ),
101
-		'new_item'           => __( 'New Donation', 'give' ),
102
-		'all_items'          => __( 'All Donations', 'give' ),
103
-		'view_item'          => __( 'View Donation', 'give' ),
104
-		'search_items'       => __( 'Search Donations', 'give' ),
105
-		'not_found'          => __( 'No donations found.', 'give' ),
106
-		'not_found_in_trash' => __( 'No donations found in Trash.', 'give' ),
96
+		'name'               => _x('Donations', 'post type general name', 'give'),
97
+		'singular_name'      => _x('Donation', 'post type singular name', 'give'),
98
+		'add_new'            => __('Add New', 'give'),
99
+		'add_new_item'       => __('Add New Donation', 'give'),
100
+		'edit_item'          => __('Edit Donation', 'give'),
101
+		'new_item'           => __('New Donation', 'give'),
102
+		'all_items'          => __('All Donations', 'give'),
103
+		'view_item'          => __('View Donation', 'give'),
104
+		'search_items'       => __('Search Donations', 'give'),
105
+		'not_found'          => __('No donations found.', 'give'),
106
+		'not_found_in_trash' => __('No donations found in Trash.', 'give'),
107 107
 		'parent_item_colon'  => '',
108
-		'menu_name'          => __( 'Donations', 'give' ),
108
+		'menu_name'          => __('Donations', 'give'),
109 109
 	);
110 110
 
111 111
 	$payment_args = array(
112
-		'labels'          => apply_filters( 'give_payment_labels', $payment_labels ),
112
+		'labels'          => apply_filters('give_payment_labels', $payment_labels),
113 113
 		'public'          => false,
114 114
 		'query_var'       => false,
115 115
 		'rewrite'         => false,
116 116
 		'map_meta_cap'    => true,
117 117
 		'capability_type' => 'give_payment',
118
-		'supports'        => array( 'title' ),
118
+		'supports'        => array('title'),
119 119
 		'can_export'      => true,
120 120
 	);
121
-	register_post_type( 'give_payment', $payment_args );
121
+	register_post_type('give_payment', $payment_args);
122 122
 
123 123
 }
124 124
 
125
-add_action( 'init', 'give_setup_post_types', 1 );
125
+add_action('init', 'give_setup_post_types', 1);
126 126
 
127 127
 
128 128
 /**
@@ -135,30 +135,30 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function give_setup_taxonomies() {
137 137
 
138
-	$slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations';
138
+	$slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations';
139 139
 
140 140
 	/** Categories */
141 141
 	$category_labels = array(
142
-		'name'              => _x( 'Form Categories', 'taxonomy general name', 'give' ),
143
-		'singular_name'     => _x( 'Category', 'taxonomy singular name', 'give' ),
144
-		'search_items'      => __( 'Search Categories', 'give' ),
145
-		'all_items'         => __( 'All Categories', 'give' ),
146
-		'parent_item'       => __( 'Parent Category', 'give' ),
147
-		'parent_item_colon' => __( 'Parent Category:', 'give' ),
148
-		'edit_item'         => __( 'Edit Category', 'give' ),
149
-		'update_item'       => __( 'Update Category', 'give' ),
150
-		'add_new_item'      => __( 'Add New Category', 'give' ),
151
-		'new_item_name'     => __( 'New Category Name', 'give' ),
152
-		'menu_name'         => __( 'Categories', 'give' ),
142
+		'name'              => _x('Form Categories', 'taxonomy general name', 'give'),
143
+		'singular_name'     => _x('Category', 'taxonomy singular name', 'give'),
144
+		'search_items'      => __('Search Categories', 'give'),
145
+		'all_items'         => __('All Categories', 'give'),
146
+		'parent_item'       => __('Parent Category', 'give'),
147
+		'parent_item_colon' => __('Parent Category:', 'give'),
148
+		'edit_item'         => __('Edit Category', 'give'),
149
+		'update_item'       => __('Update Category', 'give'),
150
+		'add_new_item'      => __('Add New Category', 'give'),
151
+		'new_item_name'     => __('New Category Name', 'give'),
152
+		'menu_name'         => __('Categories', 'give'),
153 153
 	);
154 154
 
155
-	$category_args = apply_filters( 'give_forms_category_args', array(
155
+	$category_args = apply_filters('give_forms_category_args', array(
156 156
 			'hierarchical' => true,
157
-			'labels'       => apply_filters( 'give_forms_category_labels', $category_labels ),
157
+			'labels'       => apply_filters('give_forms_category_labels', $category_labels),
158 158
 			'show_ui'      => true,
159 159
 			'query_var'    => 'give_forms_category',
160 160
 			'rewrite'      => array(
161
-				'slug'         => $slug . '/category',
161
+				'slug'         => $slug.'/category',
162 162
 				'with_front'   => false,
163 163
 				'hierarchical' => true,
164 164
 			),
@@ -172,33 +172,33 @@  discard block
 block discarded – undo
172 172
 	);
173 173
 
174 174
 	// Does the user want categories?
175
-	if ( give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) {
176
-		register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args );
177
-		register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' );
175
+	if (give_is_setting_enabled(give_get_option('categories', 'disabled'))) {
176
+		register_taxonomy('give_forms_category', array('give_forms'), $category_args);
177
+		register_taxonomy_for_object_type('give_forms_category', 'give_forms');
178 178
 	}
179 179
 
180 180
 	/** Tags */
181 181
 	$tag_labels = array(
182
-		'name'                  => _x( 'Form Tags', 'taxonomy general name', 'give' ),
183
-		'singular_name'         => _x( 'Tag', 'taxonomy singular name', 'give' ),
184
-		'search_items'          => __( 'Search Tags', 'give' ),
185
-		'all_items'             => __( 'All Tags', 'give' ),
186
-		'parent_item'           => __( 'Parent Tag', 'give' ),
187
-		'parent_item_colon'     => __( 'Parent Tag:', 'give' ),
188
-		'edit_item'             => __( 'Edit Tag', 'give' ),
189
-		'update_item'           => __( 'Update Tag', 'give' ),
190
-		'add_new_item'          => __( 'Add New Tag', 'give' ),
191
-		'new_item_name'         => __( 'New Tag Name', 'give' ),
192
-		'menu_name'             => __( 'Tags', 'give' ),
193
-		'choose_from_most_used' => __( 'Choose from most used tags.', 'give' ),
182
+		'name'                  => _x('Form Tags', 'taxonomy general name', 'give'),
183
+		'singular_name'         => _x('Tag', 'taxonomy singular name', 'give'),
184
+		'search_items'          => __('Search Tags', 'give'),
185
+		'all_items'             => __('All Tags', 'give'),
186
+		'parent_item'           => __('Parent Tag', 'give'),
187
+		'parent_item_colon'     => __('Parent Tag:', 'give'),
188
+		'edit_item'             => __('Edit Tag', 'give'),
189
+		'update_item'           => __('Update Tag', 'give'),
190
+		'add_new_item'          => __('Add New Tag', 'give'),
191
+		'new_item_name'         => __('New Tag Name', 'give'),
192
+		'menu_name'             => __('Tags', 'give'),
193
+		'choose_from_most_used' => __('Choose from most used tags.', 'give'),
194 194
 	);
195 195
 
196
-	$tag_args = apply_filters( 'give_forms_tag_args', array(
196
+	$tag_args = apply_filters('give_forms_tag_args', array(
197 197
 			'hierarchical' => false,
198
-			'labels'       => apply_filters( 'give_forms_tag_labels', $tag_labels ),
198
+			'labels'       => apply_filters('give_forms_tag_labels', $tag_labels),
199 199
 			'show_ui'      => true,
200 200
 			'query_var'    => 'give_forms_tag',
201
-			'rewrite'      => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ),
201
+			'rewrite'      => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true),
202 202
 			'capabilities' => array(
203 203
 				'manage_terms' => 'manage_give_form_terms',
204 204
 				'edit_terms'   => 'edit_give_form_terms',
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
 		)
209 209
 	);
210 210
 
211
-	if ( give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) {
212
-		register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args );
213
-		register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' );
211
+	if (give_is_setting_enabled(give_get_option('tags', 'disabled'))) {
212
+		register_taxonomy('give_forms_tag', array('give_forms'), $tag_args);
213
+		register_taxonomy_for_object_type('give_forms_tag', 'give_forms');
214 214
 	}
215 215
 
216 216
 }
217 217
 
218
-add_action( 'init', 'give_setup_taxonomies', 0 );
218
+add_action('init', 'give_setup_taxonomies', 0);
219 219
 
220 220
 
221 221
 /**
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
  */
227 227
 function give_get_default_form_labels() {
228 228
 	$defaults = array(
229
-		'singular' => __( 'Form', 'give' ),
230
-		'plural'   => __( 'Forms', 'give' ),
229
+		'singular' => __('Form', 'give'),
230
+		'plural'   => __('Forms', 'give'),
231 231
 	);
232 232
 
233
-	return apply_filters( 'give_default_form_name', $defaults );
233
+	return apply_filters('give_default_form_name', $defaults);
234 234
 }
235 235
 
236 236
 /**
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
  *
243 243
  * @return string $defaults['singular'] Singular label
244 244
  */
245
-function give_get_forms_label_singular( $lowercase = false ) {
245
+function give_get_forms_label_singular($lowercase = false) {
246 246
 	$defaults = give_get_default_form_labels();
247 247
 
248
-	return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular'];
248
+	return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular'];
249 249
 }
250 250
 
251 251
 /**
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
  * @since 1.0
255 255
  * @return string $defaults['plural'] Plural label
256 256
  */
257
-function give_get_forms_label_plural( $lowercase = false ) {
257
+function give_get_forms_label_plural($lowercase = false) {
258 258
 	$defaults = give_get_default_form_labels();
259 259
 
260
-	return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural'];
260
+	return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural'];
261 261
 }
262 262
 
263 263
 /**
@@ -269,24 +269,24 @@  discard block
 block discarded – undo
269 269
  *
270 270
  * @return string $title New placeholder text
271 271
  */
272
-function give_change_default_title( $title ) {
272
+function give_change_default_title($title) {
273 273
 	// If a frontend plugin uses this filter (check extensions before changing this function)
274
-	if ( ! is_admin() ) {
275
-		$title = __( 'Enter form title here', 'give' );
274
+	if ( ! is_admin()) {
275
+		$title = __('Enter form title here', 'give');
276 276
 
277 277
 		return $title;
278 278
 	}
279 279
 
280 280
 	$screen = get_current_screen();
281 281
 
282
-	if ( 'give_forms' == $screen->post_type ) {
283
-		$title = __( 'Enter form title here', 'give' );
282
+	if ('give_forms' == $screen->post_type) {
283
+		$title = __('Enter form title here', 'give');
284 284
 	}
285 285
 
286 286
 	return $title;
287 287
 }
288 288
 
289
-add_filter( 'enter_title_here', 'give_change_default_title' );
289
+add_filter('enter_title_here', 'give_change_default_title');
290 290
 
291 291
 /**
292 292
  * Registers Custom Post Statuses which are used by the Payments
@@ -296,58 +296,58 @@  discard block
 block discarded – undo
296 296
  */
297 297
 function give_register_post_type_statuses() {
298 298
 	// Payment Statuses
299
-	register_post_status( 'refunded', array(
300
-		'label'                     => __( 'Refunded', 'give' ),
299
+	register_post_status('refunded', array(
300
+		'label'                     => __('Refunded', 'give'),
301 301
 		'public'                    => true,
302 302
 		'exclude_from_search'       => false,
303 303
 		'show_in_admin_all_list'    => true,
304 304
 		'show_in_admin_status_list' => true,
305
-		'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ),
306
-	) );
307
-	register_post_status( 'failed', array(
308
-		'label'                     => __( 'Failed', 'give' ),
305
+		'label_count'               => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give'),
306
+	));
307
+	register_post_status('failed', array(
308
+		'label'                     => __('Failed', 'give'),
309 309
 		'public'                    => true,
310 310
 		'exclude_from_search'       => false,
311 311
 		'show_in_admin_all_list'    => true,
312 312
 		'show_in_admin_status_list' => true,
313
-		'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ),
314
-	) );
315
-	register_post_status( 'revoked', array(
316
-		'label'                     => __( 'Revoked', 'give' ),
313
+		'label_count'               => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give'),
314
+	));
315
+	register_post_status('revoked', array(
316
+		'label'                     => __('Revoked', 'give'),
317 317
 		'public'                    => true,
318 318
 		'exclude_from_search'       => false,
319 319
 		'show_in_admin_all_list'    => true,
320 320
 		'show_in_admin_status_list' => true,
321
-		'label_count'               => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ),
322
-	) );
323
-	register_post_status( 'cancelled', array(
324
-		'label'                     => __( 'Cancelled', 'give' ),
321
+		'label_count'               => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give'),
322
+	));
323
+	register_post_status('cancelled', array(
324
+		'label'                     => __('Cancelled', 'give'),
325 325
 		'public'                    => true,
326 326
 		'exclude_from_search'       => false,
327 327
 		'show_in_admin_all_list'    => true,
328 328
 		'show_in_admin_status_list' => true,
329
-		'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ),
330
-	) );
331
-	register_post_status( 'abandoned', array(
332
-		'label'                     => __( 'Abandoned', 'give' ),
329
+		'label_count'               => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give'),
330
+	));
331
+	register_post_status('abandoned', array(
332
+		'label'                     => __('Abandoned', 'give'),
333 333
 		'public'                    => true,
334 334
 		'exclude_from_search'       => false,
335 335
 		'show_in_admin_all_list'    => true,
336 336
 		'show_in_admin_status_list' => true,
337
-		'label_count'               => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ),
338
-	) );
339
-	register_post_status( 'processing', array(
340
-		'label'                     => _x( 'Processing', 'Processing payment status', 'give' ),
337
+		'label_count'               => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give'),
338
+	));
339
+	register_post_status('processing', array(
340
+		'label'                     => _x('Processing', 'Processing payment status', 'give'),
341 341
 		'public'                    => true,
342 342
 		'exclude_from_search'       => false,
343 343
 		'show_in_admin_all_list'    => true,
344 344
 		'show_in_admin_status_list' => true,
345
-		'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give' )
346
-	)  );
345
+		'label_count'               => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give')
346
+	));
347 347
 
348 348
 }
349 349
 
350
-add_action( 'init', 'give_register_post_type_statuses' );
350
+add_action('init', 'give_register_post_type_statuses');
351 351
 
352 352
 /**
353 353
  * Updated Messages
@@ -360,27 +360,27 @@  discard block
 block discarded – undo
360 360
  *
361 361
  * @return array $messages New post updated messages
362 362
  */
363
-function give_updated_messages( $messages ) {
363
+function give_updated_messages($messages) {
364 364
 	global $post, $post_ID;
365 365
 
366
-	if ( ! give_is_setting_enabled( give_get_option( 'forms_singular' ) ) ) {
366
+	if ( ! give_is_setting_enabled(give_get_option('forms_singular'))) {
367 367
 
368 368
 		$messages['give_forms'] = array(
369
-			1 => __( 'Form updated.', 'give' ),
370
-			4 => __( 'Form updated.', 'give' ),
371
-			6 => __( 'Form published.', 'give' ),
372
-			7 => __( 'Form saved.', 'give' ),
373
-			8 => __( 'Form submitted.', 'give' ),
369
+			1 => __('Form updated.', 'give'),
370
+			4 => __('Form updated.', 'give'),
371
+			6 => __('Form published.', 'give'),
372
+			7 => __('Form saved.', 'give'),
373
+			8 => __('Form submitted.', 'give'),
374 374
 		);
375 375
 
376 376
 	} else {
377 377
 
378 378
 		$messages['give_forms'] = array(
379
-			1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
380
-			4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
381
-			6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form published.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
382
-			7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form saved.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
383
-			8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form submitted.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
379
+			1 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
380
+			4 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
381
+			6 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form published.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
382
+			7 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form saved.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
383
+			8 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form submitted.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
384 384
 		);
385 385
 
386 386
 	}
@@ -388,27 +388,27 @@  discard block
 block discarded – undo
388 388
 	return $messages;
389 389
 }
390 390
 
391
-add_filter( 'post_updated_messages', 'give_updated_messages' );
391
+add_filter('post_updated_messages', 'give_updated_messages');
392 392
 
393 393
 
394 394
 /**
395 395
  * Setup Post Type Images
396 396
  */
397
-add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 );
397
+add_action('after_setup_theme', 'give_add_thumbnail_support', 10);
398 398
 
399 399
 /**
400 400
  * Ensure post thumbnail support is turned on
401 401
  */
402 402
 function give_add_thumbnail_support() {
403
-	if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
403
+	if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) {
404 404
 		return;
405 405
 	}
406 406
 
407
-	if ( ! current_theme_supports( 'post-thumbnails' ) ) {
408
-		add_theme_support( 'post-thumbnails' );
407
+	if ( ! current_theme_supports('post-thumbnails')) {
408
+		add_theme_support('post-thumbnails');
409 409
 	}
410 410
 
411
-	add_post_type_support( 'give_forms', 'thumbnail' );
411
+	add_post_type_support('give_forms', 'thumbnail');
412 412
 }
413 413
 
414 414
 /**
@@ -420,21 +420,21 @@  discard block
 block discarded – undo
420 420
 
421 421
 	// Single Give Forms (disabled if single turned off in settings)
422 422
 	if (
423
-		give_is_setting_enabled( give_get_option( 'forms_singular' ) )
424
-		&& give_is_setting_enabled( give_get_option( 'form_sidebar' ) )
423
+		give_is_setting_enabled(give_get_option('forms_singular'))
424
+		&& give_is_setting_enabled(give_get_option('form_sidebar'))
425 425
 	) {
426 426
 
427
-		register_sidebar( apply_filters( 'give_forms_single_sidebar', array(
428
-			'name'          => __( 'Give Single Form Sidebar', 'give' ),
427
+		register_sidebar(apply_filters('give_forms_single_sidebar', array(
428
+			'name'          => __('Give Single Form Sidebar', 'give'),
429 429
 			'id'            => 'give-forms-sidebar',
430
-			'description'   => __( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ),
430
+			'description'   => __('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'),
431 431
 			'before_widget' => '<div id="%1$s" class="widget %2$s">',
432 432
 			'after_widget'  => '</div>',
433 433
 			'before_title'  => '<h3 class="widgettitle widget-title">',
434 434
 			'after_title'   => '</h3>',
435
-		) ) );
435
+		)));
436 436
 
437 437
 	}
438 438
 }
439 439
 
440
-add_action( 'widgets_init', 'give_widgets_init', 999 );
440
+add_action('widgets_init', 'give_widgets_init', 999);
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 4 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param $url
74 74
 	 *
75
-	 * @return mixed
75
+	 * @return string
76 76
 	 */
77 77
 	public function give_update_cmb_meta_box_url( $url ) {
78 78
 		// Path to Give's CMB
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
  * @since      1.3.5
936 936
  *
937 937
  * @param $array
938
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
938
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
939 939
  * @param $insert   |array a valid array of options to insert
940 940
  *
941 941
  * @return array
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  * @since 1.0
975 975
  *
976 976
  * @param array $field_arr
977
- * @param array $saved_values
977
+ * @param string|boolean $saved_values
978 978
  *
979 979
  * @return void
980 980
  */
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
  * @since  1.0
1010 1010
  *
1011 1011
  * @param  array $field_arr
1012
- * @param  array $saved_value
1012
+ * @param  string|boolean $saved_value
1013 1013
  *
1014 1014
  * @return void
1015 1015
  */
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
  *  @params $string text
1164 1164
  *  @params $filter array
1165 1165
  *
1166
- *  @return text $string
1166
+ *  @return string $string
1167 1167
  */
1168 1168
 function give_slug_to_title( $string, $filters = array() ){
1169 1169
 
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1167,12 +1167,12 @@
 block discarded – undo
1167 1167
  */
1168 1168
 function give_slug_to_title( $string, $filters = array() ){
1169 1169
 
1170
-    foreach( $filters as $filter_item ){
1171
-        $string = str_replace( $filter_item, ' ', $string );
1172
-    }
1170
+	foreach( $filters as $filter_item ){
1171
+		$string = str_replace( $filter_item, ' ', $string );
1172
+	}
1173 1173
 
1174
-    // Return updated string after converting it to title case
1175
-    return ucwords( $string );
1174
+	// Return updated string after converting it to title case
1175
+	return ucwords( $string );
1176 1176
 
1177 1177
 }
1178 1178
 
Please login to merge, or discard this patch.
Spacing   +375 added lines, -375 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	public function __construct() {
44 44
 
45 45
 		// Custom CMB2 Settings Fields
46
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
47
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
48
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
49
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
50
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
51
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
52
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
53
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
46
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
47
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
48
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
49
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
50
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
51
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
52
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
53
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
54 54
 	}
55 55
 
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since  1.0
61 61
 	 */
62 62
 	public function init() {
63
-		register_setting( $this->key, $this->key );
63
+		register_setting($this->key, $this->key);
64 64
 
65 65
 	}
66 66
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return mixed
76 76
 	 */
77
-	public function give_update_cmb_meta_box_url( $url ) {
77
+	public function give_update_cmb_meta_box_url($url) {
78 78
 		// Path to Give's CMB
79
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
79
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
80 80
 	}
81 81
 
82 82
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function give_get_settings_tabs() {
90 90
 
91
-		$settings = $this->give_settings( null );
91
+		$settings = $this->give_settings(null);
92 92
 
93 93
 		$tabs             = array();
94
-		$tabs['general']  = __( 'General', 'give' );
95
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
96
-		$tabs['display']  = __( 'Display Options', 'give' );
97
-		$tabs['emails']   = __( 'Emails', 'give' );
94
+		$tabs['general']  = __('General', 'give');
95
+		$tabs['gateways'] = __('Payment Gateways', 'give');
96
+		$tabs['display']  = __('Display Options', 'give');
97
+		$tabs['emails']   = __('Emails', 'give');
98 98
 
99
-		if ( ! empty( $settings['addons']['fields'] ) ) {
100
-			$tabs['addons'] = __( 'Add-ons', 'give' );
99
+		if ( ! empty($settings['addons']['fields'])) {
100
+			$tabs['addons'] = __('Add-ons', 'give');
101 101
 		}
102 102
 
103
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
104
-			$tabs['licenses'] = __( 'Licenses', 'give' );
103
+		if ( ! empty($settings['licenses']['fields'])) {
104
+			$tabs['licenses'] = __('Licenses', 'give');
105 105
 		}
106 106
 
107
-		$tabs['advanced']    = __( 'Advanced', 'give' );
108
-		$tabs['api']         = __( 'API', 'give' );
109
-		$tabs['system_info'] = __( 'System Info', 'give' );
107
+		$tabs['advanced']    = __('Advanced', 'give');
108
+		$tabs['api']         = __('API', 'give');
109
+		$tabs['system_info'] = __('System Info', 'give');
110 110
 
111
-		return apply_filters( 'give_settings_tabs', $tabs );
111
+		return apply_filters('give_settings_tabs', $tabs);
112 112
 	}
113 113
 
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function admin_page_display() {
121 121
 
122
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
122
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
123 123
 
124 124
 		?>
125 125
 
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 
130 130
 			<h2 class="nav-tab-wrapper">
131 131
 				<?php
132
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
132
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
133 133
 
134
-					$tab_url = esc_url( add_query_arg( array(
134
+					$tab_url = esc_url(add_query_arg(array(
135 135
 						'settings-updated' => false,
136 136
 						'tab'              => $tab_id,
137
-					) ) );
137
+					)));
138 138
 
139 139
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
140 140
 
141
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
141
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
142 142
 
143 143
 				}
144 144
 				?>
145 145
 			</h2>
146 146
 
147
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
147
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
148 148
 
149 149
 		</div><!-- .wrap -->
150 150
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @return string
168 168
 	 */
169
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
169
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
170 170
 
171 171
 		// only modify the give settings form
172
-		if ( 'give_settings' == $object_id ) {
172
+		if ('give_settings' == $object_id) {
173 173
 
174
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
174
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
175 175
 
176 176
 		}
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return array
190 190
 	 */
191
-	public function give_settings( $active_tab ) {
191
+	public function give_settings($active_tab) {
192 192
 
193 193
 		$give_settings = array(
194 194
 			/**
@@ -196,99 +196,99 @@  discard block
 block discarded – undo
196 196
 			 */
197 197
 			'general'     => array(
198 198
 				'id'         => 'general_settings',
199
-				'give_title' => __( 'General Settings', 'give' ),
200
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
201
-				'fields'     => apply_filters( 'give_settings_general', array(
199
+				'give_title' => __('General Settings', 'give'),
200
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
201
+				'fields'     => apply_filters('give_settings_general', array(
202 202
 						array(
203
-							'name' => __( 'General Settings', 'give' ),
203
+							'name' => __('General Settings', 'give'),
204 204
 							'desc' => '',
205 205
 							'type' => 'give_title',
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name'    => __( 'Success Page', 'give' ),
209
+							'name'    => __('Success Page', 'give'),
210 210
 							/* translators: %s: [give_receipt] */
211
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
211
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
212 212
 							'id'      => 'success_page',
213 213
 							'type'    => 'select',
214
-							'options' => give_cmb2_get_post_options( array(
214
+							'options' => give_cmb2_get_post_options(array(
215 215
 								'post_type'   => 'page',
216
-								'numberposts' => - 1,
217
-							) ),
216
+								'numberposts' => -1,
217
+							)),
218 218
 						),
219 219
 						array(
220
-							'name'    => __( 'Failed Donation Page', 'give' ),
221
-							'desc'    => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
220
+							'name'    => __('Failed Donation Page', 'give'),
221
+							'desc'    => __('The page donors are sent to if their donation is cancelled or fails.', 'give'),
222 222
 							'id'      => 'failure_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226
-								'numberposts' => - 1,
227
-							) ),
226
+								'numberposts' => -1,
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => __( 'Donation History Page', 'give' ),
230
+							'name'    => __('Donation History Page', 'give'),
231 231
 							/* translators: %s: [donation_history] */
232
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
232
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
233 233
 							'id'      => 'history_page',
234 234
 							'type'    => 'select',
235
-							'options' => give_cmb2_get_post_options( array(
235
+							'options' => give_cmb2_get_post_options(array(
236 236
 								'post_type'   => 'page',
237
-								'numberposts' => - 1,
238
-							) ),
237
+								'numberposts' => -1,
238
+							)),
239 239
 						),
240 240
 						array(
241
-							'name'    => __( 'Base Country', 'give' ),
242
-							'desc'    => __( 'The country your site operates from.', 'give' ),
241
+							'name'    => __('Base Country', 'give'),
242
+							'desc'    => __('The country your site operates from.', 'give'),
243 243
 							'id'      => 'base_country',
244 244
 							'type'    => 'select',
245 245
 							'options' => give_get_country_list(),
246 246
 						),
247 247
 						array(
248
-							'name' => __( 'Currency Settings', 'give' ),
248
+							'name' => __('Currency Settings', 'give'),
249 249
 							'desc' => '',
250 250
 							'type' => 'give_title',
251 251
 							'id'   => 'give_title_general_settings_2',
252 252
 						),
253 253
 						array(
254
-							'name'    => __( 'Currency', 'give' ),
255
-							'desc'    => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
254
+							'name'    => __('Currency', 'give'),
255
+							'desc'    => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
256 256
 							'id'      => 'currency',
257 257
 							'type'    => 'select',
258 258
 							'options' => give_get_currencies(),
259 259
 							'default' => 'USD',
260 260
 						),
261 261
 						array(
262
-							'name'    => __( 'Currency Position', 'give' ),
263
-							'desc'    => __( 'The position of the currency symbol.', 'give' ),
262
+							'name'    => __('Currency Position', 'give'),
263
+							'desc'    => __('The position of the currency symbol.', 'give'),
264 264
 							'id'      => 'currency_position',
265 265
 							'type'    => 'select',
266 266
 							'options' => array(
267 267
 								/* translators: %s: currency symbol */
268
-								'before' => sprintf( __( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
268
+								'before' => sprintf(__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
269 269
 								/* translators: %s: currency symbol */
270
-								'after'  => sprintf( __( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) ),
270
+								'after'  => sprintf(__('After - 10%s', 'give'), give_currency_symbol(give_get_currency())),
271 271
 							),
272 272
 							'default' => 'before',
273 273
 						),
274 274
 						array(
275
-							'name'            => __( 'Thousands Separator', 'give' ),
276
-							'desc'            => __( 'The symbol (usually , or .) to separate thousands.', 'give' ),
275
+							'name'            => __('Thousands Separator', 'give'),
276
+							'desc'            => __('The symbol (usually , or .) to separate thousands.', 'give'),
277 277
 							'id'              => 'thousands_separator',
278 278
 							'type'            => 'text_small',
279 279
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
280 280
 							'default'         => ',',
281 281
 						),
282 282
 						array(
283
-							'name'    => __( 'Decimal Separator', 'give' ),
284
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
283
+							'name'    => __('Decimal Separator', 'give'),
284
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
285 285
 							'id'      => 'decimal_separator',
286 286
 							'type'    => 'text_small',
287 287
 							'default' => '.',
288 288
 						),
289 289
 						array(
290
-							'name'            => __( 'Number of Decimals', 'give' ),
291
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
290
+							'name'            => __('Number of Decimals', 'give'),
291
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
292 292
 							'id'              => 'number_decimals',
293 293
 							'type'            => 'text_small',
294 294
 							'default'         => 2,
@@ -302,83 +302,83 @@  discard block
 block discarded – undo
302 302
 			 */
303 303
 			'gateways'    => array(
304 304
 				'id'         => 'payment_gateways',
305
-				'give_title' => __( 'Payment Gateways', 'give' ),
306
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
307
-				'fields'     => apply_filters( 'give_settings_gateways', array(
305
+				'give_title' => __('Payment Gateways', 'give'),
306
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
307
+				'fields'     => apply_filters('give_settings_gateways', array(
308 308
 						array(
309
-							'name' => __( 'Gateways Settings', 'give' ),
309
+							'name' => __('Gateways Settings', 'give'),
310 310
 							'desc' => '',
311 311
 							'id'   => 'give_title_gateway_settings_1',
312 312
 							'type' => 'give_title',
313 313
 						),
314 314
 						array(
315
-							'name' => __( 'Test Mode', 'give' ),
316
-							'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
315
+							'name' => __('Test Mode', 'give'),
316
+							'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
317 317
 							'id'   => 'test_mode',
318 318
 							'type' => 'checkbox',
319 319
 						),
320 320
 						array(
321
-							'name' => __( 'Enabled Gateways', 'give' ),
322
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
321
+							'name' => __('Enabled Gateways', 'give'),
322
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
323 323
 							'id'   => 'gateways',
324 324
 							'type' => 'enabled_gateways',
325 325
 						),
326 326
 						array(
327
-							'name' => __( 'Default Gateway', 'give' ),
328
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
327
+							'name' => __('Default Gateway', 'give'),
328
+							'desc' => __('The gateway that will be selected by default.', 'give'),
329 329
 							'id'   => 'default_gateway',
330 330
 							'type' => 'default_gateway',
331 331
 						),
332 332
 						array(
333
-							'name' => __( 'PayPal Standard', 'give' ),
333
+							'name' => __('PayPal Standard', 'give'),
334 334
 							'desc' => '',
335 335
 							'type' => 'give_title',
336 336
 							'id'   => 'give_title_gateway_settings_2',
337 337
 						),
338 338
 						array(
339
-							'name' => __( 'PayPal Email', 'give' ),
340
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
339
+							'name' => __('PayPal Email', 'give'),
340
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
341 341
 							'id'   => 'paypal_email',
342 342
 							'type' => 'text_email',
343 343
 						),
344 344
 						array(
345
-							'name' => __( 'PayPal Page Style', 'give' ),
346
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
345
+							'name' => __('PayPal Page Style', 'give'),
346
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
347 347
 							'id'   => 'paypal_page_style',
348 348
 							'type' => 'text',
349 349
 						),
350 350
 						array(
351
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
352
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
351
+							'name'    => __('PayPal Transaction Type', 'give'),
352
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
353 353
 							'id'      => 'paypal_button_type',
354 354
 							'type'    => 'radio_inline',
355 355
 							'options' => array(
356
-								'donation' => __( 'Donation', 'give' ),
357
-								'standard' => __( 'Standard Transaction', 'give' ),
356
+								'donation' => __('Donation', 'give'),
357
+								'standard' => __('Standard Transaction', 'give'),
358 358
 							),
359 359
 							'default' => 'donation',
360 360
 						),
361 361
 						array(
362
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
363
-							'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
362
+							'name' => __('Disable PayPal IPN Verification', 'give'),
363
+							'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
364 364
 							'id'   => 'disable_paypal_verification',
365 365
 							'type' => 'checkbox',
366 366
 						),
367 367
 						array(
368
-							'name' => __( 'Offline Donations', 'give' ),
368
+							'name' => __('Offline Donations', 'give'),
369 369
 							'desc' => '',
370 370
 							'type' => 'give_title',
371 371
 							'id'   => 'give_title_gateway_settings_3',
372 372
 						),
373 373
 						array(
374
-							'name' => __( 'Collect Billing Details', 'give' ),
375
-							'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
374
+							'name' => __('Collect Billing Details', 'give'),
375
+							'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
376 376
 							'id'   => 'give_offline_donation_enable_billing_fields',
377 377
 							'type' => 'checkbox',
378 378
 						),
379 379
 						array(
380
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
381
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
380
+							'name'    => __('Offline Donation Instructions', 'give'),
381
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
382 382
 							'id'      => 'global_offline_donation_content',
383 383
 							'default' => give_get_default_offline_donation_content(),
384 384
 							'type'    => 'wysiwyg',
@@ -387,15 +387,15 @@  discard block
 block discarded – undo
387 387
 							),
388 388
 						),
389 389
 						array(
390
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
391
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
390
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
391
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
392 392
 							'id'      => 'offline_donation_subject',
393
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
393
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
394 394
 							'type'    => 'text',
395 395
 						),
396 396
 						array(
397
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
398
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
397
+							'name'    => __('Offline Donation Email Instructions', 'give'),
398
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
399 399
 							'id'      => 'global_offline_donation_email',
400 400
 							'default' => give_get_default_offline_donation_email_content(),
401 401
 							'type'    => 'wysiwyg',
@@ -409,104 +409,104 @@  discard block
 block discarded – undo
409 409
 			/** Display Settings */
410 410
 			'display'     => array(
411 411
 				'id'         => 'display_settings',
412
-				'give_title' => __( 'Display Settings', 'give' ),
413
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
414
-				'fields'     => apply_filters( 'give_settings_display', array(
412
+				'give_title' => __('Display Settings', 'give'),
413
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
414
+				'fields'     => apply_filters('give_settings_display', array(
415 415
 						array(
416
-							'name' => __( 'Display Settings', 'give' ),
416
+							'name' => __('Display Settings', 'give'),
417 417
 							'desc' => '',
418 418
 							'id'   => 'give_title_display_settings_1',
419 419
 							'type' => 'give_title',
420 420
 						),
421 421
 						array(
422
-							'name' => __( 'Disable CSS', 'give' ),
423
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
422
+							'name' => __('Disable CSS', 'give'),
423
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
424 424
 							'id'   => 'disable_css',
425 425
 							'type' => 'checkbox',
426 426
 						),
427 427
 						array(
428
-							'name' => __( 'Enable Floating Labels', 'give' ),
428
+							'name' => __('Enable Floating Labels', 'give'),
429 429
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
430
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
430
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
431 431
 								'a' => array(
432 432
 									'href'   => array(),
433 433
 									'target' => array(),
434 434
 								),
435
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
435
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
436 436
 							'id'   => 'floatlabels',
437 437
 							'type' => 'checkbox',
438 438
 						),
439 439
 						array(
440
-							'name' => __( 'Disable Welcome Screen', 'give' ),
440
+							'name' => __('Disable Welcome Screen', 'give'),
441 441
 							/* translators: %s: about page URL */
442
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array(
442
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array(
443 443
 								'a' => array(
444 444
 									'href'   => array(),
445 445
 									'target' => array(),
446 446
 								),
447
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
447
+							)), esc_url(admin_url('index.php?page=give-about'))),
448 448
 							'id'   => 'disable_welcome',
449 449
 							'type' => 'checkbox',
450 450
 						),
451 451
 						array(
452
-							'name' => __( 'Post Types', 'give' ),
452
+							'name' => __('Post Types', 'give'),
453 453
 							'desc' => '',
454 454
 							'id'   => 'give_title_display_settings_2',
455 455
 							'type' => 'give_title',
456 456
 						),
457 457
 						array(
458
-							'name' => __( 'Disable Form Single Views', 'give' ),
459
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
458
+							'name' => __('Disable Form Single Views', 'give'),
459
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
460 460
 							'id'   => 'disable_forms_singular',
461 461
 							'type' => 'checkbox',
462 462
 						),
463 463
 						array(
464
-							'name' => __( 'Disable Form Archives', 'give' ),
465
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
464
+							'name' => __('Disable Form Archives', 'give'),
465
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
466 466
 							'id'   => 'disable_forms_archives',
467 467
 							'type' => 'checkbox',
468 468
 						),
469 469
 						array(
470
-							'name' => __( 'Disable Form Excerpts', 'give' ),
471
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
470
+							'name' => __('Disable Form Excerpts', 'give'),
471
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
472 472
 							'id'   => 'disable_forms_excerpt',
473 473
 							'type' => 'checkbox',
474 474
 						),
475 475
 						array(
476
-							'name'    => __( 'Featured Image Size', 'give' ),
477
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
476
+							'name'    => __('Featured Image Size', 'give'),
477
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
478 478
 							'id'      => 'featured_image_size',
479 479
 							'type'    => 'select',
480 480
 							'default' => 'large',
481 481
 							'options' => give_get_featured_image_sizes(),
482 482
 						),
483 483
 						array(
484
-							'name' => __( 'Disable Form Featured Image', 'give' ),
485
-							'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
484
+							'name' => __('Disable Form Featured Image', 'give'),
485
+							'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
486 486
 							'id'   => 'disable_form_featured_img',
487 487
 							'type' => 'checkbox',
488 488
 						),
489 489
 						array(
490
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
491
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
490
+							'name' => __('Disable Single Form Sidebar', 'give'),
491
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
492 492
 							'id'   => 'disable_form_sidebar',
493 493
 							'type' => 'checkbox',
494 494
 						),
495 495
 						array(
496
-							'name' => __( 'Taxonomies', 'give' ),
496
+							'name' => __('Taxonomies', 'give'),
497 497
 							'desc' => '',
498 498
 							'id'   => 'give_title_display_settings_3',
499 499
 							'type' => 'give_title',
500 500
 						),
501 501
 						array(
502
-							'name' => __( 'Enable Form Categories', 'give' ),
503
-							'desc' => __( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
502
+							'name' => __('Enable Form Categories', 'give'),
503
+							'desc' => __('Enables the "Category" taxonomy for all Give forms.', 'give'),
504 504
 							'id'   => 'categories',
505 505
 							'type' => 'checkbox',
506 506
 						),
507 507
 						array(
508
-							'name' => __( 'Enable Form Tags', 'give' ),
509
-							'desc' => __( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
508
+							'name' => __('Enable Form Tags', 'give'),
509
+							'desc' => __('Enables the "Tag" taxonomy for all Give forms.', 'give'),
510 510
 							'id'   => 'tags',
511 511
 							'type' => 'checkbox',
512 512
 						),
@@ -519,101 +519,101 @@  discard block
 block discarded – undo
519 519
 			 */
520 520
 			'emails'      => array(
521 521
 				'id'         => 'email_settings',
522
-				'give_title' => __( 'Email Settings', 'give' ),
523
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
524
-				'fields'     => apply_filters( 'give_settings_emails', array(
522
+				'give_title' => __('Email Settings', 'give'),
523
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
524
+				'fields'     => apply_filters('give_settings_emails', array(
525 525
 						array(
526
-							'name' => __( 'Email Settings', 'give' ),
526
+							'name' => __('Email Settings', 'give'),
527 527
 							'desc' => '',
528 528
 							'id'   => 'give_title_email_settings_1',
529 529
 							'type' => 'give_title',
530 530
 						),
531 531
 						array(
532 532
 							'id'      => 'email_template',
533
-							'name'    => __( 'Email Template', 'give' ),
534
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
533
+							'name'    => __('Email Template', 'give'),
534
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
535 535
 							'type'    => 'select',
536 536
 							'options' => give_get_email_templates(),
537 537
 						),
538 538
 						array(
539 539
 							'id'   => 'email_logo',
540
-							'name' => __( 'Logo', 'give' ),
541
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
540
+							'name' => __('Logo', 'give'),
541
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
542 542
 							'type' => 'file',
543 543
 						),
544 544
 						array(
545 545
 							'id'      => 'from_name',
546
-							'name'    => __( 'From Name', 'give' ),
547
-							'desc'    => __( 'The name that appears in the "From" field in donation receipt emails.', 'give' ),
548
-							'default' => get_bloginfo( 'name' ),
546
+							'name'    => __('From Name', 'give'),
547
+							'desc'    => __('The name that appears in the "From" field in donation receipt emails.', 'give'),
548
+							'default' => get_bloginfo('name'),
549 549
 							'type'    => 'text',
550 550
 						),
551 551
 						array(
552 552
 							'id'      => 'from_email',
553
-							'name'    => __( 'From Email', 'give' ),
554
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
555
-							'default' => get_bloginfo( 'admin_email' ),
553
+							'name'    => __('From Email', 'give'),
554
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
555
+							'default' => get_bloginfo('admin_email'),
556 556
 							'type'    => 'text',
557 557
 						),
558 558
 						array(
559
-							'name' => __( 'Donation Receipt', 'give' ),
559
+							'name' => __('Donation Receipt', 'give'),
560 560
 							'desc' => '',
561 561
 							'id'   => 'give_title_email_settings_2',
562 562
 							'type' => 'give_title',
563 563
 						),
564 564
 						array(
565 565
 							'id'      => 'donation_subject',
566
-							'name'    => __( 'Donation Email Subject', 'give' ),
567
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
568
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
566
+							'name'    => __('Donation Email Subject', 'give'),
567
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
568
+							'default' => esc_attr__('Donation Receipt', 'give'),
569 569
 							'type'    => 'text',
570 570
 						),
571 571
 						array(
572 572
 							'id'      => 'donation_receipt',
573
-							'name'    => __( 'Donation Receipt', 'give' ),
573
+							'name'    => __('Donation Receipt', 'give'),
574 574
 							'desc'    => sprintf(
575 575
 								/* translators: %s: emails tags list */
576
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
577
-								'<br/>' . give_get_emails_tags_list()
576
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
577
+								'<br/>'.give_get_emails_tags_list()
578 578
 							),
579 579
 							'type'    => 'wysiwyg',
580 580
 							'default' => give_get_default_donation_receipt_email(),
581 581
 						),
582 582
 						array(
583
-							'name' => __( 'New Donation Notification', 'give' ),
583
+							'name' => __('New Donation Notification', 'give'),
584 584
 							'desc' => '',
585 585
 							'id'   => 'give_title_email_settings_3',
586 586
 							'type' => 'give_title',
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'donation_notification_subject',
590
-							'name'    => __( 'Donation Notification Subject', 'give' ),
591
-							'desc'    => __( 'Enter the subject line for the donation notification email.', 'give' ),
590
+							'name'    => __('Donation Notification Subject', 'give'),
591
+							'desc'    => __('Enter the subject line for the donation notification email.', 'give'),
592 592
 							'type'    => 'text',
593
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
593
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give'),
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'donation_notification',
597
-							'name'    => __( 'Donation Notification', 'give' ),
597
+							'name'    => __('Donation Notification', 'give'),
598 598
 							'desc'    => sprintf(
599 599
 								/* translators: %s: emails tags list */
600
-								__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
601
-								'<br/>' . give_get_emails_tags_list()
600
+								__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
601
+								'<br/>'.give_get_emails_tags_list()
602 602
 							),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_notification_email(),
605 605
 						),
606 606
 						array(
607 607
 							'id'      => 'admin_notice_emails',
608
-							'name'    => __( 'Donation Notification Emails', 'give' ),
609
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
608
+							'name'    => __('Donation Notification Emails', 'give'),
609
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
610 610
 							'type'    => 'textarea',
611
-							'default' => get_bloginfo( 'admin_email' ),
611
+							'default' => get_bloginfo('admin_email'),
612 612
 						),
613 613
 						array(
614 614
 							'id'   => 'disable_admin_notices',
615
-							'name' => __( 'Disable Admin Notifications', 'give' ),
616
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
615
+							'name' => __('Disable Admin Notifications', 'give'),
616
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
617 617
 							'type' => 'checkbox',
618 618
 						),
619 619
 					)
@@ -622,99 +622,99 @@  discard block
 block discarded – undo
622 622
 			/** Extension Settings */
623 623
 			'addons'      => array(
624 624
 				'id'         => 'addons',
625
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
626
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
627
-				'fields'     => apply_filters( 'give_settings_addons', array()
625
+				'give_title' => __('Give Add-ons Settings', 'give'),
626
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
627
+				'fields'     => apply_filters('give_settings_addons', array()
628 628
 				),
629 629
 			),
630 630
 			/** Licenses Settings */
631 631
 			'licenses'    => array(
632 632
 				'id'         => 'licenses',
633
-				'give_title' => __( 'Give Licenses', 'give' ),
634
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
635
-				'fields'     => apply_filters( 'give_settings_licenses', array()
633
+				'give_title' => __('Give Licenses', 'give'),
634
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
635
+				'fields'     => apply_filters('give_settings_licenses', array()
636 636
 				),
637 637
 			),
638 638
 			/** Advanced Options */
639 639
 			'advanced'    => array(
640 640
 				'id'         => 'advanced_options',
641
-				'give_title' => __( 'Advanced Options', 'give' ),
642
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
643
-				'fields'     => apply_filters( 'give_settings_advanced', array(
641
+				'give_title' => __('Advanced Options', 'give'),
642
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
643
+				'fields'     => apply_filters('give_settings_advanced', array(
644 644
 						array(
645
-							'name' => __( 'Access Control', 'give' ),
645
+							'name' => __('Access Control', 'give'),
646 646
 							'desc' => '',
647 647
 							'id'   => 'give_title_session_control_1',
648 648
 							'type' => 'give_title',
649 649
 						),
650 650
 						array(
651 651
 							'id'      => 'session_lifetime',
652
-							'name'    => __( 'Session Lifetime', 'give' ),
653
-							'desc'    => __( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
652
+							'name'    => __('Session Lifetime', 'give'),
653
+							'desc'    => __('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
654 654
 							'type'    => 'select',
655 655
 							'options' => array(
656
-								'86400'  => __( '24 Hours', 'give' ),
657
-								'172800' => __( '48 Hours', 'give' ),
658
-								'259200' => __( '72 Hours', 'give' ),
659
-								'604800' => __( '1 Week', 'give' ),
656
+								'86400'  => __('24 Hours', 'give'),
657
+								'172800' => __('48 Hours', 'give'),
658
+								'259200' => __('72 Hours', 'give'),
659
+								'604800' => __('1 Week', 'give'),
660 660
 							),
661 661
 						),
662 662
 						array(
663
-							'name' => __( 'Email Access', 'give' ),
664
-							'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
663
+							'name' => __('Email Access', 'give'),
664
+							'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
665 665
 							'id'   => 'email_access',
666 666
 							'type' => 'checkbox',
667 667
 						),
668 668
 						array(
669 669
 							'id'      => 'recaptcha_key',
670
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
670
+							'name'    => __('reCAPTCHA Site Key', 'give'),
671 671
 							/* translators: %s: https://www.google.com/recaptcha/ */
672
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
672
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
673 673
 							'default' => '',
674 674
 							'type'    => 'text',
675 675
 						),
676 676
 						array(
677 677
 							'id'      => 'recaptcha_secret',
678
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
679
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
678
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
679
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
680 680
 							'default' => '',
681 681
 							'type'    => 'text',
682 682
 						),
683 683
 						array(
684
-							'name' => __( 'Data Control', 'give' ),
684
+							'name' => __('Data Control', 'give'),
685 685
 							'desc' => '',
686 686
 							'id'   => 'give_title_data_control_2',
687 687
 							'type' => 'give_title',
688 688
 						),
689 689
 						array(
690
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
691
-							'desc' => __( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
690
+							'name' => __('Remove All Data on Uninstall?', 'give'),
691
+							'desc' => __('When the plugin is deleted, completely remove all Give data.', 'give'),
692 692
 							'id'   => 'uninstall_on_delete',
693 693
 							'type' => 'checkbox',
694 694
 						),
695 695
 						array(
696
-							'name' => __( 'Filter Control', 'give' ),
696
+							'name' => __('Filter Control', 'give'),
697 697
 							'desc' => '',
698 698
 							'id'   => 'give_title_filter_control',
699 699
 							'type' => 'give_title',
700 700
 						),
701 701
 						array(
702 702
 							/* translators: %s: the_content */
703
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
703
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
704 704
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
705
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
705
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
706 706
 							'id'   => 'disable_the_content_filter',
707 707
 							'type' => 'checkbox',
708 708
 						),
709 709
 						array(
710
-							'name' => __( 'Script Loading', 'give' ),
710
+							'name' => __('Script Loading', 'give'),
711 711
 							'desc' => '',
712 712
 							'id'   => 'give_title_script_control',
713 713
 							'type' => 'give_title',
714 714
 						),
715 715
 						array(
716
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
717
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
716
+							'name' => __('Load Scripts in Footer?', 'give'),
717
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
718 718
 							'id'   => 'scripts_footer',
719 719
 							'type' => 'checkbox',
720 720
 						),
@@ -724,13 +724,13 @@  discard block
 block discarded – undo
724 724
 			/** API Settings */
725 725
 			'api'         => array(
726 726
 				'id'         => 'api',
727
-				'give_title' => __( 'API', 'give' ),
728
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
727
+				'give_title' => __('API', 'give'),
728
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
729 729
 				'show_names' => false, // Hide field names on the left
730
-				'fields'     => apply_filters( 'give_settings_system', array(
730
+				'fields'     => apply_filters('give_settings_system', array(
731 731
 						array(
732 732
 							'id'   => 'api',
733
-							'name' => __( 'API', 'give' ),
733
+							'name' => __('API', 'give'),
734 734
 							'type' => 'api',
735 735
 						),
736 736
 					)
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 			/** Licenses Settings */
740 740
 			'system_info' => array(
741 741
 				'id'         => 'system_info',
742
-				'give_title' => __( 'System Info', 'give' ),
743
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
744
-				'fields'     => apply_filters( 'give_settings_system', array(
742
+				'give_title' => __('System Info', 'give'),
743
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
744
+				'fields'     => apply_filters('give_settings_system', array(
745 745
 						array(
746 746
 							'id'   => 'system-info-textarea',
747
-							'name' => __( 'System Info', 'give' ),
748
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
747
+							'name' => __('System Info', 'give'),
748
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
749 749
 							'type' => 'system_info',
750 750
 						),
751 751
 					)
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 			),
754 754
 		);
755 755
 
756
-		$give_settings = apply_filters( 'give_registered_settings', $give_settings );
756
+		$give_settings = apply_filters('give_registered_settings', $give_settings);
757 757
 
758 758
 		// Return all settings array if no active tab
759
-		if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) {
759
+		if (empty($active_tab) || ! isset($give_settings[$active_tab])) {
760 760
 			return $give_settings;
761 761
 		}
762 762
 
763 763
 		// Add other tabs and settings fields as needed
764
-		return $give_settings[ $active_tab ];
764
+		return $give_settings[$active_tab];
765 765
 
766 766
 	}
767 767
 
@@ -770,11 +770,11 @@  discard block
 block discarded – undo
770 770
 	 */
771 771
 	public function settings_notices() {
772 772
 
773
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
773
+		if ( ! isset($_POST['give_settings_saved'])) {
774 774
 			return;
775 775
 		}
776 776
 
777
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
777
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
778 778
 
779 779
 	}
780 780
 
@@ -789,14 +789,14 @@  discard block
 block discarded – undo
789 789
 	 * @return mixed         Field value or exception is thrown.
790 790
 	 * @throws Exception     Throws an exception if the field is invalid.
791 791
 	 */
792
-	public function __get( $field ) {
792
+	public function __get($field) {
793 793
 
794 794
 		// Allowed fields to retrieve
795
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
795
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
796 796
 			return $this->{$field};
797 797
 		}
798 798
 
799
-		throw new Exception( sprintf( __( 'Invalid property: %s', 'give' ), $field ) );
799
+		throw new Exception(sprintf(__('Invalid property: %s', 'give'), $field));
800 800
 	}
801 801
 
802 802
 
@@ -815,12 +815,12 @@  discard block
 block discarded – undo
815 815
  *
816 816
  * @return mixed        Option value
817 817
  */
818
-function give_get_option( $key = '', $default = false ) {
818
+function give_get_option($key = '', $default = false) {
819 819
 	$give_options = give_get_settings();
820
-	$value        = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
821
-	$value        = apply_filters( 'give_get_option', $value, $key, $default );
820
+	$value        = ! empty($give_options[$key]) ? $give_options[$key] : $default;
821
+	$value        = apply_filters('give_get_option', $value, $key, $default);
822 822
 
823
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
823
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
824 824
 }
825 825
 
826 826
 
@@ -838,33 +838,33 @@  discard block
 block discarded – undo
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
841
-function give_update_option( $key = '', $value = false ) {
841
+function give_update_option($key = '', $value = false) {
842 842
 
843 843
 	// If no key, exit
844
-	if ( empty( $key ) ) {
844
+	if (empty($key)) {
845 845
 		return false;
846 846
 	}
847 847
 
848
-	if ( empty( $value ) ) {
849
-		$remove_option = give_delete_option( $key );
848
+	if (empty($value)) {
849
+		$remove_option = give_delete_option($key);
850 850
 
851 851
 		return $remove_option;
852 852
 	}
853 853
 
854 854
 	// First let's grab the current settings
855
-	$options = get_option( 'give_settings' );
855
+	$options = get_option('give_settings');
856 856
 
857 857
 	// Let's let devs alter that value coming in
858
-	$value = apply_filters( 'give_update_option', $value, $key );
858
+	$value = apply_filters('give_update_option', $value, $key);
859 859
 
860 860
 	// Next let's try to update the value
861
-	$options[ $key ] = $value;
862
-	$did_update      = update_option( 'give_settings', $options );
861
+	$options[$key] = $value;
862
+	$did_update      = update_option('give_settings', $options);
863 863
 
864 864
 	// If it updated, let's update the global variable
865
-	if ( $did_update ) {
865
+	if ($did_update) {
866 866
 		global $give_options;
867
-		$give_options[ $key ] = $value;
867
+		$give_options[$key] = $value;
868 868
 	}
869 869
 
870 870
 	return $did_update;
@@ -883,25 +883,25 @@  discard block
 block discarded – undo
883 883
  *
884 884
  * @return boolean True if updated, false if not.
885 885
  */
886
-function give_delete_option( $key = '' ) {
886
+function give_delete_option($key = '') {
887 887
 
888 888
 	// If no key, exit
889
-	if ( empty( $key ) ) {
889
+	if (empty($key)) {
890 890
 		return false;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Next let's try to update the value
897
-	if ( isset( $options[ $key ] ) ) {
898
-		unset( $options[ $key ] );
897
+	if (isset($options[$key])) {
898
+		unset($options[$key]);
899 899
 	}
900 900
 
901
-	$did_update = update_option( 'give_settings', $options );
901
+	$did_update = update_option('give_settings', $options);
902 902
 
903 903
 	// If it updated, let's update the global variable
904
-	if ( $did_update ) {
904
+	if ($did_update) {
905 905
 		global $give_options;
906 906
 		$give_options = $options;
907 907
 	}
@@ -920,9 +920,9 @@  discard block
 block discarded – undo
920 920
  */
921 921
 function give_get_settings() {
922 922
 
923
-	$settings = get_option( 'give_settings' );
923
+	$settings = get_option('give_settings');
924 924
 
925
-	return (array) apply_filters( 'give_get_settings', $settings );
925
+	return (array) apply_filters('give_get_settings', $settings);
926 926
 
927 927
 }
928 928
 
@@ -940,25 +940,25 @@  discard block
 block discarded – undo
940 940
  *
941 941
  * @return array
942 942
  */
943
-function give_settings_array_insert( $array, $position, $insert ) {
944
-	if ( is_int( $position ) ) {
945
-		array_splice( $array, $position, 0, $insert );
943
+function give_settings_array_insert($array, $position, $insert) {
944
+	if (is_int($position)) {
945
+		array_splice($array, $position, 0, $insert);
946 946
 	} else {
947 947
 
948
-		foreach ( $array as $index => $subarray ) {
949
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
948
+		foreach ($array as $index => $subarray) {
949
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
950 950
 				$pos = $index;
951 951
 			}
952 952
 		}
953 953
 
954
-		if ( ! isset( $pos ) ) {
954
+		if ( ! isset($pos)) {
955 955
 			return $array;
956 956
 		}
957 957
 
958 958
 		$array = array_merge(
959
-			array_slice( $array, 0, $pos ),
959
+			array_slice($array, 0, $pos),
960 960
 			$insert,
961
-			array_slice( $array, $pos )
961
+			array_slice($array, $pos)
962 962
 		);
963 963
 	}
964 964
 
@@ -978,23 +978,23 @@  discard block
 block discarded – undo
978 978
  *
979 979
  * @return void
980 980
  */
981
-function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) {
981
+function give_enabled_gateways_callback($field_arr, $saved_values = array()) {
982 982
 
983 983
 	$id       = $field_arr['id'];
984
-	$gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() );
984
+	$gateways = give_get_ordered_payment_gateways(give_get_payment_gateways());
985 985
 
986 986
 	echo '<ul class="give-checklist-fields give-payment-gatways-list">';
987 987
 
988
-	foreach ( $gateways as $key => $option ) :
988
+	foreach ($gateways as $key => $option) :
989 989
 
990
-		if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) {
990
+		if (is_array($saved_values) && array_key_exists($key, $saved_values)) {
991 991
 			$enabled = '1';
992 992
 		} else {
993 993
 			$enabled = null;
994 994
 		}
995 995
 
996
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
997
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
996
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
997
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
998 998
 
999 999
 	endforeach;
1000 1000
 
@@ -1013,16 +1013,16 @@  discard block
 block discarded – undo
1013 1013
  *
1014 1014
  * @return void
1015 1015
  */
1016
-function give_default_gateway_callback( $field_arr, $saved_value ) {
1016
+function give_default_gateway_callback($field_arr, $saved_value) {
1017 1017
 	$id          = $field_arr['id'];
1018 1018
 	$gateways    = give_get_enabled_payment_gateways();
1019
-	$saved_value = give_get_default_gateway( null );
1019
+	$saved_value = give_get_default_gateway(null);
1020 1020
 
1021
-	echo '<select class="give-select" name="' . $id . '" id="' . $id . '">';
1021
+	echo '<select class="give-select" name="'.$id.'" id="'.$id.'">';
1022 1022
 
1023
-	foreach ( $gateways as $key => $option ) :
1024
-		$selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : '';
1025
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1023
+	foreach ($gateways as $key => $option) :
1024
+		$selected = isset($saved_value) ? selected($key, $saved_value, false) : '';
1025
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1026 1026
 	endforeach;
1027 1027
 
1028 1028
 	echo '</select>';
@@ -1040,13 +1040,13 @@  discard block
 block discarded – undo
1040 1040
  *
1041 1041
  * @return void
1042 1042
  */
1043
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1043
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1044 1044
 
1045 1045
 	$id                = $field_type_object->field->args['id'];
1046 1046
 	$title             = $field_type_object->field->args['name'];
1047 1047
 	$field_description = $field_type_object->field->args['desc'];
1048 1048
 
1049
-	echo '<hr>' . $field_description;
1049
+	echo '<hr>'.$field_description;
1050 1050
 
1051 1051
 }
1052 1052
 
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
  *
1062 1062
  * @return void
1063 1063
  */
1064
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1064
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1065 1065
 
1066 1066
 	$id                = $field_type_object->field->args['id'];
1067 1067
 	$title             = $field_type_object->field->args['name'];
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1081 1081
  * @return array An array of options that matches the CMB2 options array
1082 1082
  */
1083
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1083
+function give_cmb2_get_post_options($query_args, $force = false) {
1084 1084
 
1085
-	$post_options = array( '' => '' ); // Blank option
1085
+	$post_options = array('' => ''); // Blank option
1086 1086
 
1087
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1087
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1088 1088
 		return $post_options;
1089 1089
 	}
1090 1090
 
1091
-	$args = wp_parse_args( $query_args, array(
1091
+	$args = wp_parse_args($query_args, array(
1092 1092
 		'post_type'   => 'page',
1093 1093
 		'numberposts' => 10,
1094
-	) );
1094
+	));
1095 1095
 
1096
-	$posts = get_posts( $args );
1096
+	$posts = get_posts($args);
1097 1097
 
1098
-	if ( $posts ) {
1099
-		foreach ( $posts as $post ) {
1098
+	if ($posts) {
1099
+		foreach ($posts as $post) {
1100 1100
 
1101
-			$post_options[ $post->ID ] = $post->post_title;
1101
+			$post_options[$post->ID] = $post->post_title;
1102 1102
 
1103 1103
 		}
1104 1104
 	}
@@ -1123,33 +1123,33 @@  discard block
 block discarded – undo
1123 1123
 
1124 1124
 	$sizes     = array();
1125 1125
 	$get_sizes = get_intermediate_image_sizes();
1126
-	$core_image_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1126
+	$core_image_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1127 1127
 
1128 1128
 
1129 1129
 	// This will help us to filter special characters from a string
1130
-	$filter_slug_items = array( '_', '-' );
1130
+	$filter_slug_items = array('_', '-');
1131 1131
 
1132
-	foreach ( $get_sizes as $_size ) {
1132
+	foreach ($get_sizes as $_size) {
1133 1133
 
1134 1134
 		// Converting image size slug to title case
1135
-		$sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items );
1135
+		$sizes[$_size] = give_slug_to_title($_size, $filter_slug_items);
1136 1136
 
1137
-		if ( in_array( $_size, $core_image_sizes ) ) {
1138
-			$sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1139
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1140
-			$sizes[ $_size ] .= " ({$_wp_additional_image_sizes[ $_size ]['width']} x {$_wp_additional_image_sizes[ $_size ]['height']}";
1137
+		if (in_array($_size, $core_image_sizes)) {
1138
+			$sizes[$_size] .= ' ('.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1139
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1140
+			$sizes[$_size] .= " ({$_wp_additional_image_sizes[$_size]['width']} x {$_wp_additional_image_sizes[$_size]['height']}";
1141 1141
 		}
1142 1142
 
1143 1143
 		// Based on the above image height check, label the respective resolution as responsive
1144
-		if ( ( array_key_exists( $_size, $_wp_additional_image_sizes ) && ! $_wp_additional_image_sizes[ $_size ]['crop'] ) || ( in_array( $_size, $core_image_sizes ) && ! get_option( "{$_size}_crop" ) ) ) {
1145
-			$sizes[ $_size ] .= ' - responsive';
1144
+		if ((array_key_exists($_size, $_wp_additional_image_sizes) && ! $_wp_additional_image_sizes[$_size]['crop']) || (in_array($_size, $core_image_sizes) && ! get_option("{$_size}_crop"))) {
1145
+			$sizes[$_size] .= ' - responsive';
1146 1146
 		}
1147 1147
 
1148
-		$sizes[ $_size ] .= ')';
1148
+		$sizes[$_size] .= ')';
1149 1149
 
1150 1150
 	}
1151 1151
 
1152
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1152
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1153 1153
 }
1154 1154
 
1155 1155
 
@@ -1165,14 +1165,14 @@  discard block
 block discarded – undo
1165 1165
  *
1166 1166
  *  @return text $string
1167 1167
  */
1168
-function give_slug_to_title( $string, $filters = array() ){
1168
+function give_slug_to_title($string, $filters = array()) {
1169 1169
 
1170
-    foreach( $filters as $filter_item ){
1171
-        $string = str_replace( $filter_item, ' ', $string );
1170
+    foreach ($filters as $filter_item) {
1171
+        $string = str_replace($filter_item, ' ', $string);
1172 1172
     }
1173 1173
 
1174 1174
     // Return updated string after converting it to title case
1175
-    return ucwords( $string );
1175
+    return ucwords($string);
1176 1176
 
1177 1177
 }
1178 1178
 
@@ -1188,18 +1188,18 @@  discard block
 block discarded – undo
1188 1188
  *
1189 1189
  * @return void
1190 1190
  */
1191
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1191
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1192 1192
 	/* @var CMB2_Types $field_type_object */
1193 1193
 
1194 1194
 	$id                 = $field_type_object->field->args['id'];
1195 1195
 	$field_description  = $field_type_object->field->args['desc'];
1196 1196
 	$license            = $field_type_object->field->args['options']['license'];
1197 1197
 	$license_key        = $escaped_value;
1198
-	$is_license_key     = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1199
-	$is_valid_license   = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1198
+	$is_license_key     = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1199
+	$is_valid_license   = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1200 1200
 	$shortname          = $field_type_object->field->args['options']['shortname'];
1201 1201
 	$field_classes      = 'regular-text give-license-field';
1202
-	$type               = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1202
+	$type               = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1203 1203
 	$custom_html        = '';
1204 1204
 	$messages           = array();
1205 1205
 	$class              = '';
@@ -1211,145 +1211,145 @@  discard block
 block discarded – undo
1211 1211
 
1212 1212
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1213 1213
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1214
-	if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1214
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1215 1215
 		$is_license_key = false;
1216 1216
 	}
1217 1217
 
1218 1218
 	// Check if current license is part of subscription or not.
1219
-	$subscriptions = get_option( 'give_subscriptions' );
1219
+	$subscriptions = get_option('give_subscriptions');
1220 1220
 
1221
-	if ( $is_license_key && $subscriptions ) {
1222
-		foreach ( $subscriptions as $subscription ) {
1223
-			if ( in_array( $license_key, $subscription['licenses'] ) ) {
1221
+	if ($is_license_key && $subscriptions) {
1222
+		foreach ($subscriptions as $subscription) {
1223
+			if (in_array($license_key, $subscription['licenses'])) {
1224 1224
 				$is_in_subscription = $subscription['id'];
1225 1225
 				break;
1226 1226
 			}
1227 1227
 		}
1228 1228
 	}
1229 1229
 
1230
-	if ( $is_license_key ) {
1231
-		if ( $is_in_subscription ) {
1232
-			$subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] );
1233
-			$subscription_status  = __( 'renew', 'give' );
1230
+	if ($is_license_key) {
1231
+		if ($is_in_subscription) {
1232
+			$subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1233
+			$subscription_status  = __('renew', 'give');
1234 1234
 
1235
-			if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) {
1236
-				$subscription_status = __( 'expire', 'give' );
1235
+			if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1236
+				$subscription_status = __('expire', 'give');
1237 1237
 			}
1238 1238
 
1239
-			if ( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1240
-				$messages[]     = sprintf(
1241
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1242
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1243
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1244
-					$checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1239
+			if ($subscription_expires < current_time('timestamp', 1)) {
1240
+				$messages[] = sprintf(
1241
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1242
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1243
+					$subscriptions[$is_in_subscription]['payment_id'],
1244
+					$checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1245 1245
 				);
1246 1246
 				$license_status = 'license-expired';
1247
-			} elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1247
+			} elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1248 1248
 				$messages[]     = sprintf(
1249
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ),
1250
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1251
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1249
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'),
1250
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1251
+					$subscriptions[$is_in_subscription]['payment_id'],
1252 1252
 					$subscription_status,
1253
-					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) )
1253
+					human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1254 1254
 				);
1255 1255
 				$license_status = 'license-expires-soon';
1256 1256
 			} else {
1257 1257
 				$messages[]     = sprintf(
1258
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ),
1259
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1260
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1258
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'),
1259
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1260
+					$subscriptions[$is_in_subscription]['payment_id'],
1261 1261
 					$subscription_status,
1262
-					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) )
1262
+					date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1263 1263
 				);
1264 1264
 				$license_status = 'license-expiration-date';
1265 1265
 			}
1266
-		} elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1266
+		} elseif (empty($license->success) && property_exists($license, 'error')) {
1267 1267
 
1268 1268
 			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1269
-			switch ( $license->error ) {
1269
+			switch ($license->error) {
1270 1270
 				case 'expired' :
1271 1271
 					$class          = $license->error;
1272 1272
 					$messages[]     = sprintf(
1273
-						__( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1274
-						date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1275
-						$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1273
+						__('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'),
1274
+						date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1275
+						$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1276 1276
 					);
1277
-					$license_status = 'license-' . $class;
1277
+					$license_status = 'license-'.$class;
1278 1278
 					break;
1279 1279
 
1280 1280
 				case 'missing' :
1281 1281
 					$class          = $license->error;
1282 1282
 					$messages[]     = sprintf(
1283
-						__( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1284
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1283
+						__('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'),
1284
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1285 1285
 					);
1286
-					$license_status = 'license-' . $class;
1286
+					$license_status = 'license-'.$class;
1287 1287
 					break;
1288 1288
 
1289 1289
 				case 'invalid' :
1290 1290
 					$class          = $license->error;
1291 1291
 					$messages[]     = sprintf(
1292
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1292
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1293 1293
 						$addon_name,
1294
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1294
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1295 1295
 					);
1296
-					$license_status = 'license-' . $class;
1296
+					$license_status = 'license-'.$class;
1297 1297
 					break;
1298 1298
 
1299 1299
 				case 'site_inactive' :
1300 1300
 					$class          = $license->error;
1301 1301
 					$messages[]     = sprintf(
1302
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1302
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1303 1303
 						$addon_name,
1304
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1304
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1305 1305
 					);
1306
-					$license_status = 'license-' . $class;
1306
+					$license_status = 'license-'.$class;
1307 1307
 					break;
1308 1308
 
1309 1309
 				case 'item_name_mismatch' :
1310 1310
 					$class          = $license->error;
1311
-					$messages[]     = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name );
1312
-					$license_status = 'license-' . $class;
1311
+					$messages[]     = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name);
1312
+					$license_status = 'license-'.$class;
1313 1313
 					break;
1314 1314
 
1315 1315
 				case 'no_activations_left':
1316 1316
 					$class          = $license->error;
1317
-					$messages[]     = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1318
-					$license_status = 'license-' . $class;
1317
+					$messages[]     = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1318
+					$license_status = 'license-'.$class;
1319 1319
 					break;
1320 1320
 			}
1321 1321
 
1322
-		} elseif ( empty( $license->success ) ){
1322
+		} elseif (empty($license->success)) {
1323 1323
 			$class          = 'invalid';
1324 1324
 			$messages[]     = sprintf(
1325
-				__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1325
+				__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1326 1326
 				$addon_name,
1327
-				$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1327
+				$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1328 1328
 			);
1329
-			$license_status = 'license-' . $class;
1329
+			$license_status = 'license-'.$class;
1330 1330
 
1331
-		}else {
1332
-			switch ( $license->license ) {
1331
+		} else {
1332
+			switch ($license->license) {
1333 1333
 				case 'valid' :
1334 1334
 				default:
1335 1335
 					$class      = 'valid';
1336
-					$now        = current_time( 'timestamp' );
1337
-					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1336
+					$now        = current_time('timestamp');
1337
+					$expiration = strtotime($license->expires, current_time('timestamp'));
1338 1338
 
1339
-					if ( 'lifetime' === $license->expires ) {
1340
-						$messages[]     = __( 'License key never expires.', 'give' );
1339
+					if ('lifetime' === $license->expires) {
1340
+						$messages[]     = __('License key never expires.', 'give');
1341 1341
 						$license_status = 'license-lifetime-notice';
1342
-					} elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1342
+					} elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1343 1343
 						$messages[]     = sprintf(
1344
-							__( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1345
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1346
-							$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1344
+							__('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1345
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1346
+							$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1347 1347
 						);
1348 1348
 						$license_status = 'license-expires-soon';
1349 1349
 					} else {
1350 1350
 						$messages[]     = sprintf(
1351
-							__( 'Your license key expires on %s.', 'give' ),
1352
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1351
+							__('Your license key expires on %s.', 'give'),
1352
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1353 1353
 						);
1354 1354
 						$license_status = 'license-expiration-date';
1355 1355
 					}
@@ -1357,15 +1357,15 @@  discard block
 block discarded – undo
1357 1357
 			}
1358 1358
 		}
1359 1359
 	} else {
1360
-		$messages[]     = sprintf(
1361
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1360
+		$messages[] = sprintf(
1361
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1362 1362
 			$addon_name
1363 1363
 		);
1364 1364
 		$license_status = 'inactive';
1365 1365
 	}
1366 1366
 
1367 1367
 	// Add class for input field if license is active.
1368
-	if ( $is_valid_license ) {
1368
+	if ($is_valid_license) {
1369 1369
 		$field_classes .= ' give-license-active';
1370 1370
 	}
1371 1371
 
@@ -1373,33 +1373,33 @@  discard block
 block discarded – undo
1373 1373
 	$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">";
1374 1374
 
1375 1375
 	// If license is active so show deactivate button.
1376
-	if ( $is_valid_license ) {
1376
+	if ($is_valid_license) {
1377 1377
 		// Get input field html.
1378 1378
 		$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">";
1379 1379
 
1380
-		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1380
+		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1381 1381
 
1382 1382
 	}
1383 1383
 
1384 1384
 	// Field description.
1385
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1385
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1386 1386
 
1387 1387
 	// If no messages found then inform user that to get updated in future register yourself.
1388
-	if ( empty( $messages ) ) {
1389
-		$messages[] = apply_filters( "{$shortname}_default_addon_notice", __( 'To receive updates, please enter your valid license key.', 'give' ) );
1388
+	if (empty($messages)) {
1389
+		$messages[] = apply_filters("{$shortname}_default_addon_notice", __('To receive updates, please enter your valid license key.', 'give'));
1390 1390
 	}
1391 1391
 
1392
-	foreach ( $messages as $message ) {
1393
-		$custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">';
1394
-		$custom_html .= '<p>' . $message . '</p>';
1392
+	foreach ($messages as $message) {
1393
+		$custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">';
1394
+		$custom_html .= '<p>'.$message.'</p>';
1395 1395
 		$custom_html .= '</div>';
1396 1396
 	}
1397 1397
 
1398 1398
 	// Field html.
1399
-	$custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object );
1399
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1400 1400
 
1401 1401
 	// Nonce.
1402
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1402
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1403 1403
 
1404 1404
 	// Print field html.
1405 1405
 	echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>";
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
  */
1415 1415
 function give_api_callback() {
1416 1416
 
1417
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1417
+	if ( ! current_user_can('manage_give_settings')) {
1418 1418
 		return;
1419 1419
 	}
1420 1420
 
@@ -1423,9 +1423,9 @@  discard block
 block discarded – undo
1423 1423
 	 *
1424 1424
 	 * @since 1.0
1425 1425
 	 */
1426
-	do_action( 'give_tools_api_keys_before' );
1426
+	do_action('give_tools_api_keys_before');
1427 1427
 
1428
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1428
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1429 1429
 
1430 1430
 	$api_keys_table = new Give_API_Keys_Table();
1431 1431
 	$api_keys_table->prepare_items();
@@ -1434,9 +1434,9 @@  discard block
 block discarded – undo
1434 1434
 	<span class="cmb2-metabox-description api-description">
1435 1435
 		<?php echo sprintf(
1436 1436
 			/* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */
1437
-			__( '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' ),
1438
-			esc_url( 'http://docs.givewp.com/api' ),
1439
-			esc_url( 'http://docs.givewp.com/addon-zapier' )
1437
+			__('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'),
1438
+			esc_url('http://docs.givewp.com/api'),
1439
+			esc_url('http://docs.givewp.com/addon-zapier')
1440 1440
 		); ?>
1441 1441
 	</span>
1442 1442
 	<?php
@@ -1446,10 +1446,10 @@  discard block
 block discarded – undo
1446 1446
 	 *
1447 1447
 	 * @since 1.0
1448 1448
 	 */
1449
-	do_action( 'give_tools_api_keys_after' );
1449
+	do_action('give_tools_api_keys_after');
1450 1450
 }
1451 1451
 
1452
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1452
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1453 1453
 
1454 1454
 /**
1455 1455
  * Hook Callback
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
  *
1463 1463
  * @return void
1464 1464
  */
1465
-function give_hook_callback( $args ) {
1465
+function give_hook_callback($args) {
1466 1466
 
1467 1467
 	$id = $args['id'];
1468 1468
 
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
 	 *
1472 1472
 	 * @since 1.0
1473 1473
 	 */
1474
-	do_action( "give_{$id}" );
1474
+	do_action("give_{$id}");
1475 1475
 
1476 1476
 }
1477 1477
 
@@ -1486,19 +1486,19 @@  discard block
 block discarded – undo
1486 1486
  *
1487 1487
  * @return bool
1488 1488
  */
1489
-function give_is_setting_enabled( $value, $compare_with = null ) {
1490
-	if ( ! is_null( $compare_with ) ) {
1489
+function give_is_setting_enabled($value, $compare_with = null) {
1490
+	if ( ! is_null($compare_with)) {
1491 1491
 
1492
-		if ( is_array( $compare_with ) ) {
1492
+		if (is_array($compare_with)) {
1493 1493
 			// Output.
1494
-			return in_array( $value, $compare_with );
1494
+			return in_array($value, $compare_with);
1495 1495
 		}
1496 1496
 
1497 1497
 		// Output.
1498
-		return ( $value === $compare_with );
1498
+		return ($value === $compare_with);
1499 1499
 	}
1500 1500
 
1501 1501
 	// Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled
1502 1502
 	// Output.
1503
-	return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false );
1503
+	return (in_array($value, array('enabled', 'on', 'yes')) ? true : false);
1504 1504
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1328,7 +1328,7 @@
 block discarded – undo
1328 1328
 			);
1329 1329
 			$license_status = 'license-' . $class;
1330 1330
 
1331
-		}else {
1331
+		} else {
1332 1332
 			switch ( $license->license ) {
1333 1333
 				case 'valid' :
1334 1334
 				default:
Please login to merge, or discard this patch.
includes/admin/tools/logs/class-api-requests-logs-list-table.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
 	 *
158 158
 	 * @access public
159 159
 	 * @since  1.0
160
-	 * @return string|bool String if search is present, false otherwise
160
+	 * @return string|false String if search is present, false otherwise
161 161
 	 */
162 162
 	public function get_search() {
163 163
 		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		global $status, $page;
46 46
 
47 47
 		// Set parent defaults
48
-		parent::__construct( array(
49
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
50
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
51
-			'ajax'     => false,// Does this table support ajax?
52
-		) );
48
+		parent::__construct(array(
49
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
50
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
51
+			'ajax'     => false, // Does this table support ajax?
52
+		));
53 53
 	}
54 54
 
55 55
 	/**
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return void
65 65
 	 */
66
-	public function search_box( $text, $input_id ) {
67
-		$input_id = $input_id . '-search-input';
66
+	public function search_box($text, $input_id) {
67
+		$input_id = $input_id.'-search-input';
68 68
 
69
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
70
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
69
+		if ( ! empty($_REQUEST['orderby'])) {
70
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
71 71
 		}
72
-		if ( ! empty( $_REQUEST['order'] ) ) {
73
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
72
+		if ( ! empty($_REQUEST['order'])) {
73
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
74 74
 		}
75 75
 		?>
76 76
 		<p class="search-box" role="search">
77 77
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
78 78
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
79
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?>
79
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?>
80 80
 		</p>
81 81
 		<?php
82 82
 	}
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function get_columns() {
92 92
 		$columns = array(
93
-			'ID'      => esc_html__( 'Log ID', 'give' ),
94
-			'details' => esc_html__( 'Request Details', 'give' ),
95
-			'ip'      => esc_html__( 'Request IP', 'give' ),
96
-			'date'    => esc_html__( 'Date', 'give' ),
93
+			'ID'      => esc_html__('Log ID', 'give'),
94
+			'details' => esc_html__('Request Details', 'give'),
95
+			'ip'      => esc_html__('Request IP', 'give'),
96
+			'date'    => esc_html__('Date', 'give'),
97 97
 		);
98 98
 
99 99
 		return $columns;
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string Column Name
112 112
 	 */
113
-	public function column_default( $item, $column_name ) {
114
-		switch ( $column_name ) {
113
+	public function column_default($item, $column_name) {
114
+		switch ($column_name) {
115 115
 			default:
116
-				return $item[ $column_name ];
116
+				return $item[$column_name];
117 117
 		}
118 118
 	}
119 119
 
@@ -127,26 +127,26 @@  discard block
 block discarded – undo
127 127
 	 *
128 128
 	 * @return void
129 129
 	 */
130
-	public function column_details( $item ) {
130
+	public function column_details($item) {
131 131
 		?>
132
-		<a href="#TB_inline?width=640&amp;inlineId=log-details-<?php echo $item['ID']; ?>" class="thickbox"><?php esc_html_e( 'View Request', 'give' ); ?></a>
132
+		<a href="#TB_inline?width=640&amp;inlineId=log-details-<?php echo $item['ID']; ?>" class="thickbox"><?php esc_html_e('View Request', 'give'); ?></a>
133 133
 		<div id="log-details-<?php echo $item['ID']; ?>" style="display:none;">
134 134
 			<?php
135 135
 
136
-			$request = get_post_field( 'post_excerpt', $item['ID'] );
137
-			$error   = get_post_field( 'post_content', $item['ID'] );
138
-			echo '<p><strong>' . esc_html__( 'API Request:', 'give' ) . '</strong></p>';
139
-			echo '<div>' . $request . '</div>';
140
-			if ( ! empty( $error ) ) {
141
-				echo '<p><strong>' . esc_html__( 'Error', 'give' ) . '</strong></p>';
142
-				echo '<div>' . esc_html( $error ) . '</div>';
136
+			$request = get_post_field('post_excerpt', $item['ID']);
137
+			$error   = get_post_field('post_content', $item['ID']);
138
+			echo '<p><strong>'.esc_html__('API Request:', 'give').'</strong></p>';
139
+			echo '<div>'.$request.'</div>';
140
+			if ( ! empty($error)) {
141
+				echo '<p><strong>'.esc_html__('Error', 'give').'</strong></p>';
142
+				echo '<div>'.esc_html($error).'</div>';
143 143
 			}
144
-			echo '<p><strong>' . esc_html__( 'API User:', 'give' ) . '</strong></p>';
145
-			echo '<div>' . give_get_meta( $item['ID'], '_give_log_user', true ) . '</div>';
146
-			echo '<p><strong>' . esc_html__( 'API Key:', 'give' ) . '</strong></p>';
147
-			echo '<div>' . give_get_meta( $item['ID'], '_give_log_key', true ) . '</div>';
148
-			echo '<p><strong>' . esc_html__( 'Request Date:', 'give' ) . '</strong></p>';
149
-			echo '<div>' . get_post_field( 'post_date', $item['ID'] ) . '</div>';
144
+			echo '<p><strong>'.esc_html__('API User:', 'give').'</strong></p>';
145
+			echo '<div>'.give_get_meta($item['ID'], '_give_log_user', true).'</div>';
146
+			echo '<p><strong>'.esc_html__('API Key:', 'give').'</strong></p>';
147
+			echo '<div>'.give_get_meta($item['ID'], '_give_log_key', true).'</div>';
148
+			echo '<p><strong>'.esc_html__('Request Date:', 'give').'</strong></p>';
149
+			echo '<div>'.get_post_field('post_date', $item['ID']).'</div>';
150 150
 			?>
151 151
 		</div>
152 152
 		<?php
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @return string|bool String if search is present, false otherwise
161 161
 	 */
162 162
 	public function get_search() {
163
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
163
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
164 164
 	}
165 165
 
166 166
 
@@ -176,19 +176,19 @@  discard block
 block discarded – undo
176 176
 	 *
177 177
 	 * @param string $which
178 178
 	 */
179
-	protected function display_tablenav( $which ) {
180
-		if ( 'top' === $which ) {
181
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
179
+	protected function display_tablenav($which) {
180
+		if ('top' === $which) {
181
+			wp_nonce_field('bulk-'.$this->_args['plural']);
182 182
 		}
183 183
 		?>
184
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
184
+		<div class="tablenav <?php echo esc_attr($which); ?>">
185 185
 
186 186
 			<div class="alignleft actions bulkactions">
187
-				<?php $this->bulk_actions( $which ); ?>
187
+				<?php $this->bulk_actions($which); ?>
188 188
 			</div>
189 189
 			<?php
190
-			$this->extra_tablenav( $which );
191
-			$this->pagination( $which );
190
+			$this->extra_tablenav($which);
191
+			$this->pagination($which);
192 192
 			?>
193 193
 
194 194
 			<br class="clear"/>
@@ -210,31 +210,31 @@  discard block
 block discarded – undo
210 210
 
211 211
 		$search = $this->get_search();
212 212
 
213
-		if ( $search ) {
214
-			if ( filter_var( $search, FILTER_VALIDATE_IP ) ) {
213
+		if ($search) {
214
+			if (filter_var($search, FILTER_VALIDATE_IP)) {
215 215
 				// This is an IP address search
216 216
 				$key = '_give_log_request_ip';
217
-			} elseif ( is_email( $search ) ) {
217
+			} elseif (is_email($search)) {
218 218
 				// This is an email search
219
-				$userdata = get_user_by( 'email', $search );
219
+				$userdata = get_user_by('email', $search);
220 220
 
221
-				if ( $userdata ) {
221
+				if ($userdata) {
222 222
 					$search = $userdata->ID;
223 223
 				}
224 224
 
225 225
 				$key = '_give_log_user';
226
-			} elseif ( strlen( $search ) == 32 ) {
226
+			} elseif (strlen($search) == 32) {
227 227
 				// Look for an API key
228 228
 				$key = '_give_log_key';
229
-			} elseif ( stristr( $search, 'token:' ) ) {
229
+			} elseif (stristr($search, 'token:')) {
230 230
 				// Look for an API token
231
-				$search = str_ireplace( 'token:', '', $search );
231
+				$search = str_ireplace('token:', '', $search);
232 232
 				$key    = '_give_log_token';
233 233
 			} else {
234 234
 				// This is (probably) a user ID search
235
-				$userdata = get_userdata( $search );
235
+				$userdata = get_userdata($search);
236 236
 
237
-				if ( $userdata ) {
237
+				if ($userdata) {
238 238
 					$search = $userdata->ID;
239 239
 				}
240 240
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	 * @return int Current page number
261 261
 	 */
262 262
 	public function get_paged() {
263
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
263
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
264 264
 	}
265 265
 
266 266
 	/**
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	 * @since  1.0
271 271
 	 * @return void
272 272
 	 */
273
-	function bulk_actions( $which = '' ) {
273
+	function bulk_actions($which = '') {
274 274
 		give_log_views();
275 275
 	}
276 276
 
@@ -294,14 +294,14 @@  discard block
 block discarded – undo
294 294
 			'posts_per_page' => $this->per_page,
295 295
 		);
296 296
 
297
-		$logs = $give_logs->get_connected_logs( $log_query );
297
+		$logs = $give_logs->get_connected_logs($log_query);
298 298
 
299
-		if ( $logs ) {
300
-			foreach ( $logs as $log ) {
299
+		if ($logs) {
300
+			foreach ($logs as $log) {
301 301
 
302 302
 				$logs_data[] = array(
303 303
 					'ID'   => $log->ID,
304
-					'ip'   => give_get_meta( $log->ID, '_give_log_request_ip', true ),
304
+					'ip'   => give_get_meta($log->ID, '_give_log_request_ip', true),
305 305
 					'date' => $log->post_date,
306 306
 				);
307 307
 			}
@@ -329,14 +329,14 @@  discard block
 block discarded – undo
329 329
 		$columns               = $this->get_columns();
330 330
 		$hidden                = array(); // No hidden columns
331 331
 		$sortable              = $this->get_sortable_columns();
332
-		$this->_column_headers = array( $columns, $hidden, $sortable );
332
+		$this->_column_headers = array($columns, $hidden, $sortable);
333 333
 		$this->items           = $this->get_logs();
334
-		$total_items           = $give_logs->get_log_count( 0, 'api_request' );
334
+		$total_items           = $give_logs->get_log_count(0, 'api_request');
335 335
 
336
-		$this->set_pagination_args( array(
336
+		$this->set_pagination_args(array(
337 337
 				'total_items' => $total_items,
338 338
 				'per_page'    => $this->per_page,
339
-				'total_pages' => ceil( $total_items / $this->per_page ),
339
+				'total_pages' => ceil($total_items / $this->per_page),
340 340
 			)
341 341
 		);
342 342
 	}
Please login to merge, or discard this patch.
includes/admin/tools/logs/class-sales-logs-list-table.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
 	 *
158 158
 	 * @access public
159 159
 	 * @since  1.0
160
-	 * @return string|bool string If search is present, false otherwise
160
+	 * @return string|false string If search is present, false otherwise
161 161
 	 */
162 162
 	public function get_search() {
163 163
 		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
Please login to merge, or discard this patch.
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Exit if accessed directly.
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
16 16
 // Load WP_List_Table if not loaded.
17
-if ( ! class_exists( 'WP_List_Table' ) ) {
18
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
17
+if ( ! class_exists('WP_List_Table')) {
18
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
19 19
 }
20 20
 
21 21
 /**
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 		global $status, $page;
45 45
 
46 46
 		// Set parent defaults
47
-		parent::__construct( array(
48
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
49
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
50
-			'ajax'     => false,// Does this table support ajax?
51
-		) );
47
+		parent::__construct(array(
48
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
49
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
50
+			'ajax'     => false, // Does this table support ajax?
51
+		));
52 52
 
53
-		add_action( 'give_log_view_actions', array( $this, 'give_forms_filter' ) );
53
+		add_action('give_log_view_actions', array($this, 'give_forms_filter'));
54 54
 	}
55 55
 
56 56
 	/**
@@ -64,39 +64,39 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return string Column Name
66 66
 	 */
67
-	public function column_default( $item, $column_name ) {
67
+	public function column_default($item, $column_name) {
68 68
 
69
-		$payment = give_get_payment_by( 'id', $item['payment_id'] );
69
+		$payment = give_get_payment_by('id', $item['payment_id']);
70 70
 
71
-		switch ( $column_name ) {
71
+		switch ($column_name) {
72 72
 			case 'form' :
73
-				$form_title = get_the_title( $item[ $column_name ] );
74
-				$form_title = empty( $form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $item[ $column_name ] ) : $form_title;
75
-				return '<a href="' . esc_url( add_query_arg( 'form', $item[ $column_name ] ) ) . '" >' . $form_title . '</a>';
73
+				$form_title = get_the_title($item[$column_name]);
74
+				$form_title = empty($form_title) ? sprintf(__('Untitled (#%s)', 'give'), $item[$column_name]) : $form_title;
75
+				return '<a href="'.esc_url(add_query_arg('form', $item[$column_name])).'" >'.$form_title.'</a>';
76 76
 
77 77
 			case 'user_id' :
78
-				return '<a href="' .
79
-					   admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . ( ! empty( $item['user_id'] ) ? urlencode( $item['user_id'] ) : give_get_payment_user_email( $item['payment_id'] ) ) ) .
80
-					   '">' . $item['user_name'] . '</a>';
78
+				return '<a href="'.
79
+					   admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.( ! empty($item['user_id']) ? urlencode($item['user_id']) : give_get_payment_user_email($item['payment_id']))).
80
+					   '">'.$item['user_name'].'</a>';
81 81
 
82 82
 			case 'amount' :
83
-				return give_currency_filter( give_format_amount( $item['amount'], array( 'sanitize' => false ) ) );
83
+				return give_currency_filter(give_format_amount($item['amount'], array('sanitize' => false)));
84 84
 
85 85
 			case 'status' :
86 86
 
87
-				$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
87
+				$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
88 88
 
89
-				if ( $payment->mode == 'test' ) {
90
-					$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . __( 'Test', 'give' ) . '</span>';
89
+				if ($payment->mode == 'test') {
90
+					$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.__('Test', 'give').'</span>';
91 91
 				}
92 92
 
93 93
 				return $value;
94 94
 
95 95
 			case 'payment_id' :
96
-				return '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $item['payment_id'] ) . '">' . give_get_payment_number( $item['payment_id'] ) . '</a>';
96
+				return '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$item['payment_id']).'">'.give_get_payment_number($item['payment_id']).'</a>';
97 97
 
98 98
 			default:
99
-				return $item[ $column_name ];
99
+				return $item[$column_name];
100 100
 		}
101 101
 	}
102 102
 
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function get_columns() {
111 111
 		$columns = array(
112
-			'ID'         => __( 'Log ID', 'give' ),
113
-			'user_id'    => __( 'Donor', 'give' ),
114
-			'form'       => __( 'Form', 'give' ),
115
-			'amount'     => __( 'Donation Amount', 'give' ),
116
-			'status'     => __( 'Status', 'give' ),
117
-			'payment_id' => __( 'Donation ID', 'give' ),
118
-			'date'       => __( 'Date', 'give' ),
112
+			'ID'         => __('Log ID', 'give'),
113
+			'user_id'    => __('Donor', 'give'),
114
+			'form'       => __('Form', 'give'),
115
+			'amount'     => __('Donation Amount', 'give'),
116
+			'status'     => __('Status', 'give'),
117
+			'payment_id' => __('Donation ID', 'give'),
118
+			'date'       => __('Date', 'give'),
119 119
 		);
120 120
 
121 121
 		return $columns;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 * @return int Current page number
130 130
 	 */
131 131
 	public function get_paged() {
132
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
132
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
133 133
 	}
134 134
 
135 135
 	/**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @return mixed int If User ID, string If Email/Login
141 141
 	 */
142 142
 	public function get_filtered_user() {
143
-		return isset( $_GET['user'] ) ? absint( $_GET['user'] ) : false;
143
+		return isset($_GET['user']) ? absint($_GET['user']) : false;
144 144
 	}
145 145
 
146 146
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * @return int Download ID
152 152
 	 */
153 153
 	public function get_filtered_give_form() {
154
-		return ! empty( $_GET['form'] ) ? absint( $_GET['form'] ) : false;
154
+		return ! empty($_GET['form']) ? absint($_GET['form']) : false;
155 155
 	}
156 156
 
157 157
 	/**
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 * @return string|bool string If search is present, false otherwise
163 163
 	 */
164 164
 	public function get_search() {
165
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
165
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
166 166
 	}
167 167
 
168 168
 
@@ -178,20 +178,20 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @param string $which
180 180
 	 */
181
-	protected function display_tablenav( $which ) {
181
+	protected function display_tablenav($which) {
182 182
 
183
-		if ( 'top' === $which ) {
184
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
183
+		if ('top' === $which) {
184
+			wp_nonce_field('bulk-'.$this->_args['plural']);
185 185
 		}
186 186
 		?>
187
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
187
+		<div class="tablenav <?php echo esc_attr($which); ?>">
188 188
 
189 189
 			<div class="alignleft actions bulkactions">
190
-				<?php $this->bulk_actions( $which ); ?>
190
+				<?php $this->bulk_actions($which); ?>
191 191
 			</div>
192 192
 			<?php
193
-			$this->extra_tablenav( $which );
194
-			$this->pagination( $which );
193
+			$this->extra_tablenav($which);
194
+			$this->pagination($which);
195 195
 			?>
196 196
 
197 197
 			<br class="clear"/>
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 		$meta_query = array();
217 217
 
218
-		if ( $user ) {
218
+		if ($user) {
219 219
 			// Show only logs from a specific user.
220 220
 			$meta_query[] = array(
221 221
 				'key'   => '_give_log_user_id',
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 		}
225 225
 
226 226
 		$search = $this->get_search();
227
-		if ( $search ) {
228
-			if ( is_email( $search ) ) {
227
+		if ($search) {
228
+			if (is_email($search)) {
229 229
 				// This is an email search. We use this to ensure it works for guest users and logged-in users.
230 230
 				$key     = '_give_log_user_info';
231 231
 				$compare = 'LIKE';
@@ -234,32 +234,32 @@  discard block
 block discarded – undo
234 234
 				$key     = '_give_log_user_id';
235 235
 				$compare = 'LIKE';
236 236
 
237
-				if ( ! is_numeric( $search ) ) {
237
+				if ( ! is_numeric($search)) {
238 238
 					// Searching for user by username
239
-					$user = get_user_by( 'login', $search );
239
+					$user = get_user_by('login', $search);
240 240
 
241
-					if ( $user ) {
241
+					if ($user) {
242 242
 						// Found one, set meta value to user's ID.
243 243
 						$search = $user->ID;
244 244
 					} else {
245 245
 						// No user found so let's do a real search query.
246
-						$users = new WP_User_Query( array(
246
+						$users = new WP_User_Query(array(
247 247
 							'search'         => $search,
248
-							'search_columns' => array( 'user_url', 'user_nicename' ),
248
+							'search_columns' => array('user_url', 'user_nicename'),
249 249
 							'number'         => 1,
250 250
 							'fields'         => 'ids',
251
-						) );
251
+						));
252 252
 
253 253
 						$found_user = $users->get_results();
254 254
 
255
-						if ( $found_user ) {
255
+						if ($found_user) {
256 256
 							$search = $found_user[0];
257 257
 						}
258 258
 					}
259 259
 				}
260 260
 			}
261 261
 
262
-			if ( ! $this->file_search ) {
262
+			if ( ! $this->file_search) {
263 263
 				// Meta query only works for non file name search.
264 264
 				$meta_query[] = array(
265 265
 					'key'     => $key,
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 * @since  1.0
281 281
 	 * @return void
282 282
 	 */
283
-	function bulk_actions( $which = '' ) {
283
+	function bulk_actions($which = '') {
284 284
 		give_log_views();
285 285
 	}
286 286
 
@@ -292,24 +292,24 @@  discard block
 block discarded – undo
292 292
 	 * @return void
293 293
 	 */
294 294
 	public function give_forms_filter() {
295
-		$give_forms = get_posts( array(
295
+		$give_forms = get_posts(array(
296 296
 			'post_type'              => 'give_forms',
297 297
 			'post_status'            => 'any',
298
-			'posts_per_page'         => - 1,
298
+			'posts_per_page'         => -1,
299 299
 			'orderby'                => 'title',
300 300
 			'order'                  => 'ASC',
301 301
 			'fields'                 => 'ids',
302 302
 			'update_post_meta_cache' => false,
303 303
 			'update_post_term_cache' => false,
304
-		) );
304
+		));
305 305
 
306
-		if ( $give_forms ) {
306
+		if ($give_forms) {
307 307
 			echo '<select name="form" id="give-log-form-filter">';
308
-			echo '<option value="0">' . __( 'All', 'give' ) . '</option>';
309
-			foreach ( $give_forms as $form ) {
310
-				$form_title = get_the_title( $form );
311
-				$form_title = empty( $form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $form ) : $form_title;
312
-				echo '<option value="' . $form . '"' . selected( $form, $this->get_filtered_give_form() ) . '>' . esc_html( $form_title ) . '</option>';
308
+			echo '<option value="0">'.__('All', 'give').'</option>';
309
+			foreach ($give_forms as $form) {
310
+				$form_title = get_the_title($form);
311
+				$form_title = empty($form_title) ? sprintf(__('Untitled (#%s)', 'give'), $form) : $form_title;
312
+				echo '<option value="'.$form.'"'.selected($form, $this->get_filtered_give_form()).'>'.esc_html($form_title).'</option>';
313 313
 			}
314 314
 			echo '</select>';
315 315
 		}
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 		$logs_data = array();
331 331
 		$paged     = $this->get_paged();
332
-		$give_form = empty( $_GET['s'] ) ? $this->get_filtered_give_form() : null;
332
+		$give_form = empty($_GET['s']) ? $this->get_filtered_give_form() : null;
333 333
 		$user      = $this->get_filtered_user();
334 334
 
335 335
 		$log_query = array(
@@ -340,38 +340,38 @@  discard block
 block discarded – undo
340 340
 			'posts_per_page' => $this->per_page,
341 341
 		);
342 342
 
343
-		$cache_key = Give_Cache::get_key( 'get_logs', $log_query );
343
+		$cache_key = Give_Cache::get_key('get_logs', $log_query);
344 344
 
345 345
 		// Return result from cache if exist.
346
-		if ( ! ( $logs_data = Give_Cache::get( $cache_key ) ) ) {
347
-			$logs = $give_logs->get_connected_logs( $log_query );
346
+		if ( ! ($logs_data = Give_Cache::get($cache_key))) {
347
+			$logs = $give_logs->get_connected_logs($log_query);
348 348
 
349
-			if ( $logs ) {
350
-				foreach ( $logs as $log ) {
351
-					$payment_id = give_get_meta( $log->ID, '_give_log_payment_id', true );
349
+			if ($logs) {
350
+				foreach ($logs as $log) {
351
+					$payment_id = give_get_meta($log->ID, '_give_log_payment_id', true);
352 352
 
353 353
 					// Make sure this payment hasn't been deleted.
354
-					if ( get_post( $payment_id ) ) :
355
-						$user_info      = give_get_payment_meta_user_info( $payment_id );
356
-						$payment_meta   = give_get_payment_meta( $payment_id );
357
-						$payment_amount = give_get_payment_amount( $payment_id );
354
+					if (get_post($payment_id)) :
355
+						$user_info      = give_get_payment_meta_user_info($payment_id);
356
+						$payment_meta   = give_get_payment_meta($payment_id);
357
+						$payment_amount = give_get_payment_amount($payment_id);
358 358
 
359 359
 						$logs_data[] = array(
360
-							'ID'         => '<span class="give-item-label give-item-label-gray">' . $log->ID . '</span>',
360
+							'ID'         => '<span class="give-item-label give-item-label-gray">'.$log->ID.'</span>',
361 361
 							'payment_id' => $payment_id,
362 362
 							'form'       => $log->post_parent,
363 363
 							'amount'     => $payment_amount,
364 364
 							'user_id'    => $user_info['id'],
365
-							'user_name'  => $user_info['first_name'] . ' ' . $user_info['last_name'],
366
-							'date'       => get_post_field( 'post_date', $payment_id ),
365
+							'user_name'  => $user_info['first_name'].' '.$user_info['last_name'],
366
+							'date'       => get_post_field('post_date', $payment_id),
367 367
 						);
368 368
 
369 369
 					endif;
370 370
 				}
371 371
 
372 372
 				// Cache results.
373
-				if ( ! empty( $logs_data ) ) {
374
-					Give_Cache::set( $cache_key, $logs_data );
373
+				if ( ! empty($logs_data)) {
374
+					Give_Cache::set($cache_key, $logs_data);
375 375
 				}
376 376
 			}
377 377
 		}
@@ -399,15 +399,15 @@  discard block
 block discarded – undo
399 399
 		$columns               = $this->get_columns();
400 400
 		$hidden                = array();
401 401
 		$sortable              = $this->get_sortable_columns();
402
-		$this->_column_headers = array( $columns, $hidden, $sortable );
402
+		$this->_column_headers = array($columns, $hidden, $sortable);
403 403
 		$current_page          = $this->get_pagenum();
404 404
 		$this->items           = $this->get_logs();
405
-		$total_items           = $give_logs->get_log_count( $this->get_filtered_give_form(), 'sale', $this->get_meta_query() );
405
+		$total_items           = $give_logs->get_log_count($this->get_filtered_give_form(), 'sale', $this->get_meta_query());
406 406
 
407
-		$this->set_pagination_args( array(
407
+		$this->set_pagination_args(array(
408 408
 				'total_items' => $total_items,
409 409
 				'per_page'    => $this->per_page,
410
-				'total_pages' => ceil( $total_items / $this->per_page ),
410
+				'total_pages' => ceil($total_items / $this->per_page),
411 411
 			)
412 412
 		);
413 413
 	}
Please login to merge, or discard this patch.
includes/forms/template.php 4 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @param  array $args An array of form arguments.
23 23
  *
24
- * @return string Donation form.
24
+ * @return false|null Donation form.
25 25
  */
26 26
 function give_get_donation_form( $args = array() ) {
27 27
 
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
  *
1471 1471
  * @param  int $form_id The form ID.
1472 1472
  *
1473
- * @return bool
1473
+ * @return false|null
1474 1474
  */
1475 1475
 function give_terms_agreement( $form_id ) {
1476 1476
 	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
  * @param  int   $form_id The form ID.
1648 1648
  * @param  array $args    An array of form arguments.
1649 1649
  *
1650
- * @return mixed
1650
+ * @return boolean
1651 1651
  */
1652 1652
 function give_show_goal_progress( $form_id, $args ) {
1653 1653
 
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
  *
1668 1668
  * @since  1.8
1669 1669
  *
1670
- * @param  $form_id
1670
+ * @param  integer $form_id
1671 1671
  * @param  $args
1672 1672
  *
1673 1673
  * @return mixed|string
@@ -1708,7 +1708,7 @@  discard block
 block discarded – undo
1708 1708
  * @param  int   $form_id The form ID.
1709 1709
  * @param  array $args    An array of form arguments.
1710 1710
  *
1711
- * @return void|bool
1711
+ * @return false|null
1712 1712
  */
1713 1713
 function give_form_content( $form_id, $args ) {
1714 1714
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1036,7 +1036,7 @@
 block discarded – undo
1036 1036
 			<label for="card_state" class="give-label">
1037 1037
 				<?php echo $label; ?>
1038 1038
 				<?php if ( give_field_is_required( 'card_state', $form_id ) ) :
1039
-                    ?>
1039
+					?>
1040 1040
 					<span class="give-required-indicator <?php echo ( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span>
1041 1041
 				<?php endif; ?>
1042 1042
 				<span class="give-tooltip give-icon give-icon-question"
Please login to merge, or discard this patch.
Spacing   +400 added lines, -401 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,50 +23,50 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return string Donation form.
25 25
  */
26
-function give_get_donation_form( $args = array() ) {
26
+function give_get_donation_form($args = array()) {
27 27
 
28 28
 	global $post;
29 29
 
30
-	$form_id = is_object( $post ) ? $post->ID : 0;
30
+	$form_id = is_object($post) ? $post->ID : 0;
31 31
 
32
-	if ( isset( $args['id'] ) ) {
32
+	if (isset($args['id'])) {
33 33
 		$form_id = $args['id'];
34 34
 	}
35 35
 
36
-	$defaults = apply_filters( 'give_form_args_defaults', array(
36
+	$defaults = apply_filters('give_form_args_defaults', array(
37 37
 		'form_id' => $form_id,
38
-	) );
38
+	));
39 39
 
40
-	$args = wp_parse_args( $args, $defaults );
40
+	$args = wp_parse_args($args, $defaults);
41 41
 
42
-	$form = new Give_Donate_Form( $args['form_id'] );
42
+	$form = new Give_Donate_Form($args['form_id']);
43 43
 
44 44
 	//bail if no form ID.
45
-	if ( empty( $form->ID ) ) {
45
+	if (empty($form->ID)) {
46 46
 		return false;
47 47
 	}
48 48
 
49
-	$payment_mode = give_get_chosen_gateway( $form->ID );
49
+	$payment_mode = give_get_chosen_gateway($form->ID);
50 50
 
51
-	$form_action = add_query_arg( apply_filters( 'give_form_action_args', array(
51
+	$form_action = add_query_arg(apply_filters('give_form_action_args', array(
52 52
 		'payment-mode' => $payment_mode,
53
-	) ),
53
+	)),
54 54
 		give_get_current_page_url()
55 55
 	);
56 56
 
57 57
 	//Sanity Check: Donation form not published or user doesn't have permission to view drafts.
58 58
 	if (
59
-		( 'publish' !== $form->post_status && ! current_user_can( 'edit_give_forms', $form->ID ) )
60
-		|| ( 'trash' === $form->post_status )
59
+		('publish' !== $form->post_status && ! current_user_can('edit_give_forms', $form->ID))
60
+		|| ('trash' === $form->post_status)
61 61
 	) {
62 62
 		return false;
63 63
 	}
64 64
 
65 65
 	//Get the form wrap CSS classes.
66
-	$form_wrap_classes = $form->get_form_wrap_classes( $args );
66
+	$form_wrap_classes = $form->get_form_wrap_classes($args);
67 67
 
68 68
 	//Get the <form> tag wrap CSS classes.
69
-	$form_classes = $form->get_form_classes( $args );
69
+	$form_classes = $form->get_form_classes($args);
70 70
 
71 71
 	ob_start();
72 72
 
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 	 * @param int   $form_id The form ID.
79 79
 	 * @param array $args    An array of form arguments.
80 80
 	 */
81
-	do_action( 'give_pre_form_output', $form->ID, $args );
81
+	do_action('give_pre_form_output', $form->ID, $args);
82 82
 
83 83
 	?>
84 84
 	<div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_wrap_classes; ?>">
85 85
 
86
-		<?php if ( $form->is_close_donation_form() ) {
86
+		<?php if ($form->is_close_donation_form()) {
87 87
 
88 88
 			// Get Goal thank you message.
89
-			$goal_achieved_message = give_get_meta( $form->ID, '_give_form_goal_achieved_message', true );
90
-			$goal_achieved_message = ! empty( $goal_achieved_message ) ? apply_filters( 'the_content', $goal_achieved_message ) : '';
89
+			$goal_achieved_message = give_get_meta($form->ID, '_give_form_goal_achieved_message', true);
90
+			$goal_achieved_message = ! empty($goal_achieved_message) ? apply_filters('the_content', $goal_achieved_message) : '';
91 91
 
92 92
 			// Print thank you message.
93
-			echo apply_filters( 'give_goal_closed_output', $goal_achieved_message, $form->ID );
93
+			echo apply_filters('give_goal_closed_output', $goal_achieved_message, $form->ID);
94 94
 
95 95
 		} else {
96 96
 			/**
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
 			 * 1. if show_title params set to true
99 99
 			 * 2. if admin set form display_style to button
100 100
 			 */
101
-			$form_title = apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $form_id ) . '</h2>' );
101
+			$form_title = apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($form_id).'</h2>');
102 102
 			if (
103
-				( isset( $args['show_title'] ) && $args['show_title'] == true )
104
-				&& ! doing_action( 'give_single_form_summary' )
103
+				(isset($args['show_title']) && $args['show_title'] == true)
104
+				&& ! doing_action('give_single_form_summary')
105 105
 			) {
106 106
 				echo $form_title;
107 107
 			}
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
 			 * @param int   $form_id The form ID.
115 115
 			 * @param array $args    An array of form arguments.
116 116
 			 */
117
-			do_action( 'give_pre_form', $form->ID, $args );
117
+			do_action('give_pre_form', $form->ID, $args);
118 118
 			?>
119 119
 
120 120
 			<form id="give-form-<?php echo $form_id; ?>" class="<?php echo $form_classes; ?>"
121
-				  action="<?php echo esc_url_raw( $form_action ); ?>" method="post">
121
+				  action="<?php echo esc_url_raw($form_action); ?>" method="post">
122 122
 				<input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/>
123
-				<input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/>
123
+				<input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/>
124 124
 				<input type="hidden" name="give-current-url"
125
-					   value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
125
+					   value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
126 126
 				<input type="hidden" name="give-form-url"
127
-					   value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/>
127
+					   value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/>
128 128
 				<input type="hidden" name="give-form-minimum"
129
-					   value="<?php echo give_format_amount( give_get_form_minimum_price( $form->ID ), array( 'sanitize' => false ) ); ?>"/>
129
+					   value="<?php echo give_format_amount(give_get_form_minimum_price($form->ID), array('sanitize' => false)); ?>"/>
130 130
 
131 131
 				<!-- The following field is for robots only, invisible to humans: -->
132 132
 				<span class="give-hidden" style="display: none !important;">
@@ -138,13 +138,13 @@  discard block
 block discarded – undo
138 138
 				<?php
139 139
 
140 140
 				// Price ID hidden field for variable (multi-level) donation forms.
141
-				if ( give_has_variable_prices( $form_id ) ) {
141
+				if (give_has_variable_prices($form_id)) {
142 142
 					// Get default selected price ID.
143
-					$prices   = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
143
+					$prices   = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
144 144
 					$price_id = 0;
145 145
 					//loop through prices.
146
-					foreach ( $prices as $price ) {
147
-						if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
146
+					foreach ($prices as $price) {
147
+						if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
148 148
 							$price_id = $price['_give_id']['level_id'];
149 149
 						};
150 150
 					}
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 				 * @param int   $form_id The form ID.
161 161
 				 * @param array $args    An array of form arguments.
162 162
 				 */
163
-				do_action( 'give_donation_form_top', $form->ID, $args );
163
+				do_action('give_donation_form_top', $form->ID, $args);
164 164
 
165 165
 				/**
166 166
 				 * Fires while outputting donation form, for payment gateway fields.
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 				 * @param int   $form_id The form ID.
171 171
 				 * @param array $args    An array of form arguments.
172 172
 				 */
173
-				do_action( 'give_payment_mode_select', $form->ID, $args );
173
+				do_action('give_payment_mode_select', $form->ID, $args);
174 174
 
175 175
 				/**
176 176
 				 * Fires while outputting donation form, after all other fields.
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				 * @param int   $form_id The form ID.
181 181
 				 * @param array $args    An array of form arguments.
182 182
 				 */
183
-				do_action( 'give_donation_form_bottom', $form->ID, $args );
183
+				do_action('give_donation_form_bottom', $form->ID, $args);
184 184
 
185 185
 				?>
186 186
 			</form>
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 			 * @param int   $form_id The form ID.
195 195
 			 * @param array $args    An array of form arguments.
196 196
 			 */
197
-			do_action( 'give_post_form', $form->ID, $args );
197
+			do_action('give_post_form', $form->ID, $args);
198 198
 
199 199
 		}
200 200
 		?>
201 201
 
202
-	</div><!--end #give-form-<?php echo absint( $form->ID ); ?>-->
202
+	</div><!--end #give-form-<?php echo absint($form->ID); ?>-->
203 203
 	<?php
204 204
 
205 205
 	/**
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
 	 * @param int   $form_id The form ID.
211 211
 	 * @param array $args    An array of form arguments.
212 212
 	 */
213
-	do_action( 'give_post_form_output', $form->ID, $args );
213
+	do_action('give_post_form_output', $form->ID, $args);
214 214
 
215 215
 	$final_output = ob_get_clean();
216 216
 
217
-	echo apply_filters( 'give_donate_form', $final_output, $args );
217
+	echo apply_filters('give_donate_form', $final_output, $args);
218 218
 }
219 219
 
220 220
 /**
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
  *
232 232
  * @return string
233 233
  */
234
-function give_show_purchase_form( $form_id ) {
234
+function give_show_purchase_form($form_id) {
235 235
 
236
-	$payment_mode = give_get_chosen_gateway( $form_id );
236
+	$payment_mode = give_get_chosen_gateway($form_id);
237 237
 
238
-	if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) {
238
+	if ( ! isset($form_id) && isset($_POST['give_form_id'])) {
239 239
 		$form_id = $_POST['give_form_id'];
240 240
 	}
241 241
 
@@ -244,33 +244,33 @@  discard block
 block discarded – undo
244 244
 	 *
245 245
 	 * @since 1.7
246 246
 	 */
247
-	do_action( 'give_payment_fields_top', $form_id );
247
+	do_action('give_payment_fields_top', $form_id);
248 248
 
249
-	if ( give_can_checkout() && isset( $form_id ) ) {
249
+	if (give_can_checkout() && isset($form_id)) {
250 250
 
251 251
 		/**
252 252
 		 * Fires while displaying donation form, before registration login.
253 253
 		 *
254 254
 		 * @since 1.7
255 255
 		 */
256
-		do_action( 'give_donation_form_before_register_login', $form_id );
256
+		do_action('give_donation_form_before_register_login', $form_id);
257 257
 
258 258
 		/**
259 259
 		 * Fire when register/login form fields render.
260 260
 		 *
261 261
 		 * @since 1.7
262 262
 		 */
263
-		do_action( 'give_donation_form_register_login_fields', $form_id );
263
+		do_action('give_donation_form_register_login_fields', $form_id);
264 264
 
265 265
 		/**
266 266
 		 * Fire when credit card form fields render.
267 267
 		 *
268 268
 		 * @since 1.7
269 269
 		 */
270
-		do_action( 'give_donation_form_before_cc_form', $form_id );
270
+		do_action('give_donation_form_before_cc_form', $form_id);
271 271
 
272 272
 		// Load the credit card form and allow gateways to load their own if they wish.
273
-		if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) {
273
+		if (has_action('give_'.$payment_mode.'_cc_form')) {
274 274
 			/**
275 275
 			 * Fires while displaying donation form, credit card form fields for a given gateway.
276 276
 			 *
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			 *
279 279
 			 * @param int $form_id The form ID.
280 280
 			 */
281
-			do_action( "give_{$payment_mode}_cc_form", $form_id );
281
+			do_action("give_{$payment_mode}_cc_form", $form_id);
282 282
 		} else {
283 283
 			/**
284 284
 			 * Fires while displaying donation form, credit card form fields.
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			 *
288 288
 			 * @param int $form_id The form ID.
289 289
 			 */
290
-			do_action( 'give_cc_form', $form_id );
290
+			do_action('give_cc_form', $form_id);
291 291
 		}
292 292
 
293 293
 		/**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		 *
296 296
 		 * @since 1.7
297 297
 		 */
298
-		do_action( 'give_donation_form_after_cc_form', $form_id );
298
+		do_action('give_donation_form_after_cc_form', $form_id);
299 299
 
300 300
 	} else {
301 301
 		/**
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		 *
304 304
 		 * @since 1.7
305 305
 		 */
306
-		do_action( 'give_donation_form_no_access', $form_id );
306
+		do_action('give_donation_form_no_access', $form_id);
307 307
 
308 308
 	}
309 309
 
@@ -312,10 +312,10 @@  discard block
 block discarded – undo
312 312
 	 *
313 313
 	 * @since 1.7
314 314
 	 */
315
-	do_action( 'give_payment_fields_bottom', $form_id );
315
+	do_action('give_payment_fields_bottom', $form_id);
316 316
 }
317 317
 
318
-add_action( 'give_donation_form', 'give_show_purchase_form' );
318
+add_action('give_donation_form', 'give_show_purchase_form');
319 319
 
320 320
 /**
321 321
  * Give Show Login/Register Form Fields.
@@ -326,11 +326,11 @@  discard block
 block discarded – undo
326 326
  *
327 327
  * @return void
328 328
  */
329
-function give_show_register_login_fields( $form_id ) {
329
+function give_show_register_login_fields($form_id) {
330 330
 
331
-	$show_register_form = give_show_login_register_option( $form_id );
331
+	$show_register_form = give_show_login_register_option($form_id);
332 332
 
333
-	if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) :
333
+	if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) :
334 334
 		?>
335 335
 		<div id="give-checkout-login-register-<?php echo $form_id; ?>">
336 336
 			<?php
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 			 *
340 340
 			 * @since 1.7
341 341
 			 */
342
-			do_action( 'give_donation_form_register_fields', $form_id );
342
+			do_action('give_donation_form_register_fields', $form_id);
343 343
 			?>
344 344
 		</div>
345 345
 		<?php
346
-	elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) :
346
+	elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) :
347 347
 		?>
348 348
 		<div id="give-checkout-login-register-<?php echo $form_id; ?>">
349 349
 			<?php
@@ -352,23 +352,23 @@  discard block
 block discarded – undo
352 352
 			 *
353 353
 			 * @since 1.7
354 354
 			 */
355
-			do_action( 'give_donation_form_login_fields', $form_id );
355
+			do_action('give_donation_form_login_fields', $form_id);
356 356
 			?>
357 357
 		</div>
358 358
 		<?php
359 359
 	endif;
360 360
 
361
-	if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) {
361
+	if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) {
362 362
 		/**
363 363
 		 * Fire when user info render.
364 364
 		 *
365 365
 		 * @since 1.7
366 366
 		 */
367
-		do_action( 'give_donation_form_after_user_info', $form_id );
367
+		do_action('give_donation_form_after_user_info', $form_id);
368 368
 	}
369 369
 }
370 370
 
371
-add_action( 'give_donation_form_register_login_fields', 'give_show_register_login_fields' );
371
+add_action('give_donation_form_register_login_fields', 'give_show_register_login_fields');
372 372
 
373 373
 /**
374 374
  * Donation Amount Field.
@@ -383,16 +383,16 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return void
385 385
  */
386
-function give_output_donation_amount_top( $form_id = 0, $args = array() ) {
386
+function give_output_donation_amount_top($form_id = 0, $args = array()) {
387 387
 
388 388
 	$give_options        = give_get_settings();
389
-	$variable_pricing    = give_has_variable_prices( $form_id );
390
-	$allow_custom_amount = give_get_meta( $form_id, '_give_custom_amount', true );
391
-	$currency_position   = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before';
392
-	$symbol              = give_currency_symbol( give_get_currency() );
393
-	$currency_output     = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>';
394
-	$default_amount      = give_format_amount( give_get_default_form_amount( $form_id ), array( 'sanitize' => false ) );
395
-	$custom_amount_text  = give_get_meta( $form_id, '_give_custom_amount_text', true );
389
+	$variable_pricing    = give_has_variable_prices($form_id);
390
+	$allow_custom_amount = give_get_meta($form_id, '_give_custom_amount', true);
391
+	$currency_position   = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before';
392
+	$symbol              = give_currency_symbol(give_get_currency());
393
+	$currency_output     = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>';
394
+	$default_amount      = give_format_amount(give_get_default_form_amount($form_id), array('sanitize' => false));
395
+	$custom_amount_text  = give_get_meta($form_id, '_give_custom_amount_text', true);
396 396
 
397 397
 	/**
398 398
 	 * Fires while displaying donation form, before donation level fields.
@@ -402,20 +402,20 @@  discard block
 block discarded – undo
402 402
 	 * @param int   $form_id The form ID.
403 403
 	 * @param array $args    An array of form arguments.
404 404
 	 */
405
-	do_action( 'give_before_donation_levels', $form_id, $args );
405
+	do_action('give_before_donation_levels', $form_id, $args);
406 406
 
407 407
 	//Set Price, No Custom Amount Allowed means hidden price field
408
-	if ( ! give_is_setting_enabled( $allow_custom_amount ) ) {
408
+	if ( ! give_is_setting_enabled($allow_custom_amount)) {
409 409
 		?>
410
-		<label class="give-hidden" for="give-amount-hidden"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label>
410
+		<label class="give-hidden" for="give-amount-hidden"><?php esc_html_e('Donation Amount:', 'give'); ?></label>
411 411
 		<input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount"
412 412
 			   value="<?php echo $default_amount; ?>" required aria-required="true"/>
413 413
 		<div class="set-price give-donation-amount form-row-wide">
414
-			<?php if ( $currency_position == 'before' ) {
414
+			<?php if ($currency_position == 'before') {
415 415
 				echo $currency_output;
416 416
 			} ?>
417 417
 			<span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span>
418
-			<?php if ( $currency_position == 'after' ) {
418
+			<?php if ($currency_position == 'after') {
419 419
 				echo $currency_output;
420 420
 			} ?>
421 421
 		</div>
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
 		?>
426 426
 		<div class="give-total-wrap">
427 427
 			<div class="give-donation-amount form-row-wide">
428
-				<?php if ( $currency_position == 'before' ) {
428
+				<?php if ($currency_position == 'before') {
429 429
 					echo $currency_output;
430 430
 				} ?>
431
-				<label class="give-hidden" for="give-amount"><?php esc_html_e( 'Donation Amount:', 'give' ); ?></label>
431
+				<label class="give-hidden" for="give-amount"><?php esc_html_e('Donation Amount:', 'give'); ?></label>
432 432
 				<input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel"
433 433
 					   placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off">
434
-				<?php if ( $currency_position == 'after' ) {
434
+				<?php if ($currency_position == 'after') {
435 435
 					echo $currency_output;
436 436
 				} ?>
437 437
 			</div>
@@ -446,16 +446,16 @@  discard block
 block discarded – undo
446 446
 	 * @param int   $form_id The form ID.
447 447
 	 * @param array $args    An array of form arguments.
448 448
 	 */
449
-	do_action( 'give_after_donation_amount', $form_id, $args );
449
+	do_action('give_after_donation_amount', $form_id, $args);
450 450
 
451 451
 	//Custom Amount Text
452
-	if ( ! $variable_pricing && give_is_setting_enabled( $allow_custom_amount ) && ! empty( $custom_amount_text ) ) { ?>
452
+	if ( ! $variable_pricing && give_is_setting_enabled($allow_custom_amount) && ! empty($custom_amount_text)) { ?>
453 453
 		<p class="give-custom-amount-text"><?php echo $custom_amount_text; ?></p>
454 454
 	<?php }
455 455
 
456 456
 	//Output Variable Pricing Levels.
457
-	if ( $variable_pricing ) {
458
-		give_output_levels( $form_id );
457
+	if ($variable_pricing) {
458
+		give_output_levels($form_id);
459 459
 	}
460 460
 
461 461
 	/**
@@ -466,10 +466,10 @@  discard block
 block discarded – undo
466 466
 	 * @param int   $form_id The form ID.
467 467
 	 * @param array $args    An array of form arguments.
468 468
 	 */
469
-	do_action( 'give_after_donation_levels', $form_id, $args );
469
+	do_action('give_after_donation_levels', $form_id, $args);
470 470
 }
471 471
 
472
-add_action( 'give_donation_form_top', 'give_output_donation_amount_top', 10, 2 );
472
+add_action('give_donation_form_top', 'give_output_donation_amount_top', 10, 2);
473 473
 
474 474
 /**
475 475
  * Outputs the Donation Levels in various formats such as dropdown, radios, and buttons.
@@ -480,30 +480,30 @@  discard block
 block discarded – undo
480 480
  *
481 481
  * @return string Donation levels.
482 482
  */
483
-function give_output_levels( $form_id ) {
483
+function give_output_levels($form_id) {
484 484
 
485 485
 	//Get variable pricing.
486
-	$prices             = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
487
-	$display_style      = give_get_meta( $form_id, '_give_display_style', true );
488
-	$custom_amount      = give_get_meta( $form_id, '_give_custom_amount', true );
489
-	$custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true );
490
-	if ( empty( $custom_amount_text ) ) {
491
-		$custom_amount_text = esc_html__( 'Give a Custom Amount', 'give' );
486
+	$prices             = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id);
487
+	$display_style      = give_get_meta($form_id, '_give_display_style', true);
488
+	$custom_amount      = give_get_meta($form_id, '_give_custom_amount', true);
489
+	$custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true);
490
+	if (empty($custom_amount_text)) {
491
+		$custom_amount_text = esc_html__('Give a Custom Amount', 'give');
492 492
 	}
493 493
 
494 494
 	$output = '';
495 495
 
496
-	switch ( $display_style ) {
496
+	switch ($display_style) {
497 497
 		case 'buttons':
498 498
 
499 499
 			$output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">';
500 500
 
501
-			foreach ( $prices as $price ) {
502
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price );
503
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $price['_give_id']['level_id'] . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price );
501
+			foreach ($prices as $price) {
502
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price);
503
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-'.$price['_give_id']['level_id'].' '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'give-default-level' : ''), $form_id, $price);
504 504
 
505 505
 				$output .= '<li>';
506
-				$output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">';
506
+				$output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">';
507 507
 				$output .= $level_text;
508 508
 				$output .= '</button>';
509 509
 				$output .= '</li>';
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			}
512 512
 
513 513
 			//Custom Amount.
514
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
514
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
515 515
 				$output .= '<li>';
516 516
 				$output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">';
517 517
 				$output .= $custom_amount_text;
@@ -527,22 +527,22 @@  discard block
 block discarded – undo
527 527
 
528 528
 			$output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">';
529 529
 
530
-			foreach ( $prices as $price ) {
531
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price );
532
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
530
+			foreach ($prices as $price) {
531
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price);
532
+				$level_classes = apply_filters('give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-'.$price['_give_id']['level_id'].((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
533 533
 
534 534
 				$output .= '<li>';
535
-				$output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $price['_give_id']['level_id'] . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">';
536
-				$output .= '<label for="give-radio-level-' . $price['_give_id']['level_id'] . '">' . $level_text . '</label>';
535
+				$output .= '<input type="radio" data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" name="give-radio-donation-level" id="give-radio-level-'.$price['_give_id']['level_id'].'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'checked="checked"' : '').' value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">';
536
+				$output .= '<label for="give-radio-level-'.$price['_give_id']['level_id'].'">'.$level_text.'</label>';
537 537
 				$output .= '</li>';
538 538
 
539 539
 			}
540 540
 
541 541
 			//Custom Amount.
542
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
542
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
543 543
 				$output .= '<li>';
544 544
 				$output .= '<input type="radio" data-price-id="custom" class="give-radio-input give-radio-input-level give-radio-level-custom" name="give-radio-donation-level" id="give-radio-level-custom" value="custom">';
545
-				$output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>';
545
+				$output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>';
546 546
 				$output .= '</li>';
547 547
 			}
548 548
 
@@ -552,23 +552,23 @@  discard block
 block discarded – undo
552 552
 
553 553
 		case 'dropdown':
554 554
 
555
-			$output .= '<label for="give-donation-level-select-' . $form_id . '" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>';
556
-			$output .= '<select id="give-donation-level-select-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">';
555
+			$output .= '<label for="give-donation-level-select-'.$form_id.'" class="give-hidden">'.esc_html__('Choose Your Donation Amount', 'give').':</label>';
556
+			$output .= '<select id="give-donation-level-select-'.$form_id.'" class="give-select give-select-level give-donation-levels-wrap">';
557 557
 
558 558
 			//first loop through prices.
559
-			foreach ( $prices as $price ) {
560
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) ), $form_id, $price );
561
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $price['_give_id']['level_id'] . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
559
+			foreach ($prices as $price) {
560
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false))), $form_id, $price);
561
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$price['_give_id']['level_id'].((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
562 562
 
563
-				$output .= '<option data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'selected="selected"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) . '">';
563
+				$output .= '<option data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'selected="selected"' : '').' value="'.give_format_amount($price['_give_amount'], array('sanitize' => false)).'">';
564 564
 				$output .= $level_text;
565 565
 				$output .= '</option>';
566 566
 
567 567
 			}
568 568
 
569 569
 			//Custom Amount.
570
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
571
-				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>';
570
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
571
+				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>';
572 572
 			}
573 573
 
574 574
 			$output .= '</select>';
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			break;
577 577
 	}
578 578
 
579
-	echo apply_filters( 'give_form_level_output', $output, $form_id );
579
+	echo apply_filters('give_form_level_output', $output, $form_id);
580 580
 }
581 581
 
582 582
 /**
@@ -591,27 +591,27 @@  discard block
 block discarded – undo
591 591
  *
592 592
  * @return string Checkout button.
593 593
  */
594
-function give_display_checkout_button( $form_id, $args ) {
594
+function give_display_checkout_button($form_id, $args) {
595 595
 
596
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
596
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
597 597
 		? $args['display_style']
598
-		: give_get_meta( $form_id, '_give_payment_display', true );
598
+		: give_get_meta($form_id, '_give_payment_display', true);
599 599
 
600
-	if ( 'button' === $display_option ) {
600
+	if ('button' === $display_option) {
601 601
 		$display_option = 'modal';
602
-	} elseif ( $display_option === 'onpage' ) {
602
+	} elseif ($display_option === 'onpage') {
603 603
 		return '';
604 604
 	}
605 605
 
606
-	$display_label_field = give_get_meta( $form_id, '_give_reveal_label', true );
607
-	$display_label       = ! empty( $args['continue_button_title'] ) ? $args['continue_button_title'] : ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
606
+	$display_label_field = give_get_meta($form_id, '_give_reveal_label', true);
607
+	$display_label       = ! empty($args['continue_button_title']) ? $args['continue_button_title'] : ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
608 608
 
609
-	$output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>';
609
+	$output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>';
610 610
 
611
-	echo apply_filters( 'give_display_checkout_button', $output );
611
+	echo apply_filters('give_display_checkout_button', $output);
612 612
 }
613 613
 
614
-add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 );
614
+add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2);
615 615
 
616 616
 /**
617 617
  * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided.
@@ -622,57 +622,57 @@  discard block
 block discarded – undo
622 622
  *
623 623
  * @return void
624 624
  */
625
-function give_user_info_fields( $form_id ) {
625
+function give_user_info_fields($form_id) {
626 626
 	// Get user info.
627
-	$give_user_info = _give_get_prefill_form_field_values( $form_id );
627
+	$give_user_info = _give_get_prefill_form_field_values($form_id);
628 628
 
629 629
 	/**
630 630
 	 * Fire before user personal information fields
631 631
 	 *
632 632
 	 * @since 1.7
633 633
 	 */
634
-	do_action( 'give_donation_form_before_personal_info', $form_id );
634
+	do_action('give_donation_form_before_personal_info', $form_id);
635 635
 	?>
636 636
 	<fieldset id="give_checkout_user_info">
637
-		<legend><?php echo apply_filters( 'give_checkout_personal_info_text', esc_html__( 'Personal Info', 'give' ) ); ?></legend>
637
+		<legend><?php echo apply_filters('give_checkout_personal_info_text', esc_html__('Personal Info', 'give')); ?></legend>
638 638
 		<p id="give-first-name-wrap" class="form-row form-row-first form-row-responsive">
639 639
 			<label class="give-label" for="give-first">
640
-				<?php esc_html_e( 'First Name', 'give' ); ?>
641
-				<?php if ( give_field_is_required( 'give_first', $form_id ) ) : ?>
640
+				<?php esc_html_e('First Name', 'give'); ?>
641
+				<?php if (give_field_is_required('give_first', $form_id)) : ?>
642 642
 					<span class="give-required-indicator">*</span>
643 643
 				<?php endif ?>
644 644
 				<span class="give-tooltip give-icon give-icon-question"
645
-					  data-tooltip="<?php esc_attr_e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span>
645
+					  data-tooltip="<?php esc_attr_e('We will use this to personalize your account experience.', 'give'); ?>"></span>
646 646
 			</label>
647 647
 			<input
648 648
 					class="give-input required"
649 649
 					type="text"
650 650
 					name="give_first"
651
-					placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>"
651
+					placeholder="<?php esc_attr_e('First Name', 'give'); ?>"
652 652
 					id="give-first"
653
-					value="<?php echo isset( $give_user_info['give_first'] ) ? $give_user_info['give_first'] : ''; ?>"
654
-				<?php echo( give_field_is_required( 'give_first', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
653
+					value="<?php echo isset($give_user_info['give_first']) ? $give_user_info['give_first'] : ''; ?>"
654
+				<?php echo(give_field_is_required('give_first', $form_id) ? ' required aria-required="true" ' : ''); ?>
655 655
 			/>
656 656
 		</p>
657 657
 
658 658
 		<p id="give-last-name-wrap" class="form-row form-row-last form-row-responsive">
659 659
 			<label class="give-label" for="give-last">
660
-				<?php esc_html_e( 'Last Name', 'give' ); ?>
661
-				<?php if ( give_field_is_required( 'give_last', $form_id ) ) : ?>
660
+				<?php esc_html_e('Last Name', 'give'); ?>
661
+				<?php if (give_field_is_required('give_last', $form_id)) : ?>
662 662
 					<span class="give-required-indicator">*</span>
663 663
 				<?php endif ?>
664 664
 				<span class="give-tooltip give-icon give-icon-question"
665
-					  data-tooltip="<?php esc_attr_e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span>
665
+					  data-tooltip="<?php esc_attr_e('We will use this as well to personalize your account experience.', 'give'); ?>"></span>
666 666
 			</label>
667 667
 
668 668
 			<input
669
-					class="give-input<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required' : '' ); ?>"
669
+					class="give-input<?php echo(give_field_is_required('give_last', $form_id) ? ' required' : ''); ?>"
670 670
 					type="text"
671 671
 					name="give_last"
672 672
 					id="give-last"
673
-					placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>"
674
-					value="<?php echo isset( $give_user_info['give_last'] ) ? $give_user_info['give_last'] : ''; ?>"
675
-				<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
673
+					placeholder="<?php esc_attr_e('Last Name', 'give'); ?>"
674
+					value="<?php echo isset($give_user_info['give_last']) ? $give_user_info['give_last'] : ''; ?>"
675
+				<?php echo(give_field_is_required('give_last', $form_id) ? ' required aria-required="true" ' : ''); ?>
676 676
 			/>
677 677
 		</p>
678 678
 
@@ -682,26 +682,26 @@  discard block
 block discarded – undo
682 682
 		 *
683 683
 		 * @since 1.7
684 684
 		 */
685
-		do_action( 'give_donation_form_before_email', $form_id );
685
+		do_action('give_donation_form_before_email', $form_id);
686 686
 		?>
687 687
 		<p id="give-email-wrap" class="form-row form-row-wide">
688 688
 			<label class="give-label" for="give-email">
689
-				<?php esc_html_e( 'Email Address', 'give' ); ?>
690
-				<?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?>
689
+				<?php esc_html_e('Email Address', 'give'); ?>
690
+				<?php if (give_field_is_required('give_email', $form_id)) { ?>
691 691
 					<span class="give-required-indicator">*</span>
692 692
 				<?php } ?>
693 693
 				<span class="give-tooltip give-icon give-icon-question"
694
-					  data-tooltip="<?php esc_attr_e( 'We will send the donation receipt to this address.', 'give' ); ?>"></span>
694
+					  data-tooltip="<?php esc_attr_e('We will send the donation receipt to this address.', 'give'); ?>"></span>
695 695
 			</label>
696 696
 
697 697
 			<input
698 698
 					class="give-input required"
699 699
 					type="email"
700 700
 					name="give_email"
701
-					placeholder="<?php esc_attr_e( 'Email Address', 'give' ); ?>"
701
+					placeholder="<?php esc_attr_e('Email Address', 'give'); ?>"
702 702
 					id="give-email"
703
-					value="<?php echo isset( $give_user_info['give_email'] ) ? $give_user_info['give_email'] : ''; ?>"
704
-				<?php echo( give_field_is_required( 'give_email', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
703
+					value="<?php echo isset($give_user_info['give_email']) ? $give_user_info['give_email'] : ''; ?>"
704
+				<?php echo(give_field_is_required('give_email', $form_id) ? ' required aria-required="true" ' : ''); ?>
705 705
 			/>
706 706
 
707 707
 		</p>
@@ -711,14 +711,14 @@  discard block
 block discarded – undo
711 711
 		 *
712 712
 		 * @since 1.7
713 713
 		 */
714
-		do_action( 'give_donation_form_after_email', $form_id );
714
+		do_action('give_donation_form_after_email', $form_id);
715 715
 
716 716
 		/**
717 717
 		 * Fire after personal email field
718 718
 		 *
719 719
 		 * @since 1.7
720 720
 		 */
721
-		do_action( 'give_donation_form_user_info', $form_id );
721
+		do_action('give_donation_form_user_info', $form_id);
722 722
 		?>
723 723
 	</fieldset>
724 724
 	<?php
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
 	 *
728 728
 	 * @since 1.7
729 729
 	 */
730
-	do_action( 'give_donation_form_after_personal_info', $form_id );
730
+	do_action('give_donation_form_after_personal_info', $form_id);
731 731
 }
732 732
 
733
-add_action( 'give_donation_form_after_user_info', 'give_user_info_fields' );
734
-add_action( 'give_register_fields_before', 'give_user_info_fields' );
733
+add_action('give_donation_form_after_user_info', 'give_user_info_fields');
734
+add_action('give_register_fields_before', 'give_user_info_fields');
735 735
 
736 736
 /**
737 737
  * Renders the credit card info form.
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
  *
743 743
  * @return void
744 744
  */
745
-function give_get_cc_form( $form_id ) {
745
+function give_get_cc_form($form_id) {
746 746
 
747 747
 	ob_start();
748 748
 
@@ -753,53 +753,53 @@  discard block
 block discarded – undo
753 753
 	 *
754 754
 	 * @param int $form_id The form ID.
755 755
 	 */
756
-	do_action( 'give_before_cc_fields', $form_id );
756
+	do_action('give_before_cc_fields', $form_id);
757 757
 	?>
758 758
 	<fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate">
759
-		<legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>
760
-		<?php if ( is_ssl() ) : ?>
759
+		<legend><?php echo apply_filters('give_credit_card_fieldset_heading', esc_html__('Credit Card Info', 'give')); ?></legend>
760
+		<?php if (is_ssl()) : ?>
761 761
 			<div id="give_secure_site_wrapper-<?php echo $form_id ?>">
762 762
 				<span class="give-icon padlock"></span>
763
-				<span><?php esc_html_e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>
763
+				<span><?php esc_html_e('This is a secure SSL encrypted payment.', 'give'); ?></span>
764 764
 			</div>
765 765
 		<?php endif; ?>
766 766
 		<p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive">
767 767
 			<label for="card_number-<?php echo $form_id ?>" class="give-label">
768
-				<?php esc_html_e( 'Card Number', 'give' ); ?>
768
+				<?php esc_html_e('Card Number', 'give'); ?>
769 769
 				<span class="give-required-indicator">*</span>
770 770
 				<span class="give-tooltip give-icon give-icon-question"
771
-					  data-tooltip="<?php esc_attr_e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span>
771
+					  data-tooltip="<?php esc_attr_e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span>
772 772
 				<span class="card-type"></span>
773 773
 			</label>
774 774
 
775 775
 			<input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>"
776
-				   class="card-number give-input required" placeholder="<?php esc_attr_e( 'Card number', 'give' ); ?>"
776
+				   class="card-number give-input required" placeholder="<?php esc_attr_e('Card number', 'give'); ?>"
777 777
 				   required aria-required="true"/>
778 778
 		</p>
779 779
 
780 780
 		<p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third form-row-responsive">
781 781
 			<label for="card_cvc-<?php echo $form_id ?>" class="give-label">
782
-				<?php esc_html_e( 'CVC', 'give' ); ?>
782
+				<?php esc_html_e('CVC', 'give'); ?>
783 783
 				<span class="give-required-indicator">*</span>
784 784
 				<span class="give-tooltip give-icon give-icon-question"
785
-					  data-tooltip="<?php esc_attr_e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span>
785
+					  data-tooltip="<?php esc_attr_e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span>
786 786
 			</label>
787 787
 
788 788
 			<input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>"
789
-				   class="card-cvc give-input required" placeholder="<?php esc_attr_e( 'Security code', 'give' ); ?>"
789
+				   class="card-cvc give-input required" placeholder="<?php esc_attr_e('Security code', 'give'); ?>"
790 790
 				   required aria-required="true"/>
791 791
 		</p>
792 792
 
793 793
 		<p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive">
794 794
 			<label for="card_name-<?php echo $form_id ?>" class="give-label">
795
-				<?php esc_html_e( 'Name on the Card', 'give' ); ?>
795
+				<?php esc_html_e('Name on the Card', 'give'); ?>
796 796
 				<span class="give-required-indicator">*</span>
797 797
 				<span class="give-tooltip give-icon give-icon-question"
798
-					  data-tooltip="<?php esc_attr_e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span>
798
+					  data-tooltip="<?php esc_attr_e('The name printed on the front of your credit card.', 'give'); ?>"></span>
799 799
 			</label>
800 800
 
801 801
 			<input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>"
802
-				   class="card-name give-input required" placeholder="<?php esc_attr_e( 'Card name', 'give' ); ?>"
802
+				   class="card-name give-input required" placeholder="<?php esc_attr_e('Card name', 'give'); ?>"
803 803
 				   required aria-required="true"/>
804 804
 		</p>
805 805
 		<?php
@@ -810,14 +810,14 @@  discard block
 block discarded – undo
810 810
 		 *
811 811
 		 * @param int $form_id The form ID.
812 812
 		 */
813
-		do_action( 'give_before_cc_expiration' );
813
+		do_action('give_before_cc_expiration');
814 814
 		?>
815 815
 		<p class="card-expiration form-row form-row-one-third form-row-responsive">
816 816
 			<label for="card_expiry-<?php echo $form_id ?>" class="give-label">
817
-				<?php esc_html_e( 'Expiration', 'give' ); ?>
817
+				<?php esc_html_e('Expiration', 'give'); ?>
818 818
 				<span class="give-required-indicator">*</span>
819 819
 				<span class="give-tooltip give-icon give-icon-question"
820
-					  data-tooltip="<?php esc_attr_e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span>
820
+					  data-tooltip="<?php esc_attr_e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span>
821 821
 			</label>
822 822
 
823 823
 			<input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month"
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 				   class="card-expiry-year"/>
827 827
 
828 828
 			<input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>"
829
-				   class="card-expiry give-input required" placeholder="<?php esc_attr_e( 'MM / YY', 'give' ); ?>"
829
+				   class="card-expiry give-input required" placeholder="<?php esc_attr_e('MM / YY', 'give'); ?>"
830 830
 				   required aria-required="true"/>
831 831
 		</p>
832 832
 		<?php
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 		 *
838 838
 		 * @param int $form_id The form ID.
839 839
 		 */
840
-		do_action( 'give_after_cc_expiration', $form_id );
840
+		do_action('give_after_cc_expiration', $form_id);
841 841
 		?>
842 842
 	</fieldset>
843 843
 	<?php
@@ -848,12 +848,12 @@  discard block
 block discarded – undo
848 848
 	 *
849 849
 	 * @param int $form_id The form ID.
850 850
 	 */
851
-	do_action( 'give_after_cc_fields', $form_id );
851
+	do_action('give_after_cc_fields', $form_id);
852 852
 
853 853
 	echo ob_get_clean();
854 854
 }
855 855
 
856
-add_action( 'give_cc_form', 'give_get_cc_form' );
856
+add_action('give_cc_form', 'give_get_cc_form');
857 857
 
858 858
 /**
859 859
  * Outputs the default credit card address fields.
@@ -864,24 +864,24 @@  discard block
 block discarded – undo
864 864
  *
865 865
  * @return void
866 866
  */
867
-function give_default_cc_address_fields( $form_id ) {
867
+function give_default_cc_address_fields($form_id) {
868 868
 	// Get user info.
869
-	$give_user_info = _give_get_prefill_form_field_values( $form_id );
869
+	$give_user_info = _give_get_prefill_form_field_values($form_id);
870 870
 
871 871
 	$logged_in = is_user_logged_in();
872 872
 
873
-	if ( $logged_in ) {
874
-		$user_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
873
+	if ($logged_in) {
874
+		$user_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
875 875
 	}
876
-	$line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : '';
877
-	$line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : '';
878
-	$city  = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : '';
879
-	$zip   = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : '';
876
+	$line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : '';
877
+	$line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : '';
878
+	$city  = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : '';
879
+	$zip   = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : '';
880 880
 
881 881
 	ob_start();
882 882
 	?>
883 883
 	<fieldset id="give_cc_address" class="cc-address">
884
-		<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>
884
+		<legend><?php echo apply_filters('give_billing_details_fieldset_heading', esc_html__('Billing Details', 'give')); ?></legend>
885 885
 		<?php
886 886
 		/**
887 887
 		 * Fires while rendering credit card billing form, before address fields.
@@ -890,79 +890,79 @@  discard block
 block discarded – undo
890 890
 		 *
891 891
 		 * @param int $form_id The form ID.
892 892
 		 */
893
-		do_action( 'give_cc_billing_top' );
893
+		do_action('give_cc_billing_top');
894 894
 		?>
895 895
 		<p id="give-card-address-wrap" class="form-row form-row-wide">
896 896
 			<label for="card_address" class="give-label">
897
-				<?php esc_html_e( 'Address 1', 'give' ); ?>
897
+				<?php esc_html_e('Address 1', 'give'); ?>
898 898
 				<?php
899
-				if ( give_field_is_required( 'card_address', $form_id ) ) : ?>
899
+				if (give_field_is_required('card_address', $form_id)) : ?>
900 900
 					<span class="give-required-indicator">*</span>
901 901
 				<?php endif; ?>
902 902
 				<span class="give-tooltip give-icon give-icon-question"
903
-					  data-tooltip="<?php esc_attr_e( 'The primary billing address for your credit card.', 'give' ); ?>"></span>
903
+					  data-tooltip="<?php esc_attr_e('The primary billing address for your credit card.', 'give'); ?>"></span>
904 904
 			</label>
905 905
 
906 906
 			<input
907 907
 					type="text"
908 908
 					id="card_address"
909 909
 					name="card_address"
910
-					class="card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>"
911
-					placeholder="<?php esc_attr_e( 'Address line 1', 'give' ); ?>"
912
-					value="<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>"
913
-				<?php echo( give_field_is_required( 'card_address', $form_id ) ? '  required aria-required="true" ' : '' ); ?>
910
+					class="card-address give-input<?php echo(give_field_is_required('card_address', $form_id) ? ' required' : ''); ?>"
911
+					placeholder="<?php esc_attr_e('Address line 1', 'give'); ?>"
912
+					value="<?php echo isset($give_user_info['card_address']) ? $give_user_info['card_address'] : ''; ?>"
913
+				<?php echo(give_field_is_required('card_address', $form_id) ? '  required aria-required="true" ' : ''); ?>
914 914
 			/>
915 915
 		</p>
916 916
 
917 917
 		<p id="give-card-address-2-wrap" class="form-row form-row-wide">
918 918
 			<label for="card_address_2" class="give-label">
919
-				<?php esc_html_e( 'Address 2', 'give' ); ?>
920
-				<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>
919
+				<?php esc_html_e('Address 2', 'give'); ?>
920
+				<?php if (give_field_is_required('card_address_2', $form_id)) : ?>
921 921
 					<span class="give-required-indicator">*</span>
922 922
 				<?php endif; ?>
923 923
 				<span class="give-tooltip give-icon give-icon-question"
924
-					  data-tooltip="<?php esc_attr_e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span>
924
+					  data-tooltip="<?php esc_attr_e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span>
925 925
 			</label>
926 926
 
927 927
 			<input
928 928
 					type="text"
929 929
 					id="card_address_2"
930 930
 					name="card_address_2"
931
-					class="card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>"
932
-					placeholder="<?php esc_attr_e( 'Address line 2', 'give' ); ?>"
933
-					value="<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>"
934
-				<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
931
+					class="card-address-2 give-input<?php echo(give_field_is_required('card_address_2', $form_id) ? ' required' : ''); ?>"
932
+					placeholder="<?php esc_attr_e('Address line 2', 'give'); ?>"
933
+					value="<?php echo isset($give_user_info['card_address_2']) ? $give_user_info['card_address_2'] : ''; ?>"
934
+				<?php echo(give_field_is_required('card_address_2', $form_id) ? ' required aria-required="true" ' : ''); ?>
935 935
 			/>
936 936
 		</p>
937 937
 
938 938
 		<p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive">
939 939
 			<label for="card_city" class="give-label">
940
-				<?php esc_html_e( 'City', 'give' ); ?>
941
-				<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>
940
+				<?php esc_html_e('City', 'give'); ?>
941
+				<?php if (give_field_is_required('card_city', $form_id)) : ?>
942 942
 					<span class="give-required-indicator">*</span>
943 943
 				<?php endif; ?>
944 944
 				<span class="give-tooltip give-icon give-icon-question"
945
-					  data-tooltip="<?php esc_attr_e( 'The city for your billing address.', 'give' ); ?>"></span>
945
+					  data-tooltip="<?php esc_attr_e('The city for your billing address.', 'give'); ?>"></span>
946 946
 			</label>
947 947
 			<input
948 948
 					type="text"
949 949
 					id="card_city"
950 950
 					name="card_city"
951
-					class="card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>"
952
-					placeholder="<?php esc_attr_e( 'City', 'give' ); ?>"
953
-					value="<?php echo isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : ''; ?>"
954
-				<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
951
+					class="card-city give-input<?php echo(give_field_is_required('card_city', $form_id) ? ' required' : ''); ?>"
952
+					placeholder="<?php esc_attr_e('City', 'give'); ?>"
953
+					value="<?php echo isset($give_user_info['card_city']) ? $give_user_info['card_city'] : ''; ?>"
954
+				<?php echo(give_field_is_required('card_city', $form_id) ? ' required aria-required="true" ' : ''); ?>
955 955
 			/>
956 956
 		</p>
957 957
 
958 958
 		<p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive">
959 959
 			<label for="card_zip" class="give-label">
960
-				<?php esc_html_e( 'Zip / Postal Code', 'give' ); ?>
961
-				<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>
960
+				<?php esc_html_e('Zip / Postal Code', 'give'); ?>
961
+				<?php if (give_field_is_required('card_zip', $form_id)) : ?>
962 962
 					<span class="give-required-indicator">*</span>
963 963
 				<?php endif; ?>
964 964
 				<span class="give-tooltip give-icon give-icon-question"
965
-					  data-tooltip="<?php esc_attr_e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span>
965
+					  data-tooltip="<?php esc_attr_e('The zip or postal code for your billing address.', 'give'); ?>"></span>
966 966
 			</label>
967 967
 
968 968
 			<input
@@ -970,40 +970,40 @@  discard block
 block discarded – undo
970 970
 					size="4"
971 971
 					id="card_zip"
972 972
 					name="card_zip"
973
-					class="card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>"
974
-					placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>"
975
-					value="<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>"
976
-				<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
973
+					class="card-zip give-input<?php echo(give_field_is_required('card_zip', $form_id) ? ' required' : ''); ?>"
974
+					placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>"
975
+					value="<?php echo isset($give_user_info['card_zip']) ? $give_user_info['card_zip'] : ''; ?>"
976
+				<?php echo(give_field_is_required('card_zip', $form_id) ? ' required aria-required="true" ' : ''); ?>
977 977
 			/>
978 978
 		</p>
979 979
 
980 980
 		<p id="give-card-country-wrap" class="form-row form-row-first form-row-responsive">
981 981
 			<label for="billing_country" class="give-label">
982
-				<?php esc_html_e( 'Country', 'give' ); ?>
983
-				<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>
982
+				<?php esc_html_e('Country', 'give'); ?>
983
+				<?php if (give_field_is_required('billing_country', $form_id)) : ?>
984 984
 					<span class="give-required-indicator">*</span>
985 985
 				<?php endif; ?>
986 986
 				<span class="give-tooltip give-icon give-icon-question"
987
-					  data-tooltip="<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>"></span>
987
+					  data-tooltip="<?php esc_attr_e('The country for your billing address.', 'give'); ?>"></span>
988 988
 			</label>
989 989
 
990 990
 			<select
991 991
 					name="billing_country"
992 992
 					id="billing_country"
993
-					class="billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>"
994
-				<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
993
+					class="billing-country billing_country give-select<?php echo(give_field_is_required('billing_country', $form_id) ? ' required' : ''); ?>"
994
+				<?php echo(give_field_is_required('billing_country', $form_id) ? ' required aria-required="true" ' : ''); ?>
995 995
 			>
996 996
 				<?php
997 997
 
998 998
 				$selected_country = give_get_country();
999 999
 
1000
-				if ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {
1000
+				if ( ! empty($give_user_info['billing_country']) && '*' !== $give_user_info['billing_country']) {
1001 1001
 					$selected_country = $give_user_info['billing_country'];
1002 1002
 				}
1003 1003
 
1004 1004
 				$countries = give_get_country_list();
1005
-				foreach ( $countries as $country_code => $country ) {
1006
-					echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
1005
+				foreach ($countries as $country_code => $country) {
1006
+					echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
1007 1007
 				}
1008 1008
 				?>
1009 1009
 			</select>
@@ -1013,46 +1013,46 @@  discard block
 block discarded – undo
1013 1013
 		<?php
1014 1014
 		$selected_state = give_get_state();
1015 1015
 
1016
-		$label = __( 'State', 'give' );
1016
+		$label = __('State', 'give');
1017 1017
 		$states_label = give_get_states_label();
1018 1018
 		// Check if $country code exists in the array key for states label.
1019
-		if ( array_key_exists( $selected_country, $states_label ) ) {
1020
-			$label = $states_label[ $selected_country ];
1019
+		if (array_key_exists($selected_country, $states_label)) {
1020
+			$label = $states_label[$selected_country];
1021 1021
 		}
1022 1022
 
1023
-		$states = give_get_states( $selected_country );
1023
+		$states = give_get_states($selected_country);
1024 1024
 
1025 1025
 		// Get the country list that does not have any states init.
1026 1026
 		$no_states_country = give_no_states_country_list();
1027 1027
 
1028
-		if ( ! empty( $give_user_info['card_state'] ) ) {
1028
+		if ( ! empty($give_user_info['card_state'])) {
1029 1029
 			$selected_state = $give_user_info['card_state'];
1030 1030
 		}
1031 1031
 
1032 1032
 		// Get the country list that does not require states.
1033 1033
 		$states_not_required_country_list = give_states_not_required_country_list();
1034 1034
 		?>
1035
-		<p id="give-card-state-wrap" class="form-row form-row-last form-row-responsive <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ) ? 'give-hidden' : ''; ?> ">
1035
+		<p id="give-card-state-wrap" class="form-row form-row-last form-row-responsive <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country)) ? 'give-hidden' : ''; ?> ">
1036 1036
 			<label for="card_state" class="give-label">
1037 1037
 				<?php echo $label; ?>
1038
-				<?php if ( give_field_is_required( 'card_state', $form_id ) ) :
1038
+				<?php if (give_field_is_required('card_state', $form_id)) :
1039 1039
                     ?>
1040
-					<span class="give-required-indicator <?php echo ( array_key_exists( $selected_country, $states_not_required_country_list ) ? 'give-hidden' : '' ) ?> ">*</span>
1040
+					<span class="give-required-indicator <?php echo (array_key_exists($selected_country, $states_not_required_country_list) ? 'give-hidden' : '') ?> ">*</span>
1041 1041
 				<?php endif; ?>
1042 1042
 				<span class="give-tooltip give-icon give-icon-question"
1043
-					  data-tooltip="<?php esc_attr_e( 'The state or province for your billing address.', 'give' ); ?>"></span>
1043
+					  data-tooltip="<?php esc_attr_e('The state or province for your billing address.', 'give'); ?>"></span>
1044 1044
 			</label>
1045 1045
             <?php
1046 1046
 
1047
-			if ( ! empty( $states ) ) : ?>
1047
+			if ( ! empty($states)) : ?>
1048 1048
 				<select
1049 1049
 						name="card_state"
1050 1050
 						id="card_state"
1051
-						class="card_state give-select<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required' : '' ); ?>"
1052
-					<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required aria-required="true" ' : '' ); ?>>
1051
+						class="card_state give-select<?php echo(give_field_is_required('card_state', $form_id) ? ' required' : ''); ?>"
1052
+					<?php echo(give_field_is_required('card_state', $form_id) ? ' required aria-required="true" ' : ''); ?>>
1053 1053
 					<?php
1054
-					foreach ( $states as $state_code => $state ) {
1055
-						echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
1054
+					foreach ($states as $state_code => $state) {
1055
+						echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
1056 1056
 					}
1057 1057
 					?>
1058 1058
 				</select>
@@ -1069,14 +1069,14 @@  discard block
 block discarded – undo
1069 1069
 		 *
1070 1070
 		 * @param int $form_id The form ID.
1071 1071
 		 */
1072
-		do_action( 'give_cc_billing_bottom' );
1072
+		do_action('give_cc_billing_bottom');
1073 1073
 		?>
1074 1074
 	</fieldset>
1075 1075
 	<?php
1076 1076
 	echo ob_get_clean();
1077 1077
 }
1078 1078
 
1079
-add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' );
1079
+add_action('give_after_cc_fields', 'give_default_cc_address_fields');
1080 1080
 
1081 1081
 
1082 1082
 /**
@@ -1089,24 +1089,24 @@  discard block
 block discarded – undo
1089 1089
  *
1090 1090
  * @return string
1091 1091
  */
1092
-function give_get_register_fields( $form_id ) {
1092
+function give_get_register_fields($form_id) {
1093 1093
 
1094 1094
 	global $user_ID;
1095 1095
 
1096
-	if ( is_user_logged_in() ) {
1097
-		$user_data = get_userdata( $user_ID );
1096
+	if (is_user_logged_in()) {
1097
+		$user_data = get_userdata($user_ID);
1098 1098
 	}
1099 1099
 
1100
-	$show_register_form = give_show_login_register_option( $form_id );
1100
+	$show_register_form = give_show_login_register_option($form_id);
1101 1101
 
1102 1102
 	ob_start(); ?>
1103 1103
 	<fieldset id="give-register-fields-<?php echo $form_id; ?>">
1104 1104
 
1105
-		<?php if ( $show_register_form == 'both' ) { ?>
1105
+		<?php if ($show_register_form == 'both') { ?>
1106 1106
 			<div class="give-login-account-wrap">
1107
-				<p class="give-login-message"><?php esc_html_e( 'Already have an account?', 'give' ); ?>&nbsp;
1108
-					<a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login"
1109
-					   data-action="give_checkout_login"><?php esc_html_e( 'Login', 'give' ); ?></a>
1107
+				<p class="give-login-message"><?php esc_html_e('Already have an account?', 'give'); ?>&nbsp;
1108
+					<a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login"
1109
+					   data-action="give_checkout_login"><?php esc_html_e('Login', 'give'); ?></a>
1110 1110
 				</p>
1111 1111
 				<p class="give-loading-text">
1112 1112
 					<span class="give-loading-animation"></span>
@@ -1122,15 +1122,15 @@  discard block
 block discarded – undo
1122 1122
 		 *
1123 1123
 		 * @param int $form_id The form ID.
1124 1124
 		 */
1125
-		do_action( 'give_register_fields_before', $form_id );
1125
+		do_action('give_register_fields_before', $form_id);
1126 1126
 		?>
1127 1127
 
1128 1128
 		<fieldset id="give-register-account-fields-<?php echo $form_id; ?>">
1129 1129
 			<legend>
1130 1130
 				<?php
1131
-				echo apply_filters( 'give_create_account_fieldset_heading', esc_html__( 'Create an account', 'give' ) );
1132
-				if ( ! give_logged_in_only( $form_id ) ) {
1133
-					echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1131
+				echo apply_filters('give_create_account_fieldset_heading', esc_html__('Create an account', 'give'));
1132
+				if ( ! give_logged_in_only($form_id)) {
1133
+					echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1134 1134
 				}
1135 1135
 				?>
1136 1136
 			</legend>
@@ -1142,54 +1142,54 @@  discard block
 block discarded – undo
1142 1142
 			 *
1143 1143
 			 * @param int $form_id The form ID.
1144 1144
 			 */
1145
-			do_action( 'give_register_account_fields_before', $form_id );
1145
+			do_action('give_register_account_fields_before', $form_id);
1146 1146
 			?>
1147 1147
 			<div id="give-user-login-wrap-<?php echo $form_id; ?>"
1148 1148
 				 class="form-row form-row-one-third form-row-first form-row-responsive">
1149 1149
 				<label for="give-user-login-<?php echo $form_id; ?>">
1150
-					<?php esc_html_e( 'Username', 'give' ); ?>
1151
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1150
+					<?php esc_html_e('Username', 'give'); ?>
1151
+					<?php if (give_logged_in_only($form_id)) { ?>
1152 1152
 						<span class="give-required-indicator">*</span>
1153 1153
 					<?php } ?>
1154 1154
 					<span class="give-tooltip give-icon give-icon-question"
1155
-						  data-tooltip="<?php esc_attr_e( 'The username you will use to log into your account.', 'give' ); ?>"></span>
1155
+						  data-tooltip="<?php esc_attr_e('The username you will use to log into your account.', 'give'); ?>"></span>
1156 1156
 				</label>
1157 1157
 
1158 1158
 				<input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="give-input"
1159 1159
 					   type="text"
1160
-					   placeholder="<?php esc_attr_e( 'Username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1160
+					   placeholder="<?php esc_attr_e('Username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1161 1161
 			</div>
1162 1162
 
1163 1163
 			<div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1164 1164
 				 class="form-row form-row-one-third form-row-responsive">
1165 1165
 				<label for="give-user-pass-<?php echo $form_id; ?>">
1166
-					<?php esc_html_e( 'Password', 'give' ); ?>
1167
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1166
+					<?php esc_html_e('Password', 'give'); ?>
1167
+					<?php if (give_logged_in_only($form_id)) { ?>
1168 1168
 						<span class="give-required-indicator">*</span>
1169 1169
 					<?php } ?>
1170 1170
 					<span class="give-tooltip give-icon give-icon-question"
1171
-						  data-tooltip="<?php esc_attr_e( 'The password used to access your account.', 'give' ); ?>"></span>
1171
+						  data-tooltip="<?php esc_attr_e('The password used to access your account.', 'give'); ?>"></span>
1172 1172
 				</label>
1173 1173
 
1174 1174
 				<input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="give-input"
1175
-					   placeholder="<?php esc_attr_e( 'Password', 'give' ); ?>"
1176
-					   type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1175
+					   placeholder="<?php esc_attr_e('Password', 'give'); ?>"
1176
+					   type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1177 1177
 			</div>
1178 1178
 
1179 1179
 			<div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>"
1180 1180
 				 class="give-register-password form-row form-row-one-third form-row-responsive">
1181 1181
 				<label for="give-user-pass-confirm-<?php echo $form_id; ?>">
1182
-					<?php esc_html_e( 'Confirm PW', 'give' ); ?>
1183
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1182
+					<?php esc_html_e('Confirm PW', 'give'); ?>
1183
+					<?php if (give_logged_in_only($form_id)) { ?>
1184 1184
 						<span class="give-required-indicator">*</span>
1185 1185
 					<?php } ?>
1186 1186
 					<span class="give-tooltip give-icon give-icon-question"
1187
-						  data-tooltip="<?php esc_attr_e( 'Please retype your password to confirm.', 'give' ); ?>"></span>
1187
+						  data-tooltip="<?php esc_attr_e('Please retype your password to confirm.', 'give'); ?>"></span>
1188 1188
 				</label>
1189 1189
 
1190 1190
 				<input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>"
1191
-					   class="give-input" placeholder="<?php esc_attr_e( 'Confirm password', 'give' ); ?>"
1192
-					   type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1191
+					   class="give-input" placeholder="<?php esc_attr_e('Confirm password', 'give'); ?>"
1192
+					   type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1193 1193
 			</div>
1194 1194
 			<?php
1195 1195
 			/**
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 			 *
1200 1200
 			 * @param int $form_id The form ID.
1201 1201
 			 */
1202
-			do_action( 'give_register_account_fields_after', $form_id );
1202
+			do_action('give_register_account_fields_after', $form_id);
1203 1203
 			?>
1204 1204
 		</fieldset>
1205 1205
 
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 		 *
1212 1212
 		 * @param int $form_id The form ID.
1213 1213
 		 */
1214
-		do_action( 'give_register_fields_after', $form_id );
1214
+		do_action('give_register_fields_after', $form_id);
1215 1215
 		?>
1216 1216
 
1217 1217
 		<input type="hidden" name="give-purchase-var" value="needs-to-register"/>
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		 *
1223 1223
 		 * @since 1.7
1224 1224
 		 */
1225
-		do_action( 'give_donation_form_user_info', $form_id );
1225
+		do_action('give_donation_form_user_info', $form_id);
1226 1226
 		?>
1227 1227
 
1228 1228
 	</fieldset>
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 	echo ob_get_clean();
1231 1231
 }
1232 1232
 
1233
-add_action( 'give_donation_form_register_fields', 'give_get_register_fields' );
1233
+add_action('give_donation_form_register_fields', 'give_get_register_fields');
1234 1234
 
1235 1235
 /**
1236 1236
  * Gets the login fields for the login form on the checkout. This function hooks
@@ -1243,27 +1243,27 @@  discard block
 block discarded – undo
1243 1243
  *
1244 1244
  * @return string
1245 1245
  */
1246
-function give_get_login_fields( $form_id ) {
1246
+function give_get_login_fields($form_id) {
1247 1247
 
1248
-	$form_id            = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id;
1249
-	$show_register_form = give_show_login_register_option( $form_id );
1248
+	$form_id            = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id;
1249
+	$show_register_form = give_show_login_register_option($form_id);
1250 1250
 
1251 1251
 	ob_start();
1252 1252
 	?>
1253 1253
 	<fieldset id="give-login-fields-<?php echo $form_id; ?>">
1254
-		<legend><?php echo apply_filters( 'give_account_login_fieldset_heading', esc_html__( 'Login to Your Account', 'give' ) );
1255
-			if ( ! give_logged_in_only( $form_id ) ) {
1256
-				echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1254
+		<legend><?php echo apply_filters('give_account_login_fieldset_heading', esc_html__('Login to Your Account', 'give'));
1255
+			if ( ! give_logged_in_only($form_id)) {
1256
+				echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1257 1257
 			} ?>
1258 1258
 		</legend>
1259
-		<?php if ( $show_register_form == 'both' ) { ?>
1259
+		<?php if ($show_register_form == 'both') { ?>
1260 1260
 			<p class="give-new-account-link">
1261
-				<?php esc_html_e( 'Need to create an account?', 'give' ); ?>&nbsp;
1262
-				<a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel"
1261
+				<?php esc_html_e('Need to create an account?', 'give'); ?>&nbsp;
1262
+				<a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel"
1263 1263
 				   data-action="give_checkout_register">
1264
-					<?php esc_html_e( 'Register', 'give' );
1265
-					if ( ! give_logged_in_only( $form_id ) ) {
1266
-						echo ' ' . esc_html__( 'and donate as a guest &raquo;', 'give' );
1264
+					<?php esc_html_e('Register', 'give');
1265
+					if ( ! give_logged_in_only($form_id)) {
1266
+						echo ' '.esc_html__('and donate as a guest &raquo;', 'give');
1267 1267
 					} ?>
1268 1268
 				</a>
1269 1269
 			</p>
@@ -1279,49 +1279,49 @@  discard block
 block discarded – undo
1279 1279
 		 *
1280 1280
 		 * @param int $form_id The form ID.
1281 1281
 		 */
1282
-		do_action( 'give_checkout_login_fields_before', $form_id );
1282
+		do_action('give_checkout_login_fields_before', $form_id);
1283 1283
 		?>
1284 1284
 		<div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive">
1285 1285
 			<label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
1286
-				<?php esc_html_e( 'Username', 'give' ); ?>
1287
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1286
+				<?php esc_html_e('Username', 'give'); ?>
1287
+				<?php if (give_logged_in_only($form_id)) { ?>
1288 1288
 					<span class="give-required-indicator">*</span>
1289 1289
 				<?php } ?>
1290 1290
 			</label>
1291 1291
 
1292
-			<input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text"
1292
+			<input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>" type="text"
1293 1293
 				   name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value=""
1294
-				   placeholder="<?php esc_attr_e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1294
+				   placeholder="<?php esc_attr_e('Your username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1295 1295
 		</div>
1296 1296
 
1297 1297
 		<div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1298 1298
 			 class="give_login_password form-row form-row-last form-row-responsive">
1299 1299
 			<label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
1300
-				<?php esc_html_e( 'Password', 'give' ); ?>
1301
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1300
+				<?php esc_html_e('Password', 'give'); ?>
1301
+				<?php if (give_logged_in_only($form_id)) { ?>
1302 1302
 					<span class="give-required-indicator">*</span>
1303 1303
 				<?php } ?>
1304 1304
 			</label>
1305
-			<input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>"
1305
+			<input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>"
1306 1306
 				   type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>"
1307
-				   placeholder="<?php esc_attr_e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1307
+				   placeholder="<?php esc_attr_e('Your password', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1308 1308
 			<input type="hidden" name="give-purchase-var" value="needs-to-login"/>
1309 1309
 		</div>
1310 1310
 
1311 1311
 		<div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
1312 1312
 			 <span class="give-forgot-password ">
1313 1313
 				 <a href="<?php echo wp_lostpassword_url() ?>"
1314
-					target="_blank"><?php esc_html_e( 'Reset Password', 'give' ) ?></a>
1314
+					target="_blank"><?php esc_html_e('Reset Password', 'give') ?></a>
1315 1315
 			 </span>
1316 1316
 		</div>
1317 1317
 
1318 1318
 		<div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
1319 1319
 			<input type="submit" class="give-submit give-btn button" name="give_login_submit"
1320
-				   value="<?php esc_attr_e( 'Login', 'give' ); ?>"/>
1321
-			<?php if ( $show_register_form !== 'login' ) { ?>
1320
+				   value="<?php esc_attr_e('Login', 'give'); ?>"/>
1321
+			<?php if ($show_register_form !== 'login') { ?>
1322 1322
 				<input type="button" data-action="give_cancel_login"
1323 1323
 					   class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel"
1324
-					   value="<?php esc_attr_e( 'Cancel', 'give' ); ?>"/>
1324
+					   value="<?php esc_attr_e('Cancel', 'give'); ?>"/>
1325 1325
 			<?php } ?>
1326 1326
 			<span class="give-loading-animation"></span>
1327 1327
 		</div>
@@ -1333,14 +1333,14 @@  discard block
 block discarded – undo
1333 1333
 		 *
1334 1334
 		 * @param int $form_id The form ID.
1335 1335
 		 */
1336
-		do_action( 'give_checkout_login_fields_after', $form_id );
1336
+		do_action('give_checkout_login_fields_after', $form_id);
1337 1337
 		?>
1338 1338
 	</fieldset><!--end #give-login-fields-->
1339 1339
 	<?php
1340 1340
 	echo ob_get_clean();
1341 1341
 }
1342 1342
 
1343
-add_action( 'give_donation_form_login_fields', 'give_get_login_fields', 10, 1 );
1343
+add_action('give_donation_form_login_fields', 'give_get_login_fields', 10, 1);
1344 1344
 
1345 1345
 /**
1346 1346
  * Payment Mode Select.
@@ -1356,9 +1356,9 @@  discard block
 block discarded – undo
1356 1356
  *
1357 1357
  * @return void
1358 1358
  */
1359
-function give_payment_mode_select( $form_id ) {
1359
+function give_payment_mode_select($form_id) {
1360 1360
 
1361
-	$gateways = give_get_enabled_payment_gateways( $form_id );
1361
+	$gateways = give_get_enabled_payment_gateways($form_id);
1362 1362
 
1363 1363
 	/**
1364 1364
 	 * Fires while selecting payment gateways, before the fields.
@@ -1367,10 +1367,10 @@  discard block
 block discarded – undo
1367 1367
 	 *
1368 1368
 	 * @param int $form_id The form ID.
1369 1369
 	 */
1370
-	do_action( 'give_payment_mode_top', $form_id );
1370
+	do_action('give_payment_mode_top', $form_id);
1371 1371
 	?>
1372 1372
 
1373
-	<fieldset id="give-payment-mode-select" <?php if ( count( $gateways ) <= 1 ) {
1373
+	<fieldset id="give-payment-mode-select" <?php if (count($gateways) <= 1) {
1374 1374
 		echo 'style="display: none;"';
1375 1375
 	} ?>>
1376 1376
 		<?php
@@ -1381,10 +1381,10 @@  discard block
 block discarded – undo
1381 1381
 		 *
1382 1382
 		 * @param int $form_id The form ID.
1383 1383
 		 */
1384
-		do_action( 'give_payment_mode_before_gateways_wrap' );
1384
+		do_action('give_payment_mode_before_gateways_wrap');
1385 1385
 		?>
1386 1386
 		<legend
1387
-				class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', esc_html__( 'Select Payment Method', 'give' ) ); ?>
1387
+				class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', esc_html__('Select Payment Method', 'give')); ?>
1388 1388
 			<span class="give-loading-text"><span
1389 1389
 						class="give-loading-animation"></span>
1390 1390
             </span>
@@ -1397,26 +1397,26 @@  discard block
 block discarded – undo
1397 1397
 			 *
1398 1398
 			 * @since 1.7
1399 1399
 			 */
1400
-			do_action( 'give_payment_mode_before_gateways' )
1400
+			do_action('give_payment_mode_before_gateways')
1401 1401
 			?>
1402 1402
 			<ul id="give-gateway-radio-list">
1403 1403
 				<?php
1404 1404
 				/**
1405 1405
 				 * Loop through the active payment gateways.
1406 1406
 				 */
1407
-				$selected_gateway  = give_get_chosen_gateway( $form_id );
1407
+				$selected_gateway = give_get_chosen_gateway($form_id);
1408 1408
 
1409
-				foreach ( $gateways as $gateway_id => $gateway ) :
1409
+				foreach ($gateways as $gateway_id => $gateway) :
1410 1410
 					//Determine the default gateway.
1411
-					$checked = checked( $gateway_id, $selected_gateway, false );
1411
+					$checked = checked($gateway_id, $selected_gateway, false);
1412 1412
 					$checked_class = $checked ? ' class="give-gateway-option-selected"' : ''; ?>
1413 1413
 					<li<?php echo $checked_class ?>>
1414 1414
 						<input type="radio" name="payment-mode" class="give-gateway"
1415
-							   id="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1416
-							   value="<?php echo esc_attr( $gateway_id ); ?>"<?php echo $checked; ?>>
1417
-						<label for="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1415
+							   id="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1416
+							   value="<?php echo esc_attr($gateway_id); ?>"<?php echo $checked; ?>>
1417
+						<label for="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1418 1418
 							   class="give-gateway-option"
1419
-							   id="give-gateway-option-<?php echo esc_attr( $gateway_id ); ?>"> <?php echo esc_html( $gateway['checkout_label'] ); ?></label>
1419
+							   id="give-gateway-option-<?php echo esc_attr($gateway_id); ?>"> <?php echo esc_html($gateway['checkout_label']); ?></label>
1420 1420
 					</li>
1421 1421
 					<?php
1422 1422
 				endforeach;
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
 			 *
1429 1429
 			 * @since 1.7
1430 1430
 			 */
1431
-			do_action( 'give_payment_mode_after_gateways' );
1431
+			do_action('give_payment_mode_after_gateways');
1432 1432
 			?>
1433 1433
 		</div>
1434 1434
 		<?php
@@ -1439,7 +1439,7 @@  discard block
 block discarded – undo
1439 1439
 		 *
1440 1440
 		 * @param int $form_id The form ID.
1441 1441
 		 */
1442
-		do_action( 'give_payment_mode_after_gateways_wrap' );
1442
+		do_action('give_payment_mode_after_gateways_wrap');
1443 1443
 		?>
1444 1444
 	</fieldset>
1445 1445
 
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
 	 *
1452 1452
 	 * @param int $form_id The form ID.
1453 1453
 	 */
1454
-	do_action( 'give_payment_mode_bottom', $form_id );
1454
+	do_action('give_payment_mode_bottom', $form_id);
1455 1455
 	?>
1456 1456
 
1457 1457
 	<div id="give_purchase_form_wrap">
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 		 *
1463 1463
 		 * @since 1.7
1464 1464
 		 */
1465
-		do_action( 'give_donation_form', $form_id );
1465
+		do_action('give_donation_form', $form_id);
1466 1466
 		?>
1467 1467
 
1468 1468
 	</div>
@@ -1473,10 +1473,10 @@  discard block
 block discarded – undo
1473 1473
 	 *
1474 1474
 	 * @since 1.7
1475 1475
 	 */
1476
-	do_action( 'give_donation_form_wrap_bottom', $form_id );
1476
+	do_action('give_donation_form_wrap_bottom', $form_id);
1477 1477
 }
1478 1478
 
1479
-add_action( 'give_payment_mode_select', 'give_payment_mode_select' );
1479
+add_action('give_payment_mode_select', 'give_payment_mode_select');
1480 1480
 
1481 1481
 /**
1482 1482
  * Renders the Checkout Agree to Terms, this displays a checkbox for users to
@@ -1489,31 +1489,31 @@  discard block
 block discarded – undo
1489 1489
  *
1490 1490
  * @return bool
1491 1491
  */
1492
-function give_terms_agreement( $form_id ) {
1493
-	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
1492
+function give_terms_agreement($form_id) {
1493
+	$form_option = give_get_meta($form_id, '_give_terms_option', true);
1494 1494
 
1495 1495
 	// Bailout if per form and global term and conditions is not setup.
1496 1496
 	if (
1497
-		give_is_setting_enabled( $form_option, 'global' )
1498
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1497
+		give_is_setting_enabled($form_option, 'global')
1498
+		&& give_is_setting_enabled(give_get_option('terms'))
1499 1499
 	) {
1500
-		$label         = give_get_option( 'agree_to_terms_label', esc_html__( 'Agree to Terms?', 'give' ) );
1501
-		$terms         = $terms = give_get_option( 'agreement_text', '' );
1502
-		$edit_term_url = admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions' );
1500
+		$label         = give_get_option('agree_to_terms_label', esc_html__('Agree to Terms?', 'give'));
1501
+		$terms         = $terms = give_get_option('agreement_text', '');
1502
+		$edit_term_url = admin_url('edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions');
1503 1503
 
1504
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1505
-		$label         = ( $label = give_get_meta( $form_id, '_give_agree_label', true ) ) ? stripslashes( $label ) : esc_html__( 'Agree to Terms?', 'give' );
1506
-		$terms         = give_get_meta( $form_id, '_give_agree_text', true );
1507
-		$edit_term_url = admin_url( 'post.php?post=' . $form_id . '&action=edit#form_terms_options' );
1504
+	} elseif (give_is_setting_enabled($form_option)) {
1505
+		$label         = ($label = give_get_meta($form_id, '_give_agree_label', true)) ? stripslashes($label) : esc_html__('Agree to Terms?', 'give');
1506
+		$terms         = give_get_meta($form_id, '_give_agree_text', true);
1507
+		$edit_term_url = admin_url('post.php?post='.$form_id.'&action=edit#form_terms_options');
1508 1508
 
1509 1509
 	} else {
1510 1510
 		return false;
1511 1511
 	}
1512 1512
 
1513 1513
 	// Bailout: Check if term and conditions text is empty or not.
1514
-	if ( empty( $terms ) ) {
1515
-		if ( is_user_logged_in() && current_user_can( 'edit_give_forms' ) ) {
1516
-			echo sprintf( __( 'Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give' ), $edit_term_url );
1514
+	if (empty($terms)) {
1515
+		if (is_user_logged_in() && current_user_can('edit_give_forms')) {
1516
+			echo sprintf(__('Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give'), $edit_term_url);
1517 1517
 		}
1518 1518
 
1519 1519
 		return false;
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 
1522 1522
 	?>
1523 1523
 	<fieldset id="give_terms_agreement">
1524
-		<legend><?php echo apply_filters( 'give_terms_agreement_text', esc_html__( 'Terms', 'give' ) ); ?></legend>
1524
+		<legend><?php echo apply_filters('give_terms_agreement_text', esc_html__('Terms', 'give')); ?></legend>
1525 1525
 		<div id="give_terms" class="give_terms-<?php echo $form_id; ?>" style="display:none;">
1526 1526
 			<?php
1527 1527
 			/**
@@ -1529,22 +1529,22 @@  discard block
 block discarded – undo
1529 1529
 			 *
1530 1530
 			 * @since 1.0
1531 1531
 			 */
1532
-			do_action( 'give_before_terms' );
1532
+			do_action('give_before_terms');
1533 1533
 
1534
-			echo wpautop( stripslashes( $terms ) );
1534
+			echo wpautop(stripslashes($terms));
1535 1535
 			/**
1536 1536
 			 * Fires while rendering terms of agreement, after the fields.
1537 1537
 			 *
1538 1538
 			 * @since 1.0
1539 1539
 			 */
1540
-			do_action( 'give_after_terms' );
1540
+			do_action('give_after_terms');
1541 1541
 			?>
1542 1542
 		</div>
1543 1543
 		<div id="give_show_terms">
1544 1544
 			<a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1545
-			   aria-controls="give_terms"><?php esc_html_e( 'Show Terms', 'give' ); ?></a>
1545
+			   aria-controls="give_terms"><?php esc_html_e('Show Terms', 'give'); ?></a>
1546 1546
 			<a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1547
-			   aria-controls="give_terms" style="display:none;"><?php esc_html_e( 'Hide Terms', 'give' ); ?></a>
1547
+			   aria-controls="give_terms" style="display:none;"><?php esc_html_e('Hide Terms', 'give'); ?></a>
1548 1548
 		</div>
1549 1549
 
1550 1550
 		<input name="give_agree_to_terms" class="required" type="checkbox"
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 	<?php
1556 1556
 }
1557 1557
 
1558
-add_action( 'give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1 );
1558
+add_action('give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1);
1559 1559
 
1560 1560
 /**
1561 1561
  * Checkout Final Total.
@@ -1568,30 +1568,29 @@  discard block
 block discarded – undo
1568 1568
  *
1569 1569
  * @return void
1570 1570
  */
1571
-function give_checkout_final_total( $form_id ) {
1571
+function give_checkout_final_total($form_id) {
1572 1572
 
1573
-	$total = isset( $_POST['give_total'] ) ?
1574
-		apply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give_total'] ) ) :
1575
-		give_get_default_form_amount( $form_id );
1573
+	$total = isset($_POST['give_total']) ?
1574
+		apply_filters('give_donation_total', give_maybe_sanitize_amount($_POST['give_total'])) : give_get_default_form_amount($form_id);
1576 1575
 
1577 1576
 
1578 1577
 	//Only proceed if give_total available.
1579
-	if ( empty( $total ) ) {
1578
+	if (empty($total)) {
1580 1579
 		return;
1581 1580
 	}
1582 1581
 	?>
1583 1582
 	<p id="give-final-total-wrap" class="form-wrap ">
1584 1583
 		<span class="give-donation-total-label">
1585
-			<?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?>
1584
+			<?php echo apply_filters('give_donation_total_label', esc_html__('Donation Total:', 'give')); ?>
1586 1585
 		</span>
1587
-		<span class="give-final-total-amount" data-total="<?php echo give_format_amount( $total, array( 'sanitize' => false ) ); ?>">
1588
-			<?php echo give_currency_filter( give_format_amount( $total , array( 'sanitize' => false ) ) ); ?>
1586
+		<span class="give-final-total-amount" data-total="<?php echo give_format_amount($total, array('sanitize' => false)); ?>">
1587
+			<?php echo give_currency_filter(give_format_amount($total, array('sanitize' => false))); ?>
1589 1588
 		</span>
1590 1589
 	</p>
1591 1590
 	<?php
1592 1591
 }
1593 1592
 
1594
-add_action( 'give_donation_form_before_submit', 'give_checkout_final_total', 999 );
1593
+add_action('give_donation_form_before_submit', 'give_checkout_final_total', 999);
1595 1594
 
1596 1595
 /**
1597 1596
  * Renders the Checkout Submit section.
@@ -1602,7 +1601,7 @@  discard block
 block discarded – undo
1602 1601
  *
1603 1602
  * @return void
1604 1603
  */
1605
-function give_checkout_submit( $form_id ) {
1604
+function give_checkout_submit($form_id) {
1606 1605
 	?>
1607 1606
 	<fieldset id="give_purchase_submit">
1608 1607
 		<?php
@@ -1611,24 +1610,24 @@  discard block
 block discarded – undo
1611 1610
 		 *
1612 1611
 		 * @since 1.7
1613 1612
 		 */
1614
-		do_action( 'give_donation_form_before_submit', $form_id );
1613
+		do_action('give_donation_form_before_submit', $form_id);
1615 1614
 
1616
-		give_checkout_hidden_fields( $form_id );
1615
+		give_checkout_hidden_fields($form_id);
1617 1616
 
1618
-		echo give_get_donation_form_submit_button( $form_id );
1617
+		echo give_get_donation_form_submit_button($form_id);
1619 1618
 
1620 1619
 		/**
1621 1620
 		 * Fire after donation form submit.
1622 1621
 		 *
1623 1622
 		 * @since 1.7
1624 1623
 		 */
1625
-		do_action( 'give_donation_form_after_submit', $form_id );
1624
+		do_action('give_donation_form_after_submit', $form_id);
1626 1625
 		?>
1627 1626
 	</fieldset>
1628 1627
 	<?php
1629 1628
 }
1630 1629
 
1631
-add_action( 'give_donation_form_after_cc_form', 'give_checkout_submit', 9999 );
1630
+add_action('give_donation_form_after_cc_form', 'give_checkout_submit', 9999);
1632 1631
 
1633 1632
 /**
1634 1633
  * Give Donation form submit button.
@@ -1639,10 +1638,10 @@  discard block
 block discarded – undo
1639 1638
  *
1640 1639
  * @return string
1641 1640
  */
1642
-function give_get_donation_form_submit_button( $form_id ) {
1641
+function give_get_donation_form_submit_button($form_id) {
1643 1642
 
1644
-	$display_label_field = give_get_meta( $form_id, '_give_checkout_label', true );
1645
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
1643
+	$display_label_field = give_get_meta($form_id, '_give_checkout_label', true);
1644
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
1646 1645
 	ob_start();
1647 1646
 	?>
1648 1647
 	<div class="give-submit-button-wrap give-clearfix">
@@ -1650,7 +1649,7 @@  discard block
 block discarded – undo
1650 1649
 		<span class="give-loading-animation"></span>
1651 1650
 	</div>
1652 1651
 	<?php
1653
-	return apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id );
1652
+	return apply_filters('give_donation_form_submit_button', ob_get_clean(), $form_id);
1654 1653
 }
1655 1654
 
1656 1655
 /**
@@ -1665,17 +1664,17 @@  discard block
 block discarded – undo
1665 1664
  *
1666 1665
  * @return mixed
1667 1666
  */
1668
-function give_show_goal_progress( $form_id, $args ) {
1667
+function give_show_goal_progress($form_id, $args) {
1669 1668
 
1670 1669
 	ob_start();
1671
-	give_get_template( 'shortcode-goal', array( 'form_id' => $form_id, 'args' => $args ) );
1670
+	give_get_template('shortcode-goal', array('form_id' => $form_id, 'args' => $args));
1672 1671
 
1673
-	echo apply_filters( 'give_goal_output', ob_get_clean() );
1672
+	echo apply_filters('give_goal_output', ob_get_clean());
1674 1673
 
1675 1674
 	return true;
1676 1675
 }
1677 1676
 
1678
-add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 );
1677
+add_action('give_pre_form', 'give_show_goal_progress', 10, 2);
1679 1678
 
1680 1679
 
1681 1680
 /**
@@ -1688,10 +1687,10 @@  discard block
 block discarded – undo
1688 1687
  *
1689 1688
  * @return mixed|string
1690 1689
  */
1691
-function give_get_form_content_placement( $form_id, $args ) {
1690
+function give_get_form_content_placement($form_id, $args) {
1692 1691
 	$show_content = '';
1693 1692
 
1694
-	if ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) {
1693
+	if (isset($args['show_content']) && ! empty($args['show_content'])) {
1695 1694
 		// Content positions.
1696 1695
 		$content_placement = array(
1697 1696
 			'above' => 'give_pre_form',
@@ -1699,18 +1698,18 @@  discard block
 block discarded – undo
1699 1698
 		);
1700 1699
 
1701 1700
 		// Check if content position already decoded.
1702
-		if ( in_array( $args['show_content'], $content_placement ) ) {
1701
+		if (in_array($args['show_content'], $content_placement)) {
1703 1702
 			return $args['show_content'];
1704 1703
 		}
1705 1704
 
1706
-		$show_content = ( 'none' !== $args['show_content'] ? $content_placement[ $args['show_content'] ] : '' );
1705
+		$show_content = ('none' !== $args['show_content'] ? $content_placement[$args['show_content']] : '');
1707 1706
 
1708
-	} elseif ( give_is_setting_enabled( give_get_meta( $form_id, '_give_display_content', true ) ) ) {
1709
-		$show_content = give_get_meta( $form_id, '_give_content_placement', true );
1707
+	} elseif (give_is_setting_enabled(give_get_meta($form_id, '_give_display_content', true))) {
1708
+		$show_content = give_get_meta($form_id, '_give_content_placement', true);
1710 1709
 
1711
-	} elseif ( 'none' !== give_get_meta( $form_id, '_give_content_option', true ) ) {
1710
+	} elseif ('none' !== give_get_meta($form_id, '_give_content_option', true)) {
1712 1711
 		// Backward compatibility for _give_content_option for v18.
1713
-		$show_content = give_get_meta( $form_id, '_give_content_option', true );
1712
+		$show_content = give_get_meta($form_id, '_give_content_option', true);
1714 1713
 	}
1715 1714
 
1716 1715
 	return $show_content;
@@ -1726,20 +1725,20 @@  discard block
 block discarded – undo
1726 1725
  *
1727 1726
  * @return void|bool
1728 1727
  */
1729
-function give_form_content( $form_id, $args ) {
1728
+function give_form_content($form_id, $args) {
1730 1729
 
1731
-	$show_content = give_get_form_content_placement( $form_id, $args );
1730
+	$show_content = give_get_form_content_placement($form_id, $args);
1732 1731
 
1733 1732
 	// Bailout.
1734
-	if ( empty( $show_content ) ) {
1733
+	if (empty($show_content)) {
1735 1734
 		return false;
1736 1735
 	}
1737 1736
 
1738 1737
 	// Add action according to value.
1739
-	add_action( $show_content, 'give_form_display_content', 10, 2 );
1738
+	add_action($show_content, 'give_form_display_content', 10, 2);
1740 1739
 }
1741 1740
 
1742
-add_action( 'give_pre_form_output', 'give_form_content', 10, 2 );
1741
+add_action('give_pre_form_output', 'give_form_content', 10, 2);
1743 1742
 
1744 1743
 /**
1745 1744
  * Renders Post Form Content.
@@ -1753,22 +1752,22 @@  discard block
 block discarded – undo
1753 1752
  *
1754 1753
  * @return void
1755 1754
  */
1756
-function give_form_display_content( $form_id, $args ) {
1755
+function give_form_display_content($form_id, $args) {
1757 1756
 
1758
-	$content      = wpautop( give_get_meta( $form_id, '_give_form_content', true ) );
1759
-	$show_content = give_get_form_content_placement( $form_id, $args );
1757
+	$content      = wpautop(give_get_meta($form_id, '_give_form_content', true));
1758
+	$show_content = give_get_form_content_placement($form_id, $args);
1760 1759
 
1761
-	if ( give_is_setting_enabled( give_get_option( 'the_content_filter' ) ) ) {
1762
-		$content = apply_filters( 'the_content', $content );
1760
+	if (give_is_setting_enabled(give_get_option('the_content_filter'))) {
1761
+		$content = apply_filters('the_content', $content);
1763 1762
 	}
1764 1763
 
1765
-	$output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap ' . $show_content . '-content">' . $content . '</div>';
1764
+	$output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap '.$show_content.'-content">'.$content.'</div>';
1766 1765
 
1767
-	echo apply_filters( 'give_form_content_output', $output );
1766
+	echo apply_filters('give_form_content_output', $output);
1768 1767
 
1769 1768
 	//remove action to prevent content output on addition forms on page.
1770 1769
 	//@see: https://github.com/WordImpress/Give/issues/634.
1771
-	remove_action( $show_content, 'give_form_display_content' );
1770
+	remove_action($show_content, 'give_form_display_content');
1772 1771
 }
1773 1772
 
1774 1773
 /**
@@ -1780,7 +1779,7 @@  discard block
 block discarded – undo
1780 1779
  *
1781 1780
  * @return void
1782 1781
  */
1783
-function give_checkout_hidden_fields( $form_id ) {
1782
+function give_checkout_hidden_fields($form_id) {
1784 1783
 
1785 1784
 	/**
1786 1785
 	 * Fires while rendering hidden checkout fields, before the fields.
@@ -1789,13 +1788,13 @@  discard block
 block discarded – undo
1789 1788
 	 *
1790 1789
 	 * @param int $form_id The form ID.
1791 1790
 	 */
1792
-	do_action( 'give_hidden_fields_before', $form_id );
1791
+	do_action('give_hidden_fields_before', $form_id);
1793 1792
 
1794
-	if ( is_user_logged_in() ) { ?>
1793
+	if (is_user_logged_in()) { ?>
1795 1794
 		<input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/>
1796 1795
 	<?php } ?>
1797 1796
 	<input type="hidden" name="give_action" value="purchase"/>
1798
-	<input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/>
1797
+	<input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/>
1799 1798
 	<?php
1800 1799
 	/**
1801 1800
 	 * Fires while rendering hidden checkout fields, after the fields.
@@ -1804,7 +1803,7 @@  discard block
 block discarded – undo
1804 1803
 	 *
1805 1804
 	 * @param int $form_id The form ID.
1806 1805
 	 */
1807
-	do_action( 'give_hidden_fields_after', $form_id );
1806
+	do_action('give_hidden_fields_after', $form_id);
1808 1807
 
1809 1808
 }
1810 1809
 
@@ -1819,20 +1818,20 @@  discard block
 block discarded – undo
1819 1818
  *
1820 1819
  * @return string $content Filtered content.
1821 1820
  */
1822
-function give_filter_success_page_content( $content ) {
1821
+function give_filter_success_page_content($content) {
1823 1822
 
1824 1823
 	$give_options = give_get_settings();
1825 1824
 
1826
-	if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) {
1827
-		if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) {
1828
-			$content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content );
1825
+	if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) {
1826
+		if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) {
1827
+			$content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content);
1829 1828
 		}
1830 1829
 	}
1831 1830
 
1832 1831
 	return $content;
1833 1832
 }
1834 1833
 
1835
-add_filter( 'the_content', 'give_filter_success_page_content' );
1834
+add_filter('the_content', 'give_filter_success_page_content');
1836 1835
 
1837 1836
 /**
1838 1837
  * Test Mode Frontend Warning.
@@ -1843,12 +1842,12 @@  discard block
 block discarded – undo
1843 1842
  */
1844 1843
 function give_test_mode_frontend_warning() {
1845 1844
 
1846
-	if ( give_is_test_mode() ) {
1847
-		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . esc_html__( 'Notice:', 'give' ) . '</strong> ' . esc_html__( 'Test mode is enabled. While in test mode no live donations are processed.', 'give' ) . '</p></div>';
1845
+	if (give_is_test_mode()) {
1846
+		echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>'.esc_html__('Notice:', 'give').'</strong> '.esc_html__('Test mode is enabled. While in test mode no live donations are processed.', 'give').'</p></div>';
1848 1847
 	}
1849 1848
 }
1850 1849
 
1851
-add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 );
1850
+add_action('give_pre_form', 'give_test_mode_frontend_warning', 10);
1852 1851
 
1853 1852
 /**
1854 1853
  * Members-only Form.
@@ -1862,21 +1861,21 @@  discard block
 block discarded – undo
1862 1861
  *
1863 1862
  * @return string
1864 1863
  */
1865
-function give_members_only_form( $final_output, $args ) {
1864
+function give_members_only_form($final_output, $args) {
1866 1865
 
1867
-	$form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0;
1866
+	$form_id = isset($args['form_id']) ? $args['form_id'] : 0;
1868 1867
 
1869 1868
 	//Sanity Check: Must have form_id & not be logged in.
1870
-	if ( empty( $form_id ) || is_user_logged_in() ) {
1869
+	if (empty($form_id) || is_user_logged_in()) {
1871 1870
 		return $final_output;
1872 1871
 	}
1873 1872
 
1874 1873
 	//Logged in only and Register / Login set to none.
1875
-	if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) {
1874
+	if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') {
1876 1875
 
1877
-		$final_output = Give()->notices->print_frontend_notice( esc_html__( 'Please log in in order to complete your donation.', 'give' ), false );
1876
+		$final_output = Give()->notices->print_frontend_notice(esc_html__('Please log in in order to complete your donation.', 'give'), false);
1878 1877
 
1879
-		return apply_filters( 'give_members_only_output', $final_output, $form_id );
1878
+		return apply_filters('give_members_only_output', $final_output, $form_id);
1880 1879
 
1881 1880
 	}
1882 1881
 
@@ -1884,4 +1883,4 @@  discard block
 block discarded – undo
1884 1883
 
1885 1884
 }
1886 1885
 
1887
-add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 );
1886
+add_filter('give_donate_form', 'give_members_only_form', 10, 2);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1056,9 +1056,12 @@
 block discarded – undo
1056 1056
 					}
1057 1057
 					?>
1058 1058
 				</select>
1059
-			<?php else : ?>
1059
+			<?php else {
1060
+	: ?>
1060 1061
 				<input type="text" size="6" name="card_state" id="card_state" class="card_state give-input"
1061
-					   placeholder="<?php echo $label; ?>"/>
1062
+					   placeholder="<?php echo $label;
1063
+}
1064
+?>"/>
1062 1065
 			<?php endif; ?>
1063 1066
 		</p>
1064 1067
 		<?php
Please login to merge, or discard this patch.
includes/class-give-gravatars.php 1 patch
Spacing   +95 added lines, -95 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
 
@@ -62,50 +62,50 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return bool If the gravatar exists or not
64 64
 	 */
65
-	public function validate_gravatar( $id_or_email ) {
65
+	public function validate_gravatar($id_or_email) {
66 66
 		//id or email code borrowed from wp-includes/pluggable.php
67 67
 		$email = '';
68
-		if ( is_numeric( $id_or_email ) ) {
68
+		if (is_numeric($id_or_email)) {
69 69
 			$id   = (int) $id_or_email;
70
-			$user = get_userdata( $id );
71
-			if ( $user ) {
70
+			$user = get_userdata($id);
71
+			if ($user) {
72 72
 				$email = $user->user_email;
73 73
 			}
74
-		} elseif ( is_object( $id_or_email ) ) {
74
+		} elseif (is_object($id_or_email)) {
75 75
 			// No avatar for pingbacks or trackbacks
76
-			$allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );
77
-			if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) {
76
+			$allowed_comment_types = apply_filters('get_avatar_comment_types', array('comment'));
77
+			if ( ! empty($id_or_email->comment_type) && ! in_array($id_or_email->comment_type, (array) $allowed_comment_types)) {
78 78
 				return false;
79 79
 			}
80 80
 
81
-			if ( ! empty( $id_or_email->user_id ) ) {
81
+			if ( ! empty($id_or_email->user_id)) {
82 82
 				$id   = (int) $id_or_email->user_id;
83
-				$user = get_userdata( $id );
84
-				if ( $user ) {
83
+				$user = get_userdata($id);
84
+				if ($user) {
85 85
 					$email = $user->user_email;
86 86
 				}
87
-			} elseif ( ! empty( $id_or_email->comment_author_email ) ) {
87
+			} elseif ( ! empty($id_or_email->comment_author_email)) {
88 88
 				$email = $id_or_email->comment_author_email;
89 89
 			}
90 90
 		} else {
91 91
 			$email = $id_or_email;
92 92
 		}
93 93
 
94
-		$hashkey = md5( strtolower( trim( $email ) ) );
95
-		$uri     = 'http://www.gravatar.com/avatar/' . $hashkey . '?d=404';
94
+		$hashkey = md5(strtolower(trim($email)));
95
+		$uri     = 'http://www.gravatar.com/avatar/'.$hashkey.'?d=404';
96 96
 
97
-		$data = wp_cache_get( $hashkey );
98
-		if ( false === $data ) {
99
-			$response = wp_remote_head( $uri );
100
-			if ( is_wp_error( $response ) ) {
97
+		$data = wp_cache_get($hashkey);
98
+		if (false === $data) {
99
+			$response = wp_remote_head($uri);
100
+			if (is_wp_error($response)) {
101 101
 				$data = 'not200';
102 102
 			} else {
103 103
 				$data = $response['response']['code'];
104 104
 			}
105
-			wp_cache_set( $hashkey, $data, $group = '', $expire = 60 * 5 );
105
+			wp_cache_set($hashkey, $data, $group = '', $expire = 60 * 5);
106 106
 
107 107
 		}
108
-		if ( $data == '200' ) {
108
+		if ($data == '200') {
109 109
 			return true;
110 110
 		} else {
111 111
 			return false;
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
 	 *
123 123
 	 * @return array        IDs if logs, false otherwise
124 124
 	 */
125
-	public function get_log_ids( $form_id = '' ) {
125
+	public function get_log_ids($form_id = '') {
126 126
 
127 127
 		// get Give_Logging class
128 128
 		global $give_logs;
129 129
 
130 130
 		// get log for this form
131
-		$logs = $give_logs->get_logs( $form_id );
131
+		$logs = $give_logs->get_logs($form_id);
132 132
 
133
-		if ( $logs ) {
133
+		if ($logs) {
134 134
 			$log_ids = array();
135 135
 
136 136
 			// make an array with all the donor IDs
137
-			foreach ( $logs as $log ) {
137
+			foreach ($logs as $log) {
138 138
 				$log_ids[] = $log->ID;
139 139
 			}
140 140
 
@@ -155,51 +155,51 @@  discard block
 block discarded – undo
155 155
 	 *
156 156
 	 * @return mixed
157 157
 	 */
158
-	public function get_payment_ids( $form_id = '' ) {
158
+	public function get_payment_ids($form_id = '') {
159 159
 
160 160
 		$give_options = give_get_settings();
161 161
 
162
-		$log_ids = $this->get_log_ids( $form_id );
162
+		$log_ids = $this->get_log_ids($form_id);
163 163
 
164
-		if ( $log_ids ) {
164
+		if ($log_ids) {
165 165
 
166 166
 			$payment_ids = array();
167 167
 
168
-			foreach ( $log_ids as $id ) {
168
+			foreach ($log_ids as $id) {
169 169
 				// get the payment ID for each corresponding log ID
170
-				$payment_ids[] = give_get_meta( $id, '_give_log_payment_id', true );
170
+				$payment_ids[] = give_get_meta($id, '_give_log_payment_id', true);
171 171
 			}
172 172
 
173 173
 			// remove donors who have donated more than once so we can have unique avatars
174 174
 			$unique_emails = array();
175 175
 
176
-			foreach ( $payment_ids as $key => $id ) {
176
+			foreach ($payment_ids as $key => $id) {
177 177
 
178
-				$email = give_get_meta( $id, '_give_payment_user_email', true );
178
+				$email = give_get_meta($id, '_give_payment_user_email', true);
179 179
 
180
-				if ( isset ( $give_options['give_donors_gravatars_has_gravatar_account'] ) ) {
181
-					if ( ! $this->validate_gravatar( $email ) ) {
180
+				if (isset ($give_options['give_donors_gravatars_has_gravatar_account'])) {
181
+					if ( ! $this->validate_gravatar($email)) {
182 182
 						continue;
183 183
 					}
184 184
 				}
185 185
 
186
-				$unique_emails[ $id ] = give_get_meta( $id, '_give_payment_user_email', true );
186
+				$unique_emails[$id] = give_get_meta($id, '_give_payment_user_email', true);
187 187
 
188 188
 			}
189 189
 
190 190
 			$unique_ids = array();
191 191
 
192 192
 			// strip duplicate emails
193
-			$unique_emails = array_unique( $unique_emails );
193
+			$unique_emails = array_unique($unique_emails);
194 194
 
195 195
 			// convert the unique IDs back into simple array
196
-			foreach ( $unique_emails as $id => $email ) {
196
+			foreach ($unique_emails as $id => $email) {
197 197
 				$unique_ids[] = $id;
198 198
 			}
199 199
 
200 200
 			// randomize the payment IDs if enabled
201
-			if ( isset( $give_options['give_donors_gravatars_random_gravatars'] ) ) {
202
-				shuffle( $unique_ids );
201
+			if (isset($give_options['give_donors_gravatars_random_gravatars'])) {
202
+				shuffle($unique_ids);
203 203
 			}
204 204
 
205 205
 			// return our unique IDs
@@ -220,22 +220,22 @@  discard block
 block discarded – undo
220 220
 	 *
221 221
 	 * @return string
222 222
 	 */
223
-	public function gravatars( $form_id = false, $title = '' ) {
223
+	public function gravatars($form_id = false, $title = '') {
224 224
 
225 225
 		// unique $payment_ids 
226
-		$payment_ids = $this->get_payment_ids( $form_id );
226
+		$payment_ids = $this->get_payment_ids($form_id);
227 227
 
228 228
 		$give_options = give_get_settings();
229 229
 
230 230
 		// return if no ID
231
-		if ( ! $form_id ) {
231
+		if ( ! $form_id) {
232 232
 			return;
233 233
 		}
234 234
 
235 235
 		// minimum amount of donations before showing gravatars
236 236
 		// if the number of items in array is not greater or equal to the number specified, then exit
237
-		if ( isset( $give_options['give_donors_gravatars_min_purchases_required'] ) && '' != $give_options['give_donors_gravatars_min_purchases_required'] ) {
238
-			if ( ! ( count( $payment_ids ) >= $give_options['give_donors_gravatars_min_purchases_required'] ) ) {
237
+		if (isset($give_options['give_donors_gravatars_min_purchases_required']) && '' != $give_options['give_donors_gravatars_min_purchases_required']) {
238
+			if ( ! (count($payment_ids) >= $give_options['give_donors_gravatars_min_purchases_required'])) {
239 239
 				return;
240 240
 			}
241 241
 		}
@@ -246,51 +246,51 @@  discard block
 block discarded – undo
246 246
 		echo '<div id="give-purchase-gravatars">';
247 247
 
248 248
 
249
-		if ( isset ( $title ) ) {
249
+		if (isset ($title)) {
250 250
 
251
-			if ( $title ) {
252
-				echo apply_filters( 'give_donors_gravatars_title', '<h3 class="give-gravatars-title">' . esc_attr( $title ) . '</h3>' );
253
-			} elseif ( isset( $give_options['give_donors_gravatars_heading'] ) ) {
254
-				echo apply_filters( 'give_donors_gravatars_title', '<h3 class="give-gravatars-title">' . esc_attr( $give_options['give_donors_gravatars_heading'] ) . '</h2>' );
251
+			if ($title) {
252
+				echo apply_filters('give_donors_gravatars_title', '<h3 class="give-gravatars-title">'.esc_attr($title).'</h3>');
253
+			} elseif (isset($give_options['give_donors_gravatars_heading'])) {
254
+				echo apply_filters('give_donors_gravatars_title', '<h3 class="give-gravatars-title">'.esc_attr($give_options['give_donors_gravatars_heading']).'</h2>');
255 255
 			}
256 256
 
257 257
 		}
258 258
 		echo '<ul class="give-purchase-gravatars-list">';
259 259
 		$i = 0;
260 260
 
261
-		if ( $payment_ids ) {
262
-			foreach ( $payment_ids as $id ) {
261
+		if ($payment_ids) {
262
+			foreach ($payment_ids as $id) {
263 263
 
264 264
 				// Give saves a blank option even when the control is turned off, hence the extra check
265
-				if ( isset( $give_options['give_donors_gravatars_maximum_number'] ) && '' != $give_options['give_donors_gravatars_maximum_number'] && $i == $give_options['give_donors_gravatars_maximum_number'] ) {
265
+				if (isset($give_options['give_donors_gravatars_maximum_number']) && '' != $give_options['give_donors_gravatars_maximum_number'] && $i == $give_options['give_donors_gravatars_maximum_number']) {
266 266
 					continue;
267 267
 				}
268 268
 
269 269
 				// get the payment meta
270
-				$payment_meta = give_get_meta( $id, '_give_payment_meta', true );
270
+				$payment_meta = give_get_meta($id, '_give_payment_meta', true);
271 271
 
272 272
 				// unserialize the payment meta
273
-				$user_info = maybe_unserialize( $payment_meta['user_info'] );
273
+				$user_info = maybe_unserialize($payment_meta['user_info']);
274 274
 
275 275
 				// get donor's first name
276 276
 				$name = $user_info['first_name'];
277 277
 
278 278
 				// get donor's email
279
-				$email = give_get_meta( $id, '_give_payment_user_email', true );
279
+				$email = give_get_meta($id, '_give_payment_user_email', true);
280 280
 
281 281
 				// set gravatar size and provide filter
282
-				$size = isset( $give_options['give_donors_gravatars_gravatar_size'] ) ? apply_filters( 'give_donors_gravatars_gravatar_size', $give_options['give_donors_gravatars_gravatar_size'] ) : '';
282
+				$size = isset($give_options['give_donors_gravatars_gravatar_size']) ? apply_filters('give_donors_gravatars_gravatar_size', $give_options['give_donors_gravatars_gravatar_size']) : '';
283 283
 
284 284
 				// default image
285
-				$default_image = apply_filters( 'give_donors_gravatars_gravatar_default_image', false );
285
+				$default_image = apply_filters('give_donors_gravatars_gravatar_default_image', false);
286 286
 
287 287
 				// assemble output
288 288
 				$output .= '<li>';
289 289
 
290
-				$output .= get_avatar( $email, $size, $default_image, $name );
290
+				$output .= get_avatar($email, $size, $default_image, $name);
291 291
 				$output .= '</li>';
292 292
 
293
-				$i ++;
293
+				$i++;
294 294
 
295 295
 			} // end foreach
296 296
 		}
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 		echo '</ul>';
300 300
 		echo '</div>';
301 301
 
302
-		return apply_filters( 'give_donors_gravatars', ob_get_clean() );
302
+		return apply_filters('give_donors_gravatars', ob_get_clean());
303 303
 	}
304 304
 
305 305
 	/**
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	 * @return void
312 312
 	 */
313 313
 	public function register_widget() {
314
-		register_widget( 'Give_Donors_Gravatars_Widget' );
314
+		register_widget('Give_Donors_Gravatars_Widget');
315 315
 	}
316 316
 
317 317
 	/**
@@ -325,19 +325,19 @@  discard block
 block discarded – undo
325 325
 	 *
326 326
 	 * @return string
327 327
 	 */
328
-	public function shortcode( $atts, $content = null ) {
328
+	public function shortcode($atts, $content = null) {
329 329
 
330
-		$atts = shortcode_atts( array(
330
+		$atts = shortcode_atts(array(
331 331
 			'id'    => '',
332 332
 			'title' => ''
333
-		), $atts, 'give_donors_gravatars' );
333
+		), $atts, 'give_donors_gravatars');
334 334
 
335 335
 		// if no ID is passed on single give_forms pages, get the correct ID
336
-		if ( is_singular( 'give_forms' ) ) {
336
+		if (is_singular('give_forms')) {
337 337
 			$id = get_the_ID();
338 338
 		}
339 339
 
340
-		$content = $this->gravatars( $atts['id'], $atts['title'] );
340
+		$content = $this->gravatars($atts['id'], $atts['title']);
341 341
 
342 342
 		return $content;
343 343
 
@@ -353,56 +353,56 @@  discard block
 block discarded – undo
353 353
 	 *
354 354
 	 * @return array           Gravatar settings.
355 355
 	 */
356
-	public function settings( $settings ) {
356
+	public function settings($settings) {
357 357
 
358 358
 		$give_gravatar_settings = array(
359 359
 			array(
360
-				'name' => esc_html__( 'Donator Gravatars', 'give' ),
360
+				'name' => esc_html__('Donator Gravatars', 'give'),
361 361
 				'desc' => '<hr>',
362 362
 				'id'   => 'give_title',
363 363
 				'type' => 'give_title'
364 364
 			),
365 365
 			array(
366
-				'name' => esc_html__( 'Heading', 'give' ),
367
-				'desc' => esc_html__( 'The heading to display above the Gravatars.', 'give' ),
366
+				'name' => esc_html__('Heading', 'give'),
367
+				'desc' => esc_html__('The heading to display above the Gravatars.', 'give'),
368 368
 				'type' => 'text',
369 369
 				'id'   => 'give_donors_gravatars_heading'
370 370
 			),
371 371
 			array(
372
-				'name'    => esc_html__( 'Gravatar Size', 'give' ),
373
-				'desc'    => esc_html__( 'The size of each Gravatar in pixels (512px maximum).', 'give' ),
372
+				'name'    => esc_html__('Gravatar Size', 'give'),
373
+				'desc'    => esc_html__('The size of each Gravatar in pixels (512px maximum).', 'give'),
374 374
 				'type'    => 'text_small',
375 375
 				'id'      => 'give_donors_gravatars_gravatar_size',
376 376
 				'default' => '64'
377 377
 			),
378 378
 			array(
379
-				'name' => esc_html__( 'Minimum Unique Donations Required', 'give' ),
380
-				'desc' => esc_html__( 'The minimum number of unique donations a form must have before the Gravatars are shown. Leave blank for no minimum.', 'give' ),
379
+				'name' => esc_html__('Minimum Unique Donations Required', 'give'),
380
+				'desc' => esc_html__('The minimum number of unique donations a form must have before the Gravatars are shown. Leave blank for no minimum.', 'give'),
381 381
 				'type' => 'text_small',
382 382
 				'id'   => 'give_donors_gravatars_min_purchases_required',
383 383
 			),
384 384
 			array(
385
-				'name'    => esc_html__( 'Maximum Gravatars To Show', 'give' ),
386
-				'desc'    => esc_html__( 'The maximum number of gravatars to show. Leave blank for no limit.', 'give' ),
385
+				'name'    => esc_html__('Maximum Gravatars To Show', 'give'),
386
+				'desc'    => esc_html__('The maximum number of gravatars to show. Leave blank for no limit.', 'give'),
387 387
 				'type'    => 'text',
388 388
 				'id'      => 'give_donors_gravatars_maximum_number',
389 389
 				'default' => '20',
390 390
 			),
391 391
 			array(
392
-				'name' => esc_html__( 'Gravatar Visibility', 'give' ),
393
-				'desc' => esc_html__( 'Show only donors with a Gravatar account.', 'give' ),
392
+				'name' => esc_html__('Gravatar Visibility', 'give'),
393
+				'desc' => esc_html__('Show only donors with a Gravatar account.', 'give'),
394 394
 				'id'   => 'give_donors_gravatars_has_gravatar_account',
395 395
 				'type' => 'checkbox',
396 396
 			),
397 397
 			array(
398
-				'name' => esc_html__( 'Randomize Gravatars', 'give' ),
399
-				'desc' => esc_html__( 'Randomize the Gravatars.', 'give' ),
398
+				'name' => esc_html__('Randomize Gravatars', 'give'),
399
+				'desc' => esc_html__('Randomize the Gravatars.', 'give'),
400 400
 				'id'   => 'give_donors_gravatars_random_gravatars',
401 401
 				'type' => 'checkbox',
402 402
 			),
403 403
 		);
404 404
 
405
-		return array_merge( $settings, $give_gravatar_settings );
405
+		return array_merge($settings, $give_gravatar_settings);
406 406
 	}
407 407
 
408 408
 }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 		// widget settings
429 429
 		$widget_ops = array(
430 430
 			'classname'   => 'give-donors-gravatars',
431
-			'description' => esc_html__( 'Displays gravatars of people who have donated using your your form. Will only show on the single form page.', 'give' ),
431
+			'description' => esc_html__('Displays gravatars of people who have donated using your your form. Will only show on the single form page.', 'give'),
432 432
 		);
433 433
 
434 434
 		// widget control settings
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 		// create the widget
442 442
 		parent::__construct(
443 443
 			'give_donors_gravatars_widget',
444
-			esc_html__( 'Give Donors Gravatars', 'give' ),
444
+			esc_html__('Give Donors Gravatars', 'give'),
445 445
 			$widget_ops,
446 446
 			$control_ops
447 447
 		);
@@ -461,29 +461,29 @@  discard block
 block discarded – undo
461 461
 	 *
462 462
 	 * @return void
463 463
 	 */
464
-	public function widget( $args, $instance ) {
464
+	public function widget($args, $instance) {
465 465
 
466 466
 		//@TODO: Don't extract it!!!
467
-		extract( $args );
467
+		extract($args);
468 468
 
469
-		if ( ! is_singular( 'give_forms' ) ) {
469
+		if ( ! is_singular('give_forms')) {
470 470
 			return;
471 471
 		}
472 472
 
473 473
 		// Variables from widget settings
474
-		$title = apply_filters( 'widget_title', $instance['title'] );
474
+		$title = apply_filters('widget_title', $instance['title']);
475 475
 
476 476
 		// Used by themes. Opens the widget
477 477
 		echo $before_widget;
478 478
 
479 479
 		// Display the widget title
480
-		if ( $title ) {
481
-			echo $before_title . $title . $after_title;
480
+		if ($title) {
481
+			echo $before_title.$title.$after_title;
482 482
 		}
483 483
 
484 484
 		$gravatars = new Give_Donors_Gravatars();
485 485
 
486
-		echo $gravatars->gravatars( get_the_ID(), null ); // remove title
486
+		echo $gravatars->gravatars(get_the_ID(), null); // remove title
487 487
 
488 488
 		// Used by themes. Closes the widget
489 489
 		echo $after_widget;
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
 	 *
504 504
 	 * @return array Updated settings to save.
505 505
 	 */
506
-	public function update( $new_instance, $old_instance ) {
506
+	public function update($new_instance, $old_instance) {
507 507
 
508 508
 		$instance = $old_instance;
509 509
 
510
-		$instance['title'] = strip_tags( $new_instance['title'] );
510
+		$instance['title'] = strip_tags($new_instance['title']);
511 511
 
512 512
 		return $instance;
513 513
 
@@ -525,19 +525,19 @@  discard block
 block discarded – undo
525 525
 	 *
526 526
 	 * @return void
527 527
 	 */
528
-	public function form( $instance ) {
528
+	public function form($instance) {
529 529
 
530 530
 		// Set up some default widget settings.
531 531
 		$defaults = array(
532 532
 			'title' => '',
533 533
 		);
534 534
 
535
-		$instance = wp_parse_args( (array) $instance, $defaults ); ?>
535
+		$instance = wp_parse_args((array) $instance, $defaults); ?>
536 536
 
537 537
 		<!-- Title -->
538 538
 		<p>
539
-			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'give' ) ?></label>
540
-			<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $instance['title']; ?>" />
539
+			<label for="<?php echo $this->get_field_id('title'); ?>"><?php esc_html_e('Title:', 'give') ?></label>
540
+			<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $instance['title']; ?>" />
541 541
 		</p>
542 542
 
543 543
 		<?php
Please login to merge, or discard this patch.
includes/gateways/functions.php 1 patch
Spacing   +66 added lines, -66 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
 
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 	// Default, built-in gateways
25 25
 	$gateways = array(
26 26
 		'paypal' => array(
27
-			'admin_label'    => __( 'PayPal Standard', 'give' ),
28
-			'checkout_label' => __( 'PayPal', 'give' ),
27
+			'admin_label'    => __('PayPal Standard', 'give'),
28
+			'checkout_label' => __('PayPal', 'give'),
29 29
 		),
30 30
 		'manual' => array(
31
-			'admin_label'    => __( 'Test Donation', 'give' ),
32
-			'checkout_label' => __( 'Test Donation', 'give' )
31
+			'admin_label'    => __('Test Donation', 'give'),
32
+			'checkout_label' => __('Test Donation', 'give')
33 33
 		),
34 34
 	);
35 35
 
36
-	return apply_filters( 'give_payment_gateways', $gateways );
36
+	return apply_filters('give_payment_gateways', $gateways);
37 37
 
38 38
 }
39 39
 
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @return array $gateway_list All the available gateways
48 48
  */
49
-function give_get_enabled_payment_gateways( $form_id = 0 ) {
49
+function give_get_enabled_payment_gateways($form_id = 0) {
50 50
 
51 51
 	$gateways = give_get_payment_gateways();
52 52
 
53
-	$enabled = isset( $_POST['gateways'] ) ? $_POST['gateways'] : give_get_option( 'gateways' );
53
+	$enabled = isset($_POST['gateways']) ? $_POST['gateways'] : give_get_option('gateways');
54 54
 
55 55
 	$gateway_list = array();
56 56
 
57
-	foreach ( $gateways as $key => $gateway ) {
58
-		if ( isset( $enabled[ $key ] ) && $enabled[ $key ] == 1 ) {
59
-			$gateway_list[ $key ] = $gateway;
57
+	foreach ($gateways as $key => $gateway) {
58
+		if (isset($enabled[$key]) && $enabled[$key] == 1) {
59
+			$gateway_list[$key] = $gateway;
60 60
 		}
61 61
 	}
62 62
 
63 63
 	// Set order of payment gateway in list.
64
-	$gateway_list = give_get_ordered_payment_gateways( $gateway_list );
64
+	$gateway_list = give_get_ordered_payment_gateways($gateway_list);
65 65
 
66
-	return apply_filters( 'give_enabled_payment_gateways', $gateway_list, $form_id );
66
+	return apply_filters('give_enabled_payment_gateways', $gateway_list, $form_id);
67 67
 }
68 68
 
69 69
 /**
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
  *
76 76
  * @return boolean true if enabled, false otherwise
77 77
  */
78
-function give_is_gateway_active( $gateway ) {
78
+function give_is_gateway_active($gateway) {
79 79
 	$gateways = give_get_enabled_payment_gateways();
80 80
 
81
-	$ret = array_key_exists( $gateway, $gateways );
81
+	$ret = array_key_exists($gateway, $gateways);
82 82
 
83
-	return apply_filters( 'give_is_gateway_active', $ret, $gateway, $gateways );
83
+	return apply_filters('give_is_gateway_active', $ret, $gateway, $gateways);
84 84
 }
85 85
 
86 86
 /**
@@ -92,23 +92,23 @@  discard block
 block discarded – undo
92 92
  *
93 93
  * @return string Gateway ID
94 94
  */
95
-function give_get_default_gateway( $form_id ) {
95
+function give_get_default_gateway($form_id) {
96 96
 
97 97
 	$give_options = give_get_settings();
98
-	$default      = isset( $give_options['default_gateway'] ) && give_is_gateway_active( $give_options['default_gateway'] ) ? $give_options['default_gateway'] : 'paypal';
99
-	$form_default = give_get_meta( $form_id, '_give_default_gateway', true );
98
+	$default      = isset($give_options['default_gateway']) && give_is_gateway_active($give_options['default_gateway']) ? $give_options['default_gateway'] : 'paypal';
99
+	$form_default = give_get_meta($form_id, '_give_default_gateway', true);
100 100
 
101 101
 	// Single Form settings varies compared to the Global default settings.
102
-	if ( ! empty( $form_default ) &&
102
+	if ( ! empty($form_default) &&
103 103
 		 $form_id !== null &&
104 104
 		 $default !== $form_default &&
105 105
 		 $form_default !== 'global' &&
106
-		 give_is_gateway_active( $form_default )
106
+		 give_is_gateway_active($form_default)
107 107
 	) {
108 108
 		$default = $form_default;
109 109
 	}
110 110
 
111
-	return apply_filters( 'give_default_gateway', $default );
111
+	return apply_filters('give_default_gateway', $default);
112 112
 }
113 113
 
114 114
 /**
@@ -120,18 +120,18 @@  discard block
 block discarded – undo
120 120
  *
121 121
  * @return string Gateway admin label
122 122
  */
123
-function give_get_gateway_admin_label( $gateway ) {
123
+function give_get_gateway_admin_label($gateway) {
124 124
 	$gateways = give_get_payment_gateways();
125
-	$label    = isset( $gateways[ $gateway ] ) ? $gateways[ $gateway ]['admin_label'] : $gateway;
126
-	$payment  = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : false;
125
+	$label    = isset($gateways[$gateway]) ? $gateways[$gateway]['admin_label'] : $gateway;
126
+	$payment  = isset($_GET['id']) ? absint($_GET['id']) : false;
127 127
 
128
-	if ( $gateway == 'manual' && $payment ) {
129
-		if ( give_get_payment_amount( $payment ) == 0 ) {
130
-			$label = __( 'Test Donation', 'give' );
128
+	if ($gateway == 'manual' && $payment) {
129
+		if (give_get_payment_amount($payment) == 0) {
130
+			$label = __('Test Donation', 'give');
131 131
 		}
132 132
 	}
133 133
 
134
-	return apply_filters( 'give_gateway_admin_label', $label, $gateway );
134
+	return apply_filters('give_gateway_admin_label', $label, $gateway);
135 135
 }
136 136
 
137 137
 /**
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
  *
144 144
  * @return string Checkout label for the gateway
145 145
  */
146
-function give_get_gateway_checkout_label( $gateway ) {
146
+function give_get_gateway_checkout_label($gateway) {
147 147
 	$gateways = give_get_payment_gateways();
148
-	$label    = isset( $gateways[ $gateway ] ) ? $gateways[ $gateway ]['checkout_label'] : $gateway;
148
+	$label    = isset($gateways[$gateway]) ? $gateways[$gateway]['checkout_label'] : $gateway;
149 149
 
150
-	if ( $gateway == 'manual' ) {
151
-		$label = __( 'Test Donation', 'give' );
150
+	if ($gateway == 'manual') {
151
+		$label = __('Test Donation', 'give');
152 152
 	}
153 153
 
154
-	return apply_filters( 'give_gateway_checkout_label', $label, $gateway );
154
+	return apply_filters('give_gateway_checkout_label', $label, $gateway);
155 155
 }
156 156
 
157 157
 /**
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
  *
164 164
  * @return array Options the gateway supports
165 165
  */
166
-function give_get_gateway_supports( $gateway ) {
166
+function give_get_gateway_supports($gateway) {
167 167
 	$gateways = give_get_enabled_payment_gateways();
168
-	$supports = isset( $gateways[ $gateway ]['supports'] ) ? $gateways[ $gateway ]['supports'] : array();
168
+	$supports = isset($gateways[$gateway]['supports']) ? $gateways[$gateway]['supports'] : array();
169 169
 
170
-	return apply_filters( 'give_gateway_supports', $supports, $gateway );
170
+	return apply_filters('give_gateway_supports', $supports, $gateway);
171 171
 }
172 172
 
173 173
 /**
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
  *
181 181
  * @return void
182 182
  */
183
-function give_send_to_gateway( $gateway, $payment_data ) {
183
+function give_send_to_gateway($gateway, $payment_data) {
184 184
 
185
-	$payment_data['gateway_nonce'] = wp_create_nonce( 'give-gateway' );
185
+	$payment_data['gateway_nonce'] = wp_create_nonce('give-gateway');
186 186
 
187 187
 	/**
188 188
 	 * Fires while loading payment gateway via AJAX.
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @param array $payment_data All the payment data to be sent to the gateway.
195 195
 	 */
196
-	do_action( "give_gateway_{$gateway}", $payment_data );
196
+	do_action("give_gateway_{$gateway}", $payment_data);
197 197
 }
198 198
 
199 199
 
@@ -207,34 +207,34 @@  discard block
 block discarded – undo
207 207
  *
208 208
  * @return string $enabled_gateway The slug of the gateway
209 209
  */
210
-function give_get_chosen_gateway( $form_id ) {
210
+function give_get_chosen_gateway($form_id) {
211 211
 
212
-	$request_form_id = isset( $_REQUEST['give_form_id'] ) ? $_REQUEST['give_form_id'] : 0;
212
+	$request_form_id = isset($_REQUEST['give_form_id']) ? $_REQUEST['give_form_id'] : 0;
213 213
 
214 214
 	// Back to check if 'form-id' is present.
215
-	if ( empty( $request_form_id ) ) {
216
-		$request_form_id = isset( $_REQUEST['form-id'] ) ? $_REQUEST['form-id'] : 0;
215
+	if (empty($request_form_id)) {
216
+		$request_form_id = isset($_REQUEST['form-id']) ? $_REQUEST['form-id'] : 0;
217 217
 	}
218 218
 
219
-	$request_payment_mode = isset( $_REQUEST['payment-mode'] ) ? $_REQUEST['payment-mode'] : '';
219
+	$request_payment_mode = isset($_REQUEST['payment-mode']) ? $_REQUEST['payment-mode'] : '';
220 220
 	$chosen               = false;
221 221
 
222 222
 	// If both 'payment-mode' and 'form-id' then set for only this form.
223
-	if ( ! empty( $request_form_id ) && $form_id == $request_form_id ) {
223
+	if ( ! empty($request_form_id) && $form_id == $request_form_id) {
224 224
 		$chosen = $request_payment_mode;
225
-	} elseif ( empty( $request_form_id ) && $request_payment_mode ) {
225
+	} elseif (empty($request_form_id) && $request_payment_mode) {
226 226
 		// If no 'form-id' but there is 'payment-mode'.
227 227
 		$chosen = $request_payment_mode;
228 228
 	}
229 229
 
230 230
 	// Get the enable gateway based of chosen var.
231
-	if ( $chosen && give_is_gateway_active( $chosen ) ) {
232
-		$enabled_gateway = urldecode( $chosen );
231
+	if ($chosen && give_is_gateway_active($chosen)) {
232
+		$enabled_gateway = urldecode($chosen);
233 233
 	} else {
234
-		$enabled_gateway = give_get_default_gateway( $form_id );
234
+		$enabled_gateway = give_get_default_gateway($form_id);
235 235
 	}
236 236
 
237
-	return apply_filters( 'give_chosen_gateway', $enabled_gateway );
237
+	return apply_filters('give_chosen_gateway', $enabled_gateway);
238 238
 
239 239
 }
240 240
 
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
  *
253 253
  * @return int ID of the new log entry
254 254
  */
255
-function give_record_gateway_error( $title = '', $message = '', $parent = 0 ) {
256
-	return give_record_log( $title, $message, $parent, 'gateway_error' );
255
+function give_record_gateway_error($title = '', $message = '', $parent = 0) {
256
+	return give_record_log($title, $message, $parent, 'gateway_error');
257 257
 }
258 258
 
259 259
 /**
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
  *
267 267
  * @return int
268 268
  */
269
-function give_count_sales_by_gateway( $gateway_id = 'paypal', $status = 'publish' ) {
269
+function give_count_sales_by_gateway($gateway_id = 'paypal', $status = 'publish') {
270 270
 
271 271
 	$ret  = 0;
272 272
 	$args = array(
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
 		'fields'      => 'ids',
279 279
 	);
280 280
 
281
-	$payments = new WP_Query( $args );
281
+	$payments = new WP_Query($args);
282 282
 
283
-	if ( $payments ) {
283
+	if ($payments) {
284 284
 		$ret = $payments->post_count;
285 285
 	}
286 286
 
@@ -297,27 +297,27 @@  discard block
 block discarded – undo
297 297
  *
298 298
  * @return array $gateways All the available gateways
299 299
  */
300
-function give_get_ordered_payment_gateways( $gateways ) {
300
+function give_get_ordered_payment_gateways($gateways) {
301 301
 
302 302
 	// Get gateways setting.
303
-	$gateways_setting = isset( $_POST['gateways'] ) ? $_POST['gateways'] : give_get_option( 'gateways' );
303
+	$gateways_setting = isset($_POST['gateways']) ? $_POST['gateways'] : give_get_option('gateways');
304 304
 
305 305
 	// Return from here if we do not have gateways setting.
306
-	if ( empty( $gateways_setting ) ) {
306
+	if (empty($gateways_setting)) {
307 307
 		return $gateways;
308 308
 	}
309 309
 
310 310
 	// Reverse array to order payment gateways.
311
-	$gateways_setting = array_reverse( $gateways_setting );
311
+	$gateways_setting = array_reverse($gateways_setting);
312 312
 
313 313
 	// Reorder gateways array
314
-	foreach ( $gateways_setting as $gateway_key => $value ) {
314
+	foreach ($gateways_setting as $gateway_key => $value) {
315 315
 
316
-		$new_gateway_value = isset( $gateways[ $gateway_key ] ) ? $gateways[ $gateway_key ] : '';
317
-		unset( $gateways[ $gateway_key ] );
316
+		$new_gateway_value = isset($gateways[$gateway_key]) ? $gateways[$gateway_key] : '';
317
+		unset($gateways[$gateway_key]);
318 318
 
319
-		if ( ! empty( $new_gateway_value ) ) {
320
-			$gateways = array_merge( array( $gateway_key => $new_gateway_value ), $gateways );
319
+		if ( ! empty($new_gateway_value)) {
320
+			$gateways = array_merge(array($gateway_key => $new_gateway_value), $gateways);
321 321
 		}
322 322
 	}
323 323
 
@@ -328,5 +328,5 @@  discard block
 block discarded – undo
328 328
 	 *
329 329
 	 * @param array $gateways All the available gateways
330 330
 	 */
331
-	return apply_filters( 'give_payment_gateways_order', $gateways );
331
+	return apply_filters('give_payment_gateways_order', $gateways);
332 332
 }
333 333
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/class-addon-activation-banner.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Exit if accessed directly.
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 *                               'testing'           => false, // (required) Never leave as "true" in production!!!
33 33
 	 *                               }
34 34
 	 */
35
-	function __construct( $_banner_details ) {
35
+	function __construct($_banner_details) {
36 36
 		$current_user = wp_get_current_user();
37 37
 
38 38
 		$this->plugin_activate_by   = 0;
39 39
 		$this->banner_details       = $_banner_details;
40
-		$this->test_mode            = ( $this->banner_details['testing'] == 'true' ) ? true : false;
41
-		$this->nag_meta_key         = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] );
42
-		$this->activate_by_meta_key = 'give_addon_' . sanitize_title( $this->banner_details['name'] ) . '_active_by_user';
40
+		$this->test_mode            = ($this->banner_details['testing'] == 'true') ? true : false;
41
+		$this->nag_meta_key         = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']);
42
+		$this->activate_by_meta_key = 'give_addon_'.sanitize_title($this->banner_details['name']).'_active_by_user';
43 43
 
44 44
 		//Get current user
45 45
 		$this->user_id = $current_user->ID;
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 	public function init() {
63 63
 
64 64
 		//Testing?
65
-		if ( $this->test_mode ) {
66
-			delete_user_meta( $this->user_id, $this->nag_meta_key );
65
+		if ($this->test_mode) {
66
+			delete_user_meta($this->user_id, $this->nag_meta_key);
67 67
 		}
68 68
 
69 69
 		//Get the current page to add the notice to
70
-		add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) );
71
-		add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );
70
+		add_action('current_screen', array($this, 'give_addon_notice_ignore'));
71
+		add_action('admin_notices', array($this, 'give_addon_activation_admin_notice'));
72 72
 
73 73
 		// File path of addon must be included in banner detail other addon activate meta will not delete.
74 74
 		$file_name = $this->get_plugin_file_name();
75 75
 
76
-		if ( ! empty( $file_name ) ) {
77
-			add_action( 'deactivate_' . $file_name, array( $this, 'remove_addon_activate_meta' ) );
76
+		if ( ! empty($file_name)) {
77
+			add_action('deactivate_'.$file_name, array($this, 'remove_addon_activate_meta'));
78 78
 		}
79 79
 	}
80 80
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	private function is_plugin_page() {
90 90
 		$screen = get_current_screen();
91 91
 
92
-		return ( $screen->parent_file === 'plugins.php' );
92
+		return ($screen->parent_file === 'plugins.php');
93 93
 	}
94 94
 
95 95
 
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
 	public function give_addon_activation_admin_notice() {
103 103
 
104 104
 		// Bailout.
105
-		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) {
105
+		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by) {
106 106
 			return;
107 107
 		}
108 108
 
109 109
 		// If the user hasn't already dismissed the alert, output activation banner.
110
-		if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) {
110
+		if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) {
111 111
 
112 112
 			// Output inline styles here because there's no reason
113 113
 			// to enqueued them after the alert is dismissed.
@@ -189,44 +189,44 @@  discard block
 block discarded – undo
189 189
 					<h3><?php
190 190
 						printf(
191 191
 						/* translators: %s: Add-on name */
192
-							esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ),
193
-							'<span>' . $this->banner_details['name'] . '</span>'
192
+							esc_html__("Thank you for installing Give's %s Add-on!", 'give'),
193
+							'<span>'.$this->banner_details['name'].'</span>'
194 194
 						);
195 195
 						?></h3>
196 196
 
197 197
 					<a href="<?php
198 198
 					//The Dismiss Button.
199
-					$nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0';
200
-					echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span
199
+					$nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0';
200
+					echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span
201 201
 							class="dashicons dashicons-dismiss"></span></a>
202 202
 
203 203
 					<div class="alert-actions">
204 204
 
205 205
 						<?php //Point them to your settings page.
206
-						if ( isset( $this->banner_details['settings_url'] ) ) { ?>
206
+						if (isset($this->banner_details['settings_url'])) { ?>
207 207
 							<a href="<?php echo $this->banner_details['settings_url']; ?>">
208
-								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?>
208
+								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?>
209 209
 							</a>
210 210
 						<?php } ?>
211 211
 
212 212
 						<?php
213 213
 						// Show them how to configure the Addon.
214
-						if ( isset( $this->banner_details['documentation_url'] ) ) { ?>
214
+						if (isset($this->banner_details['documentation_url'])) { ?>
215 215
 							<a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank">
216 216
 								<span class="dashicons dashicons-media-text"></span><?php
217 217
 								printf(
218 218
 								/* translators: %s: Add-on name */
219
-									esc_html__( 'Documentation: %s Add-on', 'give' ),
219
+									esc_html__('Documentation: %s Add-on', 'give'),
220 220
 									$this->banner_details['name']
221 221
 								);
222 222
 								?></a>
223 223
 						<?php } ?>
224 224
 						<?php
225 225
 						//Let them signup for plugin updates
226
-						if ( isset( $this->banner_details['support_url'] ) ) { ?>
226
+						if (isset($this->banner_details['support_url'])) { ?>
227 227
 
228 228
 							<a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank">
229
-								<span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?>
229
+								<span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?>
230 230
 							</a>
231 231
 
232 232
 						<?php } ?>
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
 		 * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
254 254
 		 * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
255 255
 		 */
256
-		if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) {
256
+		if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) {
257 257
 
258 258
 			//Get the global user
259 259
 			$current_user = wp_get_current_user();
260 260
 			$user_id      = $current_user->ID;
261 261
 
262
-			add_user_meta( $user_id, $this->nag_meta_key, 'true', true );
262
+			add_user_meta($user_id, $this->nag_meta_key, 'true', true);
263 263
 		}
264 264
 	}
265 265
 
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 	 * @access private
271 271
 	 */
272 272
 	private function add_addon_activate_meta() {
273
-		$user_id                  = get_option( $this->activate_by_meta_key );
273
+		$user_id                  = get_option($this->activate_by_meta_key);
274 274
 		$this->plugin_activate_by = (int) $user_id;
275 275
 
276
-		if ( ! $user_id ) {
277
-			add_option( $this->activate_by_meta_key, $this->user_id, '', 'no' );
276
+		if ( ! $user_id) {
277
+			add_option($this->activate_by_meta_key, $this->user_id, '', 'no');
278 278
 			$this->plugin_activate_by = (int) $this->user_id;
279 279
 		}
280 280
 	}
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
 	 * @access public
288 288
 	 */
289 289
 	public function remove_addon_activate_meta() {
290
-		$user_id = get_option( $this->activate_by_meta_key );
290
+		$user_id = get_option($this->activate_by_meta_key);
291 291
 
292
-		if ( $user_id ) {
293
-			delete_option( $this->activate_by_meta_key );
292
+		if ($user_id) {
293
+			delete_option($this->activate_by_meta_key);
294 294
 		}
295 295
 	}
296 296
 
@@ -303,39 +303,39 @@  discard block
 block discarded – undo
303 303
 	 * @return mixed
304 304
 	 */
305 305
 	private function get_plugin_file_name() {
306
-		$active_plugins = get_option( 'active_plugins' );
306
+		$active_plugins = get_option('active_plugins');
307 307
 		$file_name      = '';
308 308
 
309 309
 		try {
310 310
 
311 311
 			// Check addon file path.
312
-			if ( ! empty( $this->banner_details['file'] ) ) {
312
+			if ( ! empty($this->banner_details['file'])) {
313 313
 				$file_name = '';
314
-				if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) {
315
-					$file_path = array_pop( $file_path );
316
-					$file_name = current( explode( '/', $file_path ) );
314
+				if ($file_path = explode('/plugins/', $this->banner_details['file'])) {
315
+					$file_path = array_pop($file_path);
316
+					$file_name = current(explode('/', $file_path));
317 317
 				}
318 318
 
319
-				if ( empty( $file_name ) ) {
319
+				if (empty($file_name)) {
320 320
 					return false;
321 321
 				}
322 322
 
323
-				foreach ( $active_plugins as $plugin ) {
324
-					if ( false !== strpos( $plugin, $file_name ) ) {
323
+				foreach ($active_plugins as $plugin) {
324
+					if (false !== strpos($plugin, $file_name)) {
325 325
 						$file_name = $plugin;
326 326
 						break;
327 327
 					}
328 328
 				}
329
-			} elseif ( WP_DEBUG ) {
330
-				throw new Exception( __( "File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give' ) );
329
+			} elseif (WP_DEBUG) {
330
+				throw new Exception(__("File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give'));
331 331
 			}
332 332
 
333 333
 			// Check plugin path calculated by addon file path.
334
-			if ( empty( $file_name ) && WP_DEBUG ) {
335
-				throw new Exception( __( "Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give' ) );
334
+			if (empty($file_name) && WP_DEBUG) {
335
+				throw new Exception(__("Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give'));
336 336
 			}
337 337
 
338
-		} catch ( Exception $e ) {
338
+		} catch (Exception $e) {
339 339
 			echo $e->getMessage();
340 340
 		}
341 341
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-display.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 								'disabled' => __( 'Disabled', 'give' ),
88 88
 							)
89 89
 						),
90
-                        array(
91
-                            'name'  => __( 'Display Settings Docs Link', 'give' ),
92
-                            'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
95
-                            'type'  => 'give_docs_link',
96
-                        ),
90
+						array(
91
+							'name'  => __( 'Display Settings Docs Link', 'give' ),
92
+							'id'    => 'display_settings_docs_link',
93
+							'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
+							'title' => __( 'Display Options Settings', 'give' ),
95
+							'type'  => 'give_docs_link',
96
+						),
97 97
 						array(
98 98
 							'id'   => 'give_title_display_settings_1',
99 99
 							'type' => 'sectionend'
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 								'disabled' => __( 'Disabled', 'give' ),
171 171
 							)
172 172
 						),
173
-                        array(
174
-                            'name'  => __( 'Post Types Docs Link', 'give' ),
175
-                            'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
178
-                            'type'  => 'give_docs_link',
179
-                        ),
173
+						array(
174
+							'name'  => __( 'Post Types Docs Link', 'give' ),
175
+							'id'    => 'post_types_settings_docs_link',
176
+							'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
+							'title' => __( 'Post Types Settings', 'give' ),
178
+							'type'  => 'give_docs_link',
179
+						),
180 180
 						array(
181 181
 							'id'   => 'give_title_display_settings_2',
182 182
 							'type' => 'sectionend'
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 								'disabled' => __( 'Disabled', 'give' ),
213 213
 							)
214 214
 						),
215
-                        array(
216
-                            'name'  => __( 'Taxonomies Docs Link', 'give' ),
217
-                            'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
220
-                            'type'  => 'give_docs_link',
221
-                        ),
215
+						array(
216
+							'name'  => __( 'Taxonomies Docs Link', 'give' ),
217
+							'id'    => 'taxonomies_settings_docs_link',
218
+							'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
+							'title' => __( 'Taxonomies Settings', 'give' ),
220
+							'type'  => 'give_docs_link',
221
+						),
222 222
 						array(
223 223
 							'id'   => 'give_title_display_settings_3',
224 224
 							'type' => 'sectionend'
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261
-                        array(
262
-                            'name'  => __( 'Terms and Conditions Docs Link', 'give' ),
263
-                            'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
266
-                            'type'  => 'give_docs_link',
267
-                        ),
261
+						array(
262
+							'name'  => __( 'Terms and Conditions Docs Link', 'give' ),
263
+							'id'    => 'terms_settings_docs_link',
264
+							'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
+							'title' => __( 'Terms and Conditions Settings', 'give' ),
266
+							'type'  => 'give_docs_link',
267
+						),
268 268
 						array(
269 269
 							'id'   => 'give_title_display_settings_4',
270 270
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Display' ) ) :
16
+if ( ! class_exists('Give_Settings_Display')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Display.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'display';
30
-			$this->label = __( 'Display Options', 'give' );
30
+			$this->label = __('Display Options', 'give');
31 31
 
32 32
 			$this->default_tab = 'display-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'display-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Display
@@ -53,45 +53,45 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title'
54 54
 						),
55 55
 						array(
56
-							'name'    => __( 'Default Give Styles', 'give' ),
57
-							'desc'    => __( 'You can disable Give\'s default styles for donation forms and other frontend elements.', 'give' ),
56
+							'name'    => __('Default Give Styles', 'give'),
57
+							'desc'    => __('You can disable Give\'s default styles for donation forms and other frontend elements.', 'give'),
58 58
 							'id'      => 'css',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'enabled',
61 61
 							'options' => array(
62
-								'enabled' => __( 'Enabled', 'give' ),
63
-								'disabled' => __( 'Disabled', 'give' ),
62
+								'enabled' => __('Enabled', 'give'),
63
+								'disabled' => __('Disabled', 'give'),
64 64
 							)
65 65
 						),
66 66
 						array(
67
-							'name' => __( 'Floating Labels', 'give' ),
67
+							'name' => __('Floating Labels', 'give'),
68 68
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
69
-							'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> allows your lables to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
69
+							'desc' => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> allows your lables to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url('http://docs.givewp.com/form-floating-labels')),
70 70
 							'id'   => 'floatlabels',
71 71
 							'type'    => 'radio_inline',
72 72
 							'default' => 'disabled',
73 73
 							'options' => array(
74
-								'enabled' => __( 'Enabled', 'give' ),
75
-								'disabled' => __( 'Disabled', 'give' ),
74
+								'enabled' => __('Enabled', 'give'),
75
+								'disabled' => __('Disabled', 'give'),
76 76
 							)
77 77
 						),
78 78
 						array(
79
-							'name'    => __( 'Welcome Screen', 'give' ),
79
+							'name'    => __('Welcome Screen', 'give'),
80 80
 							/* translators: %s: about page URL */
81
-							'desc'    => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
81
+							'desc'    => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('index.php?page=give-about'))),
82 82
 							'id'      => 'welcome',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'enabled',
85 85
 							'options' => array(
86
-								'enabled' => __( 'Enabled', 'give' ),
87
-								'disabled' => __( 'Disabled', 'give' ),
86
+								'enabled' => __('Enabled', 'give'),
87
+								'disabled' => __('Disabled', 'give'),
88 88
 							)
89 89
 						),
90 90
                         array(
91
-                            'name'  => __( 'Display Settings Docs Link', 'give' ),
91
+                            'name'  => __('Display Settings Docs Link', 'give'),
92 92
                             'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
93
+                            'url'   => esc_url('http://docs.givewp.com/form-display-options'),
94
+                            'title' => __('Display Options Settings', 'give'),
95 95
                             'type'  => 'give_docs_link',
96 96
                         ),
97 97
 						array(
@@ -108,73 +108,73 @@  discard block
 block discarded – undo
108 108
 							'type' => 'title'
109 109
 						),
110 110
 						array(
111
-							'name'    => __( 'Form Single Views', 'give' ),
112
-							'desc'    => __( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
111
+							'name'    => __('Form Single Views', 'give'),
112
+							'desc'    => __('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
113 113
 							'id'      => 'forms_singular',
114 114
 							'type'    => 'radio_inline',
115 115
 							'default' => 'enabled',
116 116
 							'options' => array(
117
-								'enabled' => __( 'Enabled', 'give' ),
118
-								'disabled' => __( 'Disabled', 'give' ),
117
+								'enabled' => __('Enabled', 'give'),
118
+								'disabled' => __('Disabled', 'give'),
119 119
 							)
120 120
 						),
121 121
 						array(
122
-							'name'    => __( 'Form Archives', 'give' ),
123
-							'desc'    => sprintf( wp_kses( __( 'Archives pages list all the donation 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 <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'options-permalink.php' ) ) ),
122
+							'name'    => __('Form Archives', 'give'),
123
+							'desc'    => sprintf(wp_kses(__('Archives pages list all the donation 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 <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('options-permalink.php'))),
124 124
 							'id'      => 'forms_archives',
125 125
 							'type'    => 'radio_inline',
126 126
 							'default' => 'enabled',
127 127
 							'options' => array(
128
-								'enabled' => __( 'Enabled', 'give' ),
129
-								'disabled' => __( 'Disabled', 'give' ),
128
+								'enabled' => __('Enabled', 'give'),
129
+								'disabled' => __('Disabled', 'give'),
130 130
 							)
131 131
 						),
132 132
 						array(
133
-							'name'    => __( 'Form Excerpts', 'give' ),
134
-							'desc'    => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
133
+							'name'    => __('Form Excerpts', 'give'),
134
+							'desc'    => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
135 135
 							'id'      => 'forms_excerpt',
136 136
 							'type'    => 'radio_inline',
137 137
 							'default' => 'enabled',
138 138
 							'options' => array(
139
-								'enabled' => __( 'Enabled', 'give' ),
140
-								'disabled' => __( 'Disabled', 'give' ),
139
+								'enabled' => __('Enabled', 'give'),
140
+								'disabled' => __('Disabled', 'give'),
141 141
 							)
142 142
 						),
143 143
 						array(
144
-							'name'    => __( 'Form Featured Image', 'give' ),
145
-							'desc'    => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
144
+							'name'    => __('Form Featured Image', 'give'),
145
+							'desc'    => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
146 146
 							'id'      => 'form_featured_img',
147 147
 							'type'    => 'radio_inline',
148 148
 							'default' => 'enabled',
149 149
 							'options' => array(
150
-								'enabled' => __( 'Enabled', 'give' ),
151
-								'disabled' => __( 'Disabled', 'give' ),
150
+								'enabled' => __('Enabled', 'give'),
151
+								'disabled' => __('Disabled', 'give'),
152 152
 							)
153 153
 						),
154 154
 						array(
155
-							'name'    => __( 'Featured Image Size', 'give' ),
156
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
155
+							'name'    => __('Featured Image Size', 'give'),
156
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
157 157
 							'id'      => 'featured_image_size',
158 158
 							'type'    => 'select',
159 159
 							'default' => 'large',
160 160
 							'options' => give_get_featured_image_sizes()
161 161
 						),
162 162
 						array(
163
-							'name'    => __( 'Single Form Sidebar', 'give' ),
164
-							'desc'    => __( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
163
+							'name'    => __('Single Form Sidebar', 'give'),
164
+							'desc'    => __('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
165 165
 							'id'      => 'form_sidebar',
166 166
 							'type'    => 'radio_inline',
167 167
 							'default' => 'enabled',
168 168
 							'options' => array(
169
-								'enabled' => __( 'Enabled', 'give' ),
170
-								'disabled' => __( 'Disabled', 'give' ),
169
+								'enabled' => __('Enabled', 'give'),
170
+								'disabled' => __('Disabled', 'give'),
171 171
 							)
172 172
 						),
173 173
                         array(
174
-                            'name'  => __( 'Post Types Docs Link', 'give' ),
174
+                            'name'  => __('Post Types Docs Link', 'give'),
175 175
                             'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
176
+                            'url'   => esc_url('http://docs.givewp.com/settings-post-types'),
177
+                            'title' => __('Post Types Settings', 'give'),
178 178
                             'type'  => 'give_docs_link',
179 179
                         ),
180 180
 						array(
@@ -191,32 +191,32 @@  discard block
 block discarded – undo
191 191
 							'type' => 'title'
192 192
 						),
193 193
 						array(
194
-							'name' => __( 'Form Categories', 'give' ),
195
-							'desc' => __( 'Enable Categories for all Give forms.', 'give' ),
194
+							'name' => __('Form Categories', 'give'),
195
+							'desc' => __('Enable Categories for all Give forms.', 'give'),
196 196
 							'id'   => 'categories',
197 197
 							'type'    => 'radio_inline',
198 198
 							'default' => 'disabled',
199 199
 							'options' => array(
200
-								'enabled' => __( 'Enabled', 'give' ),
201
-								'disabled' => __( 'Disabled', 'give' ),
200
+								'enabled' => __('Enabled', 'give'),
201
+								'disabled' => __('Disabled', 'give'),
202 202
 							)
203 203
 						),
204 204
 						array(
205
-							'name' => __( 'Form Tags', 'give' ),
206
-							'desc' => __( 'Enable Tags for all Give forms.', 'give' ),
205
+							'name' => __('Form Tags', 'give'),
206
+							'desc' => __('Enable Tags for all Give forms.', 'give'),
207 207
 							'id'   => 'tags',
208 208
 							'type'    => 'radio_inline',
209 209
 							'default' => 'disabled',
210 210
 							'options' => array(
211
-								'enabled' => __( 'Enabled', 'give' ),
212
-								'disabled' => __( 'Disabled', 'give' ),
211
+								'enabled' => __('Enabled', 'give'),
212
+								'disabled' => __('Disabled', 'give'),
213 213
 							)
214 214
 						),
215 215
                         array(
216
-                            'name'  => __( 'Taxonomies Docs Link', 'give' ),
216
+                            'name'  => __('Taxonomies Docs Link', 'give'),
217 217
                             'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
218
+                            'url'   => esc_url('http://docs.givewp.com/settings-taxonomies'),
219
+                            'title' => __('Taxonomies Settings', 'give'),
220 220
                             'type'  => 'give_docs_link',
221 221
                         ),
222 222
 						array(
@@ -233,36 +233,36 @@  discard block
 block discarded – undo
233 233
 							'type' => 'title'
234 234
 						),
235 235
 						array(
236
-							'name'    => __( 'Terms and Conditions', 'give' ),
237
-							'desc'    => __( 'Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ),
236
+							'name'    => __('Terms and Conditions', 'give'),
237
+							'desc'    => __('Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give'),
238 238
 							'id'      => 'terms',
239 239
 							'type'    => 'radio_inline',
240 240
 							'default' => 'disabled',
241 241
 							'options' => array(
242
-								'enabled' => __( 'Enabled', 'give' ),
243
-								'disabled' => __( 'Disabled', 'give' ),
242
+								'enabled' => __('Enabled', 'give'),
243
+								'disabled' => __('Disabled', 'give'),
244 244
 							)
245 245
 						),
246 246
 						array(
247
-							'name' => __( 'Agree to Terms Label', 'give' ),
248
-							'desc' => __( 'The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give' ),
247
+							'name' => __('Agree to Terms Label', 'give'),
248
+							'desc' => __('The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give'),
249 249
 							'id'   => 'agree_to_terms_label',
250 250
 							'attributes'  => array(
251
-								'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
251
+								'placeholder' => esc_attr__('Agree to Terms?', 'give'),
252 252
 							),
253 253
 							'type' => 'text'
254 254
 						),
255 255
 						array(
256
-							'name' => __( 'Agreement Text', 'give' ),
257
-							'desc' => __( 'This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give' ),
256
+							'name' => __('Agreement Text', 'give'),
257
+							'desc' => __('This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give'),
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261 261
                         array(
262
-                            'name'  => __( 'Terms and Conditions Docs Link', 'give' ),
262
+                            'name'  => __('Terms and Conditions Docs Link', 'give'),
263 263
                             'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
264
+                            'url'   => esc_url('http://docs.givewp.com/settings-terms'),
265
+                            'title' => __('Terms and Conditions Settings', 'give'),
266 266
                             'type'  => 'give_docs_link',
267 267
                         ),
268 268
 						array(
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 			 * Filter the display options settings.
278 278
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
279 279
 			 */
280
-			$settings = apply_filters( 'give_settings_display', $settings );
280
+			$settings = apply_filters('give_settings_display', $settings);
281 281
 
282 282
 			/**
283 283
 			 * Filter the settings.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			 * @since  1.8
286 286
 			 * @param  array $settings
287 287
 			 */
288
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
288
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
289 289
 
290 290
 			// Output.
291 291
 			return $settings;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		 */
300 300
 		public function get_sections() {
301 301
 			$sections = array(
302
-				'display-settings'    => __( 'Display', 'give' ),
303
-				'post-types'          => __( 'Post Types', 'give' ),
304
-				'taxonomies'          => __( 'Taxonomies', 'give' ),
305
-				'term-and-conditions' => __( 'Terms and Conditions', 'give' )
302
+				'display-settings'    => __('Display', 'give'),
303
+				'post-types'          => __('Post Types', 'give'),
304
+				'taxonomies'          => __('Taxonomies', 'give'),
305
+				'term-and-conditions' => __('Terms and Conditions', 'give')
306 306
 			);
307 307
 
308
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
308
+			return apply_filters('give_get_sections_'.$this->id, $sections);
309 309
 		}
310 310
 	}
311 311
 
Please login to merge, or discard this patch.