Completed
Pull Request — master (#1574)
by
unknown
19:09
created
includes/admin/forms/class-metabox-form-data.php 3 patches
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -641,9 +641,12 @@  discard block
 block discarded – undo
641 641
 							<a href="#<?php echo $form_data_tab['id']; ?>">
642 642
 								<?php if ( ! empty( $form_data_tab['icon-html'] ) ) : ?>
643 643
 									<?php echo $form_data_tab['icon-html']; ?>
644
-								<?php else : ?>
644
+								<?php else {
645
+	: ?>
645 646
 									<span class="give-icon give-icon-default"></span>
646
-								<?php endif; ?>
647
+								<?php endif;
648
+}
649
+?>
647 650
 								<span class="give-label"><?php echo $form_data_tab['label']; ?></span>
648 651
 							</a>
649 652
 							<?php if ( $this->has_sub_tab( $form_data_tab ) ) : ?>
@@ -653,9 +656,12 @@  discard block
 block discarded – undo
653 656
 											<a href="#<?php echo $sub_tab['id']; ?>">
654 657
 												<?php if ( ! empty( $sub_tab['icon-html'] ) ) : ?>
655 658
 													<?php echo $sub_tab['icon-html']; ?>
656
-												<?php else : ?>
659
+												<?php else {
660
+	: ?>
657 661
 													<span class="give-icon give-icon-default"></span>
658
-												<?php endif; ?>
662
+												<?php endif;
663
+}
664
+?>
659 665
 												<span class="give-label"><?php echo $sub_tab['label']; ?></span>
660 666
 											</a>
661 667
 										</li>
@@ -682,11 +688,14 @@  discard block
 block discarded – undo
682 688
 						</div>
683 689
 
684 690
 						<?php do_action( "give_after_{$setting['id']}_settings" ); ?>
685
-					<?php else: ?>
691
+					<?php else {
692
+	: ?>
686 693
 						<?php if ( $this->has_sub_tab( $setting ) ) : ?>
687 694
 							<?php if ( ! empty( $setting['sub-fields'] ) ) : ?>
688 695
 								<?php foreach ( $setting['sub-fields'] as $index => $sub_fields ) : ?>
689
-									<div id="<?php echo $sub_fields['id']; ?>"
696
+									<div id="<?php echo $sub_fields['id'];
697
+}
698
+?>"
690 699
 										 class="panel give_options_panel give-hidden">
691 700
 										<?php if ( ! empty( $sub_fields['fields'] ) ) : ?>
692 701
 											<?php foreach ( $sub_fields['fields'] as $sub_field ) : ?>
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 						'desc'       => __( 'Do you want to display a custom message when the goal is closed?', 'give' ),
400 400
 						'id'         => $prefix . 'form_goal_achieved_message',
401 401
 						'type'       => 'wysiwyg',
402
-                        'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
402
+						'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
403 403
 					),
404 404
 					array(
405 405
 						'name'  => 'donation_goal_docs',
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 
672 672
 						<div id="<?php echo $setting['id']; ?>"
673 673
 							 class="panel give_options_panel<?php echo( $show_first_tab_content ? '' : ' give-hidden' );
674
-						     $show_first_tab_content = false; ?>">
674
+							 $show_first_tab_content = false; ?>">
675 675
 							<?php if ( ! empty( $setting['fields'] ) ) : ?>
676 676
 								<?php foreach ( $setting['fields'] as $field ) : ?>
677 677
 									<?php give_render_field( $field ); ?>
Please login to merge, or discard this patch.
Spacing   +293 added lines, -293 removed lines patch added patch discarded remove patch
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	function __construct() {
48 48
 		$this->metabox_id    = 'give-metabox-form-data';
49
-		$this->metabox_label = esc_html__( 'Donation Form Options', 'give' );
49
+		$this->metabox_label = esc_html__('Donation Form Options', 'give');
50 50
 
51 51
 		// Setup.
52
-		add_action( 'admin_init', array( $this, 'setup' ) );
52
+		add_action('admin_init', array($this, 'setup'));
53 53
 
54 54
 		// Add metabox.
55
-		add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ), 30 );
55
+		add_action('add_meta_boxes', array($this, 'add_meta_box'), 30);
56 56
 
57 57
 		// Load required scripts.
58
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script' ) );
58
+		add_action('admin_enqueue_scripts', array($this, 'enqueue_script'));
59 59
 
60 60
 		// Save form meta.
61
-		add_action( 'save_post_give_forms', array( $this, 'save' ), 10, 2 );
61
+		add_action('save_post_give_forms', array($this, 'save'), 10, 2);
62 62
 
63 63
 		// cmb2 old setting loaders.
64 64
 		// add_filter( 'give_metabox_form_data_settings', array( $this, 'cmb2_metabox_settings' ) );
65 65
 		// Add offline donations options.
66
-		add_filter( 'give_metabox_form_data_settings', array( $this, 'add_offline_donations_setting_tab' ), 0, 1 );
66
+		add_filter('give_metabox_form_data_settings', array($this, 'add_offline_donations_setting_tab'), 0, 1);
67 67
 	}
68 68
 
69 69
 
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	function get_settings() {
88 88
 		$post_id               = give_get_admin_post_id();
89
-		$price                 = give_get_form_price( $post_id );
90
-		$custom_amount_minimum = give_get_form_minimum_price( $post_id );
91
-		$goal                  = give_get_form_goal( $post_id );
89
+		$price                 = give_get_form_price($post_id);
90
+		$custom_amount_minimum = give_get_form_minimum_price($post_id);
91
+		$goal                  = give_get_form_goal($post_id);
92 92
 
93 93
 		// No empty prices - min. 1.00 for new forms
94
-		if ( empty( $price ) && is_null( $post_id ) ) {
95
-			$price = esc_attr( give_format_decimal( '1.00' ) );
94
+		if (empty($price) && is_null($post_id)) {
95
+			$price = esc_attr(give_format_decimal('1.00'));
96 96
 		}
97 97
 
98 98
 		// Min. $1.00 for new forms
99
-		if ( empty( $custom_amount_minimum ) ) {
100
-			$custom_amount_minimum = esc_attr( give_format_decimal( '1.00' ) );
99
+		if (empty($custom_amount_minimum)) {
100
+			$custom_amount_minimum = esc_attr(give_format_decimal('1.00'));
101 101
 		}
102 102
 
103 103
 		// Start with an underscore to hide fields from custom fields list
@@ -107,215 +107,215 @@  discard block
 block discarded – undo
107 107
 			/**
108 108
 			 * Repeatable Field Groups
109 109
 			 */
110
-			'form_field_options'    => apply_filters( 'give_forms_field_options', array(
110
+			'form_field_options'    => apply_filters('give_forms_field_options', array(
111 111
 				'id'        => 'form_field_options',
112
-				'title'     => esc_html__( 'Donation Options', 'give' ),
112
+				'title'     => esc_html__('Donation Options', 'give'),
113 113
 				'icon-html' => '<span class="give-icon give-icon-heart"></span>',
114
-				'fields'    => apply_filters( 'give_forms_donation_form_metabox_fields', array(
114
+				'fields'    => apply_filters('give_forms_donation_form_metabox_fields', array(
115 115
 					// Donation Option
116 116
 					array(
117
-						'name'        => esc_html__( 'Donation Option', 'give' ),
118
-						'description' => esc_html__( 'Do you want this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ),
119
-						'id'          => $prefix . 'price_option',
117
+						'name'        => esc_html__('Donation Option', 'give'),
118
+						'description' => esc_html__('Do you want this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give'),
119
+						'id'          => $prefix.'price_option',
120 120
 						'type'        => 'radio_inline',
121 121
 						'default'     => 'set',
122
-						'options'     => apply_filters( 'give_forms_price_options', array(
123
-							'set'   => esc_html__( 'Set Donation', 'give' ),
124
-							'multi' => esc_html__( 'Multi-level Donation', 'give' ),
125
-						) ),
122
+						'options'     => apply_filters('give_forms_price_options', array(
123
+							'set'   => esc_html__('Set Donation', 'give'),
124
+							'multi' => esc_html__('Multi-level Donation', 'give'),
125
+						)),
126 126
 					),
127 127
 					array(
128
-						'name'        => esc_html__( 'Set Donation', 'give' ),
129
-						'description' => esc_html__( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ),
130
-						'id'          => $prefix . 'set_price',
128
+						'name'        => esc_html__('Set Donation', 'give'),
129
+						'description' => esc_html__('This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give'),
130
+						'id'          => $prefix.'set_price',
131 131
 						'type'        => 'text_small',
132 132
 						'data_type'   => 'price',
133 133
 						'attributes'  => array(
134
-							'placeholder' => give_format_decimal( '1.00' ),
135
-							'value'       => give_format_decimal( $price ),
134
+							'placeholder' => give_format_decimal('1.00'),
135
+							'value'       => give_format_decimal($price),
136 136
 							'class'       => 'give-money-field',
137 137
 						),
138 138
 					),
139 139
 					// Display Style
140 140
 					array(
141
-						'name'        => esc_html__( 'Display Style', 'give' ),
142
-						'description' => esc_html__( 'Set how the donations levels will display on the form.', 'give' ),
143
-						'id'          => $prefix . 'display_style',
141
+						'name'        => esc_html__('Display Style', 'give'),
142
+						'description' => esc_html__('Set how the donations levels will display on the form.', 'give'),
143
+						'id'          => $prefix.'display_style',
144 144
 						'type'        => 'radio_inline',
145 145
 						'default'     => 'buttons',
146 146
 						'options'     => array(
147
-							'buttons'  => esc_html__( 'Buttons', 'give' ),
148
-							'radios'   => esc_html__( 'Radios', 'give' ),
149
-							'dropdown' => esc_html__( 'Dropdown', 'give' ),
147
+							'buttons'  => esc_html__('Buttons', 'give'),
148
+							'radios'   => esc_html__('Radios', 'give'),
149
+							'dropdown' => esc_html__('Dropdown', 'give'),
150 150
 						),
151 151
 					),
152 152
 					// Custom Amount
153 153
 					array(
154
-						'name'        => esc_html__( 'Custom Amount', 'give' ),
155
-						'description' => esc_html__( 'Do you want the user to be able to input their own donation amount?', 'give' ),
156
-						'id'          => $prefix . 'custom_amount',
154
+						'name'        => esc_html__('Custom Amount', 'give'),
155
+						'description' => esc_html__('Do you want the user to be able to input their own donation amount?', 'give'),
156
+						'id'          => $prefix.'custom_amount',
157 157
 						'type'        => 'radio_inline',
158 158
 						'default'     => 'disabled',
159 159
 						'options'     => array(
160
-							'enabled'  => esc_html__( 'Enabled', 'give' ),
161
-							'disabled' => esc_html__( 'Disabled', 'give' ),
160
+							'enabled'  => esc_html__('Enabled', 'give'),
161
+							'disabled' => esc_html__('Disabled', 'give'),
162 162
 						),
163 163
 					),
164 164
 					array(
165
-						'name'        => esc_html__( 'Minimum Amount', 'give' ),
166
-						'description' => esc_html__( 'Enter the minimum custom donation amount.', 'give' ),
167
-						'id'          => $prefix . 'custom_amount_minimum',
165
+						'name'        => esc_html__('Minimum Amount', 'give'),
166
+						'description' => esc_html__('Enter the minimum custom donation amount.', 'give'),
167
+						'id'          => $prefix.'custom_amount_minimum',
168 168
 						'type'        => 'text_small',
169 169
 						'data_type'   => 'price',
170 170
 						'attributes'  => array(
171
-							'placeholder' => give_format_decimal( '1.00' ),
172
-							'value'       => give_format_decimal( $custom_amount_minimum ),
171
+							'placeholder' => give_format_decimal('1.00'),
172
+							'value'       => give_format_decimal($custom_amount_minimum),
173 173
 							'class'       => 'give-money-field',
174 174
 						),
175 175
 					),
176 176
 					array(
177
-						'name'        => esc_html__( 'Custom Amount Text', 'give' ),
178
-						'description' => esc_html__( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ),
179
-						'id'          => $prefix . 'custom_amount_text',
177
+						'name'        => esc_html__('Custom Amount Text', 'give'),
178
+						'description' => esc_html__('This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give'),
179
+						'id'          => $prefix.'custom_amount_text',
180 180
 						'type'        => 'text_medium',
181 181
 						'attributes'  => array(
182 182
 							'rows'        => 3,
183
-							'placeholder' => esc_attr__( 'Give a Custom Amount', 'give' ),
183
+							'placeholder' => esc_attr__('Give a Custom Amount', 'give'),
184 184
 						),
185 185
 					),
186 186
 					// Donation Levels: Repeatable CMB2 Group
187 187
 					array(
188
-						'id'      => $prefix . 'donation_levels',
188
+						'id'      => $prefix.'donation_levels',
189 189
 						'type'    => 'group',
190 190
 						'options' => array(
191
-							'add_button'    => esc_html__( 'Add Level', 'give' ),
192
-							'header_title'  => esc_html__( 'Donation Level', 'give' ),
191
+							'add_button'    => esc_html__('Add Level', 'give'),
192
+							'header_title'  => esc_html__('Donation Level', 'give'),
193 193
 							'remove_button' => '<span class="dashicons dashicons-no"></span>',
194 194
 						),
195 195
 						// Fields array works the same, except id's only need to be unique for this group.
196 196
 						// Prefix is not needed.
197
-						'fields'  => apply_filters( 'give_donation_levels_table_row', array(
197
+						'fields'  => apply_filters('give_donation_levels_table_row', array(
198 198
 							array(
199
-								'name' => esc_html__( 'ID', 'give' ),
200
-								'id'   => $prefix . 'id',
199
+								'name' => esc_html__('ID', 'give'),
200
+								'id'   => $prefix.'id',
201 201
 								'type' => 'levels_id',
202 202
 							),
203 203
 							array(
204
-								'name'       => esc_html__( 'Amount', 'give' ),
205
-								'id'         => $prefix . 'amount',
204
+								'name'       => esc_html__('Amount', 'give'),
205
+								'id'         => $prefix.'amount',
206 206
 								'type'       => 'text_small',
207 207
 								'data_type'  => 'price',
208 208
 								'attributes' => array(
209
-									'placeholder' => give_format_decimal( '1.00' ),
209
+									'placeholder' => give_format_decimal('1.00'),
210 210
 									'class'       => 'give-money-field',
211 211
 								),
212 212
 							),
213 213
 							array(
214
-								'name'       => esc_html__( 'Text', 'give' ),
215
-								'id'         => $prefix . 'text',
214
+								'name'       => esc_html__('Text', 'give'),
215
+								'id'         => $prefix.'text',
216 216
 								'type'       => 'text',
217 217
 								'attributes' => array(
218
-									'placeholder' => esc_html__( 'Donation Level', 'give' ),
218
+									'placeholder' => esc_html__('Donation Level', 'give'),
219 219
 									'class'       => 'give-multilevel-text-field',
220 220
 								),
221 221
 							),
222 222
 							array(
223
-								'name' => esc_html__( 'Default', 'give' ),
224
-								'id'   => $prefix . 'default',
223
+								'name' => esc_html__('Default', 'give'),
224
+								'id'   => $prefix.'default',
225 225
 								'type' => 'give_default_radio_inline',
226 226
 							),
227
-						) ),
227
+						)),
228 228
 					),
229 229
 					array(
230 230
 						'name'  => 'donation_options_docs',
231 231
 						'type'  => 'docs_link',
232 232
 						'url'   => 'http://docs.givewp.com/form-donation-options',
233
-						'title' => esc_html__( 'Donation Options', 'give' ),
233
+						'title' => esc_html__('Donation Options', 'give'),
234 234
 					),
235 235
 				),
236 236
 					$post_id
237 237
 				),
238
-			) ),
238
+			)),
239 239
 
240 240
 			/**
241 241
 			 * Display Options
242 242
 			 */
243
-			'form_display_options'  => apply_filters( 'give_form_display_options', array(
243
+			'form_display_options'  => apply_filters('give_form_display_options', array(
244 244
 					'id'        => 'form_display_options',
245
-					'title'     => esc_html__( 'Form Display', 'give' ),
245
+					'title'     => esc_html__('Form Display', 'give'),
246 246
 					'icon-html' => '<span class="give-icon give-icon-display"></span>',
247
-					'fields'    => apply_filters( 'give_forms_display_options_metabox_fields', array(
247
+					'fields'    => apply_filters('give_forms_display_options_metabox_fields', array(
248 248
 						array(
249
-							'name'    => esc_html__( 'Display Options', 'give' ),
250
-							'desc'    => sprintf( __( 'How would you like to display donation information for this form?', 'give' ), '#' ),
251
-							'id'      => $prefix . 'payment_display',
249
+							'name'    => esc_html__('Display Options', 'give'),
250
+							'desc'    => sprintf(__('How would you like to display donation information for this form?', 'give'), '#'),
251
+							'id'      => $prefix.'payment_display',
252 252
 							'type'    => 'radio_inline',
253 253
 							'options' => array(
254
-								'onpage' => esc_html__( 'All Fields', 'give' ),
255
-								'modal'  => esc_html__( 'Modal', 'give' ),
256
-								'reveal' => esc_html__( 'Reveal', 'give' ),
257
-								'button' => esc_html__( 'Button', 'give' ),
254
+								'onpage' => esc_html__('All Fields', 'give'),
255
+								'modal'  => esc_html__('Modal', 'give'),
256
+								'reveal' => esc_html__('Reveal', 'give'),
257
+								'button' => esc_html__('Button', 'give'),
258 258
 							),
259 259
 							'default' => 'onpage',
260 260
 						),
261 261
 						array(
262
-							'id'         => $prefix . 'reveal_label',
263
-							'name'       => esc_html__( 'Continue Button', 'give' ),
264
-							'desc'       => esc_html__( 'The button label for displaying the additional payment fields.', 'give' ),
262
+							'id'         => $prefix.'reveal_label',
263
+							'name'       => esc_html__('Continue Button', 'give'),
264
+							'desc'       => esc_html__('The button label for displaying the additional payment fields.', 'give'),
265 265
 							'type'       => 'text_small',
266 266
 							'attributes' => array(
267
-								'placeholder' => esc_attr__( 'Donate Now', 'give' ),
267
+								'placeholder' => esc_attr__('Donate Now', 'give'),
268 268
 							),
269 269
 						),
270 270
 						array(
271
-							'id'         => $prefix . 'checkout_label',
272
-							'name'       => esc_html__( 'Submit Button', 'give' ),
273
-							'desc'       => esc_html__( 'The button label for completing a donation.', 'give' ),
271
+							'id'         => $prefix.'checkout_label',
272
+							'name'       => esc_html__('Submit Button', 'give'),
273
+							'desc'       => esc_html__('The button label for completing a donation.', 'give'),
274 274
 							'type'       => 'text_small',
275 275
 							'attributes' => array(
276
-								'placeholder' => esc_html__( 'Donate Now', 'give' ),
276
+								'placeholder' => esc_html__('Donate Now', 'give'),
277 277
 							),
278 278
 						),
279 279
 						array(
280
-							'name' => esc_html__( 'Default Gateway', 'give' ),
281
-							'desc' => esc_html__( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ),
282
-							'id'   => $prefix . 'default_gateway',
280
+							'name' => esc_html__('Default Gateway', 'give'),
281
+							'desc' => esc_html__('By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give'),
282
+							'id'   => $prefix.'default_gateway',
283 283
 							'type' => 'default_gateway',
284 284
 						),
285 285
 						array(
286
-							'name'    => esc_html__( 'Guest Donations', 'give' ),
287
-							'desc'    => esc_html__( 'Do you want to allow non-logged-in users to make donations?', 'give' ),
288
-							'id'      => $prefix . 'logged_in_only',
286
+							'name'    => esc_html__('Guest Donations', 'give'),
287
+							'desc'    => esc_html__('Do you want to allow non-logged-in users to make donations?', 'give'),
288
+							'id'      => $prefix.'logged_in_only',
289 289
 							'type'    => 'radio_inline',
290 290
 							'default' => 'enabled',
291 291
 							'options' => array(
292
-								'enabled'  => esc_html__( 'Enabled', 'give' ),
293
-								'disabled' => esc_html__( 'Disabled', 'give' ),
292
+								'enabled'  => esc_html__('Enabled', 'give'),
293
+								'disabled' => esc_html__('Disabled', 'give'),
294 294
 							),
295 295
 						),
296 296
 						array(
297
-							'name'    => esc_html__( 'Registration', 'give' ),
298
-							'desc'    => esc_html__( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ),
299
-							'id'      => $prefix . 'show_register_form',
297
+							'name'    => esc_html__('Registration', 'give'),
298
+							'desc'    => esc_html__('Display the registration and login forms in the payment section for non-logged-in users.', 'give'),
299
+							'id'      => $prefix.'show_register_form',
300 300
 							'type'    => 'radio',
301 301
 							'options' => array(
302
-								'none'         => esc_html__( 'None', 'give' ),
303
-								'registration' => esc_html__( 'Registration', 'give' ),
304
-								'login'        => esc_html__( 'Login', 'give' ),
305
-								'both'         => esc_html__( 'Registration + Login', 'give' ),
302
+								'none'         => esc_html__('None', 'give'),
303
+								'registration' => esc_html__('Registration', 'give'),
304
+								'login'        => esc_html__('Login', 'give'),
305
+								'both'         => esc_html__('Registration + Login', 'give'),
306 306
 							),
307 307
 							'default' => 'none',
308 308
 						),
309 309
 						array(
310
-							'name'    => esc_html__( 'Floating Labels', 'give' ),
310
+							'name'    => esc_html__('Floating Labels', 'give'),
311 311
 							/* translators: %s: forms http://docs.givewp.com/form-floating-labels */
312
-							'desc'    => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form. Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
313
-							'id'      => $prefix . 'form_floating_labels',
312
+							'desc'    => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form. Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url('http://docs.givewp.com/form-floating-labels')),
313
+							'id'      => $prefix.'form_floating_labels',
314 314
 							'type'    => 'radio_inline',
315 315
 							'options' => array(
316
-								'global'   => esc_html__( 'Global Option', 'give' ),
317
-								'enabled'  => esc_html__( 'Enabled', 'give' ),
318
-								'disabled' => esc_html__( 'Disabled', 'give' ),
316
+								'global'   => esc_html__('Global Option', 'give'),
317
+								'enabled'  => esc_html__('Enabled', 'give'),
318
+								'disabled' => esc_html__('Disabled', 'give'),
319 319
 							),
320 320
 							'default' => 'global',
321 321
 						),
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 							'name'  => 'form_display_docs',
324 324
 							'type'  => 'docs_link',
325 325
 							'url'   => 'http://docs.givewp.com/form-display-options',
326
-							'title' => esc_html__( 'Form Display', 'give' ),
326
+							'title' => esc_html__('Form Display', 'give'),
327 327
 						),
328 328
 					),
329 329
 						$post_id
@@ -334,191 +334,191 @@  discard block
 block discarded – undo
334 334
 			/**
335 335
 			 * Donation Goals
336 336
 			 */
337
-			'donation_goal_options' => apply_filters( 'give_donation_goal_options', array(
337
+			'donation_goal_options' => apply_filters('give_donation_goal_options', array(
338 338
 				'id'        => 'donation_goal_options',
339
-				'title'     => esc_html__( 'Donation Goal', 'give' ),
339
+				'title'     => esc_html__('Donation Goal', 'give'),
340 340
 				'icon-html' => '<span class="give-icon give-icon-target"></span>',
341
-				'fields'    => apply_filters( 'give_forms_donation_goal_metabox_fields', array(
341
+				'fields'    => apply_filters('give_forms_donation_goal_metabox_fields', array(
342 342
 					// Goals
343 343
 					array(
344
-						'name'        => esc_html__( 'Donation Goal', 'give' ),
345
-						'description' => esc_html__( 'Do you want to set a donation goal for this form?', 'give' ),
346
-						'id'          => $prefix . 'goal_option',
344
+						'name'        => esc_html__('Donation Goal', 'give'),
345
+						'description' => esc_html__('Do you want to set a donation goal for this form?', 'give'),
346
+						'id'          => $prefix.'goal_option',
347 347
 						'type'        => 'radio_inline',
348 348
 						'default'     => 'disabled',
349 349
 						'options'     => array(
350
-							'enabled'  => esc_html__( 'Enabled', 'give' ),
351
-							'disabled' => esc_html__( 'Disabled', 'give' ),
350
+							'enabled'  => esc_html__('Enabled', 'give'),
351
+							'disabled' => esc_html__('Disabled', 'give'),
352 352
 						),
353 353
 					),
354 354
 					array(
355
-						'name'        => esc_html__( 'Goal Amount', 'give' ),
356
-						'description' => esc_html__( 'This is the monetary goal amount you want to reach for this form.', 'give' ),
357
-						'id'          => $prefix . 'set_goal',
355
+						'name'        => esc_html__('Goal Amount', 'give'),
356
+						'description' => esc_html__('This is the monetary goal amount you want to reach for this form.', 'give'),
357
+						'id'          => $prefix.'set_goal',
358 358
 						'type'        => 'text_small',
359 359
 						'data_type'   => 'price',
360 360
 						'attributes'  => array(
361
-							'placeholder' => give_format_decimal( '0.00' ),
362
-							'value'       => give_format_decimal( $goal ),
361
+							'placeholder' => give_format_decimal('0.00'),
362
+							'value'       => give_format_decimal($goal),
363 363
 							'class'       => 'give-money-field',
364 364
 						),
365 365
 					),
366 366
 
367 367
 					array(
368
-						'name'        => esc_html__( 'Goal Format', 'give' ),
369
-						'description' => esc_html__( 'Do you want to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ),
370
-						'id'          => $prefix . 'goal_format',
368
+						'name'        => esc_html__('Goal Format', 'give'),
369
+						'description' => esc_html__('Do you want to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give'),
370
+						'id'          => $prefix.'goal_format',
371 371
 						'type'        => 'radio_inline',
372 372
 						'default'     => 'amount',
373 373
 						'options'     => array(
374
-							'amount'     => esc_html__( 'Amount', 'give' ),
375
-							'percentage' => esc_html__( 'Percentage', 'give' ),
374
+							'amount'     => esc_html__('Amount', 'give'),
375
+							'percentage' => esc_html__('Percentage', 'give'),
376 376
 						),
377 377
 					),
378 378
 					array(
379
-						'name'    => esc_html__( 'Progress Bar Color', 'give' ),
380
-						'desc'    => esc_html__( 'Customize the color of the goal progress bar.', 'give' ),
381
-						'id'      => $prefix . 'goal_color',
379
+						'name'    => esc_html__('Progress Bar Color', 'give'),
380
+						'desc'    => esc_html__('Customize the color of the goal progress bar.', 'give'),
381
+						'id'      => $prefix.'goal_color',
382 382
 						'type'    => 'colorpicker',
383 383
 						'default' => '#2bc253',
384 384
 					),
385 385
 
386 386
 					array(
387
-						'name'    => esc_html__( 'Close Form', 'give' ),
388
-						'desc'    => esc_html__( 'Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give' ),
389
-						'id'      => $prefix . 'close_form_when_goal_achieved',
387
+						'name'    => esc_html__('Close Form', 'give'),
388
+						'desc'    => esc_html__('Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give'),
389
+						'id'      => $prefix.'close_form_when_goal_achieved',
390 390
 						'type'    => 'radio_inline',
391 391
 						'default' => 'disabled',
392 392
 						'options' => array(
393
-							'enabled'  => esc_html__( 'Enabled', 'give' ),
394
-							'disabled' => esc_html__( 'Disabled', 'give' ),
393
+							'enabled'  => esc_html__('Enabled', 'give'),
394
+							'disabled' => esc_html__('Disabled', 'give'),
395 395
 						),
396 396
 					),
397 397
 					array(
398
-						'name'       => __( 'Goal Achieved Message', 'give' ),
399
-						'desc'       => __( 'Do you want to display a custom message when the goal is closed?', 'give' ),
400
-						'id'         => $prefix . 'form_goal_achieved_message',
398
+						'name'       => __('Goal Achieved Message', 'give'),
399
+						'desc'       => __('Do you want to display a custom message when the goal is closed?', 'give'),
400
+						'id'         => $prefix.'form_goal_achieved_message',
401 401
 						'type'       => 'wysiwyg',
402
-                        'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
402
+                        'default' => __('Thank you to all our donors, we have met our fundraising goal.', 'give'),
403 403
 					),
404 404
 					array(
405 405
 						'name'  => 'donation_goal_docs',
406 406
 						'type'  => 'docs_link',
407 407
 						'url'   => 'http://docs.givewp.com/form-donation-goal',
408
-						'title' => esc_html__( 'Donation Goal', 'give' ),
408
+						'title' => esc_html__('Donation Goal', 'give'),
409 409
 					),
410 410
 				),
411 411
 					$post_id
412 412
 				),
413
-			) ),
413
+			)),
414 414
 
415 415
 			/**
416 416
 			 * Content Field
417 417
 			 */
418
-			'form_content_options'  => apply_filters( 'give_forms_content_options', array(
418
+			'form_content_options'  => apply_filters('give_forms_content_options', array(
419 419
 				'id'        => 'form_content_options',
420
-				'title'     => esc_html__( 'Form Content', 'give' ),
420
+				'title'     => esc_html__('Form Content', 'give'),
421 421
 				'icon-html' => '<span class="give-icon give-icon-edit"></span>',
422
-				'fields'    => apply_filters( 'give_forms_content_options_metabox_fields', array(
422
+				'fields'    => apply_filters('give_forms_content_options_metabox_fields', array(
423 423
 
424 424
 					// Donation content.
425 425
 					array(
426
-						'name'        => esc_html__( 'Display Content', 'give' ),
427
-						'description' => esc_html__( 'Do you want to add custom content to this form?', 'give' ),
428
-						'id'          => $prefix . 'display_content',
426
+						'name'        => esc_html__('Display Content', 'give'),
427
+						'description' => esc_html__('Do you want to add custom content to this form?', 'give'),
428
+						'id'          => $prefix.'display_content',
429 429
 						'type'        => 'radio_inline',
430 430
 						'options'     => array(
431
-							'enabled'  => esc_html__( 'Enabled', 'give' ),
432
-							'disabled' => esc_html__( 'Disabled', 'give' ),
431
+							'enabled'  => esc_html__('Enabled', 'give'),
432
+							'disabled' => esc_html__('Disabled', 'give'),
433 433
 						),
434 434
 						'default'     => 'disabled',
435 435
 					),
436 436
 
437 437
 					// Content placement.
438 438
 					array(
439
-						'name'        => esc_html__( 'Content Placement', 'give' ),
440
-						'description' => esc_html__( 'This option controls where the content appears within the donation form.', 'give' ),
441
-						'id'          => $prefix . 'content_placement',
439
+						'name'        => esc_html__('Content Placement', 'give'),
440
+						'description' => esc_html__('This option controls where the content appears within the donation form.', 'give'),
441
+						'id'          => $prefix.'content_placement',
442 442
 						'type'        => 'radio_inline',
443
-						'options'     => apply_filters( 'give_forms_content_options_select', array(
444
-								'give_pre_form'  => esc_html__( 'Above fields', 'give' ),
445
-								'give_post_form' => esc_html__( 'Below fields', 'give' ),
443
+						'options'     => apply_filters('give_forms_content_options_select', array(
444
+								'give_pre_form'  => esc_html__('Above fields', 'give'),
445
+								'give_post_form' => esc_html__('Below fields', 'give'),
446 446
 							)
447 447
 						),
448 448
 						'default'     => 'give_pre_form',
449 449
 					),
450 450
 					array(
451
-						'name'        => esc_html__( 'Content', 'give' ),
452
-						'description' => esc_html__( 'This content will display on the single give form page.', 'give' ),
453
-						'id'          => $prefix . 'form_content',
451
+						'name'        => esc_html__('Content', 'give'),
452
+						'description' => esc_html__('This content will display on the single give form page.', 'give'),
453
+						'id'          => $prefix.'form_content',
454 454
 						'type'        => 'wysiwyg',
455 455
 					),
456 456
 					array(
457 457
 						'name'  => 'form_content_docs',
458 458
 						'type'  => 'docs_link',
459 459
 						'url'   => 'http://docs.givewp.com/form-content',
460
-						'title' => esc_html__( 'Form Content', 'give' ),
460
+						'title' => esc_html__('Form Content', 'give'),
461 461
 					),
462 462
 				),
463 463
 					$post_id
464 464
 				),
465
-			) ),
465
+			)),
466 466
 
467 467
 			/**
468 468
 			 * Terms & Conditions
469 469
 			 */
470
-			'form_terms_options'    => apply_filters( 'give_forms_terms_options', array(
470
+			'form_terms_options'    => apply_filters('give_forms_terms_options', array(
471 471
 				'id'        => 'form_terms_options',
472
-				'title'     => esc_html__( 'Terms & Conditions', 'give' ),
472
+				'title'     => esc_html__('Terms & Conditions', 'give'),
473 473
 				'icon-html' => '<span class="give-icon give-icon-checklist"></span>',
474
-				'fields'    => apply_filters( 'give_forms_terms_options_metabox_fields', array(
474
+				'fields'    => apply_filters('give_forms_terms_options_metabox_fields', array(
475 475
 					// Donation Option
476 476
 					array(
477
-						'name'        => esc_html__( 'Terms and Conditions', 'give' ),
478
-						'description' => esc_html__( 'Do you want to require the donor to accept terms prior to being able to complete their donation?', 'give' ),
479
-						'id'          => $prefix . 'terms_option',
477
+						'name'        => esc_html__('Terms and Conditions', 'give'),
478
+						'description' => esc_html__('Do you want to require the donor to accept terms prior to being able to complete their donation?', 'give'),
479
+						'id'          => $prefix.'terms_option',
480 480
 						'type'        => 'radio_inline',
481
-						'options'     => apply_filters( 'give_forms_content_options_select', array(
482
-								'global'   => esc_html__( 'Global Option', 'give' ),
483
-								'enabled'  => esc_html__( 'Customize', 'give' ),
484
-								'disabled' => esc_html__( 'Disable', 'give' ),
481
+						'options'     => apply_filters('give_forms_content_options_select', array(
482
+								'global'   => esc_html__('Global Option', 'give'),
483
+								'enabled'  => esc_html__('Customize', 'give'),
484
+								'disabled' => esc_html__('Disable', 'give'),
485 485
 							)
486 486
 						),
487 487
 						'default'     => 'global',
488 488
 					),
489 489
 					array(
490
-						'id'         => $prefix . 'agree_label',
491
-						'name'       => esc_html__( 'Agreement Label', 'give' ),
492
-						'desc'       => esc_html__( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ),
490
+						'id'         => $prefix.'agree_label',
491
+						'name'       => esc_html__('Agreement Label', 'give'),
492
+						'desc'       => esc_html__('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give'),
493 493
 						'type'       => 'text',
494 494
 						'size'       => 'regular',
495 495
 						'attributes' => array(
496
-							'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
496
+							'placeholder' => esc_attr__('Agree to Terms?', 'give'),
497 497
 						),
498 498
 					),
499 499
 					array(
500
-						'id'   => $prefix . 'agree_text',
501
-						'name' => esc_html__( 'Agreement Text', 'give' ),
502
-						'desc' => esc_html__( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ),
500
+						'id'   => $prefix.'agree_text',
501
+						'name' => esc_html__('Agreement Text', 'give'),
502
+						'desc' => esc_html__('This is the actual text which the user will have to agree to in order to make a donation.', 'give'),
503 503
 						'type' => 'wysiwyg',
504 504
 					),
505 505
 					array(
506 506
 						'name'  => 'terms_docs',
507 507
 						'type'  => 'docs_link',
508 508
 						'url'   => 'http://docs.givewp.com/form-terms',
509
-						'title' => esc_html__( 'Terms and Conditions', 'give' ),
509
+						'title' => esc_html__('Terms and Conditions', 'give'),
510 510
 					),
511 511
 				),
512 512
 					$post_id
513 513
 				),
514
-			) ),
514
+			)),
515 515
 		);
516 516
 
517 517
 
518 518
 		/**
519 519
 		 * Filter the metabox tabbed panel settings.
520 520
 		 */
521
-		$settings = apply_filters( 'give_metabox_form_data_settings', $settings, $post_id );
521
+		$settings = apply_filters('give_metabox_form_data_settings', $settings, $post_id);
522 522
 
523 523
 		// Output.
524 524
 		return $settings;
@@ -534,8 +534,8 @@  discard block
 block discarded – undo
534 534
 		add_meta_box(
535 535
 			$this->get_metabox_ID(),
536 536
 			$this->get_metabox_label(),
537
-			array( $this, 'output' ),
538
-			array( 'give_forms' ),
537
+			array($this, 'output'),
538
+			array('give_forms'),
539 539
 			'normal',
540 540
 			'high'
541 541
 		);
@@ -551,9 +551,9 @@  discard block
 block discarded – undo
551 551
 	function enqueue_script() {
552 552
 		global $post;
553 553
 
554
-		if ( is_object( $post ) && 'give_forms' === $post->post_type ) {
555
-			wp_enqueue_style( 'wp-color-picker' );
556
-			wp_enqueue_script( 'wp-color-picker' );
554
+		if (is_object($post) && 'give_forms' === $post->post_type) {
555
+			wp_enqueue_style('wp-color-picker');
556
+			wp_enqueue_script('wp-color-picker');
557 557
 		}
558 558
 	}
559 559
 
@@ -587,32 +587,32 @@  discard block
 block discarded – undo
587 587
 	public function get_tabs() {
588 588
 		$tabs = array();
589 589
 
590
-		if ( ! empty( $this->settings ) ) {
591
-			foreach ( $this->settings as $setting ) {
592
-				if ( ! isset( $setting['id'] ) || ! isset( $setting['title'] ) ) {
590
+		if ( ! empty($this->settings)) {
591
+			foreach ($this->settings as $setting) {
592
+				if ( ! isset($setting['id']) || ! isset($setting['title'])) {
593 593
 					continue;
594 594
 				}
595 595
 				$tab = array(
596 596
 					'id'        => $setting['id'],
597 597
 					'label'     => $setting['title'],
598
-					'icon-html' => ( ! empty( $setting['icon-html'] ) ? $setting['icon-html'] : '' ),
598
+					'icon-html' => ( ! empty($setting['icon-html']) ? $setting['icon-html'] : ''),
599 599
 				);
600 600
 
601
-				if ( $this->has_sub_tab( $setting ) ) {
602
-					if ( empty( $setting['sub-fields'] ) ) {
601
+				if ($this->has_sub_tab($setting)) {
602
+					if (empty($setting['sub-fields'])) {
603 603
 						$tab = array();
604 604
 					} else {
605
-						foreach ( $setting['sub-fields'] as $sub_fields ) {
605
+						foreach ($setting['sub-fields'] as $sub_fields) {
606 606
 							$tab['sub-fields'][] = array(
607 607
 								'id'        => $sub_fields['id'],
608 608
 								'label'     => $sub_fields['title'],
609
-								'icon-html' => ( ! empty( $sub_fields['icon-html'] ) ? $sub_fields['icon-html'] : '' ),
609
+								'icon-html' => ( ! empty($sub_fields['icon-html']) ? $sub_fields['icon-html'] : ''),
610 610
 							);
611 611
 						}
612 612
 					}
613 613
 				}
614 614
 
615
-				if ( ! empty( $tab ) ) {
615
+				if ( ! empty($tab)) {
616 616
 					$tabs[] = $tab;
617 617
 				}
618 618
 			}
@@ -629,27 +629,27 @@  discard block
 block discarded – undo
629 629
 	 */
630 630
 	public function output() {
631 631
 		// Bailout.
632
-		if ( $form_data_tabs = $this->get_tabs() ) {
633
-			wp_nonce_field( 'give_save_form_meta', 'give_form_meta_nonce' );
632
+		if ($form_data_tabs = $this->get_tabs()) {
633
+			wp_nonce_field('give_save_form_meta', 'give_form_meta_nonce');
634 634
 			?>
635 635
 			<div class="give-metabox-panel-wrap">
636 636
 				<ul class="give-form-data-tabs give-metabox-tabs">
637
-					<?php foreach ( $form_data_tabs as $index => $form_data_tab ) : ?>
638
-						<li class="<?php echo "{$form_data_tab['id']}_tab" . ( ! $index ? ' active' : '' ) . ( $this->has_sub_tab( $form_data_tab ) ? ' has-sub-fields' : '' ); ?>">
637
+					<?php foreach ($form_data_tabs as $index => $form_data_tab) : ?>
638
+						<li class="<?php echo "{$form_data_tab['id']}_tab".( ! $index ? ' active' : '').($this->has_sub_tab($form_data_tab) ? ' has-sub-fields' : ''); ?>">
639 639
 							<a href="#<?php echo $form_data_tab['id']; ?>">
640
-								<?php if ( ! empty( $form_data_tab['icon-html'] ) ) : ?>
640
+								<?php if ( ! empty($form_data_tab['icon-html'])) : ?>
641 641
 									<?php echo $form_data_tab['icon-html']; ?>
642 642
 								<?php else : ?>
643 643
 									<span class="give-icon give-icon-default"></span>
644 644
 								<?php endif; ?>
645 645
 								<span class="give-label"><?php echo $form_data_tab['label']; ?></span>
646 646
 							</a>
647
-							<?php if ( $this->has_sub_tab( $form_data_tab ) ) : ?>
647
+							<?php if ($this->has_sub_tab($form_data_tab)) : ?>
648 648
 								<ul class="give-metabox-sub-tabs give-hidden">
649
-									<?php foreach ( $form_data_tab['sub-fields'] as $sub_tab ) : ?>
649
+									<?php foreach ($form_data_tab['sub-fields'] as $sub_tab) : ?>
650 650
 										<li class="<?php echo "{$sub_tab['id']}_tab"; ?>">
651 651
 											<a href="#<?php echo $sub_tab['id']; ?>">
652
-												<?php if ( ! empty( $sub_tab['icon-html'] ) ) : ?>
652
+												<?php if ( ! empty($sub_tab['icon-html'])) : ?>
653 653
 													<?php echo $sub_tab['icon-html']; ?>
654 654
 												<?php else : ?>
655 655
 													<span class="give-icon give-icon-default"></span>
@@ -665,30 +665,30 @@  discard block
 block discarded – undo
665 665
 				</ul>
666 666
 
667 667
 				<?php $show_first_tab_content = true; ?>
668
-				<?php foreach ( $this->settings as $setting ) : ?>
669
-					<?php if ( ! $this->has_sub_tab( $setting ) ) : ?>
670
-						<?php do_action( "give_before_{$setting['id']}_settings" ); ?>
668
+				<?php foreach ($this->settings as $setting) : ?>
669
+					<?php if ( ! $this->has_sub_tab($setting)) : ?>
670
+						<?php do_action("give_before_{$setting['id']}_settings"); ?>
671 671
 
672 672
 						<div id="<?php echo $setting['id']; ?>"
673
-							 class="panel give_options_panel<?php echo( $show_first_tab_content ? '' : ' give-hidden' );
673
+							 class="panel give_options_panel<?php echo($show_first_tab_content ? '' : ' give-hidden');
674 674
 						     $show_first_tab_content = false; ?>">
675
-							<?php if ( ! empty( $setting['fields'] ) ) : ?>
676
-								<?php foreach ( $setting['fields'] as $field ) : ?>
677
-									<?php give_render_field( $field ); ?>
675
+							<?php if ( ! empty($setting['fields'])) : ?>
676
+								<?php foreach ($setting['fields'] as $field) : ?>
677
+									<?php give_render_field($field); ?>
678 678
 								<?php endforeach; ?>
679 679
 							<?php endif; ?>
680 680
 						</div>
681 681
 
682
-						<?php do_action( "give_after_{$setting['id']}_settings" ); ?>
682
+						<?php do_action("give_after_{$setting['id']}_settings"); ?>
683 683
 					<?php else: ?>
684
-						<?php if ( $this->has_sub_tab( $setting ) ) : ?>
685
-							<?php if ( ! empty( $setting['sub-fields'] ) ) : ?>
686
-								<?php foreach ( $setting['sub-fields'] as $index => $sub_fields ) : ?>
684
+						<?php if ($this->has_sub_tab($setting)) : ?>
685
+							<?php if ( ! empty($setting['sub-fields'])) : ?>
686
+								<?php foreach ($setting['sub-fields'] as $index => $sub_fields) : ?>
687 687
 									<div id="<?php echo $sub_fields['id']; ?>"
688 688
 										 class="panel give_options_panel give-hidden">
689
-										<?php if ( ! empty( $sub_fields['fields'] ) ) : ?>
690
-											<?php foreach ( $sub_fields['fields'] as $sub_field ) : ?>
691
-												<?php give_render_field( $sub_field ); ?>
689
+										<?php if ( ! empty($sub_fields['fields'])) : ?>
690
+											<?php foreach ($sub_fields['fields'] as $sub_field) : ?>
691
+												<?php give_render_field($sub_field); ?>
692 692
 											<?php endforeach; ?>
693 693
 										<?php endif; ?>
694 694
 									</div>
@@ -712,9 +712,9 @@  discard block
 block discarded – undo
712 712
 	 *
713 713
 	 * @return bool
714 714
 	 */
715
-	private function has_sub_tab( $field_setting ) {
715
+	private function has_sub_tab($field_setting) {
716 716
 		$has_sub_tab = false;
717
-		if ( array_key_exists( 'sub-fields', $field_setting ) ) {
717
+		if (array_key_exists('sub-fields', $field_setting)) {
718 718
 			$has_sub_tab = true;
719 719
 		}
720 720
 
@@ -728,13 +728,13 @@  discard block
 block discarded – undo
728 728
 	 * @return array
729 729
 	 */
730 730
 	function cmb2_metabox_settings() {
731
-		$all_cmb2_settings   = apply_filters( 'cmb2_meta_boxes', array() );
731
+		$all_cmb2_settings   = apply_filters('cmb2_meta_boxes', array());
732 732
 		$give_forms_settings = $all_cmb2_settings;
733 733
 
734 734
 		// Filter settings: Use only give forms related settings.
735
-		foreach ( $all_cmb2_settings as $index => $setting ) {
736
-			if ( ! in_array( 'give_forms', $setting['object_types'] ) ) {
737
-				unset( $give_forms_settings[ $index ] );
735
+		foreach ($all_cmb2_settings as $index => $setting) {
736
+			if ( ! in_array('give_forms', $setting['object_types'])) {
737
+				unset($give_forms_settings[$index]);
738 738
 			}
739 739
 		}
740 740
 
@@ -752,114 +752,114 @@  discard block
 block discarded – undo
752 752
 	 *
753 753
 	 * @return void
754 754
 	 */
755
-	public function save( $post_id, $post ) {
755
+	public function save($post_id, $post) {
756 756
 
757 757
 		// $post_id and $post are required.
758
-		if ( empty( $post_id ) || empty( $post ) ) {
758
+		if (empty($post_id) || empty($post)) {
759 759
 			return;
760 760
 		}
761 761
 
762 762
 		// Don't save meta boxes for revisions or autosaves.
763
-		if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
763
+		if (defined('DOING_AUTOSAVE') || is_int(wp_is_post_revision($post)) || is_int(wp_is_post_autosave($post))) {
764 764
 			return;
765 765
 		}
766 766
 
767 767
 		// Check the nonce.
768
-		if ( empty( $_POST['give_form_meta_nonce'] ) || ! wp_verify_nonce( $_POST['give_form_meta_nonce'], 'give_save_form_meta' ) ) {
768
+		if (empty($_POST['give_form_meta_nonce']) || ! wp_verify_nonce($_POST['give_form_meta_nonce'], 'give_save_form_meta')) {
769 769
 			return;
770 770
 		}
771 771
 
772 772
 		// Check the post being saved == the $post_id to prevent triggering this call for other save_post events.
773
-		if ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) {
773
+		if (empty($_POST['post_ID']) || $_POST['post_ID'] != $post_id) {
774 774
 			return;
775 775
 		}
776 776
 
777 777
 		// Check user has permission to edit.
778
-		if ( ! current_user_can( 'edit_post', $post_id ) ) {
778
+		if ( ! current_user_can('edit_post', $post_id)) {
779 779
 			return;
780 780
 		}
781 781
 
782 782
 		// Fire action before saving form meta.
783
-		do_action( 'give_pre_process_give_forms_meta', $post_id, $post );
783
+		do_action('give_pre_process_give_forms_meta', $post_id, $post);
784 784
 
785 785
 		/**
786 786
 		 * Filter the meta key to save.
787 787
 		 * Third party addon developer can remove there meta keys from this array to handle saving data on there own.
788 788
 		 */
789
-		$form_meta_keys = apply_filters( 'give_process_form_meta_keys', $this->get_meta_keys_from_settings() );
789
+		$form_meta_keys = apply_filters('give_process_form_meta_keys', $this->get_meta_keys_from_settings());
790 790
 
791 791
 		// Save form meta data.
792
-		if ( ! empty( $form_meta_keys ) ) {
793
-			foreach ( $form_meta_keys as $form_meta_key ) {
792
+		if ( ! empty($form_meta_keys)) {
793
+			foreach ($form_meta_keys as $form_meta_key) {
794 794
 
795 795
 				// Set default value for checkbox fields.
796 796
 				if (
797
-					! isset( $_POST[ $form_meta_key ] )
798
-					&& ( 'checkbox' === $this->get_field_type( $form_meta_key ) )
797
+					! isset($_POST[$form_meta_key])
798
+					&& ('checkbox' === $this->get_field_type($form_meta_key))
799 799
 				) {
800
-					$_POST[ $form_meta_key ] = '';
800
+					$_POST[$form_meta_key] = '';
801 801
 				}
802 802
 
803
-				if ( isset( $_POST[ $form_meta_key ] ) ) {
804
-					if ( $field_type = $this->get_field_type( $form_meta_key ) ) {
805
-						switch ( $field_type ) {
803
+				if (isset($_POST[$form_meta_key])) {
804
+					if ($field_type = $this->get_field_type($form_meta_key)) {
805
+						switch ($field_type) {
806 806
 							case 'textarea':
807 807
 							case 'wysiwyg':
808
-								$form_meta_value = wp_kses_post( $_POST[ $form_meta_key ] );
809
-								update_post_meta( $post_id, $form_meta_key, $form_meta_value );
808
+								$form_meta_value = wp_kses_post($_POST[$form_meta_key]);
809
+								update_post_meta($post_id, $form_meta_key, $form_meta_value);
810 810
 								break;
811 811
 
812 812
 							case 'group':
813 813
 								$form_meta_value = array();
814 814
 
815
-								foreach ( $_POST[ $form_meta_key ] as $index => $group ) {
815
+								foreach ($_POST[$form_meta_key] as $index => $group) {
816 816
 
817 817
 									// Do not save template input field values.
818
-									if ( '{{row-count-placeholder}}' === $index ) {
818
+									if ('{{row-count-placeholder}}' === $index) {
819 819
 										continue;
820 820
 									}
821 821
 
822 822
 									$group_meta_value = array();
823
-									foreach ( $group as $field_id => $field_value ) {
824
-										switch ( $this->get_field_type( $field_id, $form_meta_key ) ) {
823
+									foreach ($group as $field_id => $field_value) {
824
+										switch ($this->get_field_type($field_id, $form_meta_key)) {
825 825
 											case 'wysiwyg':
826
-												$group_meta_value[ $field_id ] = wp_kses_post( $field_value );
826
+												$group_meta_value[$field_id] = wp_kses_post($field_value);
827 827
 												break;
828 828
 
829 829
 											default:
830
-												$group_meta_value[ $field_id ] = give_clean( $field_value );
830
+												$group_meta_value[$field_id] = give_clean($field_value);
831 831
 										}
832 832
 									}
833 833
 
834
-									if ( ! empty( $group_meta_value ) ) {
835
-										$form_meta_value[ $index ] = $group_meta_value;
834
+									if ( ! empty($group_meta_value)) {
835
+										$form_meta_value[$index] = $group_meta_value;
836 836
 									}
837 837
 								}
838 838
 
839 839
 
840 840
 								// Arrange repeater field keys in order.
841
-								$form_meta_value = array_values( $form_meta_value );
841
+								$form_meta_value = array_values($form_meta_value);
842 842
 
843 843
 								// Save data.
844
-								update_post_meta( $post_id, $form_meta_key, $form_meta_value );
844
+								update_post_meta($post_id, $form_meta_key, $form_meta_value);
845 845
 								break;
846 846
 
847 847
 							default:
848
-								$form_meta_value = give_clean( $_POST[ $form_meta_key ] );
848
+								$form_meta_value = give_clean($_POST[$form_meta_key]);
849 849
 
850 850
 								// Save data.
851
-								update_post_meta( $post_id, $form_meta_key, $form_meta_value );
851
+								update_post_meta($post_id, $form_meta_key, $form_meta_value);
852 852
 						}
853 853
 
854 854
 						// Fire after saving form meta key.
855
-						do_action( "give_save_{$form_meta_key}", $form_meta_key, $form_meta_value, $post_id, $post );
855
+						do_action("give_save_{$form_meta_key}", $form_meta_key, $form_meta_value, $post_id, $post);
856 856
 					}
857 857
 				}
858 858
 			}
859 859
 		}
860 860
 
861 861
 		// Fire action after saving form meta.
862
-		do_action( 'give_post_process_give_forms_meta', $post_id, $post );
862
+		do_action('give_post_process_give_forms_meta', $post_id, $post);
863 863
 	}
864 864
 
865 865
 
@@ -872,10 +872,10 @@  discard block
 block discarded – undo
872 872
 	 *
873 873
 	 * @return string
874 874
 	 */
875
-	private function get_field_id( $field ) {
875
+	private function get_field_id($field) {
876 876
 		$field_id = '';
877 877
 
878
-		if ( array_key_exists( 'id', $field ) ) {
878
+		if (array_key_exists('id', $field)) {
879 879
 			$field_id = $field['id'];
880 880
 
881 881
 		}
@@ -892,12 +892,12 @@  discard block
 block discarded – undo
892 892
 	 *
893 893
 	 * @return array
894 894
 	 */
895
-	private function get_fields_id( $setting ) {
895
+	private function get_fields_id($setting) {
896 896
 		$meta_keys = array();
897 897
 
898
-		if ( ! empty( $setting ) ) {
899
-			foreach ( $setting['fields'] as $field ) {
900
-				if ( $field_id = $this->get_field_id( $field ) ) {
898
+		if ( ! empty($setting)) {
899
+			foreach ($setting['fields'] as $field) {
900
+				if ($field_id = $this->get_field_id($field)) {
901 901
 					$meta_keys[] = $field_id;
902 902
 				}
903 903
 			}
@@ -915,14 +915,14 @@  discard block
 block discarded – undo
915 915
 	 *
916 916
 	 * @return array
917 917
 	 */
918
-	private function get_sub_fields_id( $setting ) {
918
+	private function get_sub_fields_id($setting) {
919 919
 		$meta_keys = array();
920 920
 
921
-		if ( $this->has_sub_tab( $setting ) && ! empty( $setting['sub-fields'] ) ) {
922
-			foreach ( $setting['sub-fields'] as $fields ) {
923
-				if ( ! empty( $fields['fields'] ) ) {
924
-					foreach ( $fields['fields'] as $field ) {
925
-						if ( $field_id = $this->get_field_id( $field ) ) {
921
+		if ($this->has_sub_tab($setting) && ! empty($setting['sub-fields'])) {
922
+			foreach ($setting['sub-fields'] as $fields) {
923
+				if ( ! empty($fields['fields'])) {
924
+					foreach ($fields['fields'] as $field) {
925
+						if ($field_id = $this->get_field_id($field)) {
926 926
 							$meta_keys[] = $field_id;
927 927
 						}
928 928
 					}
@@ -943,14 +943,14 @@  discard block
 block discarded – undo
943 943
 	private function get_meta_keys_from_settings() {
944 944
 		$meta_keys = array();
945 945
 
946
-		foreach ( $this->settings as $setting ) {
947
-			if ( $this->has_sub_tab( $setting ) ) {
948
-				$meta_key = $this->get_sub_fields_id( $setting );
946
+		foreach ($this->settings as $setting) {
947
+			if ($this->has_sub_tab($setting)) {
948
+				$meta_key = $this->get_sub_fields_id($setting);
949 949
 			} else {
950
-				$meta_key = $this->get_fields_id( $setting );
950
+				$meta_key = $this->get_fields_id($setting);
951 951
 			}
952 952
 
953
-			$meta_keys = array_merge( $meta_keys, $meta_key );
953
+			$meta_keys = array_merge($meta_keys, $meta_key);
954 954
 		}
955 955
 
956 956
 		return $meta_keys;
@@ -967,10 +967,10 @@  discard block
 block discarded – undo
967 967
 	 *
968 968
 	 * @return string
969 969
 	 */
970
-	function get_field_type( $field_id, $group_id = '' ) {
971
-		$field = $this->get_setting_field( $field_id, $group_id );
970
+	function get_field_type($field_id, $group_id = '') {
971
+		$field = $this->get_setting_field($field_id, $group_id);
972 972
 
973
-		$type = array_key_exists( 'type', $field )
973
+		$type = array_key_exists('type', $field)
974 974
 			? $field['type']
975 975
 			: '';
976 976
 
@@ -988,12 +988,12 @@  discard block
 block discarded – undo
988 988
 	 *
989 989
 	 * @return array
990 990
 	 */
991
-	private function get_field( $setting, $field_id ) {
991
+	private function get_field($setting, $field_id) {
992 992
 		$setting_field = array();
993 993
 
994
-		if ( ! empty( $setting['fields'] ) ) {
995
-			foreach ( $setting['fields'] as $field ) {
996
-				if ( array_key_exists( 'id', $field ) && $field['id'] === $field_id ) {
994
+		if ( ! empty($setting['fields'])) {
995
+			foreach ($setting['fields'] as $field) {
996
+				if (array_key_exists('id', $field) && $field['id'] === $field_id) {
997 997
 					$setting_field = $field;
998 998
 					break;
999 999
 				}
@@ -1013,12 +1013,12 @@  discard block
 block discarded – undo
1013 1013
 	 *
1014 1014
 	 * @return array
1015 1015
 	 */
1016
-	private function get_sub_field( $setting, $field_id ) {
1016
+	private function get_sub_field($setting, $field_id) {
1017 1017
 		$setting_field = array();
1018 1018
 
1019
-		if ( ! empty( $setting['sub-fields'] ) ) {
1020
-			foreach ( $setting['sub-fields'] as $fields ) {
1021
-				if ( $field = $this->get_field( $fields, $field_id ) ) {
1019
+		if ( ! empty($setting['sub-fields'])) {
1020
+			foreach ($setting['sub-fields'] as $fields) {
1021
+				if ($field = $this->get_field($fields, $field_id)) {
1022 1022
 					$setting_field = $field;
1023 1023
 					break;
1024 1024
 				}
@@ -1038,17 +1038,17 @@  discard block
 block discarded – undo
1038 1038
 	 *
1039 1039
 	 * @return array
1040 1040
 	 */
1041
-	function get_setting_field( $field_id, $group_id = '' ) {
1041
+	function get_setting_field($field_id, $group_id = '') {
1042 1042
 		$setting_field = array();
1043 1043
 
1044 1044
 		$_field_id = $field_id;
1045
-		$field_id  = empty( $group_id ) ? $field_id : $group_id;
1045
+		$field_id  = empty($group_id) ? $field_id : $group_id;
1046 1046
 
1047
-		if ( ! empty( $this->settings ) ) {
1048
-			foreach ( $this->settings as $setting ) {
1047
+		if ( ! empty($this->settings)) {
1048
+			foreach ($this->settings as $setting) {
1049 1049
 				if (
1050
-					( $this->has_sub_tab( $setting ) && ( $setting_field = $this->get_sub_field( $setting, $field_id ) ) )
1051
-					|| ( $setting_field = $this->get_field( $setting, $field_id ) )
1050
+					($this->has_sub_tab($setting) && ($setting_field = $this->get_sub_field($setting, $field_id)))
1051
+					|| ($setting_field = $this->get_field($setting, $field_id))
1052 1052
 				) {
1053 1053
 					break;
1054 1054
 				}
@@ -1057,9 +1057,9 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 
1059 1059
 		// Get field from group.
1060
-		if ( ! empty( $group_id ) ) {
1061
-			foreach ( $setting_field['fields'] as $field ) {
1062
-				if ( array_key_exists( 'id', $field ) && $field['id'] === $_field_id ) {
1060
+		if ( ! empty($group_id)) {
1061
+			foreach ($setting_field['fields'] as $field) {
1062
+				if (array_key_exists('id', $field) && $field['id'] === $_field_id) {
1063 1063
 					$setting_field = $field;
1064 1064
 				}
1065 1065
 			}
@@ -1078,14 +1078,14 @@  discard block
 block discarded – undo
1078 1078
 	 *
1079 1079
 	 * @return mixed
1080 1080
 	 */
1081
-	function add_offline_donations_setting_tab( $settings ) {
1082
-		if ( give_is_gateway_active( 'offline' ) ) {
1083
-			$settings['offline_donations_options'] = apply_filters( 'give_forms_offline_donations_options', array(
1081
+	function add_offline_donations_setting_tab($settings) {
1082
+		if (give_is_gateway_active('offline')) {
1083
+			$settings['offline_donations_options'] = apply_filters('give_forms_offline_donations_options', array(
1084 1084
 				'id'        => 'offline_donations_options',
1085
-				'title'     => esc_html__( 'Offline Donations', 'give' ),
1085
+				'title'     => esc_html__('Offline Donations', 'give'),
1086 1086
 				'icon-html' => '<span class="give-icon give-icon-purse"></span>',
1087
-				'fields'    => apply_filters( 'give_forms_offline_donations_metabox_fields', array() ),
1088
-			) );
1087
+				'fields'    => apply_filters('give_forms_offline_donations_metabox_fields', array()),
1088
+			));
1089 1089
 		}
1090 1090
 
1091 1091
 		return $settings;
Please login to merge, or discard this patch.
includes/emails/class-give-emails.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function __construct() {
89 89
 
90
-		if ( 'none' === $this->get_template() ) {
90
+		if ('none' === $this->get_template()) {
91 91
 			$this->html = false;
92 92
 		}
93 93
 
94
-		add_action( 'give_email_send_before', array( $this, 'send_before' ) );
95
-		add_action( 'give_email_send_after', array( $this, 'send_after' ) );
94
+		add_action('give_email_send_before', array($this, 'send_before'));
95
+		add_action('give_email_send_after', array($this, 'send_after'));
96 96
 
97 97
 	}
98 98
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 * @param $key
105 105
 	 * @param $value
106 106
 	 */
107
-	public function __set( $key, $value ) {
107
+	public function __set($key, $value) {
108 108
 		$this->$key = $value;
109 109
 	}
110 110
 
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 	 * @since 1.0
115 115
 	 */
116 116
 	public function get_from_name() {
117
-		if ( ! $this->from_name ) {
118
-			$this->from_name = give_get_option( 'from_name', get_bloginfo( 'name' ) );
117
+		if ( ! $this->from_name) {
118
+			$this->from_name = give_get_option('from_name', get_bloginfo('name'));
119 119
 		}
120 120
 
121
-		return apply_filters( 'give_email_from_name', wp_specialchars_decode( $this->from_name ), $this );
121
+		return apply_filters('give_email_from_name', wp_specialchars_decode($this->from_name), $this);
122 122
 	}
123 123
 
124 124
 	/**
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 * @since 1.0
128 128
 	 */
129 129
 	public function get_from_address() {
130
-		if ( ! $this->from_address ) {
131
-			$this->from_address = give_get_option( 'from_email', get_option( 'admin_email' ) );
130
+		if ( ! $this->from_address) {
131
+			$this->from_address = give_get_option('from_email', get_option('admin_email'));
132 132
 		}
133 133
 
134
-		return apply_filters( 'give_email_from_address', $this->from_address, $this );
134
+		return apply_filters('give_email_from_address', $this->from_address, $this);
135 135
 	}
136 136
 
137 137
 	/**
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 	 * @since 1.0
141 141
 	 */
142 142
 	public function get_content_type() {
143
-		if ( ! $this->content_type && $this->html ) {
144
-			$this->content_type = apply_filters( 'give_email_default_content_type', 'text/html', $this );
145
-		} else if ( ! $this->html ) {
143
+		if ( ! $this->content_type && $this->html) {
144
+			$this->content_type = apply_filters('give_email_default_content_type', 'text/html', $this);
145
+		} else if ( ! $this->html) {
146 146
 			$this->content_type = 'text/plain';
147 147
 		}
148 148
 
149
-		return apply_filters( 'give_email_content_type', $this->content_type, $this );
149
+		return apply_filters('give_email_content_type', $this->content_type, $this);
150 150
 	}
151 151
 
152 152
 	/**
@@ -155,13 +155,13 @@  discard block
 block discarded – undo
155 155
 	 * @since 1.0
156 156
 	 */
157 157
 	public function get_headers() {
158
-		if ( ! $this->headers ) {
158
+		if ( ! $this->headers) {
159 159
 			$this->headers = "From: {$this->get_from_name()} <{$this->get_from_address()}>\r\n";
160 160
 			$this->headers .= "Reply-To: {$this->get_from_address()}\r\n";
161 161
 			$this->headers .= "Content-Type: {$this->get_content_type()}; charset=utf-8\r\n";
162 162
 		}
163 163
 
164
-		return apply_filters( 'give_email_headers', $this->headers, $this );
164
+		return apply_filters('give_email_headers', $this->headers, $this);
165 165
 	}
166 166
 
167 167
 	/**
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function get_templates() {
173 173
 		$templates = array(
174
-			'default' => esc_html__( 'Default Template', 'give' ),
175
-			'none'    => esc_html__( 'No template, plain text only', 'give' )
174
+			'default' => esc_html__('Default Template', 'give'),
175
+			'none'    => esc_html__('No template, plain text only', 'give')
176 176
 		);
177 177
 
178
-		return apply_filters( 'give_email_templates', $templates );
178
+		return apply_filters('give_email_templates', $templates);
179 179
 	}
180 180
 
181 181
 	/**
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 	 * @since 1.0
185 185
 	 */
186 186
 	public function get_template() {
187
-		if ( ! $this->template ) {
188
-			$this->template = give_get_option( 'email_template', 'default' );
187
+		if ( ! $this->template) {
188
+			$this->template = give_get_option('email_template', 'default');
189 189
 		}
190 190
 
191
-		return apply_filters( 'give_email_template', $this->template );
191
+		return apply_filters('give_email_template', $this->template);
192 192
 	}
193 193
 
194 194
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * @since 1.0
198 198
 	 */
199 199
 	public function get_heading() {
200
-		return apply_filters( 'give_email_heading', $this->heading );
200
+		return apply_filters('give_email_heading', $this->heading);
201 201
 	}
202 202
 
203 203
 	/**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 *
208 208
 	 * @return mixed
209 209
 	 */
210
-	public function parse_tags( $content ) {
210
+	public function parse_tags($content) {
211 211
 		return $content;
212 212
 	}
213 213
 
@@ -220,19 +220,19 @@  discard block
 block discarded – undo
220 220
 	 *
221 221
 	 * @return string
222 222
 	 */
223
-	public function build_email( $message ) {
223
+	public function build_email($message) {
224 224
 
225
-		if ( false === $this->html ) {
226
-			return apply_filters( 'give_email_message', wp_strip_all_tags( $message ), $this );
225
+		if (false === $this->html) {
226
+			return apply_filters('give_email_message', wp_strip_all_tags($message), $this);
227 227
 		}
228 228
 
229
-		$message = $this->text_to_html( $message );
229
+		$message = $this->text_to_html($message);
230 230
 
231 231
 		$template = $this->get_template();
232 232
 
233 233
 		ob_start();
234 234
 
235
-		give_get_template_part( 'emails/header', $template, true );
235
+		give_get_template_part('emails/header', $template, true);
236 236
 
237 237
 		/**
238 238
 		 * Fires in the email head.
@@ -241,17 +241,17 @@  discard block
 block discarded – undo
241 241
 		 *
242 242
 		 * @param Give_Emails $this The email object.
243 243
 		 */
244
-		do_action( 'give_email_header', $this );
244
+		do_action('give_email_header', $this);
245 245
 
246
-		if ( has_action( 'give_email_template_' . $template ) ) {
246
+		if (has_action('give_email_template_'.$template)) {
247 247
 			/**
248 248
 			 * Fires in a specific email template.
249 249
 			 *
250 250
 			 * @since 1.0
251 251
 			 */
252
-			do_action( "give_email_template_{$template}" );
252
+			do_action("give_email_template_{$template}");
253 253
 		} else {
254
-			give_get_template_part( 'emails/body', $template, true );
254
+			give_get_template_part('emails/body', $template, true);
255 255
 		}
256 256
 
257 257
 		/**
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
 		 *
262 262
 		 * @param Give_Emails $this The email object.
263 263
 		 */
264
-		do_action( 'give_email_body', $this );
264
+		do_action('give_email_body', $this);
265 265
 
266
-		give_get_template_part( 'emails/footer', $template, true );
266
+		give_get_template_part('emails/footer', $template, true);
267 267
 
268 268
 		/**
269 269
 		 * Fires in the email footer.
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 		 *
273 273
 		 * @param Give_Emails $this The email object.
274 274
 		 */
275
-		do_action( 'give_email_footer', $this );
275
+		do_action('give_email_footer', $this);
276 276
 
277 277
 		$body    = ob_get_clean();
278
-		$message = str_replace( '{email}', $message, $body );
278
+		$message = str_replace('{email}', $message, $body);
279 279
 
280
-		return apply_filters( 'give_email_message', $message, $this );
280
+		return apply_filters('give_email_message', $message, $this);
281 281
 	}
282 282
 
283 283
 	/**
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
 	 *
291 291
 	 * @return bool
292 292
 	 */
293
-	public function send( $to, $subject, $message, $attachments = '' ) {
293
+	public function send($to, $subject, $message, $attachments = '') {
294 294
 
295
-		if ( ! did_action( 'init' ) && ! did_action( 'admin_init' ) ) {
296
-			_doing_it_wrong( __FUNCTION__, esc_html__( 'You cannot send email with Give_Emails until init/admin_init has been reached.', 'give' ), null );
295
+		if ( ! did_action('init') && ! did_action('admin_init')) {
296
+			_doing_it_wrong(__FUNCTION__, esc_html__('You cannot send email with Give_Emails until init/admin_init has been reached.', 'give'), null);
297 297
 
298 298
 			return false;
299 299
 		}
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
 		 *
306 306
 		 * @param Give_Emails $this The email object.
307 307
 		 */
308
-		do_action( 'give_email_send_before', $this );
308
+		do_action('give_email_send_before', $this);
309 309
 
310
-		$subject = $this->parse_tags( $subject );
311
-		$message = $this->parse_tags( $message );
310
+		$subject = $this->parse_tags($subject);
311
+		$message = $this->parse_tags($message);
312 312
 
313
-		$message = $this->build_email( $message );
313
+		$message = $this->build_email($message);
314 314
 
315
-		$attachments = apply_filters( 'give_email_attachments', $attachments, $this );
315
+		$attachments = apply_filters('give_email_attachments', $attachments, $this);
316 316
 
317
-		$sent = wp_mail( $to, $subject, $message, $this->get_headers(), $attachments );
317
+		$sent = wp_mail($to, $subject, $message, $this->get_headers(), $attachments);
318 318
 
319 319
 		/**
320 320
 		 * Fires after sending an email.
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		 *
324 324
 		 * @param Give_Emails $this The email object.
325 325
 		 */
326
-		do_action( 'give_email_send_after', $this );
326
+		do_action('give_email_send_after', $this);
327 327
 
328 328
 		return $sent;
329 329
 
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
 	 * @since 1.0
336 336
 	 */
337 337
 	public function send_before() {
338
-		add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
339
-		add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
340
-		add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
338
+		add_filter('wp_mail_from', array($this, 'get_from_address'));
339
+		add_filter('wp_mail_from_name', array($this, 'get_from_name'));
340
+		add_filter('wp_mail_content_type', array($this, 'get_content_type'));
341 341
 	}
342 342
 
343 343
 	/**
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 	 * @since 1.0
347 347
 	 */
348 348
 	public function send_after() {
349
-		remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
350
-		remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
351
-		remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
349
+		remove_filter('wp_mail_from', array($this, 'get_from_address'));
350
+		remove_filter('wp_mail_from_name', array($this, 'get_from_name'));
351
+		remove_filter('wp_mail_content_type', array($this, 'get_content_type'));
352 352
 
353 353
 		// Reset heading to an empty string
354 354
 		$this->heading = '';
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 	 *
360 360
 	 * @since 1.0
361 361
 	 */
362
-	public function text_to_html( $message ) {
362
+	public function text_to_html($message) {
363 363
 
364
-		if ( 'text/html' == $this->content_type || true === $this->html ) {
365
-			$message = wpautop( $message );
364
+		if ('text/html' == $this->content_type || true === $this->html) {
365
+			$message = wpautop($message);
366 366
 		}
367 367
 
368 368
 		return $message;
Please login to merge, or discard this patch.
includes/forms/template.php 3 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
 
@@ -1473,7 +1473,7 @@  discard block
 block discarded – undo
1473 1473
  *
1474 1474
  * @param  int $form_id The form ID.
1475 1475
  *
1476
- * @return bool
1476
+ * @return false|null
1477 1477
  */
1478 1478
 function give_terms_agreement( $form_id ) {
1479 1479
 	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
  * @param  int   $form_id The form ID.
1684 1684
  * @param  array $args    An array of form arguments.
1685 1685
  *
1686
- * @return mixed
1686
+ * @return boolean
1687 1687
  */
1688 1688
 function give_show_goal_progress( $form_id, $args ) {
1689 1689
 
@@ -1703,7 +1703,7 @@  discard block
 block discarded – undo
1703 1703
  *
1704 1704
  * @since  1.8
1705 1705
  *
1706
- * @param  $form_id
1706
+ * @param  integer $form_id
1707 1707
  * @param  $args
1708 1708
  *
1709 1709
  * @return mixed|string
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
  * @param  int   $form_id The form ID.
1745 1745
  * @param  array $args    An array of form arguments.
1746 1746
  *
1747
- * @return void|bool
1747
+ * @return false|null
1748 1748
  */
1749 1749
 function give_form_content( $form_id, $args ) {
1750 1750
 
Please login to merge, or discard this patch.
Spacing   +406 added lines, -406 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 = get_post_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 = get_post_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 ) ); ?>"/>
129
+                       value="<?php echo give_format_amount(give_get_form_minimum_price($form->ID)); ?>"/>
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 (mult-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_checkout_form_top', $form->ID, $args );
163
+				do_action('give_checkout_form_top', $form->ID, $args);
164 164
 
165 165
 				/**
166 166
 				 * Fires while outputing donation form, for payment gatways 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 outputing 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_checkout_form_bottom', $form->ID, $args );
183
+				do_action('give_checkout_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_donation_form_top', $form_id );
247
+	do_action('give_donation_form_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_donation_form_bottom', $form_id );
315
+	do_action('give_donation_form_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 = get_post_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 ) );
395
-	$custom_amount_text  = get_post_meta( $form_id, '_give_custom_amount_text', true );
389
+	$variable_pricing    = give_has_variable_prices($form_id);
390
+	$allow_custom_amount = get_post_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));
395
+	$custom_amount_text  = get_post_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_checkout_form_top', 'give_output_donation_amount_top', 10, 2 );
472
+add_action('give_checkout_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,32 +480,32 @@  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      = get_post_meta( $form_id, '_give_display_style', true );
488
-	$custom_amount      = get_post_meta( $form_id, '_give_custom_amount', true );
489
-	$custom_amount_text = get_post_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      = get_post_meta($form_id, '_give_display_style', true);
488
+	$custom_amount      = get_post_meta($form_id, '_give_custom_amount', true);
489
+	$custom_amount_text = get_post_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
 	$counter = 0;
496 496
 
497
-	switch ( $display_style ) {
497
+	switch ($display_style) {
498 498
 		case 'buttons':
499 499
 
500 500
 			$output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">';
501 501
 
502
-			foreach ( $prices as $price ) {
503
-				$counter ++;
504
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
505
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $counter . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price );
502
+			foreach ($prices as $price) {
503
+				$counter++;
504
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price);
505
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-'.$counter.' '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'give-default-level' : ''), $form_id, $price);
506 506
 
507 507
 				$output .= '<li>';
508
-				$output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">';
508
+				$output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount']).'">';
509 509
 				$output .= $level_text;
510 510
 				$output .= '</button>';
511 511
 				$output .= '</li>';
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 			}
514 514
 
515 515
 			//Custom Amount.
516
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
516
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
517 517
 				$output .= '<li>';
518 518
 				$output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">';
519 519
 				$output .= $custom_amount_text;
@@ -529,23 +529,23 @@  discard block
 block discarded – undo
529 529
 
530 530
 			$output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">';
531 531
 
532
-			foreach ( $prices as $price ) {
533
-				$counter ++;
534
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
535
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $counter . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
532
+			foreach ($prices as $price) {
533
+				$counter++;
534
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price);
535
+				$level_classes = apply_filters('give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-'.$counter.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
536 536
 
537 537
 				$output .= '<li>';
538
-				$output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $counter . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">';
539
-				$output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>';
538
+				$output .= '<input type="radio" data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" name="give-radio-donation-level" id="give-radio-level-'.$counter.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'checked="checked"' : '').' value="'.give_format_amount($price['_give_amount']).'">';
539
+				$output .= '<label for="give-radio-level-'.$counter.'">'.$level_text.'</label>';
540 540
 				$output .= '</li>';
541 541
 
542 542
 			}
543 543
 
544 544
 			//Custom Amount.
545
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
545
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
546 546
 				$output .= '<li>';
547 547
 				$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">';
548
-				$output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>';
548
+				$output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>';
549 549
 				$output .= '</li>';
550 550
 			}
551 551
 
@@ -555,23 +555,23 @@  discard block
 block discarded – undo
555 555
 
556 556
 		case 'dropdown':
557 557
 
558
-			$output .= '<label for="give-donation-level" class="give-hidden">' . esc_html__( 'Choose Your Donation Amount', 'give' ) . ':</label>';
559
-			$output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level give-donation-levels-wrap">';
558
+			$output .= '<label for="give-donation-level" class="give-hidden">'.esc_html__('Choose Your Donation Amount', 'give').':</label>';
559
+			$output .= '<select id="give-donation-level-'.$form_id.'" class="give-select give-select-level give-donation-levels-wrap">';
560 560
 
561 561
 			//first loop through prices.
562
-			foreach ( $prices as $price ) {
563
-				$level_text    = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price );
564
-				$level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price );
562
+			foreach ($prices as $price) {
563
+				$level_text    = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price);
564
+				$level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$form_id.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price);
565 565
 
566
-				$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'] ) . '">';
566
+				$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']).'">';
567 567
 				$output .= $level_text;
568 568
 				$output .= '</option>';
569 569
 
570 570
 			}
571 571
 
572 572
 			//Custom Amount.
573
-			if ( give_is_setting_enabled( $custom_amount ) && ! empty( $custom_amount_text ) ) {
574
-				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>';
573
+			if (give_is_setting_enabled($custom_amount) && ! empty($custom_amount_text)) {
574
+				$output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>';
575 575
 			}
576 576
 
577 577
 			$output .= '</select>';
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 			break;
580 580
 	}
581 581
 
582
-	echo apply_filters( 'give_form_level_output', $output, $form_id );
582
+	echo apply_filters('give_form_level_output', $output, $form_id);
583 583
 }
584 584
 
585 585
 /**
@@ -594,27 +594,27 @@  discard block
 block discarded – undo
594 594
  *
595 595
  * @return string Checkout button.
596 596
  */
597
-function give_display_checkout_button( $form_id, $args ) {
597
+function give_display_checkout_button($form_id, $args) {
598 598
 
599
-	$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )
599
+	$display_option = (isset($args['display_style']) && ! empty($args['display_style']))
600 600
 		? $args['display_style']
601
-		: get_post_meta( $form_id, '_give_payment_display', true );
601
+		: get_post_meta($form_id, '_give_payment_display', true);
602 602
 
603
-	if ( 'button' === $display_option ) {
603
+	if ('button' === $display_option) {
604 604
 		$display_option = 'modal';
605
-	} elseif ( $display_option === 'onpage' ) {
605
+	} elseif ($display_option === 'onpage') {
606 606
 		return '';
607 607
 	}
608 608
 
609
-	$display_label_field = get_post_meta( $form_id, '_give_reveal_label', true );
610
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
609
+	$display_label_field = get_post_meta($form_id, '_give_reveal_label', true);
610
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
611 611
 
612
-	$output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>';
612
+	$output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>';
613 613
 
614
-	echo apply_filters( 'give_display_checkout_button', $output );
614
+	echo apply_filters('give_display_checkout_button', $output);
615 615
 }
616 616
 
617
-add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 );
617
+add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2);
618 618
 
619 619
 /**
620 620
  * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided.
@@ -625,57 +625,57 @@  discard block
 block discarded – undo
625 625
  *
626 626
  * @return void
627 627
  */
628
-function give_user_info_fields( $form_id ) {
628
+function give_user_info_fields($form_id) {
629 629
 	// Get user info.
630
-	$give_user_info = _give_get_prefill_form_field_values( $form_id );
630
+	$give_user_info = _give_get_prefill_form_field_values($form_id);
631 631
 
632 632
 	/**
633 633
 	 * Fire before user personal information fields
634 634
 	 *
635 635
 	 * @since 1.7
636 636
 	 */
637
-	do_action( 'give_donation_form_before_personal_info', $form_id );
637
+	do_action('give_donation_form_before_personal_info', $form_id);
638 638
 	?>
639 639
     <fieldset id="give_checkout_user_info">
640
-        <legend><?php echo apply_filters( 'give_checkout_personal_info_text', esc_html__( 'Personal Info', 'give' ) ); ?></legend>
640
+        <legend><?php echo apply_filters('give_checkout_personal_info_text', esc_html__('Personal Info', 'give')); ?></legend>
641 641
         <p id="give-first-name-wrap" class="form-row form-row-first form-row-responsive">
642 642
             <label class="give-label" for="give-first">
643
-				<?php esc_html_e( 'First Name', 'give' ); ?>
644
-				<?php if ( give_field_is_required( 'give_first', $form_id ) ) : ?>
643
+				<?php esc_html_e('First Name', 'give'); ?>
644
+				<?php if (give_field_is_required('give_first', $form_id)) : ?>
645 645
                     <span class="give-required-indicator">*</span>
646 646
 				<?php endif ?>
647 647
                 <span class="give-tooltip give-icon give-icon-question"
648
-                      data-tooltip="<?php esc_attr_e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span>
648
+                      data-tooltip="<?php esc_attr_e('We will use this to personalize your account experience.', 'give'); ?>"></span>
649 649
             </label>
650 650
             <input
651 651
                     class="give-input required"
652 652
                     type="text"
653 653
                     name="give_first"
654
-                    placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>"
654
+                    placeholder="<?php esc_attr_e('First Name', 'give'); ?>"
655 655
                     id="give-first"
656
-                    value="<?php echo isset( $give_user_info['give_first'] ) ? $give_user_info['give_first'] : ''; ?>"
657
-				<?php echo( give_field_is_required( 'give_first', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
656
+                    value="<?php echo isset($give_user_info['give_first']) ? $give_user_info['give_first'] : ''; ?>"
657
+				<?php echo(give_field_is_required('give_first', $form_id) ? ' required aria-required="true" ' : ''); ?>
658 658
             />
659 659
         </p>
660 660
 
661 661
         <p id="give-last-name-wrap" class="form-row form-row-last form-row-responsive">
662 662
             <label class="give-label" for="give-last">
663
-				<?php esc_html_e( 'Last Name', 'give' ); ?>
664
-				<?php if ( give_field_is_required( 'give_last', $form_id ) ) : ?>
663
+				<?php esc_html_e('Last Name', 'give'); ?>
664
+				<?php if (give_field_is_required('give_last', $form_id)) : ?>
665 665
                     <span class="give-required-indicator">*</span>
666 666
 				<?php endif ?>
667 667
                 <span class="give-tooltip give-icon give-icon-question"
668
-                      data-tooltip="<?php esc_attr_e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span>
668
+                      data-tooltip="<?php esc_attr_e('We will use this as well to personalize your account experience.', 'give'); ?>"></span>
669 669
             </label>
670 670
 
671 671
             <input
672
-                    class="give-input<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required' : '' ); ?>"
672
+                    class="give-input<?php echo(give_field_is_required('give_last', $form_id) ? ' required' : ''); ?>"
673 673
                     type="text"
674 674
                     name="give_last"
675 675
                     id="give-last"
676
-                    placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>"
677
-                    value="<?php echo isset( $give_user_info['give_last'] ) ? $give_user_info['give_last'] : ''; ?>"
678
-				<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
676
+                    placeholder="<?php esc_attr_e('Last Name', 'give'); ?>"
677
+                    value="<?php echo isset($give_user_info['give_last']) ? $give_user_info['give_last'] : ''; ?>"
678
+				<?php echo(give_field_is_required('give_last', $form_id) ? ' required aria-required="true" ' : ''); ?>
679 679
             />
680 680
         </p>
681 681
 
@@ -685,26 +685,26 @@  discard block
 block discarded – undo
685 685
 		 *
686 686
 		 * @since 1.7
687 687
 		 */
688
-		do_action( 'give_donation_form_before_email', $form_id );
688
+		do_action('give_donation_form_before_email', $form_id);
689 689
 		?>
690 690
         <p id="give-email-wrap" class="form-row form-row-wide">
691 691
             <label class="give-label" for="give-email">
692
-				<?php esc_html_e( 'Email Address', 'give' ); ?>
693
-				<?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?>
692
+				<?php esc_html_e('Email Address', 'give'); ?>
693
+				<?php if (give_field_is_required('give_email', $form_id)) { ?>
694 694
                     <span class="give-required-indicator">*</span>
695 695
 				<?php } ?>
696 696
                 <span class="give-tooltip give-icon give-icon-question"
697
-                      data-tooltip="<?php esc_attr_e( 'We will send the donation receipt to this address.', 'give' ); ?>"></span>
697
+                      data-tooltip="<?php esc_attr_e('We will send the donation receipt to this address.', 'give'); ?>"></span>
698 698
             </label>
699 699
 
700 700
             <input
701 701
                     class="give-input required"
702 702
                     type="email"
703 703
                     name="give_email"
704
-                    placeholder="<?php esc_attr_e( 'Email Address', 'give' ); ?>"
704
+                    placeholder="<?php esc_attr_e('Email Address', 'give'); ?>"
705 705
                     id="give-email"
706
-                    value="<?php echo isset( $give_user_info['give_email'] ) ? $give_user_info['give_email'] : ''; ?>"
707
-				<?php echo( give_field_is_required( 'give_email', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
706
+                    value="<?php echo isset($give_user_info['give_email']) ? $give_user_info['give_email'] : ''; ?>"
707
+				<?php echo(give_field_is_required('give_email', $form_id) ? ' required aria-required="true" ' : ''); ?>
708 708
             />
709 709
 
710 710
         </p>
@@ -714,14 +714,14 @@  discard block
 block discarded – undo
714 714
 		 *
715 715
 		 * @since 1.7
716 716
 		 */
717
-		do_action( 'give_donation_form_after_email', $form_id );
717
+		do_action('give_donation_form_after_email', $form_id);
718 718
 
719 719
 		/**
720 720
 		 * Fire after personal email field
721 721
 		 *
722 722
 		 * @since 1.7
723 723
 		 */
724
-		do_action( 'give_donation_form_user_info', $form_id );
724
+		do_action('give_donation_form_user_info', $form_id);
725 725
 		?>
726 726
     </fieldset>
727 727
 	<?php
@@ -730,11 +730,11 @@  discard block
 block discarded – undo
730 730
 	 *
731 731
 	 * @since 1.7
732 732
 	 */
733
-	do_action( 'give_donation_form_after_personal_info', $form_id );
733
+	do_action('give_donation_form_after_personal_info', $form_id);
734 734
 }
735 735
 
736
-add_action( 'give_donation_form_after_user_info', 'give_user_info_fields' );
737
-add_action( 'give_register_fields_before', 'give_user_info_fields' );
736
+add_action('give_donation_form_after_user_info', 'give_user_info_fields');
737
+add_action('give_register_fields_before', 'give_user_info_fields');
738 738
 
739 739
 /**
740 740
  * Renders the credit card info form.
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
  *
746 746
  * @return void
747 747
  */
748
-function give_get_cc_form( $form_id ) {
748
+function give_get_cc_form($form_id) {
749 749
 
750 750
 	ob_start();
751 751
 
@@ -756,53 +756,53 @@  discard block
 block discarded – undo
756 756
 	 *
757 757
 	 * @param int $form_id The form ID.
758 758
 	 */
759
-	do_action( 'give_before_cc_fields', $form_id );
759
+	do_action('give_before_cc_fields', $form_id);
760 760
 	?>
761 761
     <fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate">
762
-        <legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', esc_html__( 'Credit Card Info', 'give' ) ); ?></legend>
763
-		<?php if ( is_ssl() ) : ?>
762
+        <legend><?php echo apply_filters('give_credit_card_fieldset_heading', esc_html__('Credit Card Info', 'give')); ?></legend>
763
+		<?php if (is_ssl()) : ?>
764 764
             <div id="give_secure_site_wrapper-<?php echo $form_id ?>">
765 765
                 <span class="give-icon padlock"></span>
766
-                <span><?php esc_html_e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span>
766
+                <span><?php esc_html_e('This is a secure SSL encrypted payment.', 'give'); ?></span>
767 767
             </div>
768 768
 		<?php endif; ?>
769 769
         <p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive">
770 770
             <label for="card_number-<?php echo $form_id ?>" class="give-label">
771
-				<?php esc_html_e( 'Card Number', 'give' ); ?>
771
+				<?php esc_html_e('Card Number', 'give'); ?>
772 772
                 <span class="give-required-indicator">*</span>
773 773
                 <span class="give-tooltip give-icon give-icon-question"
774
-                      data-tooltip="<?php esc_attr_e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span>
774
+                      data-tooltip="<?php esc_attr_e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span>
775 775
                 <span class="card-type"></span>
776 776
             </label>
777 777
 
778 778
             <input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>"
779
-                   class="card-number give-input required" placeholder="<?php esc_attr_e( 'Card number', 'give' ); ?>"
779
+                   class="card-number give-input required" placeholder="<?php esc_attr_e('Card number', 'give'); ?>"
780 780
                    required aria-required="true"/>
781 781
         </p>
782 782
 
783 783
         <p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third form-row-responsive">
784 784
             <label for="card_cvc-<?php echo $form_id ?>" class="give-label">
785
-				<?php esc_html_e( 'CVC', 'give' ); ?>
785
+				<?php esc_html_e('CVC', 'give'); ?>
786 786
                 <span class="give-required-indicator">*</span>
787 787
                 <span class="give-tooltip give-icon give-icon-question"
788
-                      data-tooltip="<?php esc_attr_e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span>
788
+                      data-tooltip="<?php esc_attr_e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span>
789 789
             </label>
790 790
 
791 791
             <input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>"
792
-                   class="card-cvc give-input required" placeholder="<?php esc_attr_e( 'Security code', 'give' ); ?>"
792
+                   class="card-cvc give-input required" placeholder="<?php esc_attr_e('Security code', 'give'); ?>"
793 793
                    required aria-required="true"/>
794 794
         </p>
795 795
 
796 796
         <p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds form-row-responsive">
797 797
             <label for="card_name-<?php echo $form_id ?>" class="give-label">
798
-				<?php esc_html_e( 'Name on the Card', 'give' ); ?>
798
+				<?php esc_html_e('Name on the Card', 'give'); ?>
799 799
                 <span class="give-required-indicator">*</span>
800 800
                 <span class="give-tooltip give-icon give-icon-question"
801
-                      data-tooltip="<?php esc_attr_e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span>
801
+                      data-tooltip="<?php esc_attr_e('The name printed on the front of your credit card.', 'give'); ?>"></span>
802 802
             </label>
803 803
 
804 804
             <input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>"
805
-                   class="card-name give-input required" placeholder="<?php esc_attr_e( 'Card name', 'give' ); ?>"
805
+                   class="card-name give-input required" placeholder="<?php esc_attr_e('Card name', 'give'); ?>"
806 806
                    required aria-required="true"/>
807 807
         </p>
808 808
 		<?php
@@ -813,14 +813,14 @@  discard block
 block discarded – undo
813 813
 		 *
814 814
 		 * @param int $form_id The form ID.
815 815
 		 */
816
-		do_action( 'give_before_cc_expiration' );
816
+		do_action('give_before_cc_expiration');
817 817
 		?>
818 818
         <p class="card-expiration form-row form-row-one-third form-row-responsive">
819 819
             <label for="card_expiry-<?php echo $form_id ?>" class="give-label">
820
-				<?php esc_html_e( 'Expiration', 'give' ); ?>
820
+				<?php esc_html_e('Expiration', 'give'); ?>
821 821
                 <span class="give-required-indicator">*</span>
822 822
                 <span class="give-tooltip give-icon give-icon-question"
823
-                      data-tooltip="<?php esc_attr_e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span>
823
+                      data-tooltip="<?php esc_attr_e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span>
824 824
             </label>
825 825
 
826 826
             <input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month"
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
                    class="card-expiry-year"/>
830 830
 
831 831
             <input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>"
832
-                   class="card-expiry give-input required" placeholder="<?php esc_attr_e( 'MM / YY', 'give' ); ?>"
832
+                   class="card-expiry give-input required" placeholder="<?php esc_attr_e('MM / YY', 'give'); ?>"
833 833
                    required aria-required="true"/>
834 834
         </p>
835 835
 		<?php
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 		 *
841 841
 		 * @param int $form_id The form ID.
842 842
 		 */
843
-		do_action( 'give_after_cc_expiration', $form_id );
843
+		do_action('give_after_cc_expiration', $form_id);
844 844
 		?>
845 845
     </fieldset>
846 846
 	<?php
@@ -851,12 +851,12 @@  discard block
 block discarded – undo
851 851
 	 *
852 852
 	 * @param int $form_id The form ID.
853 853
 	 */
854
-	do_action( 'give_after_cc_fields', $form_id );
854
+	do_action('give_after_cc_fields', $form_id);
855 855
 
856 856
 	echo ob_get_clean();
857 857
 }
858 858
 
859
-add_action( 'give_cc_form', 'give_get_cc_form' );
859
+add_action('give_cc_form', 'give_get_cc_form');
860 860
 
861 861
 /**
862 862
  * Outputs the default credit card address fields.
@@ -867,24 +867,24 @@  discard block
 block discarded – undo
867 867
  *
868 868
  * @return void
869 869
  */
870
-function give_default_cc_address_fields( $form_id ) {
870
+function give_default_cc_address_fields($form_id) {
871 871
 	// Get user info.
872
-	$give_user_info = _give_get_prefill_form_field_values( $form_id );
872
+	$give_user_info = _give_get_prefill_form_field_values($form_id);
873 873
 
874 874
 	$logged_in = is_user_logged_in();
875 875
 
876
-	if ( $logged_in ) {
877
-		$user_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
876
+	if ($logged_in) {
877
+		$user_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
878 878
 	}
879
-	$line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : '';
880
-	$line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : '';
881
-	$city  = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : '';
882
-	$zip   = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : '';
879
+	$line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : '';
880
+	$line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : '';
881
+	$city  = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : '';
882
+	$zip   = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : '';
883 883
 
884 884
 	ob_start();
885 885
 	?>
886 886
     <fieldset id="give_cc_address" class="cc-address">
887
-        <legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>
887
+        <legend><?php echo apply_filters('give_billing_details_fieldset_heading', esc_html__('Billing Details', 'give')); ?></legend>
888 888
 		<?php
889 889
 		/**
890 890
 		 * Fires while rendering credit card billing form, before address fields.
@@ -893,79 +893,79 @@  discard block
 block discarded – undo
893 893
 		 *
894 894
 		 * @param int $form_id The form ID.
895 895
 		 */
896
-		do_action( 'give_cc_billing_top' );
896
+		do_action('give_cc_billing_top');
897 897
 		?>
898 898
         <p id="give-card-address-wrap" class="form-row form-row-wide">
899 899
             <label for="card_address" class="give-label">
900
-				<?php esc_html_e( 'Address 1', 'give' ); ?>
900
+				<?php esc_html_e('Address 1', 'give'); ?>
901 901
 				<?php
902
-				if ( give_field_is_required( 'card_address', $form_id ) ) : ?>
902
+				if (give_field_is_required('card_address', $form_id)) : ?>
903 903
                     <span class="give-required-indicator">*</span>
904 904
 				<?php endif; ?>
905 905
                 <span class="give-tooltip give-icon give-icon-question"
906
-                      data-tooltip="<?php esc_attr_e( 'The primary billing address for your credit card.', 'give' ); ?>"></span>
906
+                      data-tooltip="<?php esc_attr_e('The primary billing address for your credit card.', 'give'); ?>"></span>
907 907
             </label>
908 908
 
909 909
             <input
910 910
                     type="text"
911 911
                     id="card_address"
912 912
                     name="card_address"
913
-                    class="card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>"
914
-                    placeholder="<?php esc_attr_e( 'Address line 1', 'give' ); ?>"
915
-                    value="<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>"
916
-				<?php echo( give_field_is_required( 'card_address', $form_id ) ? '  required aria-required="true" ' : '' ); ?>
913
+                    class="card-address give-input<?php echo(give_field_is_required('card_address', $form_id) ? ' required' : ''); ?>"
914
+                    placeholder="<?php esc_attr_e('Address line 1', 'give'); ?>"
915
+                    value="<?php echo isset($give_user_info['card_address']) ? $give_user_info['card_address'] : ''; ?>"
916
+				<?php echo(give_field_is_required('card_address', $form_id) ? '  required aria-required="true" ' : ''); ?>
917 917
             />
918 918
         </p>
919 919
 
920 920
         <p id="give-card-address-2-wrap" class="form-row form-row-wide">
921 921
             <label for="card_address_2" class="give-label">
922
-				<?php esc_html_e( 'Address 2', 'give' ); ?>
923
-				<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>
922
+				<?php esc_html_e('Address 2', 'give'); ?>
923
+				<?php if (give_field_is_required('card_address_2', $form_id)) : ?>
924 924
                     <span class="give-required-indicator">*</span>
925 925
 				<?php endif; ?>
926 926
                 <span class="give-tooltip give-icon give-icon-question"
927
-                      data-tooltip="<?php esc_attr_e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span>
927
+                      data-tooltip="<?php esc_attr_e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span>
928 928
             </label>
929 929
 
930 930
             <input
931 931
                     type="text"
932 932
                     id="card_address_2"
933 933
                     name="card_address_2"
934
-                    class="card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>"
935
-                    placeholder="<?php esc_attr_e( 'Address line 2', 'give' ); ?>"
936
-                    value="<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>"
937
-				<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
934
+                    class="card-address-2 give-input<?php echo(give_field_is_required('card_address_2', $form_id) ? ' required' : ''); ?>"
935
+                    placeholder="<?php esc_attr_e('Address line 2', 'give'); ?>"
936
+                    value="<?php echo isset($give_user_info['card_address_2']) ? $give_user_info['card_address_2'] : ''; ?>"
937
+				<?php echo(give_field_is_required('card_address_2', $form_id) ? ' required aria-required="true" ' : ''); ?>
938 938
             />
939 939
         </p>
940 940
 
941 941
         <p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive">
942 942
             <label for="card_city" class="give-label">
943
-				<?php esc_html_e( 'City', 'give' ); ?>
944
-				<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>
943
+				<?php esc_html_e('City', 'give'); ?>
944
+				<?php if (give_field_is_required('card_city', $form_id)) : ?>
945 945
                     <span class="give-required-indicator">*</span>
946 946
 				<?php endif; ?>
947 947
                 <span class="give-tooltip give-icon give-icon-question"
948
-                      data-tooltip="<?php esc_attr_e( 'The city for your billing address.', 'give' ); ?>"></span>
948
+                      data-tooltip="<?php esc_attr_e('The city for your billing address.', 'give'); ?>"></span>
949 949
             </label>
950 950
             <input
951 951
                     type="text"
952 952
                     id="card_city"
953 953
                     name="card_city"
954
-                    class="card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>"
955
-                    placeholder="<?php esc_attr_e( 'City', 'give' ); ?>"
956
-                    value="<?php echo isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : ''; ?>"
957
-				<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
954
+                    class="card-city give-input<?php echo(give_field_is_required('card_city', $form_id) ? ' required' : ''); ?>"
955
+                    placeholder="<?php esc_attr_e('City', 'give'); ?>"
956
+                    value="<?php echo isset($give_user_info['card_city']) ? $give_user_info['card_city'] : ''; ?>"
957
+				<?php echo(give_field_is_required('card_city', $form_id) ? ' required aria-required="true" ' : ''); ?>
958 958
             />
959 959
         </p>
960 960
 
961 961
         <p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive">
962 962
             <label for="card_zip" class="give-label">
963
-				<?php esc_html_e( 'Zip / Postal Code', 'give' ); ?>
964
-				<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>
963
+				<?php esc_html_e('Zip / Postal Code', 'give'); ?>
964
+				<?php if (give_field_is_required('card_zip', $form_id)) : ?>
965 965
                     <span class="give-required-indicator">*</span>
966 966
 				<?php endif; ?>
967 967
                 <span class="give-tooltip give-icon give-icon-question"
968
-                      data-tooltip="<?php esc_attr_e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span>
968
+                      data-tooltip="<?php esc_attr_e('The zip or postal code for your billing address.', 'give'); ?>"></span>
969 969
             </label>
970 970
 
971 971
             <input
@@ -973,40 +973,40 @@  discard block
 block discarded – undo
973 973
                     size="4"
974 974
                     id="card_zip"
975 975
                     name="card_zip"
976
-                    class="card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>"
977
-                    placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>"
978
-                    value="<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>"
979
-				<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
976
+                    class="card-zip give-input<?php echo(give_field_is_required('card_zip', $form_id) ? ' required' : ''); ?>"
977
+                    placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>"
978
+                    value="<?php echo isset($give_user_info['card_zip']) ? $give_user_info['card_zip'] : ''; ?>"
979
+				<?php echo(give_field_is_required('card_zip', $form_id) ? ' required aria-required="true" ' : ''); ?>
980 980
             />
981 981
         </p>
982 982
 
983 983
         <p id="give-card-country-wrap" class="form-row form-row-first form-row-responsive">
984 984
             <label for="billing_country" class="give-label">
985
-				<?php esc_html_e( 'Country', 'give' ); ?>
986
-				<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>
985
+				<?php esc_html_e('Country', 'give'); ?>
986
+				<?php if (give_field_is_required('billing_country', $form_id)) : ?>
987 987
                     <span class="give-required-indicator">*</span>
988 988
 				<?php endif; ?>
989 989
                 <span class="give-tooltip give-icon give-icon-question"
990
-                      data-tooltip="<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>"></span>
990
+                      data-tooltip="<?php esc_attr_e('The country for your billing address.', 'give'); ?>"></span>
991 991
             </label>
992 992
 
993 993
             <select
994 994
                     name="billing_country"
995 995
                     id="billing_country"
996
-                    class="billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>"
997
-				<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required="true" ' : '' ); ?>
996
+                    class="billing-country billing_country give-select<?php echo(give_field_is_required('billing_country', $form_id) ? ' required' : ''); ?>"
997
+				<?php echo(give_field_is_required('billing_country', $form_id) ? ' required aria-required="true" ' : ''); ?>
998 998
             >
999 999
 				<?php
1000 1000
 
1001 1001
 				$selected_country = give_get_country();
1002 1002
 
1003
-				if ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {
1003
+				if ( ! empty($give_user_info['billing_country']) && '*' !== $give_user_info['billing_country']) {
1004 1004
 					$selected_country = $give_user_info['billing_country'];
1005 1005
 				}
1006 1006
 
1007 1007
 				$countries = give_get_country_list();
1008
-				foreach ( $countries as $country_code => $country ) {
1009
-					echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
1008
+				foreach ($countries as $country_code => $country) {
1009
+					echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
1010 1010
 				}
1011 1011
 				?>
1012 1012
             </select>
@@ -1014,37 +1014,37 @@  discard block
 block discarded – undo
1014 1014
 
1015 1015
         <p id="give-card-state-wrap" class="form-row form-row-last form-row-responsive">
1016 1016
             <label for="card_state" class="give-label">
1017
-				<?php esc_html_e( 'State / Province', 'give' ); ?>
1018
-				<?php if ( give_field_is_required( 'card_state', $form_id ) ) : ?>
1017
+				<?php esc_html_e('State / Province', 'give'); ?>
1018
+				<?php if (give_field_is_required('card_state', $form_id)) : ?>
1019 1019
                     <span class="give-required-indicator">*</span>
1020 1020
 				<?php endif; ?>
1021 1021
                 <span class="give-tooltip give-icon give-icon-question"
1022
-                      data-tooltip="<?php esc_attr_e( 'The state or province for your billing address.', 'give' ); ?>"></span>
1022
+                      data-tooltip="<?php esc_attr_e('The state or province for your billing address.', 'give'); ?>"></span>
1023 1023
             </label>
1024 1024
 
1025 1025
 			<?php
1026 1026
 			$selected_state = give_get_state();
1027
-			$states         = give_get_states( $selected_country );
1027
+			$states         = give_get_states($selected_country);
1028 1028
 
1029
-			if ( ! empty( $give_user_info['card_state'] ) ) {
1029
+			if ( ! empty($give_user_info['card_state'])) {
1030 1030
 				$selected_state = $give_user_info['card_state'];
1031 1031
 			}
1032 1032
 
1033
-			if ( ! empty( $states ) ) : ?>
1033
+			if ( ! empty($states)) : ?>
1034 1034
                 <select
1035 1035
                         name="card_state"
1036 1036
                         id="card_state"
1037
-                        class="card_state give-select<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required' : '' ); ?>"
1038
-					<?php echo( give_field_is_required( 'card_state', $form_id ) ? ' required aria-required="true" ' : '' ); ?>>
1037
+                        class="card_state give-select<?php echo(give_field_is_required('card_state', $form_id) ? ' required' : ''); ?>"
1038
+					<?php echo(give_field_is_required('card_state', $form_id) ? ' required aria-required="true" ' : ''); ?>>
1039 1039
 					<?php
1040
-					foreach ( $states as $state_code => $state ) {
1041
-						echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
1040
+					foreach ($states as $state_code => $state) {
1041
+						echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
1042 1042
 					}
1043 1043
 					?>
1044 1044
                 </select>
1045 1045
 			<?php else : ?>
1046 1046
                 <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input"
1047
-                       placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>"/>
1047
+                       placeholder="<?php esc_attr_e('State / Province', 'give'); ?>"/>
1048 1048
 			<?php endif; ?>
1049 1049
         </p>
1050 1050
 		<?php
@@ -1055,14 +1055,14 @@  discard block
 block discarded – undo
1055 1055
 		 *
1056 1056
 		 * @param int $form_id The form ID.
1057 1057
 		 */
1058
-		do_action( 'give_cc_billing_bottom' );
1058
+		do_action('give_cc_billing_bottom');
1059 1059
 		?>
1060 1060
     </fieldset>
1061 1061
 	<?php
1062 1062
 	echo ob_get_clean();
1063 1063
 }
1064 1064
 
1065
-add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' );
1065
+add_action('give_after_cc_fields', 'give_default_cc_address_fields');
1066 1066
 
1067 1067
 
1068 1068
 /**
@@ -1075,24 +1075,24 @@  discard block
 block discarded – undo
1075 1075
  *
1076 1076
  * @return string
1077 1077
  */
1078
-function give_get_register_fields( $form_id ) {
1078
+function give_get_register_fields($form_id) {
1079 1079
 
1080 1080
 	global $user_ID;
1081 1081
 
1082
-	if ( is_user_logged_in() ) {
1083
-		$user_data = get_userdata( $user_ID );
1082
+	if (is_user_logged_in()) {
1083
+		$user_data = get_userdata($user_ID);
1084 1084
 	}
1085 1085
 
1086
-	$show_register_form = give_show_login_register_option( $form_id );
1086
+	$show_register_form = give_show_login_register_option($form_id);
1087 1087
 
1088 1088
 	ob_start(); ?>
1089 1089
     <fieldset id="give-register-fields-<?php echo $form_id; ?>">
1090 1090
 
1091
-		<?php if ( $show_register_form == 'both' ) { ?>
1091
+		<?php if ($show_register_form == 'both') { ?>
1092 1092
             <div class="give-login-account-wrap">
1093
-                <p class="give-login-message"><?php esc_html_e( 'Already have an account?', 'give' ); ?>&nbsp;
1094
-                    <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login"
1095
-                       data-action="give_checkout_login"><?php esc_html_e( 'Login', 'give' ); ?></a>
1093
+                <p class="give-login-message"><?php esc_html_e('Already have an account?', 'give'); ?>&nbsp;
1094
+                    <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login"
1095
+                       data-action="give_checkout_login"><?php esc_html_e('Login', 'give'); ?></a>
1096 1096
                 </p>
1097 1097
                 <p class="give-loading-text">
1098 1098
                     <span class="give-loading-animation"></span>
@@ -1108,15 +1108,15 @@  discard block
 block discarded – undo
1108 1108
 		 *
1109 1109
 		 * @param int $form_id The form ID.
1110 1110
 		 */
1111
-		do_action( 'give_register_fields_before', $form_id );
1111
+		do_action('give_register_fields_before', $form_id);
1112 1112
 		?>
1113 1113
 
1114 1114
         <fieldset id="give-register-account-fields-<?php echo $form_id; ?>">
1115 1115
             <legend>
1116 1116
 				<?php
1117
-				echo apply_filters( 'give_create_account_fieldset_heading', esc_html__( 'Create an account', 'give' ) );
1118
-				if ( ! give_logged_in_only( $form_id ) ) {
1119
-					echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1117
+				echo apply_filters('give_create_account_fieldset_heading', esc_html__('Create an account', 'give'));
1118
+				if ( ! give_logged_in_only($form_id)) {
1119
+					echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1120 1120
 				}
1121 1121
 				?>
1122 1122
             </legend>
@@ -1128,54 +1128,54 @@  discard block
 block discarded – undo
1128 1128
 			 *
1129 1129
 			 * @param int $form_id The form ID.
1130 1130
 			 */
1131
-			do_action( 'give_register_account_fields_before', $form_id );
1131
+			do_action('give_register_account_fields_before', $form_id);
1132 1132
 			?>
1133 1133
             <div id="give-user-login-wrap-<?php echo $form_id; ?>"
1134 1134
                  class="form-row form-row-one-third form-row-first form-row-responsive">
1135 1135
                 <label for="give-user-login-<?php echo $form_id; ?>">
1136
-					<?php esc_html_e( 'Username', 'give' ); ?>
1137
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1136
+					<?php esc_html_e('Username', 'give'); ?>
1137
+					<?php if (give_logged_in_only($form_id)) { ?>
1138 1138
                         <span class="give-required-indicator">*</span>
1139 1139
 					<?php } ?>
1140 1140
                     <span class="give-tooltip give-icon give-icon-question"
1141
-                          data-tooltip="<?php esc_attr_e( 'The username you will use to log into your account.', 'give' ); ?>"></span>
1141
+                          data-tooltip="<?php esc_attr_e('The username you will use to log into your account.', 'give'); ?>"></span>
1142 1142
                 </label>
1143 1143
 
1144 1144
                 <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="give-input"
1145 1145
                        type="text"
1146
-                       placeholder="<?php esc_attr_e( 'Username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1146
+                       placeholder="<?php esc_attr_e('Username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1147 1147
             </div>
1148 1148
 
1149 1149
             <div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1150 1150
                  class="form-row form-row-one-third form-row-responsive">
1151 1151
                 <label for="give-user-pass-<?php echo $form_id; ?>">
1152
-					<?php esc_html_e( 'Password', 'give' ); ?>
1153
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1152
+					<?php esc_html_e('Password', 'give'); ?>
1153
+					<?php if (give_logged_in_only($form_id)) { ?>
1154 1154
                         <span class="give-required-indicator">*</span>
1155 1155
 					<?php } ?>
1156 1156
                     <span class="give-tooltip give-icon give-icon-question"
1157
-                          data-tooltip="<?php esc_attr_e( 'The password used to access your account.', 'give' ); ?>"></span>
1157
+                          data-tooltip="<?php esc_attr_e('The password used to access your account.', 'give'); ?>"></span>
1158 1158
                 </label>
1159 1159
 
1160 1160
                 <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="give-input"
1161
-                       placeholder="<?php esc_attr_e( 'Password', 'give' ); ?>"
1162
-                       type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1161
+                       placeholder="<?php esc_attr_e('Password', 'give'); ?>"
1162
+                       type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1163 1163
             </div>
1164 1164
 
1165 1165
             <div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>"
1166 1166
                  class="give-register-password form-row form-row-one-third form-row-responsive">
1167 1167
                 <label for="give-user-pass-confirm-<?php echo $form_id; ?>">
1168
-					<?php esc_html_e( 'Confirm PW', 'give' ); ?>
1169
-					<?php if ( give_logged_in_only( $form_id ) ) { ?>
1168
+					<?php esc_html_e('Confirm PW', 'give'); ?>
1169
+					<?php if (give_logged_in_only($form_id)) { ?>
1170 1170
                         <span class="give-required-indicator">*</span>
1171 1171
 					<?php } ?>
1172 1172
                     <span class="give-tooltip give-icon give-icon-question"
1173
-                          data-tooltip="<?php esc_attr_e( 'Please retype your password to confirm.', 'give' ); ?>"></span>
1173
+                          data-tooltip="<?php esc_attr_e('Please retype your password to confirm.', 'give'); ?>"></span>
1174 1174
                 </label>
1175 1175
 
1176 1176
                 <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>"
1177
-                       class="give-input" placeholder="<?php esc_attr_e( 'Confirm password', 'give' ); ?>"
1178
-                       type="password"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1177
+                       class="give-input" placeholder="<?php esc_attr_e('Confirm password', 'give'); ?>"
1178
+                       type="password"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1179 1179
             </div>
1180 1180
 			<?php
1181 1181
 			/**
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 			 *
1186 1186
 			 * @param int $form_id The form ID.
1187 1187
 			 */
1188
-			do_action( 'give_register_account_fields_after', $form_id );
1188
+			do_action('give_register_account_fields_after', $form_id);
1189 1189
 			?>
1190 1190
         </fieldset>
1191 1191
 
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 		 *
1198 1198
 		 * @param int $form_id The form ID.
1199 1199
 		 */
1200
-		do_action( 'give_register_fields_after', $form_id );
1200
+		do_action('give_register_fields_after', $form_id);
1201 1201
 		?>
1202 1202
 
1203 1203
         <input type="hidden" name="give-purchase-var" value="needs-to-register"/>
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
 		 *
1209 1209
 		 * @since 1.7
1210 1210
 		 */
1211
-		do_action( 'give_donation_form_user_info', $form_id );
1211
+		do_action('give_donation_form_user_info', $form_id);
1212 1212
 		?>
1213 1213
 
1214 1214
     </fieldset>
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
 	echo ob_get_clean();
1217 1217
 }
1218 1218
 
1219
-add_action( 'give_donation_form_register_fields', 'give_get_register_fields' );
1219
+add_action('give_donation_form_register_fields', 'give_get_register_fields');
1220 1220
 
1221 1221
 /**
1222 1222
  * Gets the login fields for the login form on the checkout. This function hooks
@@ -1229,27 +1229,27 @@  discard block
 block discarded – undo
1229 1229
  *
1230 1230
  * @return string
1231 1231
  */
1232
-function give_get_login_fields( $form_id ) {
1232
+function give_get_login_fields($form_id) {
1233 1233
 
1234
-	$form_id            = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id;
1235
-	$show_register_form = give_show_login_register_option( $form_id );
1234
+	$form_id            = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id;
1235
+	$show_register_form = give_show_login_register_option($form_id);
1236 1236
 
1237 1237
 	ob_start();
1238 1238
 	?>
1239 1239
     <fieldset id="give-login-fields-<?php echo $form_id; ?>">
1240
-        <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', esc_html__( 'Login to Your Account', 'give' ) );
1241
-			if ( ! give_logged_in_only( $form_id ) ) {
1242
-				echo ' <span class="sub-text">' . esc_html__( '(optional)', 'give' ) . '</span>';
1240
+        <legend><?php echo apply_filters('give_account_login_fieldset_heading', esc_html__('Login to Your Account', 'give'));
1241
+			if ( ! give_logged_in_only($form_id)) {
1242
+				echo ' <span class="sub-text">'.esc_html__('(optional)', 'give').'</span>';
1243 1243
 			} ?>
1244 1244
         </legend>
1245
-		<?php if ( $show_register_form == 'both' ) { ?>
1245
+		<?php if ($show_register_form == 'both') { ?>
1246 1246
             <p class="give-new-account-link">
1247
-				<?php esc_html_e( 'Need to create an account?', 'give' ); ?>&nbsp;
1248
-                <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel"
1247
+				<?php esc_html_e('Need to create an account?', 'give'); ?>&nbsp;
1248
+                <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel"
1249 1249
                    data-action="give_checkout_register">
1250
-					<?php esc_html_e( 'Register', 'give' );
1251
-					if ( ! give_logged_in_only( $form_id ) ) {
1252
-						echo ' ' . esc_html__( 'or checkout as a guest &raquo;', 'give' );
1250
+					<?php esc_html_e('Register', 'give');
1251
+					if ( ! give_logged_in_only($form_id)) {
1252
+						echo ' '.esc_html__('or checkout as a guest &raquo;', 'give');
1253 1253
 					} ?>
1254 1254
                 </a>
1255 1255
             </p>
@@ -1265,49 +1265,49 @@  discard block
 block discarded – undo
1265 1265
 		 *
1266 1266
 		 * @param int $form_id The form ID.
1267 1267
 		 */
1268
-		do_action( 'give_checkout_login_fields_before', $form_id );
1268
+		do_action('give_checkout_login_fields_before', $form_id);
1269 1269
 		?>
1270 1270
         <div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first form-row-responsive">
1271 1271
             <label class="give-label" for="give-user-login-<?php echo $form_id; ?>">
1272
-				<?php esc_html_e( 'Username', 'give' ); ?>
1273
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1272
+				<?php esc_html_e('Username', 'give'); ?>
1273
+				<?php if (give_logged_in_only($form_id)) { ?>
1274 1274
                     <span class="give-required-indicator">*</span>
1275 1275
 				<?php } ?>
1276 1276
             </label>
1277 1277
 
1278
-            <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>" type="text"
1278
+            <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>" type="text"
1279 1279
                    name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value=""
1280
-                   placeholder="<?php esc_attr_e( 'Your username', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1280
+                   placeholder="<?php esc_attr_e('Your username', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1281 1281
         </div>
1282 1282
 
1283 1283
         <div id="give-user-pass-wrap-<?php echo $form_id; ?>"
1284 1284
              class="give_login_password form-row form-row-last form-row-responsive">
1285 1285
             <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>">
1286
-				<?php esc_html_e( 'Password', 'give' ); ?>
1287
-				<?php if ( give_logged_in_only( $form_id ) ) { ?>
1286
+				<?php esc_html_e('Password', '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
-            <input class="give-input<?php echo ( give_logged_in_only( $form_id ) ) ? ' required' : ''; ?>"
1291
+            <input class="give-input<?php echo (give_logged_in_only($form_id)) ? ' required' : ''; ?>"
1292 1292
                    type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>"
1293
-                   placeholder="<?php esc_attr_e( 'Your password', 'give' ); ?>"<?php echo ( give_logged_in_only( $form_id ) ) ? ' required aria-required="true" ' : ''; ?>/>
1293
+                   placeholder="<?php esc_attr_e('Your password', 'give'); ?>"<?php echo (give_logged_in_only($form_id)) ? ' required aria-required="true" ' : ''; ?>/>
1294 1294
             <input type="hidden" name="give-purchase-var" value="needs-to-login"/>
1295 1295
         </div>
1296 1296
 
1297 1297
         <div id="give-forgot-password-wrap-<?php echo $form_id; ?>" class="give_login_forgot_password">
1298 1298
 			 <span class="give-forgot-password ">
1299 1299
 				 <a href="<?php echo wp_lostpassword_url() ?>"
1300
-                    target="_blank"><?php esc_html_e( 'Reset Password', 'give' ) ?></a>
1300
+                    target="_blank"><?php esc_html_e('Reset Password', 'give') ?></a>
1301 1301
 			 </span>
1302 1302
         </div>
1303 1303
 
1304 1304
         <div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix">
1305 1305
             <input type="submit" class="give-submit give-btn button" name="give_login_submit"
1306
-                   value="<?php esc_attr_e( 'Login', 'give' ); ?>"/>
1307
-			<?php if ( $show_register_form !== 'login' ) { ?>
1306
+                   value="<?php esc_attr_e('Login', 'give'); ?>"/>
1307
+			<?php if ($show_register_form !== 'login') { ?>
1308 1308
                 <input type="button" data-action="give_cancel_login"
1309 1309
                        class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel"
1310
-                       value="<?php esc_attr_e( 'Cancel', 'give' ); ?>"/>
1310
+                       value="<?php esc_attr_e('Cancel', 'give'); ?>"/>
1311 1311
 			<?php } ?>
1312 1312
             <span class="give-loading-animation"></span>
1313 1313
         </div>
@@ -1319,14 +1319,14 @@  discard block
 block discarded – undo
1319 1319
 		 *
1320 1320
 		 * @param int $form_id The form ID.
1321 1321
 		 */
1322
-		do_action( 'give_checkout_login_fields_after', $form_id );
1322
+		do_action('give_checkout_login_fields_after', $form_id);
1323 1323
 		?>
1324 1324
     </fieldset><!--end #give-login-fields-->
1325 1325
 	<?php
1326 1326
 	echo ob_get_clean();
1327 1327
 }
1328 1328
 
1329
-add_action( 'give_donation_form_login_fields', 'give_get_login_fields', 10, 1 );
1329
+add_action('give_donation_form_login_fields', 'give_get_login_fields', 10, 1);
1330 1330
 
1331 1331
 /**
1332 1332
  * Payment Mode Select.
@@ -1342,9 +1342,9 @@  discard block
 block discarded – undo
1342 1342
  *
1343 1343
  * @return void
1344 1344
  */
1345
-function give_payment_mode_select( $form_id ) {
1345
+function give_payment_mode_select($form_id) {
1346 1346
 
1347
-	$gateways = give_get_enabled_payment_gateways( $form_id );
1347
+	$gateways = give_get_enabled_payment_gateways($form_id);
1348 1348
 
1349 1349
 	/**
1350 1350
 	 * Fires while selecting payment gateways, before the fields.
@@ -1353,10 +1353,10 @@  discard block
 block discarded – undo
1353 1353
 	 *
1354 1354
 	 * @param int $form_id The form ID.
1355 1355
 	 */
1356
-	do_action( 'give_payment_mode_top', $form_id );
1356
+	do_action('give_payment_mode_top', $form_id);
1357 1357
 	?>
1358 1358
 
1359
-    <fieldset id="give-payment-mode-select" <?php if ( count( $gateways ) <= 1 ) {
1359
+    <fieldset id="give-payment-mode-select" <?php if (count($gateways) <= 1) {
1360 1360
 		echo 'style="display: none;"';
1361 1361
 	} ?>>
1362 1362
 		<?php
@@ -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_before_gateways_wrap' );
1370
+		do_action('give_payment_mode_before_gateways_wrap');
1371 1371
 		?>
1372 1372
         <legend
1373
-                class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', esc_html__( 'Select Payment Method', 'give' ) ); ?>
1373
+                class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', esc_html__('Select Payment Method', 'give')); ?>
1374 1374
             <span class="give-loading-text"><span
1375 1375
                         class="give-loading-animation"></span>
1376 1376
             </span>
@@ -1383,26 +1383,26 @@  discard block
 block discarded – undo
1383 1383
 			 *
1384 1384
 			 * @since 1.7
1385 1385
 			 */
1386
-			do_action( 'give_payment_mode_before_gateways' )
1386
+			do_action('give_payment_mode_before_gateways')
1387 1387
 			?>
1388 1388
             <ul id="give-gateway-radio-list">
1389 1389
 				<?php
1390 1390
 				/**
1391 1391
 				 * Loop through the active payment gateways.
1392 1392
 				 */
1393
-				$selected_gateway  = give_get_chosen_gateway( $form_id );
1393
+				$selected_gateway = give_get_chosen_gateway($form_id);
1394 1394
 
1395
-				foreach ( $gateways as $gateway_id => $gateway ) :
1395
+				foreach ($gateways as $gateway_id => $gateway) :
1396 1396
 					//Determine the default gateway.
1397
-					$checked = checked( $gateway_id, $selected_gateway, false );
1397
+					$checked = checked($gateway_id, $selected_gateway, false);
1398 1398
 					$checked_class = $checked ? ' class="give-gateway-option-selected"' : ''; ?>
1399 1399
                     <li<?php echo $checked_class ?>>
1400 1400
                         <input type="radio" name="payment-mode" class="give-gateway"
1401
-                               id="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1402
-                               value="<?php echo esc_attr( $gateway_id ); ?>"<?php echo $checked; ?>>
1403
-                        <label for="give-gateway-<?php echo esc_attr( $gateway_id ) . '-' . $form_id; ?>"
1401
+                               id="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1402
+                               value="<?php echo esc_attr($gateway_id); ?>"<?php echo $checked; ?>>
1403
+                        <label for="give-gateway-<?php echo esc_attr($gateway_id).'-'.$form_id; ?>"
1404 1404
                                class="give-gateway-option"
1405
-                               id="give-gateway-option-<?php echo esc_attr( $gateway_id ); ?>"> <?php echo esc_html( $gateway['checkout_label'] ); ?></label>
1405
+                               id="give-gateway-option-<?php echo esc_attr($gateway_id); ?>"> <?php echo esc_html($gateway['checkout_label']); ?></label>
1406 1406
                     </li>
1407 1407
 					<?php
1408 1408
 				endforeach;
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
 			 *
1415 1415
 			 * @since 1.7
1416 1416
 			 */
1417
-			do_action( 'give_payment_mode_after_gateways' );
1417
+			do_action('give_payment_mode_after_gateways');
1418 1418
 			?>
1419 1419
         </div>
1420 1420
 		<?php
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
 		 *
1426 1426
 		 * @param int $form_id The form ID.
1427 1427
 		 */
1428
-		do_action( 'give_payment_mode_after_gateways_wrap' );
1428
+		do_action('give_payment_mode_after_gateways_wrap');
1429 1429
 		?>
1430 1430
     </fieldset>
1431 1431
 
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
 	 *
1438 1438
 	 * @param int $form_id The form ID.
1439 1439
 	 */
1440
-	do_action( 'give_payment_mode_bottom', $form_id );
1440
+	do_action('give_payment_mode_bottom', $form_id);
1441 1441
 	?>
1442 1442
 
1443 1443
     <div id="give_purchase_form_wrap">
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 		 *
1449 1449
 		 * @since 1.7
1450 1450
 		 */
1451
-		do_action( 'give_donation_form', $form_id );
1451
+		do_action('give_donation_form', $form_id);
1452 1452
 		?>
1453 1453
 
1454 1454
     </div>
@@ -1459,10 +1459,10 @@  discard block
 block discarded – undo
1459 1459
 	 *
1460 1460
 	 * @since 1.7
1461 1461
 	 */
1462
-	do_action( 'give_donation_form_wrap_bottom', $form_id );
1462
+	do_action('give_donation_form_wrap_bottom', $form_id);
1463 1463
 }
1464 1464
 
1465
-add_action( 'give_payment_mode_select', 'give_payment_mode_select' );
1465
+add_action('give_payment_mode_select', 'give_payment_mode_select');
1466 1466
 
1467 1467
 /**
1468 1468
  * Renders the Checkout Agree to Terms, this displays a checkbox for users to
@@ -1475,31 +1475,31 @@  discard block
 block discarded – undo
1475 1475
  *
1476 1476
  * @return bool
1477 1477
  */
1478
-function give_terms_agreement( $form_id ) {
1479
-	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
1478
+function give_terms_agreement($form_id) {
1479
+	$form_option = get_post_meta($form_id, '_give_terms_option', true);
1480 1480
 
1481 1481
 	// Bailout if per form and global term and conditions is not setup.
1482 1482
 	if (
1483
-		give_is_setting_enabled( $form_option, 'global' )
1484
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1483
+		give_is_setting_enabled($form_option, 'global')
1484
+		&& give_is_setting_enabled(give_get_option('terms'))
1485 1485
 	) {
1486
-		$label         = give_get_option( 'agree_to_terms_label', esc_html__( 'Agree to Terms?', 'give' ) );
1487
-		$terms         = $terms = give_get_option( 'agreement_text', '' );
1488
-		$edit_term_url = admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions' );
1486
+		$label         = give_get_option('agree_to_terms_label', esc_html__('Agree to Terms?', 'give'));
1487
+		$terms         = $terms = give_get_option('agreement_text', '');
1488
+		$edit_term_url = admin_url('edit.php?post_type=give_forms&page=give-settings&tab=display&section=term-and-conditions');
1489 1489
 
1490
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1491
-		$label         = ( $label = get_post_meta( $form_id, '_give_agree_label', true ) ) ? stripslashes( $label ) : esc_html__( 'Agree to Terms?', 'give' );
1492
-		$terms         = get_post_meta( $form_id, '_give_agree_text', true );
1493
-		$edit_term_url = admin_url( 'post.php?post=' . $form_id . '&action=edit#form_terms_options' );
1490
+	} elseif (give_is_setting_enabled($form_option)) {
1491
+		$label         = ($label = get_post_meta($form_id, '_give_agree_label', true)) ? stripslashes($label) : esc_html__('Agree to Terms?', 'give');
1492
+		$terms         = get_post_meta($form_id, '_give_agree_text', true);
1493
+		$edit_term_url = admin_url('post.php?post='.$form_id.'&action=edit#form_terms_options');
1494 1494
 
1495 1495
 	} else {
1496 1496
 		return false;
1497 1497
 	}
1498 1498
 
1499 1499
 	// Bailout: Check if term and conditions text is empty or not.
1500
-	if ( empty( $terms ) ) {
1501
-		if ( is_user_logged_in() && current_user_can( 'edit_give_forms' ) ) {
1502
-			echo sprintf( __( 'Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give' ), $edit_term_url );
1500
+	if (empty($terms)) {
1501
+		if (is_user_logged_in() && current_user_can('edit_give_forms')) {
1502
+			echo sprintf(__('Please enter valid terms and conditions in <a href="%s">this form\'s settings</a>.', 'give'), $edit_term_url);
1503 1503
 		}
1504 1504
 
1505 1505
 		return false;
@@ -1507,7 +1507,7 @@  discard block
 block discarded – undo
1507 1507
 
1508 1508
 	?>
1509 1509
     <fieldset id="give_terms_agreement">
1510
-        <legend><?php echo apply_filters( 'give_terms_agreement_text', esc_html__( 'Terms', 'give' ) ); ?></legend>
1510
+        <legend><?php echo apply_filters('give_terms_agreement_text', esc_html__('Terms', 'give')); ?></legend>
1511 1511
         <div id="give_terms" class="give_terms-<?php echo $form_id; ?>" style="display:none;">
1512 1512
 			<?php
1513 1513
 			/**
@@ -1515,22 +1515,22 @@  discard block
 block discarded – undo
1515 1515
 			 *
1516 1516
 			 * @since 1.0
1517 1517
 			 */
1518
-			do_action( 'give_before_terms' );
1518
+			do_action('give_before_terms');
1519 1519
 
1520
-			echo wpautop( stripslashes( $terms ) );
1520
+			echo wpautop(stripslashes($terms));
1521 1521
 			/**
1522 1522
 			 * Fires while rendering terms of agreement, after the fields.
1523 1523
 			 *
1524 1524
 			 * @since 1.0
1525 1525
 			 */
1526
-			do_action( 'give_after_terms' );
1526
+			do_action('give_after_terms');
1527 1527
 			?>
1528 1528
         </div>
1529 1529
         <div id="give_show_terms">
1530 1530
             <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1531
-               aria-controls="give_terms"><?php esc_html_e( 'Show Terms', 'give' ); ?></a>
1531
+               aria-controls="give_terms"><?php esc_html_e('Show Terms', 'give'); ?></a>
1532 1532
             <a href="#" class="give_terms_links give_terms_links-<?php echo $form_id; ?>" role="button"
1533
-               aria-controls="give_terms" style="display:none;"><?php esc_html_e( 'Hide Terms', 'give' ); ?></a>
1533
+               aria-controls="give_terms" style="display:none;"><?php esc_html_e('Hide Terms', 'give'); ?></a>
1534 1534
         </div>
1535 1535
 
1536 1536
         <input name="give_agree_to_terms" class="required" type="checkbox"
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
 	<?php
1542 1542
 }
1543 1543
 
1544
-add_action( 'give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1 );
1544
+add_action('give_donation_form_after_cc_form', 'give_terms_agreement', 8888, 1);
1545 1545
 
1546 1546
 /**
1547 1547
  * Checkout Final Total.
@@ -1554,29 +1554,29 @@  discard block
 block discarded – undo
1554 1554
  *
1555 1555
  * @return void
1556 1556
  */
1557
-function give_checkout_final_total( $form_id ) {
1557
+function give_checkout_final_total($form_id) {
1558 1558
 
1559
-	if ( isset( $_POST['give_total'] ) ) {
1560
-		$total = apply_filters( 'give_donation_total', $_POST['give_total'] );
1559
+	if (isset($_POST['give_total'])) {
1560
+		$total = apply_filters('give_donation_total', $_POST['give_total']);
1561 1561
 	} else {
1562 1562
 		//default total.
1563
-		$total = give_get_default_form_amount( $form_id );
1563
+		$total = give_get_default_form_amount($form_id);
1564 1564
 	}
1565 1565
 	//Only proceed if give_total available.
1566
-	if ( empty( $total ) ) {
1566
+	if (empty($total)) {
1567 1567
 		return;
1568 1568
 	}
1569 1569
 	?>
1570 1570
     <p id="give-final-total-wrap" class="form-wrap ">
1571 1571
 		<span
1572
-                class="give-donation-total-label"><?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?></span>
1572
+                class="give-donation-total-label"><?php echo apply_filters('give_donation_total_label', esc_html__('Donation Total:', 'give')); ?></span>
1573 1573
         <span class="give-final-total-amount"
1574
-              data-total="<?php echo give_format_amount( $total ); ?>"><?php echo give_currency_filter( give_format_amount( $total ) ); ?></span>
1574
+              data-total="<?php echo give_format_amount($total); ?>"><?php echo give_currency_filter(give_format_amount($total)); ?></span>
1575 1575
     </p>
1576 1576
 	<?php
1577 1577
 }
1578 1578
 
1579
-add_action( 'give_donation_form_before_submit', 'give_checkout_final_total', 999 );
1579
+add_action('give_donation_form_before_submit', 'give_checkout_final_total', 999);
1580 1580
 
1581 1581
 /**
1582 1582
  * Renders the Checkout Submit section.
@@ -1587,7 +1587,7 @@  discard block
 block discarded – undo
1587 1587
  *
1588 1588
  * @return void
1589 1589
  */
1590
-function give_checkout_submit( $form_id ) {
1590
+function give_checkout_submit($form_id) {
1591 1591
 	?>
1592 1592
     <fieldset id="give_purchase_submit">
1593 1593
 		<?php
@@ -1596,24 +1596,24 @@  discard block
 block discarded – undo
1596 1596
 		 *
1597 1597
 		 * @since 1.7
1598 1598
 		 */
1599
-		do_action( 'give_donation_form_before_submit', $form_id );
1599
+		do_action('give_donation_form_before_submit', $form_id);
1600 1600
 
1601
-		give_checkout_hidden_fields( $form_id );
1601
+		give_checkout_hidden_fields($form_id);
1602 1602
 
1603
-		echo give_checkout_button_purchase( $form_id );
1603
+		echo give_checkout_button_purchase($form_id);
1604 1604
 
1605 1605
 		/**
1606 1606
 		 * Fire after donation form submit.
1607 1607
 		 *
1608 1608
 		 * @since 1.7
1609 1609
 		 */
1610
-		do_action( 'give_donation_form_after_submit', $form_id );
1610
+		do_action('give_donation_form_after_submit', $form_id);
1611 1611
 		?>
1612 1612
     </fieldset>
1613 1613
 	<?php
1614 1614
 }
1615 1615
 
1616
-add_action( 'give_donation_form_after_cc_form', 'give_checkout_submit', 9999 );
1616
+add_action('give_donation_form_after_cc_form', 'give_checkout_submit', 9999);
1617 1617
 
1618 1618
 /**
1619 1619
  * Give Checkout Button.
@@ -1626,10 +1626,10 @@  discard block
 block discarded – undo
1626 1626
  *
1627 1627
  * @return string
1628 1628
  */
1629
-function give_checkout_button_purchase( $form_id ) {
1629
+function give_checkout_button_purchase($form_id) {
1630 1630
 
1631
-	$display_label_field = get_post_meta( $form_id, '_give_checkout_label', true );
1632
-	$display_label       = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );
1631
+	$display_label_field = get_post_meta($form_id, '_give_checkout_label', true);
1632
+	$display_label       = ( ! empty($display_label_field) ? $display_label_field : esc_html__('Donate Now', 'give'));
1633 1633
 	ob_start(); ?>
1634 1634
     <div class="give-submit-button-wrap give-clearfix">
1635 1635
         <input type="submit" class="give-submit give-btn" id="give-purchase-button" name="give-purchase"
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
         <span class="give-loading-animation"></span>
1638 1638
     </div>
1639 1639
 	<?php
1640
-	return apply_filters( 'give_checkout_button_purchase', ob_get_clean(), $form_id );
1640
+	return apply_filters('give_checkout_button_purchase', ob_get_clean(), $form_id);
1641 1641
 }
1642 1642
 
1643 1643
 /**
@@ -1651,18 +1651,18 @@  discard block
 block discarded – undo
1651 1651
  *
1652 1652
  * @return void
1653 1653
  */
1654
-function give_agree_to_terms_js( $form_id ) {
1654
+function give_agree_to_terms_js($form_id) {
1655 1655
 
1656
-	$form_option = get_post_meta( $form_id, '_give_terms_option', true );
1656
+	$form_option = get_post_meta($form_id, '_give_terms_option', true);
1657 1657
 
1658
-	if ( give_is_setting_enabled( $form_option, array( 'enabled', 'global' ) ) ) {
1658
+	if (give_is_setting_enabled($form_option, array('enabled', 'global'))) {
1659 1659
 		?>
1660 1660
         <script type="text/javascript">
1661 1661
 			jQuery(document).ready(function ($) {
1662
-				$('body').on('click', '.give_terms_links-<?php echo $form_id;?>', function (e) {
1662
+				$('body').on('click', '.give_terms_links-<?php echo $form_id; ?>', function (e) {
1663 1663
 					e.preventDefault();
1664
-					$('.give_terms-<?php echo $form_id;?>').slideToggle();
1665
-					$('.give_terms_links-<?php echo $form_id;?>').toggle();
1664
+					$('.give_terms-<?php echo $form_id; ?>').slideToggle();
1665
+					$('.give_terms_links-<?php echo $form_id; ?>').toggle();
1666 1666
 					return false;
1667 1667
 				});
1668 1668
 			});
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 	}
1672 1672
 }
1673 1673
 
1674
-add_action( 'give_checkout_form_top', 'give_agree_to_terms_js', 10, 2 );
1674
+add_action('give_checkout_form_top', 'give_agree_to_terms_js', 10, 2);
1675 1675
 
1676 1676
 /**
1677 1677
  * Show Give Goals.
@@ -1685,17 +1685,17 @@  discard block
 block discarded – undo
1685 1685
  *
1686 1686
  * @return mixed
1687 1687
  */
1688
-function give_show_goal_progress( $form_id, $args ) {
1688
+function give_show_goal_progress($form_id, $args) {
1689 1689
 
1690 1690
 	ob_start();
1691
-	give_get_template( 'shortcode-goal', array( 'form_id' => $form_id, 'args' => $args ) );
1691
+	give_get_template('shortcode-goal', array('form_id' => $form_id, 'args' => $args));
1692 1692
 
1693
-	echo apply_filters( 'give_goal_output', ob_get_clean() );
1693
+	echo apply_filters('give_goal_output', ob_get_clean());
1694 1694
 
1695 1695
 	return true;
1696 1696
 }
1697 1697
 
1698
-add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 );
1698
+add_action('give_pre_form', 'give_show_goal_progress', 10, 2);
1699 1699
 
1700 1700
 
1701 1701
 /**
@@ -1708,10 +1708,10 @@  discard block
 block discarded – undo
1708 1708
  *
1709 1709
  * @return mixed|string
1710 1710
  */
1711
-function give_get_form_content_placement( $form_id, $args ) {
1711
+function give_get_form_content_placement($form_id, $args) {
1712 1712
 	$show_content = '';
1713 1713
 
1714
-	if ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) {
1714
+	if (isset($args['show_content']) && ! empty($args['show_content'])) {
1715 1715
 		// Content positions.
1716 1716
 		$content_placement = array(
1717 1717
 			'above' => 'give_pre_form',
@@ -1719,18 +1719,18 @@  discard block
 block discarded – undo
1719 1719
 		);
1720 1720
 
1721 1721
 		// Check if content position already decoded.
1722
-		if ( in_array( $args['show_content'], $content_placement ) ) {
1722
+		if (in_array($args['show_content'], $content_placement)) {
1723 1723
 			return $args['show_content'];
1724 1724
 		}
1725 1725
 
1726
-		$show_content = ( 'none' !== $args['show_content'] ? $content_placement[ $args['show_content'] ] : '' );
1726
+		$show_content = ('none' !== $args['show_content'] ? $content_placement[$args['show_content']] : '');
1727 1727
 
1728
-	} elseif ( give_is_setting_enabled( get_post_meta( $form_id, '_give_display_content', true ) ) ) {
1729
-		$show_content = get_post_meta( $form_id, '_give_content_placement', true );
1728
+	} elseif (give_is_setting_enabled(get_post_meta($form_id, '_give_display_content', true))) {
1729
+		$show_content = get_post_meta($form_id, '_give_content_placement', true);
1730 1730
 
1731
-	} elseif ( 'none' !== get_post_meta( $form_id, '_give_content_option', true ) ) {
1731
+	} elseif ('none' !== get_post_meta($form_id, '_give_content_option', true)) {
1732 1732
 		// Backward compatibility for _give_content_option for v18.
1733
-		$show_content = get_post_meta( $form_id, '_give_content_option', true );
1733
+		$show_content = get_post_meta($form_id, '_give_content_option', true);
1734 1734
 	}
1735 1735
 
1736 1736
 	return $show_content;
@@ -1746,20 +1746,20 @@  discard block
 block discarded – undo
1746 1746
  *
1747 1747
  * @return void|bool
1748 1748
  */
1749
-function give_form_content( $form_id, $args ) {
1749
+function give_form_content($form_id, $args) {
1750 1750
 
1751
-	$show_content = give_get_form_content_placement( $form_id, $args );
1751
+	$show_content = give_get_form_content_placement($form_id, $args);
1752 1752
 
1753 1753
 	// Bailout.
1754
-	if ( empty( $show_content ) ) {
1754
+	if (empty($show_content)) {
1755 1755
 		return false;
1756 1756
 	}
1757 1757
 
1758 1758
 	// Add action according to value.
1759
-	add_action( $show_content, 'give_form_display_content', 10, 2 );
1759
+	add_action($show_content, 'give_form_display_content', 10, 2);
1760 1760
 }
1761 1761
 
1762
-add_action( 'give_pre_form_output', 'give_form_content', 10, 2 );
1762
+add_action('give_pre_form_output', 'give_form_content', 10, 2);
1763 1763
 
1764 1764
 /**
1765 1765
  * Renders Post Form Content.
@@ -1773,22 +1773,22 @@  discard block
 block discarded – undo
1773 1773
  *
1774 1774
  * @return void
1775 1775
  */
1776
-function give_form_display_content( $form_id, $args ) {
1776
+function give_form_display_content($form_id, $args) {
1777 1777
 
1778
-	$content      = wpautop( get_post_meta( $form_id, '_give_form_content', true ) );
1779
-	$show_content = give_get_form_content_placement( $form_id, $args );
1778
+	$content      = wpautop(get_post_meta($form_id, '_give_form_content', true));
1779
+	$show_content = give_get_form_content_placement($form_id, $args);
1780 1780
 
1781
-	if ( give_is_setting_enabled( give_get_option( 'the_content_filter' ) ) ) {
1782
-		$content = apply_filters( 'the_content', $content );
1781
+	if (give_is_setting_enabled(give_get_option('the_content_filter'))) {
1782
+		$content = apply_filters('the_content', $content);
1783 1783
 	}
1784 1784
 
1785
-	$output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap ' . $show_content . '-content">' . $content . '</div>';
1785
+	$output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap '.$show_content.'-content">'.$content.'</div>';
1786 1786
 
1787
-	echo apply_filters( 'give_form_content_output', $output );
1787
+	echo apply_filters('give_form_content_output', $output);
1788 1788
 
1789 1789
 	//remove action to prevent content output on addition forms on page.
1790 1790
 	//@see: https://github.com/WordImpress/Give/issues/634.
1791
-	remove_action( $show_content, 'give_form_display_content' );
1791
+	remove_action($show_content, 'give_form_display_content');
1792 1792
 }
1793 1793
 
1794 1794
 /**
@@ -1800,7 +1800,7 @@  discard block
 block discarded – undo
1800 1800
  *
1801 1801
  * @return void
1802 1802
  */
1803
-function give_checkout_hidden_fields( $form_id ) {
1803
+function give_checkout_hidden_fields($form_id) {
1804 1804
 
1805 1805
 	/**
1806 1806
 	 * Fires while rendering hidden checkout fields, before the fields.
@@ -1809,13 +1809,13 @@  discard block
 block discarded – undo
1809 1809
 	 *
1810 1810
 	 * @param int $form_id The form ID.
1811 1811
 	 */
1812
-	do_action( 'give_hidden_fields_before', $form_id );
1812
+	do_action('give_hidden_fields_before', $form_id);
1813 1813
 
1814
-	if ( is_user_logged_in() ) { ?>
1814
+	if (is_user_logged_in()) { ?>
1815 1815
         <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/>
1816 1816
 	<?php } ?>
1817 1817
     <input type="hidden" name="give_action" value="purchase"/>
1818
-    <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/>
1818
+    <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/>
1819 1819
 	<?php
1820 1820
 	/**
1821 1821
 	 * Fires while rendering hidden checkout fields, after the fields.
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
 	 *
1825 1825
 	 * @param int $form_id The form ID.
1826 1826
 	 */
1827
-	do_action( 'give_hidden_fields_after', $form_id );
1827
+	do_action('give_hidden_fields_after', $form_id);
1828 1828
 
1829 1829
 }
1830 1830
 
@@ -1839,20 +1839,20 @@  discard block
 block discarded – undo
1839 1839
  *
1840 1840
  * @return string $content Filtered content.
1841 1841
  */
1842
-function give_filter_success_page_content( $content ) {
1842
+function give_filter_success_page_content($content) {
1843 1843
 
1844 1844
 	$give_options = give_get_settings();
1845 1845
 
1846
-	if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) {
1847
-		if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) {
1848
-			$content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content );
1846
+	if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) {
1847
+		if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) {
1848
+			$content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content);
1849 1849
 		}
1850 1850
 	}
1851 1851
 
1852 1852
 	return $content;
1853 1853
 }
1854 1854
 
1855
-add_filter( 'the_content', 'give_filter_success_page_content' );
1855
+add_filter('the_content', 'give_filter_success_page_content');
1856 1856
 
1857 1857
 /**
1858 1858
  * Test Mode Frontend Warning.
@@ -1863,12 +1863,12 @@  discard block
 block discarded – undo
1863 1863
  */
1864 1864
 function give_test_mode_frontend_warning() {
1865 1865
 
1866
-	if ( give_is_test_mode() ) {
1867
-		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>';
1866
+	if (give_is_test_mode()) {
1867
+		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>';
1868 1868
 	}
1869 1869
 }
1870 1870
 
1871
-add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 );
1871
+add_action('give_pre_form', 'give_test_mode_frontend_warning', 10);
1872 1872
 
1873 1873
 /**
1874 1874
  * Members-only Form.
@@ -1882,21 +1882,21 @@  discard block
 block discarded – undo
1882 1882
  *
1883 1883
  * @return string
1884 1884
  */
1885
-function give_members_only_form( $final_output, $args ) {
1885
+function give_members_only_form($final_output, $args) {
1886 1886
 
1887
-	$form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0;
1887
+	$form_id = isset($args['form_id']) ? $args['form_id'] : 0;
1888 1888
 
1889 1889
 	//Sanity Check: Must have form_id & not be logged in.
1890
-	if ( empty( $form_id ) || is_user_logged_in() ) {
1890
+	if (empty($form_id) || is_user_logged_in()) {
1891 1891
 		return $final_output;
1892 1892
 	}
1893 1893
 
1894 1894
 	//Logged in only and Register / Login set to none.
1895
-	if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) {
1895
+	if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') {
1896 1896
 
1897
-		$final_output = give_output_error( esc_html__( 'Please log in in order to complete your donation.', 'give' ), false );
1897
+		$final_output = give_output_error(esc_html__('Please log in in order to complete your donation.', 'give'), false);
1898 1898
 
1899
-		return apply_filters( 'give_members_only_output', $final_output, $form_id );
1899
+		return apply_filters('give_members_only_output', $final_output, $form_id);
1900 1900
 
1901 1901
 	}
1902 1902
 
@@ -1904,4 +1904,4 @@  discard block
 block discarded – undo
1904 1904
 
1905 1905
 }
1906 1906
 
1907
-add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 );
1907
+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
@@ -1042,9 +1042,12 @@
 block discarded – undo
1042 1042
 					}
1043 1043
 					?>
1044 1044
                 </select>
1045
-			<?php else : ?>
1045
+			<?php else {
1046
+	: ?>
1046 1047
                 <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input"
1047
-                       placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>"/>
1048
+                       placeholder="<?php esc_attr_e( 'State / Province', 'give' );
1049
+}
1050
+?>"/>
1048 1051
 			<?php endif; ?>
1049 1052
         </p>
1050 1053
 		<?php
Please login to merge, or discard this patch.
includes/admin/class-admin-settings.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -725,9 +725,9 @@
 block discarded – undo
725 725
                         <td class="give-docs-link" colspan="2">
726 726
 							<?php
727 727
 							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
728
-							     . '" target="_blank">'
729
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"' ), $value['title'] )
730
-							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
728
+								 . '" target="_blank">'
729
+								 . sprintf( esc_html__( 'Need Help? See docs on "%s"' ), $value['title'] )
730
+								 . '<span class="dashicons dashicons-editor-help"></span></a></p>';
731 731
 							?>
732 732
                         </td>
733 733
                         </tr><?php
Please login to merge, or discard this patch.
Spacing   +203 added lines, -203 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;
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Admin_Settings' ) ) :
16
+if ( ! class_exists('Give_Admin_Settings')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Admin_Settings Class.
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			 *
73 73
 			 * @param array $settings Array of settings class object.
74 74
 			 */
75
-			self::$settings = apply_filters( self::$setting_filter_prefix . '_get_settings_pages', array() );
75
+			self::$settings = apply_filters(self::$setting_filter_prefix.'_get_settings_pages', array());
76 76
 
77 77
 			return self::$settings;
78 78
 		}
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 		public static function save() {
87 87
 			$current_tab = give_get_current_setting_tab();
88 88
 
89
-			if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) {
90
-				die( __( 'Action failed. Please refresh the page and retry.', 'give' ) );
89
+			if (empty($_REQUEST['_give-save-settings']) || ! wp_verify_nonce($_REQUEST['_give-save-settings'], 'give-save-settings')) {
90
+				die(__('Action failed. Please refresh the page and retry.', 'give'));
91 91
 			}
92 92
 
93 93
 			/**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 			 *
100 100
 			 * @since 1.8
101 101
 			 */
102
-			do_action( self::$setting_filter_prefix . '_save_' . $current_tab );
102
+			do_action(self::$setting_filter_prefix.'_save_'.$current_tab);
103 103
 
104
-			self::add_message( 'give-setting-updated', __( 'Your settings have been saved.', 'give' ) );
104
+			self::add_message('give-setting-updated', __('Your settings have been saved.', 'give'));
105 105
 
106 106
 			/**
107 107
 			 * Trigger Action.
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			 *
113 113
 			 * @since 1.8
114 114
 			 */
115
-			do_action( self::$setting_filter_prefix . '_saved' );
115
+			do_action(self::$setting_filter_prefix.'_saved');
116 116
 		}
117 117
 
118 118
 		/**
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 		 *
126 126
 		 * @return void
127 127
 		 */
128
-		public static function add_message( $code, $message ) {
129
-			self::$messages[ $code ] = $message;
128
+		public static function add_message($code, $message) {
129
+			self::$messages[$code] = $message;
130 130
 		}
131 131
 
132 132
 		/**
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 		 *
140 140
 		 * @return void
141 141
 		 */
142
-		public static function add_error( $code, $message ) {
143
-			self::$errors[ $code ] = $message;
142
+		public static function add_error($code, $message) {
143
+			self::$errors[$code] = $message;
144 144
 		}
145 145
 
146 146
 		/**
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
 			$notice_html = '';
154 154
 			$classes     = 'give-notice settings-error notice is-dismissible';
155 155
 
156
-			self::$errors   = apply_filters( self::$setting_filter_prefix . '_error_notices', self::$errors );
157
-			self::$messages = apply_filters( self::$setting_filter_prefix . '_update_notices', self::$messages );
156
+			self::$errors   = apply_filters(self::$setting_filter_prefix.'_error_notices', self::$errors);
157
+			self::$messages = apply_filters(self::$setting_filter_prefix.'_update_notices', self::$messages);
158 158
 
159
-			if ( 0 < count( self::$errors ) ) {
160
-				foreach ( self::$errors as $code => $message ) {
161
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' error"><p><strong>' . $message . '</strong></p></div>';
159
+			if (0 < count(self::$errors)) {
160
+				foreach (self::$errors as $code => $message) {
161
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' error"><p><strong>'.$message.'</strong></p></div>';
162 162
 				}
163 163
 			}
164 164
 
165
-			if ( 0 < count( self::$messages ) ) {
166
-				foreach ( self::$messages as $code => $message ) {
167
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' updated"><p><strong>' . $message . '</strong></p></div>';
165
+			if (0 < count(self::$messages)) {
166
+				foreach (self::$messages as $code => $message) {
167
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' updated"><p><strong>'.$message.'</strong></p></div>';
168 168
 				}
169 169
 			}
170 170
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			self::$setting_filter_prefix = give_get_current_setting_page();
185 185
 
186 186
 			// Bailout: Exit if setting page is not defined.
187
-			if ( empty( self::$setting_filter_prefix ) ) {
187
+			if (empty(self::$setting_filter_prefix)) {
188 188
 				return false;
189 189
 			}
190 190
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 			 *
198 198
 			 * @since 1.8
199 199
 			 */
200
-			do_action( self::$setting_filter_prefix . '_start' );
200
+			do_action(self::$setting_filter_prefix.'_start');
201 201
 
202 202
 			$current_tab = give_get_current_setting_tab();
203 203
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			self::get_settings_pages();
206 206
 
207 207
 			// Save settings if data has been posted.
208
-			if ( ! empty( $_POST ) ) {
208
+			if ( ! empty($_POST)) {
209 209
 				self::save();
210 210
 			}
211 211
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			 *
219 219
 			 * @since 1.8
220 220
 			 */
221
-			$tabs = apply_filters( self::$setting_filter_prefix . '_tabs_array', array() );
221
+			$tabs = apply_filters(self::$setting_filter_prefix.'_tabs_array', array());
222 222
 
223 223
 			include 'views/html-admin-settings.php';
224 224
 
@@ -236,25 +236,25 @@  discard block
 block discarded – undo
236 236
 		 *
237 237
 		 * @return string|bool
238 238
 		 */
239
-		public static function get_option( $option_name = '', $field_id = '', $default = false ) {
239
+		public static function get_option($option_name = '', $field_id = '', $default = false) {
240 240
 			// Bailout.
241
-			if ( empty( $option_name ) && empty( $field_id ) ) {
241
+			if (empty($option_name) && empty($field_id)) {
242 242
 				return false;
243 243
 			}
244 244
 
245
-			if ( ! empty( $field_id ) && ! empty( $option_name ) ) {
245
+			if ( ! empty($field_id) && ! empty($option_name)) {
246 246
 				// Get field value if any.
247
-				$option_value = get_option( $option_name );
247
+				$option_value = get_option($option_name);
248 248
 
249
-				$option_value = ( is_array( $option_value ) && array_key_exists( $field_id, $option_value ) )
250
-					? $option_value[ $field_id ]
249
+				$option_value = (is_array($option_value) && array_key_exists($field_id, $option_value))
250
+					? $option_value[$field_id]
251 251
 					: $default;
252 252
 			} else {
253 253
 				// If option name is empty but not field name then this means, setting is direct store to option table under there field name.
254 254
 				$option_name = ! $option_name ? $field_id : $option_name;
255 255
 
256 256
 				// Get option value if any.
257
-				$option_value = get_option( $option_name, $default );
257
+				$option_value = get_option($option_name, $default);
258 258
 			}
259 259
 
260 260
 			return $option_value;
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		 *
273 273
 		 * @return void
274 274
 		 */
275
-		public static function output_fields( $options, $option_name = '' ) {
275
+		public static function output_fields($options, $option_name = '') {
276 276
 			$current_tab = give_get_current_setting_tab();
277 277
 
278 278
 			// Field Default values.
@@ -285,46 +285,46 @@  discard block
 block discarded – undo
285 285
 				'table_html' => true,
286 286
 			);
287 287
 
288
-			foreach ( $options as $value ) {
289
-				if ( ! isset( $value['type'] ) ) {
288
+			foreach ($options as $value) {
289
+				if ( ! isset($value['type'])) {
290 290
 					continue;
291 291
 				}
292 292
 
293 293
 				// Set title.
294
-				$defaults['title'] = isset( $value['name'] ) ? $value['name'] : '';
294
+				$defaults['title'] = isset($value['name']) ? $value['name'] : '';
295 295
 
296
-				$value = wp_parse_args( $value, $defaults );
296
+				$value = wp_parse_args($value, $defaults);
297 297
 
298 298
 				// Custom attribute handling.
299 299
 				$custom_attributes = array();
300 300
 
301
-				if ( ! empty( $value['attributes'] ) && is_array( $value['attributes'] ) ) {
302
-					foreach ( $value['attributes'] as $attribute => $attribute_value ) {
303
-						$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
301
+				if ( ! empty($value['attributes']) && is_array($value['attributes'])) {
302
+					foreach ($value['attributes'] as $attribute => $attribute_value) {
303
+						$custom_attributes[] = esc_attr($attribute).'="'.esc_attr($attribute_value).'"';
304 304
 					}
305 305
 				}
306 306
 
307 307
 				// Description handling.
308
-				$description          = self::get_field_description( $value );
308
+				$description = self::get_field_description($value);
309 309
 
310 310
 				// Switch based on type.
311
-				switch ( $value['type'] ) {
311
+				switch ($value['type']) {
312 312
 
313 313
 					// Section Titles
314 314
 					case 'title':
315
-						if ( ! empty( $value['title'] ) ) {
316
-							echo '<div class="give-setting-tab-header give-setting-tab-header-' . $current_tab . '"><h2>' . self::get_field_title( $value ) . '</h2><hr></div>';
315
+						if ( ! empty($value['title'])) {
316
+							echo '<div class="give-setting-tab-header give-setting-tab-header-'.$current_tab.'"><h2>'.self::get_field_title($value).'</h2><hr></div>';
317 317
 						}
318 318
 
319
-						if ( ! empty( $value['desc'] ) ) {
320
-							echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
319
+						if ( ! empty($value['desc'])) {
320
+							echo wpautop(wptexturize(wp_kses_post($value['desc'])));
321 321
 						}
322 322
 
323
-						if ( $value['table_html'] ) {
324
-							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-' . $current_tab . '">' . "\n\n";
323
+						if ($value['table_html']) {
324
+							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-'.$current_tab.'">'."\n\n";
325 325
 						}
326 326
 
327
-						if ( ! empty( $value['id'] ) ) {
327
+						if ( ! empty($value['id'])) {
328 328
 
329 329
 							/**
330 330
 							 * Trigger Action.
@@ -333,14 +333,14 @@  discard block
 block discarded – undo
333 333
 							 *
334 334
 							 * @since 1.8
335 335
 							 */
336
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) );
336
+							do_action('give_settings_'.sanitize_title($value['id']));
337 337
 						}
338 338
 
339 339
 						break;
340 340
 
341 341
 					// Section Ends.
342 342
 					case 'sectionend':
343
-						if ( ! empty( $value['id'] ) ) {
343
+						if ( ! empty($value['id'])) {
344 344
 
345 345
 							/**
346 346
 							 * Trigger Action.
@@ -349,14 +349,14 @@  discard block
 block discarded – undo
349 349
 							 *
350 350
 							 * @since 1.8
351 351
 							 */
352
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_end' );
352
+							do_action('give_settings_'.sanitize_title($value['id']).'_end');
353 353
 						}
354 354
 
355
-						if ( $value['table_html'] ) {
355
+						if ($value['table_html']) {
356 356
 							echo '</table>';
357 357
 						}
358 358
 
359
-						if ( ! empty( $value['id'] ) ) {
359
+						if ( ! empty($value['id'])) {
360 360
 
361 361
 							/**
362 362
 							 * Trigger Action.
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 							 *
366 366
 							 * @since 1.8
367 367
 							 */
368
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_after' );
368
+							do_action('give_settings_'.sanitize_title($value['id']).'_after');
369 369
 						}
370 370
 
371 371
 						break;
@@ -377,22 +377,22 @@  discard block
 block discarded – undo
377 377
 					case 'password' :
378 378
 
379 379
 						$type = $value['type'];
380
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
380
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
381 381
 
382 382
 						?>
383
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
383
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
384 384
                         <th scope="row" class="titledesc">
385
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
385
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
386 386
                         </th>
387
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
387
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
388 388
                             <input
389
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
390
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
391
-                                    type="<?php echo esc_attr( $type ); ?>"
392
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
393
-                                    value="<?php echo esc_attr( $option_value ); ?>"
394
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
395
-								<?php echo implode( ' ', $custom_attributes ); ?>
389
+                                    name="<?php echo esc_attr($value['id']); ?>"
390
+                                    id="<?php echo esc_attr($value['id']); ?>"
391
+                                    type="<?php echo esc_attr($type); ?>"
392
+                                    style="<?php echo esc_attr($value['css']); ?>"
393
+                                    value="<?php echo esc_attr($option_value); ?>"
394
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
395
+								<?php echo implode(' ', $custom_attributes); ?>
396 396
                             /> <?php echo $description; ?>
397 397
                         </td>
398 398
                         </tr><?php
@@ -401,23 +401,23 @@  discard block
 block discarded – undo
401 401
 					// Textarea.
402 402
 					case 'textarea':
403 403
 
404
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
404
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
405 405
 
406 406
 						?>
407
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
407
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
408 408
                         <th scope="row" class="titledesc">
409
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
409
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
410 410
                         </th>
411
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
411
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
412 412
 								<textarea
413
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
414
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
415
-                                        style="<?php echo esc_attr( $value['css'] ); ?>"
416
-                                        class="<?php echo esc_attr( $value['class'] ); ?>"
413
+                                        name="<?php echo esc_attr($value['id']); ?>"
414
+                                        id="<?php echo esc_attr($value['id']); ?>"
415
+                                        style="<?php echo esc_attr($value['css']); ?>"
416
+                                        class="<?php echo esc_attr($value['class']); ?>"
417 417
                                         rows="10"
418 418
                                         cols="60"
419
-									<?php echo implode( ' ', $custom_attributes ); ?>
420
-                                ><?php echo esc_textarea( $option_value ); ?></textarea>
419
+									<?php echo implode(' ', $custom_attributes); ?>
420
+                                ><?php echo esc_textarea($option_value); ?></textarea>
421 421
 							<?php echo $description; ?>
422 422
                         </td>
423 423
                         </tr><?php
@@ -427,35 +427,35 @@  discard block
 block discarded – undo
427 427
 					case 'select' :
428 428
 					case 'multiselect' :
429 429
 
430
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
430
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
431 431
 
432 432
 						?>
433
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
433
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
434 434
                         <th scope="row" class="titledesc">
435
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
435
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
436 436
                         </th>
437
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
437
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
438 438
                             <select
439
-                                    name="<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) {
439
+                                    name="<?php echo esc_attr($value['id']); ?><?php if ($value['type'] == 'multiselect') {
440 440
 										echo '[]';
441 441
 									} ?>"
442
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
443
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
444
-                                    class="<?php echo esc_attr( $value['class'] ); ?>"
445
-								<?php echo implode( ' ', $custom_attributes ); ?>
446
-								<?php echo ( 'multiselect' == $value['type'] ) ? 'multiple="multiple"' : ''; ?>
442
+                                    id="<?php echo esc_attr($value['id']); ?>"
443
+                                    style="<?php echo esc_attr($value['css']); ?>"
444
+                                    class="<?php echo esc_attr($value['class']); ?>"
445
+								<?php echo implode(' ', $custom_attributes); ?>
446
+								<?php echo ('multiselect' == $value['type']) ? 'multiple="multiple"' : ''; ?>
447 447
                             >
448 448
 
449 449
 								<?php
450
-								if ( ! empty( $value['options'] ) ) {
451
-									foreach ( $value['options'] as $key => $val ) {
450
+								if ( ! empty($value['options'])) {
451
+									foreach ($value['options'] as $key => $val) {
452 452
 										?>
453
-                                        <option value="<?php echo esc_attr( $key ); ?>" <?php
453
+                                        <option value="<?php echo esc_attr($key); ?>" <?php
454 454
 
455
-										if ( is_array( $option_value ) ) {
456
-											selected( in_array( $key, $option_value ), true );
455
+										if (is_array($option_value)) {
456
+											selected(in_array($key, $option_value), true);
457 457
 										} else {
458
-											selected( $option_value, $key );
458
+											selected($option_value, $key);
459 459
 										}
460 460
 
461 461
 										?>><?php echo $val ?></option>
@@ -471,28 +471,28 @@  discard block
 block discarded – undo
471 471
 
472 472
 					// Radio inputs.
473 473
 					case 'radio_inline' :
474
-						$value['class'] = empty( $value['class'] ) ? 'give-radio-inline' : $value['class'] . ' give-radio-inline';
474
+						$value['class'] = empty($value['class']) ? 'give-radio-inline' : $value['class'].' give-radio-inline';
475 475
 					case 'radio' :
476
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
476
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
477 477
 						?>
478
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
478
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
479 479
                         <th scope="row" class="titledesc">
480
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
480
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
481 481
                         </th>
482
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
482
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
483 483
                             <fieldset>
484 484
                                 <ul>
485 485
 									<?php
486
-									foreach ( $value['options'] as $key => $val ) {
486
+									foreach ($value['options'] as $key => $val) {
487 487
 										?>
488 488
                                         <li>
489 489
                                             <label><input
490
-                                                        name="<?php echo esc_attr( $value['id'] ); ?>"
490
+                                                        name="<?php echo esc_attr($value['id']); ?>"
491 491
                                                         value="<?php echo $key; ?>"
492 492
                                                         type="radio"
493
-                                                        style="<?php echo esc_attr( $value['css'] ); ?>"
494
-													<?php echo implode( ' ', $custom_attributes ); ?>
495
-													<?php checked( $key, $option_value ); ?>
493
+                                                        style="<?php echo esc_attr($value['css']); ?>"
494
+													<?php echo implode(' ', $custom_attributes); ?>
495
+													<?php checked($key, $option_value); ?>
496 496
                                                 /> <?php echo $val ?></label>
497 497
                                         </li>
498 498
 										<?php
@@ -506,21 +506,21 @@  discard block
 block discarded – undo
506 506
 
507 507
 					// Checkbox input.
508 508
 					case 'checkbox' :
509
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
509
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
510 510
 						?>
511
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
511
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
512 512
                             <th scope="row" class="titledesc">
513
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
513
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
514 514
                             </th>
515 515
                             <td class="give-forminp">
516 516
                                 <input
517
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
518
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
517
+                                        name="<?php echo esc_attr($value['id']); ?>"
518
+                                        id="<?php echo esc_attr($value['id']); ?>"
519 519
                                         type="checkbox"
520
-                                        class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>"
520
+                                        class="<?php echo esc_attr(isset($value['class']) ? $value['class'] : ''); ?>"
521 521
                                         value="1"
522
-									<?php checked( $option_value, 'on' ); ?>
523
-									<?php echo implode( ' ', $custom_attributes ); ?>
522
+									<?php checked($option_value, 'on'); ?>
523
+									<?php echo implode(' ', $custom_attributes); ?>
524 524
                                 />
525 525
 								<?php echo $description; ?>
526 526
                             </td>
@@ -530,28 +530,28 @@  discard block
 block discarded – undo
530 530
 
531 531
 					// Multi Checkbox input.
532 532
 					case 'multicheck' :
533
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
534
-						$option_value = is_array( $option_value ) ? $option_value : array();
533
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
534
+						$option_value = is_array($option_value) ? $option_value : array();
535 535
 						?>
536
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
536
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
537 537
                             <th scope="row" class="titledesc">
538
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
538
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
539 539
                             </th>
540
-                            <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
540
+                            <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
541 541
                                 <fieldset>
542 542
                                     <ul>
543 543
 										<?php
544
-										foreach ( $value['options'] as $key => $val ) {
544
+										foreach ($value['options'] as $key => $val) {
545 545
 											?>
546 546
                                             <li>
547 547
                                                 <label>
548 548
                                                     <input
549
-                                                            name="<?php echo esc_attr( $value['id'] ); ?>[]"
549
+                                                            name="<?php echo esc_attr($value['id']); ?>[]"
550 550
                                                             value="<?php echo $key; ?>"
551 551
                                                             type="checkbox"
552
-                                                            style="<?php echo esc_attr( $value['css'] ); ?>"
553
-														<?php echo implode( ' ', $custom_attributes ); ?>
554
-														<?php if ( in_array( $key, $option_value ) ) {
552
+                                                            style="<?php echo esc_attr($value['css']); ?>"
553
+														<?php echo implode(' ', $custom_attributes); ?>
554
+														<?php if (in_array($key, $option_value)) {
555 555
 															echo 'checked="checked"';
556 556
 														} ?>
557 557
                                                     /> <?php echo $val ?>
@@ -569,25 +569,25 @@  discard block
 block discarded – undo
569 569
 
570 570
 					// File input field.
571 571
 					case 'file' :
572
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
572
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
573 573
 						?>
574
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
574
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
575 575
                         <th scope="row" class="titledesc">
576
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
576
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
577 577
                         </th>
578 578
                         <td class="give-forminp">
579 579
                             <div class="give-field-wrap">
580 580
                                 <label for="<?php echo $value['id'] ?>">
581 581
                                     <input
582
-                                            name="<?php echo esc_attr( $value['id'] ); ?>"
583
-                                            id="<?php echo esc_attr( $value['id'] ); ?>"
582
+                                            name="<?php echo esc_attr($value['id']); ?>"
583
+                                            id="<?php echo esc_attr($value['id']); ?>"
584 584
                                             type="text"
585
-                                            class="give-input-field<?php echo esc_attr( isset( $value['class'] ) ? ' ' . $value['class'] : '' ); ?>"
585
+                                            class="give-input-field<?php echo esc_attr(isset($value['class']) ? ' '.$value['class'] : ''); ?>"
586 586
                                             value="<?php echo $option_value; ?>"
587
-                                            style="<?php echo esc_attr( $value['css'] ); ?>"
588
-										<?php echo implode( ' ', $custom_attributes ); ?>
587
+                                            style="<?php echo esc_attr($value['css']); ?>"
588
+										<?php echo implode(' ', $custom_attributes); ?>
589 589
                                     />&nbsp;&nbsp;&nbsp;&nbsp;<input class="give-upload-button button" type="button"
590
-                                                                     value="<?php echo esc_html__( 'Add or Upload File', 'give' ); ?>">
590
+                                                                     value="<?php echo esc_html__('Add or Upload File', 'give'); ?>">
591 591
 									<?php echo $description ?>
592 592
                                     <div class="give-image-thumb<?php echo ! $option_value ? ' give-hidden' : ''; ?>">
593 593
                                         <span class="give-delete-image-thumb dashicons dashicons-no-alt"></span>
@@ -602,17 +602,17 @@  discard block
 block discarded – undo
602 602
 					// WordPress Editor.
603 603
 					case 'wysiwyg' :
604 604
 						// Get option value.
605
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
605
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
606 606
 
607 607
 						// Get editor settings.
608
-						$editor_settings = ! empty( $value['options'] ) ? $value['options'] : array();
608
+						$editor_settings = ! empty($value['options']) ? $value['options'] : array();
609 609
 						?>
610
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
610
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
611 611
                         <th scope="row" class="titledesc">
612
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
612
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
613 613
                         </th>
614 614
                         <td class="give-forminp">
615
-							<?php wp_editor( $option_value, $value['id'], $editor_settings ); ?>
615
+							<?php wp_editor($option_value, $value['id'], $editor_settings); ?>
616 616
 							<?php echo $description; ?>
617 617
                         </td>
618 618
                         </tr><?php
@@ -621,9 +621,9 @@  discard block
 block discarded – undo
621 621
 					// Custom: System setting field.
622 622
 					case 'system_info' :
623 623
 						?>
624
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
624
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
625 625
                         <th scope="row" class="titledesc">
626
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
626
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
627 627
                         </th>
628 628
                         <td class="give-forminp">
629 629
 							<?php give_system_info_callback(); ?>
@@ -634,14 +634,14 @@  discard block
 block discarded – undo
634 634
 
635 635
 					// Custom: Default gateways setting field.
636 636
 					case 'default_gateway' :
637
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
637
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
638 638
 						?>
639
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
639
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
640 640
                         <th scope="row" class="titledesc">
641
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
641
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
642 642
                         </th>
643 643
                         <td class="give-forminp">
644
-							<?php give_default_gateway_callback( $value, $option_value ); ?>
644
+							<?php give_default_gateway_callback($value, $option_value); ?>
645 645
 							<?php echo $description; ?>
646 646
                         </td>
647 647
                         </tr><?php
@@ -649,14 +649,14 @@  discard block
 block discarded – undo
649 649
 
650 650
 					// Custom: Enable gateways setting field.
651 651
 					case 'enabled_gateways' :
652
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
652
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
653 653
 						?>
654
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
654
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
655 655
                         <th scope="row" class="titledesc">
656
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
656
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
657 657
                         </th>
658 658
                         <td class="give-forminp">
659
-							<?php give_enabled_gateways_callback( $value, $option_value ); ?>
659
+							<?php give_enabled_gateways_callback($value, $option_value); ?>
660 660
 							<?php echo $description; ?>
661 661
                         </td>
662 662
                         </tr><?php
@@ -665,9 +665,9 @@  discard block
 block discarded – undo
665 665
 					// Custom: Email preview buttons field.
666 666
 					case 'email_preview_buttons' :
667 667
 						?>
668
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
668
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
669 669
                         <th scope="row" class="titledesc">
670
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
670
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
671 671
                         </th>
672 672
                         <td class="give-forminp">
673 673
 							<?php give_email_preview_buttons_callback(); ?>
@@ -684,22 +684,22 @@  discard block
 block discarded – undo
684 684
 
685 685
 					// Custom: Gateway API key.
686 686
 					case 'api_key' :
687
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
688
-						$type         = ! empty( $option_value ) ? 'password' : 'text';
687
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
688
+						$type         = ! empty($option_value) ? 'password' : 'text';
689 689
 						?>
690
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
690
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
691 691
                         <th scope="row" class="titledesc">
692
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
692
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
693 693
                         </th>
694
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
694
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
695 695
                             <input
696
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
697
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
698
-                                    type="<?php echo esc_attr( $type ); ?>"
699
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
700
-                                    value="<?php echo esc_attr( trim( $option_value ) ); ?>"
701
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
702
-								<?php echo implode( ' ', $custom_attributes ); ?>
696
+                                    name="<?php echo esc_attr($value['id']); ?>"
697
+                                    id="<?php echo esc_attr($value['id']); ?>"
698
+                                    type="<?php echo esc_attr($type); ?>"
699
+                                    style="<?php echo esc_attr($value['css']); ?>"
700
+                                    value="<?php echo esc_attr(trim($option_value)); ?>"
701
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
702
+								<?php echo implode(' ', $custom_attributes); ?>
703 703
                             /> <?php echo $description; ?>
704 704
                         </td>
705 705
                         </tr><?php
@@ -721,12 +721,12 @@  discard block
 block discarded – undo
721 721
 					// Custom: Give Docs Link field type.
722 722
 					case 'give_docs_link' :
723 723
 						?>
724
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
724
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
725 725
                         <td class="give-docs-link" colspan="2">
726 726
 							<?php
727
-							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
727
+							echo '<p class="give-docs-link"><a href="'.esc_url($value['url'])
728 728
 							     . '" target="_blank">'
729
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"' ), $value['title'] )
729
+							     . sprintf(esc_html__('Need Help? See docs on "%s"'), $value['title'])
730 730
 							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
731 731
 							?>
732 732
                         </td>
@@ -737,8 +737,8 @@  discard block
 block discarded – undo
737 737
 					// You can add or handle your custom field action.
738 738
 					default:
739 739
 						// Get option value.
740
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
741
-						do_action( 'give_admin_field_' . $value['type'], $value, $option_value );
740
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
741
+						do_action('give_admin_field_'.$value['type'], $value, $option_value);
742 742
 						break;
743 743
 				}
744 744
 			}
@@ -754,15 +754,15 @@  discard block
 block discarded – undo
754 754
 		 *
755 755
 		 * @return string The HTML description of the field.
756 756
 		 */
757
-		public static function get_field_description( $value ) {
757
+		public static function get_field_description($value) {
758 758
 			$description = '';
759 759
 
760 760
 			// Support for both 'description' and 'desc' args.
761
-			$description_key = isset( $value['description'] ) ? 'description' : 'desc';
762
-			$value           = ( isset( $value[ $description_key ] ) && ! empty( $value[ $description_key ] ) ) ? $value[ $description_key ] : '';
761
+			$description_key = isset($value['description']) ? 'description' : 'desc';
762
+			$value           = (isset($value[$description_key]) && ! empty($value[$description_key])) ? $value[$description_key] : '';
763 763
 
764
-			if ( ! empty( $value ) ) {
765
-				$description = '<p class="give-field-description">' . wp_kses_post( $value ) . '</p>';
764
+			if ( ! empty($value)) {
765
+				$description = '<p class="give-field-description">'.wp_kses_post($value).'</p>';
766 766
 			}
767 767
 
768 768
 			return $description;
@@ -779,11 +779,11 @@  discard block
 block discarded – undo
779 779
 		 *
780 780
 		 * @return array The description and tip as a 2 element array
781 781
 		 */
782
-		public static function get_field_title( $value ) {
783
-			$title = esc_html( $value['title'] );
782
+		public static function get_field_title($value) {
783
+			$title = esc_html($value['title']);
784 784
 
785 785
 			// If html tag detected then allow them to print.
786
-			if ( strip_tags( $title ) ) {
786
+			if (strip_tags($title)) {
787 787
 				$title = $value['title'];
788 788
 			}
789 789
 
@@ -802,8 +802,8 @@  discard block
 block discarded – undo
802 802
 		 *
803 803
 		 * @return bool
804 804
 		 */
805
-		public static function save_fields( $options, $option_name = '' ) {
806
-			if ( empty( $_POST ) ) {
805
+		public static function save_fields($options, $option_name = '') {
806
+			if (empty($_POST)) {
807 807
 				return false;
808 808
 			}
809 809
 
@@ -811,37 +811,37 @@  discard block
 block discarded – undo
811 811
 			$update_options = array();
812 812
 
813 813
 			// Loop options and get values to save.
814
-			foreach ( $options as $option ) {
815
-				if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) {
814
+			foreach ($options as $option) {
815
+				if ( ! isset($option['id']) || ! isset($option['type'])) {
816 816
 					continue;
817 817
 				}
818 818
 
819 819
 				// Get posted value.
820
-				if ( strstr( $option['id'], '[' ) ) {
821
-					parse_str( $option['id'], $option_name_array );
822
-					$field_option_name = current( array_keys( $option_name_array ) );
823
-					$setting_name      = key( $option_name_array[ $field_option_name ] );
824
-					$raw_value         = isset( $_POST[ $field_option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $field_option_name ][ $setting_name ] ) : null;
820
+				if (strstr($option['id'], '[')) {
821
+					parse_str($option['id'], $option_name_array);
822
+					$field_option_name = current(array_keys($option_name_array));
823
+					$setting_name      = key($option_name_array[$field_option_name]);
824
+					$raw_value         = isset($_POST[$field_option_name][$setting_name]) ? wp_unslash($_POST[$field_option_name][$setting_name]) : null;
825 825
 				} else {
826 826
 					$field_option_name = $option['id'];
827 827
 					$setting_name      = '';
828
-					$raw_value         = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null;
828
+					$raw_value         = isset($_POST[$option['id']]) ? wp_unslash($_POST[$option['id']]) : null;
829 829
 				}
830 830
 
831 831
 				// Format the value based on option type.
832
-				switch ( $option['type'] ) {
832
+				switch ($option['type']) {
833 833
 					case 'checkbox' :
834
-						$value = is_null( $raw_value ) ? '' : 'on';
834
+						$value = is_null($raw_value) ? '' : 'on';
835 835
 						break;
836 836
 					case 'wysiwyg'  :
837 837
 					case 'textarea' :
838
-						$value = wp_kses_post( trim( $raw_value ) );
838
+						$value = wp_kses_post(trim($raw_value));
839 839
 						break;
840 840
 					case 'multiselect' :
841
-						$value = array_filter( array_map( 'give_clean', (array) $raw_value ) );
841
+						$value = array_filter(array_map('give_clean', (array) $raw_value));
842 842
 						break;
843 843
 					default :
844
-						$value = give_clean( $raw_value );
844
+						$value = give_clean($raw_value);
845 845
 						break;
846 846
 				}
847 847
 
@@ -850,37 +850,37 @@  discard block
 block discarded – undo
850 850
 				 *
851 851
 				 * @since 1.8
852 852
 				 */
853
-				$value = apply_filters( 'give_admin_settings_sanitize_option', $value, $option, $raw_value );
853
+				$value = apply_filters('give_admin_settings_sanitize_option', $value, $option, $raw_value);
854 854
 
855 855
 				/**
856 856
 				 * Sanitize the value of an option by option name.
857 857
 				 *
858 858
 				 * @since 1.8
859 859
 				 */
860
-				$value = apply_filters( "give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value );
860
+				$value = apply_filters("give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value);
861 861
 
862
-				if ( is_null( $value ) ) {
862
+				if (is_null($value)) {
863 863
 					continue;
864 864
 				}
865 865
 
866 866
 				// Check if option is an array and handle that differently to single values.
867
-				if ( $field_option_name && $setting_name ) {
868
-					if ( ! isset( $update_options[ $field_option_name ] ) ) {
869
-						$update_options[ $field_option_name ] = get_option( $field_option_name, array() );
867
+				if ($field_option_name && $setting_name) {
868
+					if ( ! isset($update_options[$field_option_name])) {
869
+						$update_options[$field_option_name] = get_option($field_option_name, array());
870 870
 					}
871
-					if ( ! is_array( $update_options[ $field_option_name ] ) ) {
872
-						$update_options[ $field_option_name ] = array();
871
+					if ( ! is_array($update_options[$field_option_name])) {
872
+						$update_options[$field_option_name] = array();
873 873
 					}
874
-					$update_options[ $field_option_name ][ $setting_name ] = $value;
874
+					$update_options[$field_option_name][$setting_name] = $value;
875 875
 				} else {
876
-					$update_options[ $field_option_name ] = $value;
876
+					$update_options[$field_option_name] = $value;
877 877
 				}
878 878
 			}
879 879
 
880 880
 			// Save all options in our array or there own option name i.e. option id.
881
-			if ( empty( $option_name ) ) {
882
-				foreach ( $update_options as $name => $value ) {
883
-					update_option( $name, $value );
881
+			if (empty($option_name)) {
882
+				foreach ($update_options as $name => $value) {
883
+					update_option($name, $value);
884 884
 
885 885
 					/**
886 886
 					 * Trigger action.
@@ -889,13 +889,13 @@  discard block
 block discarded – undo
889 889
 					 *
890 890
 					 * @since 1.8
891 891
 					 */
892
-					do_action( "give_save_option_{$name}", $value, $name );
892
+					do_action("give_save_option_{$name}", $value, $name);
893 893
 				}
894 894
 			} else {
895
-				$old_options    = ( $old_options = get_option( $option_name ) ) ? $old_options : array();
896
-				$update_options = array_merge( $old_options, $update_options );
895
+				$old_options    = ($old_options = get_option($option_name)) ? $old_options : array();
896
+				$update_options = array_merge($old_options, $update_options);
897 897
 
898
-				update_option( $option_name, $update_options );
898
+				update_option($option_name, $update_options);
899 899
 
900 900
 				/**
901 901
 				 * Trigger action.
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 				 *
905 905
 				 * @since 1.8
906 906
 				 */
907
-				do_action( "give_save_settings_{$option_name}", $update_options, $option_name );
907
+				do_action("give_save_settings_{$option_name}", $update_options, $option_name);
908 908
 			}
909 909
 
910 910
 			return true;
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-gateways.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 								'disabled' => __( 'Disabled', 'give' ),
87 87
 							)
88 88
 						),
89
-                        array(
90
-                            'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
91
-                            'id'    => 'paypal_standard_gateway_settings_docs_link',
92
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
93
-                            'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
94
-                            'type'  => 'give_docs_link',
95
-                        ),
89
+						array(
90
+							'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
91
+							'id'    => 'paypal_standard_gateway_settings_docs_link',
92
+							'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
93
+							'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
94
+							'type'  => 'give_docs_link',
95
+						),
96 96
 						array(
97 97
 							'type' => 'sectionend',
98 98
 							'id'   => 'give_title_gateway_settings_2',
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 								'textarea_rows' => 6,
146 146
 							)
147 147
 						),
148
-                        array(
149
-                            'name'  => __( 'Offline Donations Settings Docs Link', 'give' ),
150
-                            'id'    => 'offline_gateway_settings_docs_link',
151
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-offline-donations' ),
152
-                            'title' => __( 'Offline Gateway Settings', 'give' ),
153
-                            'type'  => 'give_docs_link',
154
-                        ),
148
+						array(
149
+							'name'  => __( 'Offline Donations Settings Docs Link', 'give' ),
150
+							'id'    => 'offline_gateway_settings_docs_link',
151
+							'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-offline-donations' ),
152
+							'title' => __( 'Offline Gateway Settings', 'give' ),
153
+							'type'  => 'give_docs_link',
154
+						),
155 155
 						array(
156 156
 							'type' => 'sectionend',
157 157
 							'id'   => 'give_title_gateway_settings_3',
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
 							'id'   => 'default_gateway',
190 190
 							'type' => 'default_gateway'
191 191
 						),
192
-                        array(
193
-                            'name'  => __( 'Gateways Docs Link', 'give' ),
194
-                            'id'    => 'gateway_settings_docs_link',
195
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
196
-                            'title' => __( 'Gateway Settings', 'give' ),
197
-                            'type'  => 'give_docs_link',
198
-                        ),
192
+						array(
193
+							'name'  => __( 'Gateways Docs Link', 'give' ),
194
+							'id'    => 'gateway_settings_docs_link',
195
+							'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
196
+							'title' => __( 'Gateway Settings', 'give' ),
197
+							'type'  => 'give_docs_link',
198
+						),
199 199
 						array(
200 200
 							'id'   => 'give_title_gateway_settings_1',
201 201
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 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_Gateways' ) ) :
16
+if ( ! class_exists('Give_Settings_Gateways')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Gateways.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'gateways';
30
-			$this->label = esc_html__( 'Payment Gateways', 'give' );
30
+			$this->label = esc_html__('Payment Gateways', 'give');
31 31
 
32 32
 			$this->default_tab = 'gateways-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 'paypal-standard':
49 49
 					$settings = array(
50 50
 						// Section 2: PayPal Standard.
@@ -53,44 +53,44 @@  discard block
 block discarded – undo
53 53
 							'id'   => 'give_title_gateway_settings_2',
54 54
 						),
55 55
 						array(
56
-							'name' => __( 'PayPal Email', 'give' ),
57
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
56
+							'name' => __('PayPal Email', 'give'),
57
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
58 58
 							'id'   => 'paypal_email',
59 59
 							'type' => 'email',
60 60
 						),
61 61
 						array(
62
-							'name' => __( 'PayPal Page Style', 'give' ),
63
-							'desc' => __( 'Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give' ),
62
+							'name' => __('PayPal Page Style', 'give'),
63
+							'desc' => __('Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give'),
64 64
 							'id'   => 'paypal_page_style',
65 65
 							'type' => 'text',
66 66
 						),
67 67
 						array(
68
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
69
-							'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' ),
68
+							'name'    => __('PayPal Transaction Type', 'give'),
69
+							'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'),
70 70
 							'id'      => 'paypal_button_type',
71 71
 							'type'    => 'radio_inline',
72 72
 							'options' => array(
73
-								'donation' => __( 'Donation', 'give' ),
74
-								'standard' => __( 'Standard Transaction', 'give' )
73
+								'donation' => __('Donation', 'give'),
74
+								'standard' => __('Standard Transaction', 'give')
75 75
 							),
76 76
 							'default' => 'donation',
77 77
 						),
78 78
 						array(
79
-							'name'    => __( 'PayPal IPN Verification', 'give' ),
80
-							'desc'    => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
79
+							'name'    => __('PayPal IPN Verification', 'give'),
80
+							'desc'    => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
81 81
 							'id'      => 'paypal_verification',
82 82
 							'type'    => 'radio_inline',
83 83
 							'default' => 'enabled',
84 84
 							'options' => array(
85
-								'enabled'  => __( 'Enabled', 'give' ),
86
-								'disabled' => __( 'Disabled', 'give' ),
85
+								'enabled'  => __('Enabled', 'give'),
86
+								'disabled' => __('Disabled', 'give'),
87 87
 							)
88 88
 						),
89 89
                         array(
90
-                            'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
90
+                            'name'  => __('PayPal Standard Gateway Settings Docs Link', 'give'),
91 91
                             'id'    => 'paypal_standard_gateway_settings_docs_link',
92
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
93
-                            'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
92
+                            'url'   => esc_url('http://docs.givewp.com/settings-gateway-paypal-standard'),
93
+                            'title' => __('PayPal Standard Gateway Settings', 'give'),
94 94
                             'type'  => 'give_docs_link',
95 95
                         ),
96 96
 						array(
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 							'id'   => 'give_title_gateway_settings_3',
109 109
 						),
110 110
 						array(
111
-							'name'    => __( 'Collect Billing Details', 'give' ),
112
-							'desc'    => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
111
+							'name'    => __('Collect Billing Details', 'give'),
112
+							'desc'    => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
113 113
 							'id'      => 'give_offline_donation_enable_billing_fields',
114 114
 							'type'    => 'radio_inline',
115 115
 							'default' => 'disabled',
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'    => __( 'Offline Donation Instructions', 'give' ),
123
-							'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' ),
122
+							'name'    => __('Offline Donation Instructions', 'give'),
123
+							'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'),
124 124
 							'id'      => 'global_offline_donation_content',
125 125
 							'default' => give_get_default_offline_donation_content(),
126 126
 							'type'    => 'wysiwyg',
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 							)
130 130
 						),
131 131
 						array(
132
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
133
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
132
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
133
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
134 134
 							'id'      => 'offline_donation_subject',
135
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
135
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
136 136
 							'type'    => 'text'
137 137
 						),
138 138
 						array(
139
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
140
-							'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' ) . ' ' . __( 'Available template tags:', 'give' ) . give_get_emails_tags_list(),
139
+							'name'    => __('Offline Donation Email Instructions', 'give'),
140
+							'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').' '.__('Available template tags:', 'give').give_get_emails_tags_list(),
141 141
 							'id'      => 'global_offline_donation_email',
142 142
 							'default' => give_get_default_offline_donation_email_content(),
143 143
 							'type'    => 'wysiwyg',
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 							)
147 147
 						),
148 148
                         array(
149
-                            'name'  => __( 'Offline Donations Settings Docs Link', 'give' ),
149
+                            'name'  => __('Offline Donations Settings Docs Link', 'give'),
150 150
                             'id'    => 'offline_gateway_settings_docs_link',
151
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-offline-donations' ),
152
-                            'title' => __( 'Offline Gateway Settings', 'give' ),
151
+                            'url'   => esc_url('http://docs.givewp.com/settings-gateway-offline-donations'),
152
+                            'title' => __('Offline Gateway Settings', 'give'),
153 153
                             'type'  => 'give_docs_link',
154 154
                         ),
155 155
 						array(
@@ -167,33 +167,33 @@  discard block
 block discarded – undo
167 167
 							'type' => 'title'
168 168
 						),
169 169
 						array(
170
-							'name'    => __( 'Test Mode', 'give' ),
171
-							'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' ),
170
+							'name'    => __('Test Mode', 'give'),
171
+							'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'),
172 172
 							'id'      => 'test_mode',
173 173
 							'type'    => 'radio_inline',
174 174
 							'default' => 'disabled',
175 175
 							'options' => array(
176
-								'enabled'  => __( 'Enabled', 'give' ),
177
-								'disabled' => __( 'Disabled', 'give' ),
176
+								'enabled'  => __('Enabled', 'give'),
177
+								'disabled' => __('Disabled', 'give'),
178 178
 							)
179 179
 						),
180 180
 						array(
181
-							'name' => __( 'Enabled Gateways', 'give' ),
182
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
181
+							'name' => __('Enabled Gateways', 'give'),
182
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
183 183
 							'id'   => 'gateways',
184 184
 							'type' => 'enabled_gateways'
185 185
 						),
186 186
 						array(
187
-							'name' => __( 'Default Gateway', 'give' ),
188
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
187
+							'name' => __('Default Gateway', 'give'),
188
+							'desc' => __('The gateway that will be selected by default.', 'give'),
189 189
 							'id'   => 'default_gateway',
190 190
 							'type' => 'default_gateway'
191 191
 						),
192 192
                         array(
193
-                            'name'  => __( 'Gateways Docs Link', 'give' ),
193
+                            'name'  => __('Gateways Docs Link', 'give'),
194 194
                             'id'    => 'gateway_settings_docs_link',
195
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
196
-                            'title' => __( 'Gateway Settings', 'give' ),
195
+                            'url'   => esc_url('http://docs.givewp.com/settings-gateways'),
196
+                            'title' => __('Gateway Settings', 'give'),
197 197
                             'type'  => 'give_docs_link',
198 198
                         ),
199 199
 						array(
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			 * Filter the payment gateways settings.
209 209
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
210 210
 			 */
211
-			$settings = apply_filters( 'give_settings_gateways', $settings );
211
+			$settings = apply_filters('give_settings_gateways', $settings);
212 212
 
213 213
 			/**
214 214
 			 * Filter the settings.
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			 *
218 218
 			 * @param  array $settings
219 219
 			 */
220
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
220
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
221 221
 
222 222
 			// Output.
223 223
 			return $settings;
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 		 */
232 232
 		public function get_sections() {
233 233
 			$sections = array(
234
-				'gateways-settings' => __( 'Gateways', 'give' ),
235
-				'paypal-standard'   => __( 'PayPal Standard', 'give' ),
236
-				'offline-donations' => __( 'Offline Donations', 'give' )
234
+				'gateways-settings' => __('Gateways', 'give'),
235
+				'paypal-standard'   => __('PayPal Standard', 'give'),
236
+				'offline-donations' => __('Offline Donations', 'give')
237 237
 			);
238 238
 
239
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
239
+			return apply_filters('give_get_sections_'.$this->id, $sections);
240 240
 		}
241 241
 	}
242 242
 
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrade-functions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 		case version_compare( $give_version, '1.7', '<' ) :
43 43
 			give_v17_upgrades();
44 44
 			$did_upgrade = true;
45
-            break;
45
+			break;
46 46
 
47 47
 		case version_compare( $give_version, '1.8', '<' ) :
48 48
 			give_v18_upgrades();
Please login to merge, or discard this patch.
Spacing   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -25,37 +25,37 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_do_automatic_upgrades() {
27 27
 	$did_upgrade  = false;
28
-	$give_version = preg_replace( '/[^0-9.].*/', '', get_option( 'give_version' ) );
28
+	$give_version = preg_replace('/[^0-9.].*/', '', get_option('give_version'));
29 29
 
30
-	if ( ! $give_version ) {
30
+	if ( ! $give_version) {
31 31
 		// 1.0 is the first version to use this option so we must add it.
32 32
 		$give_version = '1.0';
33 33
 	}
34 34
 
35
-	switch ( true ) {
35
+	switch (true) {
36 36
 
37
-		case version_compare( $give_version, '1.6', '<' ) :
37
+		case version_compare($give_version, '1.6', '<') :
38 38
 			give_v16_upgrades();
39 39
 			$did_upgrade = true;
40 40
 			break;
41 41
 
42
-		case version_compare( $give_version, '1.7', '<' ) :
42
+		case version_compare($give_version, '1.7', '<') :
43 43
 			give_v17_upgrades();
44 44
 			$did_upgrade = true;
45 45
             break;
46 46
 
47
-		case version_compare( $give_version, '1.8', '<' ) :
47
+		case version_compare($give_version, '1.8', '<') :
48 48
 			give_v18_upgrades();
49 49
 			$did_upgrade = true;
50 50
 	}
51 51
 
52
-	if ( $did_upgrade ) {
53
-		update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
52
+	if ($did_upgrade) {
53
+		update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
54 54
 	}
55 55
 }
56 56
 
57
-add_action( 'admin_init', 'give_do_automatic_upgrades' );
58
-add_action( 'give_upgrades', 'give_do_automatic_upgrades' );
57
+add_action('admin_init', 'give_do_automatic_upgrades');
58
+add_action('give_upgrades', 'give_do_automatic_upgrades');
59 59
 
60 60
 /**
61 61
  * Display Upgrade Notices
@@ -65,18 +65,18 @@  discard block
 block discarded – undo
65 65
  */
66 66
 function give_show_upgrade_notices() {
67 67
 	// Don't show notices on the upgrades page.
68
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-upgrades' ) {
68
+	if (isset($_GET['page']) && $_GET['page'] == 'give-upgrades') {
69 69
 		return;
70 70
 	}
71 71
 
72
-	$give_version = get_option( 'give_version' );
72
+	$give_version = get_option('give_version');
73 73
 
74
-	if ( ! $give_version ) {
74
+	if ( ! $give_version) {
75 75
 		// 1.0 is the first version to use this option so we must add it.
76 76
 		$give_version = '1.0';
77 77
 	}
78 78
 
79
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
79
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
80 80
 
81 81
 	/*
82 82
 	 *  NOTICE:
@@ -87,31 +87,31 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 
89 89
 	// v1.3.2 Upgrades
90
-	if ( version_compare( $give_version, '1.3.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) {
90
+	if (version_compare($give_version, '1.3.2', '<') || ! give_has_upgrade_completed('upgrade_give_payment_customer_id')) {
91 91
 		printf(
92 92
 			/* translators: %s: upgrade URL */
93
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
94
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id' ) )
93
+			'<div class="updated"><p>'.__('Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
94
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id'))
95 95
 		);
96 96
 	}
97 97
 
98 98
 	// v1.3.4 Upgrades //ensure the user has gone through 1.3.4.
99
-	if ( version_compare( $give_version, '1.3.4', '<' ) || ( ! give_has_upgrade_completed( 'upgrade_give_offline_status' ) && give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) ) {
99
+	if (version_compare($give_version, '1.3.4', '<') || ( ! give_has_upgrade_completed('upgrade_give_offline_status') && give_has_upgrade_completed('upgrade_give_payment_customer_id'))) {
100 100
 		printf(
101 101
 			/* translators: %s: upgrade URL */
102
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the donations database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
103
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status' ) )
102
+			'<div class="updated"><p>'.__('Give needs to upgrade the donations database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
103
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status'))
104 104
 		);
105 105
 	}
106 106
 
107 107
 	// Check if we have a stalled upgrade.
108 108
 	$resume_upgrade = give_maybe_resume_upgrade();
109
-	if ( ! empty( $resume_upgrade ) ) {
110
-		$resume_url = add_query_arg( $resume_upgrade, admin_url( 'index.php' ) );
109
+	if ( ! empty($resume_upgrade)) {
110
+		$resume_url = add_query_arg($resume_upgrade, admin_url('index.php'));
111 111
 		echo Give_Notices::notice_html(
112 112
 			sprintf(
113
-				__( 'Give needs to complete a database upgrade that was previously started, click <a href="%s">here</a> to resume the upgrade.', 'give' ),
114
-				esc_url( $resume_url )
113
+				__('Give needs to complete a database upgrade that was previously started, click <a href="%s">here</a> to resume the upgrade.', 'give'),
114
+				esc_url($resume_url)
115 115
 			)
116 116
 		);
117 117
 
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 
121 121
 	// v1.8 form metadata upgrades.
122
-	if ( version_compare( $give_version, '1.8', '<' ) || ! give_has_upgrade_completed( 'v18_upgrades_form_metadata' ) ) {
122
+	if (version_compare($give_version, '1.8', '<') || ! give_has_upgrade_completed('v18_upgrades_form_metadata')) {
123 123
 		echo Give_Notices::notice_html(
124 124
 			sprintf(
125
-				esc_html__( 'Give needs to upgrade the form database, click %1$shere%2$s to start the upgrade.', 'give' ),
126
-				'<a class="give-upgrade-link" href="' . esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=give_v18_upgrades_form_metadata' ) ) . '">',
125
+				esc_html__('Give needs to upgrade the form database, click %1$shere%2$s to start the upgrade.', 'give'),
126
+				'<a class="give-upgrade-link" href="'.esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=give_v18_upgrades_form_metadata')).'">',
127 127
 				'</a>'
128 128
 			)
129 129
 		);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	<?php
152 152
 }
153 153
 
154
-add_action( 'admin_notices', 'give_show_upgrade_notices' );
154
+add_action('admin_notices', 'give_show_upgrade_notices');
155 155
 
156 156
 /**
157 157
  * Triggers all upgrade functions
@@ -163,29 +163,29 @@  discard block
 block discarded – undo
163 163
  */
164 164
 function give_trigger_upgrades() {
165 165
 
166
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
167
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array(
166
+	if ( ! current_user_can('manage_give_settings')) {
167
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array(
168 168
 			'response' => 403,
169
-		) );
169
+		));
170 170
 	}
171 171
 
172
-	$give_version = get_option( 'give_version' );
172
+	$give_version = get_option('give_version');
173 173
 
174
-	if ( ! $give_version ) {
174
+	if ( ! $give_version) {
175 175
 		// 1.0 is the first version to use this option so we must add it.
176 176
 		$give_version = '1.0';
177
-		add_option( 'give_version', $give_version );
177
+		add_option('give_version', $give_version);
178 178
 	}
179 179
 
180
-	update_option( 'give_version', GIVE_VERSION );
181
-	delete_option( 'give_doing_upgrade' );
180
+	update_option('give_version', GIVE_VERSION);
181
+	delete_option('give_doing_upgrade');
182 182
 
183
-	if ( DOING_AJAX ) {
184
-		die( 'complete' );
183
+	if (DOING_AJAX) {
184
+		die('complete');
185 185
 	} // End if().
186 186
 }
187 187
 
188
-add_action( 'wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades' );
188
+add_action('wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades');
189 189
 
190 190
 /**
191 191
  * Check if the upgrade routine has been run for a specific action
@@ -196,15 +196,15 @@  discard block
 block discarded – undo
196 196
  *
197 197
  * @return bool                   If the action has been added to the completed actions array
198 198
  */
199
-function give_has_upgrade_completed( $upgrade_action = '' ) {
199
+function give_has_upgrade_completed($upgrade_action = '') {
200 200
 
201
-	if ( empty( $upgrade_action ) ) {
201
+	if (empty($upgrade_action)) {
202 202
 		return false;
203 203
 	}
204 204
 
205 205
 	$completed_upgrades = give_get_completed_upgrades();
206 206
 
207
-	return in_array( $upgrade_action, $completed_upgrades );
207
+	return in_array($upgrade_action, $completed_upgrades);
208 208
 
209 209
 }
210 210
 
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
  * @return mixed   When nothing to resume returns false, otherwise starts the upgrade where it left off
217 217
  */
218 218
 function give_maybe_resume_upgrade() {
219
-	$doing_upgrade = get_option( 'give_doing_upgrade', false );
220
-	if ( empty( $doing_upgrade ) ) {
219
+	$doing_upgrade = get_option('give_doing_upgrade', false);
220
+	if (empty($doing_upgrade)) {
221 221
 		return false;
222 222
 	}
223 223
 
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
  *
234 234
  * @return bool                   If the function was successfully added
235 235
  */
236
-function give_set_upgrade_complete( $upgrade_action = '' ) {
236
+function give_set_upgrade_complete($upgrade_action = '') {
237 237
 
238
-	if ( empty( $upgrade_action ) ) {
238
+	if (empty($upgrade_action)) {
239 239
 		return false;
240 240
 	}
241 241
 
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
 	$completed_upgrades[] = $upgrade_action;
244 244
 
245 245
 	// Remove any blanks, and only show uniques.
246
-	$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
246
+	$completed_upgrades = array_unique(array_values($completed_upgrades));
247 247
 
248
-	return update_option( 'give_completed_upgrades', $completed_upgrades );
248
+	return update_option('give_completed_upgrades', $completed_upgrades);
249 249
 }
250 250
 
251 251
 /**
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
  */
257 257
 function give_get_completed_upgrades() {
258 258
 
259
-	$completed_upgrades = get_option( 'give_completed_upgrades' );
259
+	$completed_upgrades = get_option('give_completed_upgrades');
260 260
 
261
-	if ( false === $completed_upgrades ) {
261
+	if (false === $completed_upgrades) {
262 262
 		$completed_upgrades = array();
263 263
 	}
264 264
 
@@ -275,31 +275,31 @@  discard block
 block discarded – undo
275 275
  */
276 276
 function give_v132_upgrade_give_payment_customer_id() {
277 277
 	global $wpdb;
278
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
279
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array(
278
+	if ( ! current_user_can('manage_give_settings')) {
279
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array(
280 280
 			'response' => 403,
281
-		) );
281
+		));
282 282
 	}
283 283
 
284
-	ignore_user_abort( true );
284
+	ignore_user_abort(true);
285 285
 
286
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
287
-		@set_time_limit( 0 );
286
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
287
+		@set_time_limit(0);
288 288
 	}
289 289
 
290 290
 	// UPDATE DB METAKEYS.
291 291
 	$sql   = "UPDATE $wpdb->postmeta SET meta_key = '_give_payment_customer_id' WHERE meta_key = '_give_payment_donor_id'";
292
-	$query = $wpdb->query( $sql );
292
+	$query = $wpdb->query($sql);
293 293
 
294
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
295
-	give_set_upgrade_complete( 'upgrade_give_payment_customer_id' );
296
-	delete_option( 'give_doing_upgrade' );
297
-	wp_redirect( admin_url() );
294
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
295
+	give_set_upgrade_complete('upgrade_give_payment_customer_id');
296
+	delete_option('give_doing_upgrade');
297
+	wp_redirect(admin_url());
298 298
 	exit;
299 299
 
300 300
 }
301 301
 
302
-add_action( 'give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id' );
302
+add_action('give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id');
303 303
 
304 304
 /**
305 305
  * Upgrades the Offline Status
@@ -312,16 +312,16 @@  discard block
 block discarded – undo
312 312
 
313 313
 	global $wpdb;
314 314
 
315
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
316
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array(
315
+	if ( ! current_user_can('manage_give_settings')) {
316
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array(
317 317
 			'response' => 403,
318
-		) );
318
+		));
319 319
 	}
320 320
 
321
-	ignore_user_abort( true );
321
+	ignore_user_abort(true);
322 322
 
323
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
324
-		@set_time_limit( 0 );
323
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
324
+		@set_time_limit(0);
325 325
 	}
326 326
 
327 327
 	// Get abandoned offline payments.
@@ -331,31 +331,31 @@  discard block
 block discarded – undo
331 331
 	$where .= "AND ( p.post_status = 'abandoned' )";
332 332
 	$where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )";
333 333
 
334
-	$sql            = $select . $join . $where;
335
-	$found_payments = $wpdb->get_col( $sql );
334
+	$sql            = $select.$join.$where;
335
+	$found_payments = $wpdb->get_col($sql);
336 336
 
337
-	foreach ( $found_payments as $payment ) {
337
+	foreach ($found_payments as $payment) {
338 338
 
339 339
 		// Only change ones marked abandoned since our release last week because the admin may have marked some abandoned themselves.
340
-		$modified_time = get_post_modified_time( 'U', false, $payment );
340
+		$modified_time = get_post_modified_time('U', false, $payment);
341 341
 
342 342
 		// 1450124863 =  12/10/2015 20:42:25.
343
-		if ( $modified_time >= 1450124863 ) {
343
+		if ($modified_time >= 1450124863) {
344 344
 
345
-			give_update_payment_status( $payment, 'pending' );
345
+			give_update_payment_status($payment, 'pending');
346 346
 
347 347
 		}
348 348
 	}
349 349
 
350
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
351
-	give_set_upgrade_complete( 'upgrade_give_offline_status' );
352
-	delete_option( 'give_doing_upgrade' );
353
-	wp_redirect( admin_url() );
350
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
351
+	give_set_upgrade_complete('upgrade_give_offline_status');
352
+	delete_option('give_doing_upgrade');
353
+	wp_redirect(admin_url());
354 354
 	exit;
355 355
 
356 356
 }
357 357
 
358
-add_action( 'give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status' );
358
+add_action('give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status');
359 359
 
360 360
 /**
361 361
  * Cleanup User Roles
@@ -366,17 +366,17 @@  discard block
 block discarded – undo
366 366
  */
367 367
 function give_v152_cleanup_users() {
368 368
 
369
-	$give_version = get_option( 'give_version' );
369
+	$give_version = get_option('give_version');
370 370
 
371
-	if ( ! $give_version ) {
371
+	if ( ! $give_version) {
372 372
 		// 1.0 is the first version to use this option so we must add it.
373 373
 		$give_version = '1.0';
374 374
 	}
375 375
 
376
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
376
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
377 377
 
378 378
 	// v1.5.2 Upgrades
379
-	if ( version_compare( $give_version, '1.5.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_user_caps_cleanup' ) ) {
379
+	if (version_compare($give_version, '1.5.2', '<') || ! give_has_upgrade_completed('upgrade_give_user_caps_cleanup')) {
380 380
 
381 381
 		// Delete all caps with "ss".
382 382
 		// Also delete all unused "campaign" roles.
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 		);
424 424
 
425 425
 		global $wp_roles;
426
-		foreach ( $delete_caps as $cap ) {
427
-			foreach ( array_keys( $wp_roles->roles ) as $role ) {
428
-				$wp_roles->remove_cap( $role, $cap );
426
+		foreach ($delete_caps as $cap) {
427
+			foreach (array_keys($wp_roles->roles) as $role) {
428
+				$wp_roles->remove_cap($role, $cap);
429 429
 			}
430 430
 		}
431 431
 
@@ -435,15 +435,15 @@  discard block
 block discarded – undo
435 435
 		$roles->add_caps();
436 436
 
437 437
 		// The Update Ran.
438
-		update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
439
-		give_set_upgrade_complete( 'upgrade_give_user_caps_cleanup' );
440
-		delete_option( 'give_doing_upgrade' );
438
+		update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
439
+		give_set_upgrade_complete('upgrade_give_user_caps_cleanup');
440
+		delete_option('give_doing_upgrade');
441 441
 
442 442
 	}// End if().
443 443
 
444 444
 }
445 445
 
446
-add_action( 'admin_init', 'give_v152_cleanup_users' );
446
+add_action('admin_init', 'give_v152_cleanup_users');
447 447
 
448 448
 /**
449 449
  * 1.6 Upgrade routine to create the customer meta table.
@@ -483,53 +483,53 @@  discard block
 block discarded – undo
483 483
 
484 484
 	// Get addons license key.
485 485
 	$addons = array();
486
-	foreach ( $give_options as $key => $value ) {
487
-		if ( false !== strpos( $key, '_license_key' ) ) {
488
-			$addons[ $key ] = $value;
486
+	foreach ($give_options as $key => $value) {
487
+		if (false !== strpos($key, '_license_key')) {
488
+			$addons[$key] = $value;
489 489
 		}
490 490
 	}
491 491
 
492 492
 	// Bailout: We do not have any addon license data to upgrade.
493
-	if ( empty( $addons ) ) {
493
+	if (empty($addons)) {
494 494
 		return false;
495 495
 	}
496 496
 
497
-	foreach ( $addons as $key => $addon_license ) {
497
+	foreach ($addons as $key => $addon_license) {
498 498
 
499 499
 		// Get addon shortname.
500
-		$shortname = str_replace( '_license_key', '', $key );
500
+		$shortname = str_replace('_license_key', '', $key);
501 501
 
502 502
 		// Addon license option name.
503
-		$addon_license_option_name = $shortname . '_license_active';
503
+		$addon_license_option_name = $shortname.'_license_active';
504 504
 
505 505
 		// bailout if license is empty.
506
-		if ( empty( $addon_license ) ) {
507
-			delete_option( $addon_license_option_name );
506
+		if (empty($addon_license)) {
507
+			delete_option($addon_license_option_name);
508 508
 			continue;
509 509
 		}
510 510
 
511 511
 		// Get addon name.
512 512
 		$addon_name       = array();
513
-		$addon_name_parts = explode( '_', str_replace( 'give_', '', $shortname ) );
514
-		foreach ( $addon_name_parts as $name_part ) {
513
+		$addon_name_parts = explode('_', str_replace('give_', '', $shortname));
514
+		foreach ($addon_name_parts as $name_part) {
515 515
 
516 516
 			// Fix addon name
517
-			switch ( $name_part ) {
517
+			switch ($name_part) {
518 518
 				case 'authorizenet' :
519 519
 					$name_part = 'authorize.net';
520 520
 					break;
521 521
 			}
522 522
 
523
-			$addon_name[] = ucfirst( $name_part );
523
+			$addon_name[] = ucfirst($name_part);
524 524
 		}
525 525
 
526
-		$addon_name = implode( ' ', $addon_name );
526
+		$addon_name = implode(' ', $addon_name);
527 527
 
528 528
 		// Data to send to the API
529 529
 		$api_params = array(
530 530
 			'edd_action' => 'activate_license', // never change from "edd_" to "give_"!
531 531
 			'license'    => $addon_license,
532
-			'item_name'  => urlencode( $addon_name ),
532
+			'item_name'  => urlencode($addon_name),
533 533
 			'url'        => home_url(),
534 534
 		);
535 535
 
@@ -544,17 +544,17 @@  discard block
 block discarded – undo
544 544
 		);
545 545
 
546 546
 		// Make sure there are no errors.
547
-		if ( is_wp_error( $response ) ) {
548
-			delete_option( $addon_license_option_name );
547
+		if (is_wp_error($response)) {
548
+			delete_option($addon_license_option_name);
549 549
 			continue;
550 550
 		}
551 551
 
552 552
 		// Tell WordPress to look for updates.
553
-		set_site_transient( 'update_plugins', null );
553
+		set_site_transient('update_plugins', null);
554 554
 
555 555
 		// Decode license data.
556
-		$license_data = json_decode( wp_remote_retrieve_body( $response ) );
557
-		update_option( $addon_license_option_name, $license_data );
556
+		$license_data = json_decode(wp_remote_retrieve_body($response));
557
+		update_option($addon_license_option_name, $license_data);
558 558
 	}// End foreach().
559 559
 }
560 560
 
@@ -584,9 +584,9 @@  discard block
 block discarded – undo
584 584
 	);
585 585
 
586 586
 	global $wp_roles;
587
-	foreach ( $delete_caps as $cap ) {
588
-		foreach ( array_keys( $wp_roles->roles ) as $role ) {
589
-			$wp_roles->remove_cap( $role, $cap );
587
+	foreach ($delete_caps as $cap) {
588
+		foreach (array_keys($wp_roles->roles) as $role) {
589
+			$wp_roles->remove_cap($role, $cap);
590 590
 		}
591 591
 	}
592 592
 
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 function give_v18_upgrades_core_setting() {
621 621
 	// Core settings which changes from checkbox to radio.
622 622
 	$core_setting_names = array_merge(
623
-		array_keys( give_v18_renamed_core_settings() ),
623
+		array_keys(give_v18_renamed_core_settings()),
624 624
 		array(
625 625
 			'uninstall_on_delete',
626 626
 			'scripts_footer',
@@ -632,48 +632,48 @@  discard block
 block discarded – undo
632 632
 	);
633 633
 
634 634
 	// Bailout: If not any setting define.
635
-	if ( $give_settings = get_option( 'give_settings' ) ) {
635
+	if ($give_settings = get_option('give_settings')) {
636 636
 
637 637
 		$setting_changed = false;
638 638
 
639 639
 		// Loop: check each setting field.
640
-		foreach ( $core_setting_names as $setting_name ) {
640
+		foreach ($core_setting_names as $setting_name) {
641 641
 			// New setting name.
642
-			$new_setting_name = preg_replace( '/^(enable_|disable_)/', '', $setting_name );
642
+			$new_setting_name = preg_replace('/^(enable_|disable_)/', '', $setting_name);
643 643
 
644 644
 			// Continue: If setting already set.
645 645
 			if (
646
-				array_key_exists( $new_setting_name, $give_settings )
647
-				&& in_array( $give_settings[ $new_setting_name ], array( 'enabled', 'disabled' ) )
646
+				array_key_exists($new_setting_name, $give_settings)
647
+				&& in_array($give_settings[$new_setting_name], array('enabled', 'disabled'))
648 648
 			) {
649 649
 				continue;
650 650
 			}
651 651
 
652 652
 			// Set checkbox value to radio value.
653
-			$give_settings[ $setting_name ] = ( ! empty( $give_settings[ $setting_name ] ) && 'on' === $give_settings[ $setting_name ] ? 'enabled' : 'disabled' );
653
+			$give_settings[$setting_name] = ( ! empty($give_settings[$setting_name]) && 'on' === $give_settings[$setting_name] ? 'enabled' : 'disabled');
654 654
 
655 655
 			// @see https://github.com/WordImpress/Give/issues/1063
656
-			if ( false !== strpos( $setting_name, 'disable_' ) ) {
656
+			if (false !== strpos($setting_name, 'disable_')) {
657 657
 
658
-				$give_settings[ $new_setting_name ] = ( give_is_setting_enabled( $give_settings[ $setting_name ] ) ? 'disabled' : 'enabled' );
659
-			} elseif ( false !== strpos( $setting_name, 'enable_' ) ) {
658
+				$give_settings[$new_setting_name] = (give_is_setting_enabled($give_settings[$setting_name]) ? 'disabled' : 'enabled');
659
+			} elseif (false !== strpos($setting_name, 'enable_')) {
660 660
 
661
-				$give_settings[ $new_setting_name ] = ( give_is_setting_enabled( $give_settings[ $setting_name ] ) ? 'enabled' : 'disabled' );
661
+				$give_settings[$new_setting_name] = (give_is_setting_enabled($give_settings[$setting_name]) ? 'enabled' : 'disabled');
662 662
 			}
663 663
 
664 664
 			// Tell bot to update core setting to db.
665
-			if ( ! $setting_changed ) {
665
+			if ( ! $setting_changed) {
666 666
 				$setting_changed = true;
667 667
 			}
668 668
 		}
669 669
 
670 670
 		// Update setting only if they changed.
671
-		if ( $setting_changed ) {
672
-			update_option( 'give_settings', $give_settings );
671
+		if ($setting_changed) {
672
+			update_option('give_settings', $give_settings);
673 673
 		}
674 674
 	}// End if().
675 675
 
676
-	give_set_upgrade_complete( 'v18_upgrades_core_setting' );
676
+	give_set_upgrade_complete('v18_upgrades_core_setting');
677 677
 }
678 678
 
679 679
 /**
@@ -683,22 +683,22 @@  discard block
 block discarded – undo
683 683
  * @return void
684 684
  */
685 685
 function give_v18_upgrades_form_metadata() {
686
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
687
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array(
686
+	if ( ! current_user_can('manage_give_settings')) {
687
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array(
688 688
 			'response' => 403,
689
-		) );
689
+		));
690 690
 	}
691 691
 
692
-	ignore_user_abort( true );
692
+	ignore_user_abort(true);
693 693
 
694
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
695
-		@set_time_limit( 0 );
694
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
695
+		@set_time_limit(0);
696 696
 	}
697 697
 
698
-	$step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1;
698
+	$step = isset($_GET['step']) ? absint($_GET['step']) : 1;
699 699
 
700 700
 	// form query
701
-	$forms = new WP_Query( array(
701
+	$forms = new WP_Query(array(
702 702
 			'paged'          => $step,
703 703
 			'status'         => 'any',
704 704
 			'order'          => 'ASC',
@@ -708,27 +708,27 @@  discard block
 block discarded – undo
708 708
 	);
709 709
 
710 710
 
711
-	if ( $forms->have_posts() ) {
712
-		while ( $forms->have_posts() ) {
711
+	if ($forms->have_posts()) {
712
+		while ($forms->have_posts()) {
713 713
 			$forms->the_post();
714 714
 
715 715
 			// Form content.
716 716
 			// Note in version 1.8 display content setting split into display content and content placement setting.
717 717
 			// You can delete _give_content_option in future
718
-			$show_content = get_post_meta( get_the_ID(), '_give_content_option', true );
719
-			if ( $show_content && ! get_post_meta( get_the_ID(), '_give_display_content', true ) ) {
720
-				$field_value = ( 'none' !== $show_content ? 'enabled' : 'disabled' );
721
-				update_post_meta( get_the_ID(), '_give_display_content', $field_value );
718
+			$show_content = get_post_meta(get_the_ID(), '_give_content_option', true);
719
+			if ($show_content && ! get_post_meta(get_the_ID(), '_give_display_content', true)) {
720
+				$field_value = ('none' !== $show_content ? 'enabled' : 'disabled');
721
+				update_post_meta(get_the_ID(), '_give_display_content', $field_value);
722 722
 
723
-				$field_value = ( 'none' !== $show_content ? $show_content : 'give_pre_form' );
724
-				update_post_meta( get_the_ID(), '_give_content_placement', $field_value );
723
+				$field_value = ('none' !== $show_content ? $show_content : 'give_pre_form');
724
+				update_post_meta(get_the_ID(), '_give_content_placement', $field_value);
725 725
 			}
726 726
             
727 727
 			// "Disable" Guest Donation. Checkbox
728 728
 			// See: https://github.com/WordImpress/Give/issues/1470
729
-			$guest_donation = get_post_meta( get_the_ID(), '_give_logged_in_only', true );
730
-			$guest_donation_newval = ( in_array( $guest_donation, array( 'yes', 'on' ) ) ? 'disabled' : 'enabled' );
731
-			update_post_meta( get_the_ID(), '_give_logged_in_only', $guest_donation_newval );
729
+			$guest_donation = get_post_meta(get_the_ID(), '_give_logged_in_only', true);
730
+			$guest_donation_newval = (in_array($guest_donation, array('yes', 'on')) ? 'disabled' : 'enabled');
731
+			update_post_meta(get_the_ID(), '_give_logged_in_only', $guest_donation_newval);
732 732
 
733 733
 			// Convert yes/no setting field to enabled/disabled.
734 734
 			$form_radio_settings = array(
@@ -751,15 +751,15 @@  discard block
 block discarded – undo
751 751
 				'_give_offline_donation_enable_billing_fields_single',
752 752
 			);
753 753
 
754
-			foreach ( $form_radio_settings as $meta_key ) {
754
+			foreach ($form_radio_settings as $meta_key) {
755 755
 				// Get value.
756
-				$field_value = get_post_meta( get_the_ID(), $meta_key, true );
756
+				$field_value = get_post_meta(get_the_ID(), $meta_key, true);
757 757
 
758 758
 				// Convert meta value only if it is in yes/no/none.
759
-				if ( in_array( $field_value, array( 'yes', 'on', 'no', 'none' ) ) ) {
759
+				if (in_array($field_value, array('yes', 'on', 'no', 'none'))) {
760 760
 
761
-					$field_value = ( in_array( $field_value, array( 'yes', 'on' ) ) ? 'enabled' : 'disabled' );
762
-					update_post_meta( get_the_ID(), $meta_key, $field_value );
761
+					$field_value = (in_array($field_value, array('yes', 'on')) ? 'enabled' : 'disabled');
762
+					update_post_meta(get_the_ID(), $meta_key, $field_value);
763 763
 				}
764 764
 			}
765 765
 		}// End while().
@@ -767,28 +767,28 @@  discard block
 block discarded – undo
767 767
 		wp_reset_postdata();
768 768
 
769 769
 		// Forms found so upgrade them
770
-		$step ++;
771
-		$redirect = add_query_arg( array(
770
+		$step++;
771
+		$redirect = add_query_arg(array(
772 772
 			'page'         => 'give-upgrades',
773 773
 			'give-upgrade' => 'give_v18_upgrades_form_metadata',
774 774
 			'step'         => $step,
775
-		), admin_url( 'index.php' ) );
776
-		wp_redirect( $redirect );
775
+		), admin_url('index.php'));
776
+		wp_redirect($redirect);
777 777
 		exit();
778 778
 
779 779
 	} else {
780 780
 		// No more forms found, finish up.
781
-		update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
782
-		delete_option( 'give_doing_upgrade' );
783
-		give_set_upgrade_complete( 'v18_upgrades_form_metadata' );
781
+		update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
782
+		delete_option('give_doing_upgrade');
783
+		give_set_upgrade_complete('v18_upgrades_form_metadata');
784 784
 
785 785
 
786
-		wp_redirect( admin_url() );
786
+		wp_redirect(admin_url());
787 787
 		exit;
788 788
 	}
789 789
 }
790 790
 
791
-add_action( 'give_give_v18_upgrades_form_metadata', 'give_v18_upgrades_form_metadata' );
791
+add_action('give_give_v18_upgrades_form_metadata', 'give_v18_upgrades_form_metadata');
792 792
 
793 793
 /**
794 794
  * Get list of core setting renamed in version 1.8.
Please login to merge, or discard this patch.
includes/admin/reporting/class-gateway-error-logs-list-table.php 1 patch
Spacing   +50 added lines, -50 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,11 +44,11 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function __construct() {
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.
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 50
 			'ajax'     => false                        // Does this table support ajax?.
51
-		) );
51
+		));
52 52
 	}
53 53
 
54 54
 	/**
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return string Column Name.
64 64
 	 */
65
-	public function column_default( $item, $column_name ) {
65
+	public function column_default($item, $column_name) {
66 66
 
67
-		switch ( $column_name ) {
67
+		switch ($column_name) {
68 68
 			case 'ID' :
69 69
 				return $item['ID_label'];
70 70
 			case 'payment_id' :
71
-				return empty( $item['payment_id'] ) ? esc_html__( 'n/a', 'give' ) : sprintf( "<a href=\"%s\" target=\"_blank\">{$item['payment_id']}</a>", get_edit_post_link( $item['payment_id'] ) );
71
+				return empty($item['payment_id']) ? esc_html__('n/a', 'give') : sprintf("<a href=\"%s\" target=\"_blank\">{$item['payment_id']}</a>", get_edit_post_link($item['payment_id']));
72 72
 			case 'gateway' :
73
-				return empty( $item['gateway'] ) ? esc_html__( 'n/a', 'give' ) : $item['gateway'];
73
+				return empty($item['gateway']) ? esc_html__('n/a', 'give') : $item['gateway'];
74 74
 			case 'error' :
75
-				return get_the_title( $item['ID'] ) ? get_the_title( $item['ID'] ) : esc_html__( 'Payment Error', 'give' );
75
+				return get_the_title($item['ID']) ? get_the_title($item['ID']) : esc_html__('Payment Error', 'give');
76 76
 			default:
77
-				return $item[ $column_name ];
77
+				return $item[$column_name];
78 78
 		}
79 79
 	}
80 80
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 *
89 89
 	 * @return void
90 90
 	 */
91
-	public function column_message( $item ) { ?>
92
-		<a href="#TB_inline?width=640&amp;inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox give-error-log-details-link button button-small" data-tooltip="<?php esc_attr_e( 'View Log Message', 'give' ); ?>"><span class="dashicons dashicons-visibility"></span></a>
91
+	public function column_message($item) { ?>
92
+		<a href="#TB_inline?width=640&amp;inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox give-error-log-details-link button button-small" data-tooltip="<?php esc_attr_e('View Log Message', 'give'); ?>"><span class="dashicons dashicons-visibility"></span></a>
93 93
 		<div id="log-message-<?php echo $item['ID']; ?>" style="display:none;">
94 94
 			<?php
95 95
 
96
-			$log_message = get_post_field( 'post_content', $item['ID'] );
96
+			$log_message = get_post_field('post_content', $item['ID']);
97 97
 
98
-			$serialized = strpos( $log_message, '{"' );
98
+			$serialized = strpos($log_message, '{"');
99 99
 
100 100
 			// Check to see if the log message contains serialized information
101
-			if ( $serialized !== false ) {
102
-				$length = strlen( $log_message ) - $serialized;
103
-				$intro  = substr( $log_message, 0, - $length );
104
-				$data   = substr( $log_message, $serialized, strlen( $log_message ) - 1 );
101
+			if ($serialized !== false) {
102
+				$length = strlen($log_message) - $serialized;
103
+				$intro  = substr($log_message, 0, - $length);
104
+				$data   = substr($log_message, $serialized, strlen($log_message) - 1);
105 105
 
106
-				echo wpautop( $intro );
107
-				echo wpautop( '<strong>' . esc_html__( 'Log data:', 'give' ) . '</strong>' );
108
-				echo '<div style="word-wrap: break-word;">' . wpautop( $data ) . '</div>';
106
+				echo wpautop($intro);
107
+				echo wpautop('<strong>'.esc_html__('Log data:', 'give').'</strong>');
108
+				echo '<div style="word-wrap: break-word;">'.wpautop($data).'</div>';
109 109
 			} else {
110 110
 				// No serialized data found
111
-				echo wpautop( $log_message );
111
+				echo wpautop($log_message);
112 112
 			}
113 113
 			?>
114 114
 		</div>
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 	 */
125 125
 	public function get_columns() {
126 126
 		$columns = array(
127
-			'ID'         => esc_html__( 'Log ID', 'give' ),
128
-			'error'      => esc_html__( 'Error', 'give' ),
129
-			'gateway'    => esc_html__( 'Gateway', 'give' ),
130
-			'payment_id' => esc_html__( 'Donation ID', 'give' ),
131
-			'date'       => esc_html__( 'Date', 'give' ),
132
-			'message'    => esc_html__( 'Details', 'give' )
127
+			'ID'         => esc_html__('Log ID', 'give'),
128
+			'error'      => esc_html__('Error', 'give'),
129
+			'gateway'    => esc_html__('Gateway', 'give'),
130
+			'payment_id' => esc_html__('Donation ID', 'give'),
131
+			'date'       => esc_html__('Date', 'give'),
132
+			'message'    => esc_html__('Details', 'give')
133 133
 		);
134 134
 
135 135
 		return $columns;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @return int Current page number
144 144
 	 */
145 145
 	public function get_paged() {
146
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
146
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
147 147
 	}
148 148
 
149 149
 	/**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 * @since  1.0
154 154
 	 * @return void
155 155
 	 */
156
-	public function bulk_actions( $which = '' ) {
156
+	public function bulk_actions($which = '') {
157 157
 		give_log_views();
158 158
 	}
159 159
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
 		// Prevent the queries from getting cached.
173 173
 		// Without this there are occasional memory issues for some installs.
174
-		wp_suspend_cache_addition( true );
174
+		wp_suspend_cache_addition(true);
175 175
 
176 176
 		$logs_data = array();
177 177
 		$paged     = $this->get_paged();
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
 			'paged'    => $paged
181 181
 		);
182 182
 
183
-		$logs = $give_logs->get_connected_logs( $log_query );
183
+		$logs = $give_logs->get_connected_logs($log_query);
184 184
 
185
-		if ( $logs ) {
186
-			foreach ( $logs as $log ) {
185
+		if ($logs) {
186
+			foreach ($logs as $log) {
187 187
 
188 188
 				$logs_data[] = array(
189 189
 					'ID'         => $log->ID,
190
-					'ID_label'   => '<span class=\'give-item-label give-item-label-gray\'>' . $log->ID . '</span>',
190
+					'ID_label'   => '<span class=\'give-item-label give-item-label-gray\'>'.$log->ID.'</span>',
191 191
 					'payment_id' => $log->post_parent,
192 192
 					'error'      => 'error',
193
-					'gateway'    => give_get_payment_gateway( $log->post_parent ),
193
+					'gateway'    => give_get_payment_gateway($log->post_parent),
194 194
 					'date'       => $log->post_date
195 195
 				);
196 196
 			}
@@ -212,19 +212,19 @@  discard block
 block discarded – undo
212 212
 	 *
213 213
 	 * @param string $which
214 214
 	 */
215
-	protected function display_tablenav( $which ) {
216
-		if ( 'top' === $which ) {
217
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
215
+	protected function display_tablenav($which) {
216
+		if ('top' === $which) {
217
+			wp_nonce_field('bulk-'.$this->_args['plural']);
218 218
 		}
219 219
 		?>
220
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
220
+		<div class="tablenav <?php echo esc_attr($which); ?>">
221 221
 
222 222
 			<div class="alignleft actions bulkactions">
223
-				<?php $this->bulk_actions( $which ); ?>
223
+				<?php $this->bulk_actions($which); ?>
224 224
 			</div>
225 225
 			<?php
226
-			$this->extra_tablenav( $which );
227
-			$this->pagination( $which );
226
+			$this->extra_tablenav($which);
227
+			$this->pagination($which);
228 228
 			?>
229 229
 
230 230
 			<br class="clear"/>
@@ -251,14 +251,14 @@  discard block
 block discarded – undo
251 251
 		$columns               = $this->get_columns();
252 252
 		$hidden                = array(); // No hidden columns
253 253
 		$sortable              = $this->get_sortable_columns();
254
-		$this->_column_headers = array( $columns, $hidden, $sortable );
254
+		$this->_column_headers = array($columns, $hidden, $sortable);
255 255
 		$this->items           = $this->get_logs();
256
-		$total_items           = $give_logs->get_log_count( 0, 'gateway_error' );
256
+		$total_items           = $give_logs->get_log_count(0, 'gateway_error');
257 257
 
258
-		$this->set_pagination_args( array(
258
+		$this->set_pagination_args(array(
259 259
 				'total_items' => $total_items,
260 260
 				'per_page'    => $this->per_page,
261
-				'total_pages' => ceil( $total_items / $this->per_page )
261
+				'total_pages' => ceil($total_items / $this->per_page)
262 262
 			)
263 263
 		);
264 264
 	}
Please login to merge, or discard this patch.
includes/scripts.php 1 patch
Spacing   +152 added lines, -152 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
 
@@ -25,25 +25,25 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_load_scripts() {
27 27
 
28
-	$js_dir         = GIVE_PLUGIN_URL . 'assets/js/frontend/';
29
-	$js_plugins     = GIVE_PLUGIN_URL . 'assets/js/plugins/';
30
-	$scripts_footer = ( give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ) ? true : false;
28
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
29
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
30
+	$scripts_footer = (give_is_setting_enabled(give_get_option('scripts_footer'))) ? true : false;
31 31
 
32 32
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
33
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
33
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
34 34
 
35 35
 	// Localize / PHP to AJAX vars.
36
-	$localize_give_vars = apply_filters( 'give_global_script_vars', array(
36
+	$localize_give_vars = apply_filters('give_global_script_vars', array(
37 37
 		'ajaxurl'             => give_get_ajax_url(),
38
-		'checkout_nonce'      => wp_create_nonce( 'give_checkout_nonce' ),
39
-		'currency_sign'       => give_currency_filter( '' ),
38
+		'checkout_nonce'      => wp_create_nonce('give_checkout_nonce'),
39
+		'currency_sign'       => give_currency_filter(''),
40 40
 		'currency_pos'        => give_get_currency_position(),
41 41
 		'thousands_separator' => give_get_price_thousand_separator(),
42 42
 		'decimal_separator'   => give_get_price_decimal_separator(),
43
-		'no_gateway'          => __( 'Please select a payment method.', 'give' ),
44
-		'bad_minimum'         => __( 'The minimum donation amount for this form is', 'give' ),
45
-		'general_loading'     => __( 'Loading...', 'give' ),
46
-		'purchase_loading'    => __( 'Please Wait...', 'give' ),
43
+		'no_gateway'          => __('Please select a payment method.', 'give'),
44
+		'bad_minimum'         => __('The minimum donation amount for this form is', 'give'),
45
+		'general_loading'     => __('Loading...', 'give'),
46
+		'purchase_loading'    => __('Please Wait...', 'give'),
47 47
 		'number_decimals'     => give_get_price_decimals(),
48 48
 		'give_version'        => GIVE_VERSION,
49 49
 		'magnific_options'    => apply_filters(
@@ -57,81 +57,81 @@  discard block
 block discarded – undo
57 57
 			'give_form_translation_js',
58 58
 			array(
59 59
 				// Field name               Validation message.
60
-				'payment-mode'           => __( 'Please select payment mode.', 'give' ),
61
-				'give_first'             => __( 'Please enter your first name.', 'give' ),
62
-				'give_email'             => __( 'Please enter a valid email address.', 'give' ),
63
-				'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
64
-				'give_user_pass'         => __( 'Enter a password.', 'give' ),
65
-				'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
66
-				'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
60
+				'payment-mode'           => __('Please select payment mode.', 'give'),
61
+				'give_first'             => __('Please enter your first name.', 'give'),
62
+				'give_email'             => __('Please enter a valid email address.', 'give'),
63
+				'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
64
+				'give_user_pass'         => __('Enter a password.', 'give'),
65
+				'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
66
+				'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
67 67
 			)
68 68
 		),
69
-	) );
69
+	));
70 70
 
71
-	$localize_give_ajax = apply_filters( 'give_global_ajax_vars', array(
71
+	$localize_give_ajax = apply_filters('give_global_ajax_vars', array(
72 72
 		'ajaxurl'         => give_get_ajax_url(),
73
-		'loading'         => __( 'Loading', 'give' ),
73
+		'loading'         => __('Loading', 'give'),
74 74
 		// General loading message.
75
-		'select_option'   => __( 'Please select an option', 'give' ),
75
+		'select_option'   => __('Please select an option', 'give'),
76 76
 		// Variable pricing error with multi-donation option enabled.
77
-		'default_gateway' => give_get_default_gateway( null ),
78
-		'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
77
+		'default_gateway' => give_get_default_gateway(null),
78
+		'permalinks'      => get_option('permalink_structure') ? '1' : '0',
79 79
 		'number_decimals' => give_get_price_decimals(),
80
-	) );
80
+	));
81 81
 
82 82
 	// DEBUG is On.
83
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
83
+	if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
84 84
 
85
-		if ( give_is_cc_verify_enabled() ) {
86
-			wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
87
-			wp_enqueue_script( 'give-cc-validator' );
85
+		if (give_is_cc_verify_enabled()) {
86
+			wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
87
+			wp_enqueue_script('give-cc-validator');
88 88
 		}
89 89
 
90
-		wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
91
-		wp_enqueue_script( 'give-float-labels' );
90
+		wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
91
+		wp_enqueue_script('give-float-labels');
92 92
 
93
-		wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
94
-		wp_enqueue_script( 'give-blockui' );
93
+		wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
94
+		wp_enqueue_script('give-blockui');
95 95
 
96
-		wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
97
-		wp_enqueue_script( 'give-qtip' );
96
+		wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
97
+		wp_enqueue_script('give-qtip');
98 98
 
99
-		wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
100
-		wp_enqueue_script( 'give-accounting' );
99
+		wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
100
+		wp_enqueue_script('give-accounting');
101 101
 
102
-		wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
103
-		wp_enqueue_script( 'give-magnific' );
102
+		wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
103
+		wp_enqueue_script('give-magnific');
104 104
 
105
-		wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
106
-		wp_enqueue_script( 'give-checkout-global' );
105
+		wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
106
+		wp_enqueue_script('give-checkout-global');
107 107
 
108 108
 		// General scripts.
109
-		wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
110
-		wp_enqueue_script( 'give-scripts' );
109
+		wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
110
+		wp_enqueue_script('give-scripts');
111 111
 
112 112
 		// Load AJAX scripts, if enabled.
113
-		wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
114
-		wp_enqueue_script( 'give-ajax' );
113
+		wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
114
+		wp_enqueue_script('give-ajax');
115 115
 
116 116
 		// Localize / Pass AJAX vars from PHP,
117
-		wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_vars );
118
-		wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax );
117
+		wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_vars);
118
+		wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax);
119 119
 
120 120
 	} else {
121 121
 
122 122
 		// DEBUG is OFF (one JS file to rule them all!).
123
-		wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
124
-		wp_enqueue_script( 'give' );
123
+		wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer);
124
+		wp_enqueue_script('give');
125 125
 
126 126
 		// Localize / Pass AJAX vars from PHP.
127
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
128
-		wp_localize_script( 'give', 'give_scripts', $localize_give_ajax );
127
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
128
+		wp_localize_script('give', 'give_scripts', $localize_give_ajax);
129 129
 
130 130
 	}
131 131
 
132 132
 }
133 133
 
134
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' );
134
+add_action('wp_enqueue_scripts', 'give_load_scripts');
135 135
 
136 136
 /**
137 137
  * Register styles.
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
  */
145 145
 function give_register_styles() {
146 146
 
147
-	if ( ! give_is_setting_enabled( give_get_option( 'css' ) ) ) {
147
+	if ( ! give_is_setting_enabled(give_get_option('css'))) {
148 148
 		return;
149 149
 	}
150 150
 
151
-	wp_register_style( 'give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
152
-	wp_enqueue_style( 'give-styles' );
151
+	wp_register_style('give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all');
152
+	wp_enqueue_style('give-styles');
153 153
 
154 154
 }
155 155
 
156
-add_action( 'wp_enqueue_scripts', 'give_register_styles' );
156
+add_action('wp_enqueue_scripts', 'give_register_styles');
157 157
 
158 158
 
159 159
 /**
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 function give_get_stylesheet_uri() {
167 167
 
168 168
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
169
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
169
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
170 170
 
171 171
 	// LTR or RTL files.
172
-	$direction = ( is_rtl() ) ? '-rtl' : '';
172
+	$direction = (is_rtl()) ? '-rtl' : '';
173 173
 
174
-	$file          = 'give' . $direction . $suffix . '.css';
174
+	$file          = 'give'.$direction.$suffix.'.css';
175 175
 	$templates_dir = give_get_theme_template_dir_name();
176 176
 
177
-	$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
178
-	$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $direction . '.css';
179
-	$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
180
-	$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $direction . '.css';
181
-	$give_plugin_style_sheet    = trailingslashit( give_get_templates_dir() ) . $file;
177
+	$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
178
+	$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$direction.'.css';
179
+	$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
180
+	$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$direction.'.css';
181
+	$give_plugin_style_sheet    = trailingslashit(give_get_templates_dir()).$file;
182 182
 
183 183
 	$uri = false;
184 184
 
@@ -188,23 +188,23 @@  discard block
 block discarded – undo
188 188
 	 * followed by non minified version, even if SCRIPT_DEBUG is not enabled.
189 189
 	 * This allows users to copy just give.css to their theme.
190 190
 	 */
191
-	if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
192
-		if ( ! empty( $nonmin ) ) {
193
-			$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $direction . '.css';
191
+	if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
192
+		if ( ! empty($nonmin)) {
193
+			$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$direction.'.css';
194 194
 		} else {
195
-			$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
195
+			$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
196 196
 		}
197
-	} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
198
-		if ( ! empty( $nonmin ) ) {
199
-			$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $direction . '.css';
197
+	} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
198
+		if ( ! empty($nonmin)) {
199
+			$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$direction.'.css';
200 200
 		} else {
201
-			$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
201
+			$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
202 202
 		}
203
-	} elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) {
204
-		$uri = trailingslashit( give_get_templates_url() ) . $file;
203
+	} elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
204
+		$uri = trailingslashit(give_get_templates_url()).$file;
205 205
 	}
206 206
 
207
-	return apply_filters( 'give_get_stylesheet_uri', $uri );
207
+	return apply_filters('give_get_stylesheet_uri', $uri);
208 208
 
209 209
 }
210 210
 
@@ -221,73 +221,73 @@  discard block
 block discarded – undo
221 221
  *
222 222
  * @return void
223 223
  */
224
-function give_load_admin_scripts( $hook ) {
224
+function give_load_admin_scripts($hook) {
225 225
 
226 226
 	global $post, $post_type;
227 227
 
228 228
 	$give_options = give_get_settings();
229 229
 
230 230
 	// Directories of assets.
231
-	$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
232
-	$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
233
-	$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
231
+	$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
232
+	$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
233
+	$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
234 234
 
235 235
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
236
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
236
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
237 237
 
238 238
 	// LTR or RTL files.
239
-	$direction = ( is_rtl() ) ? '-rtl' : '';
239
+	$direction = (is_rtl()) ? '-rtl' : '';
240 240
 
241 241
 	// Global Admin.
242
-	wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' );
243
-	wp_enqueue_style( 'give-admin-bar-notification' );
242
+	wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css');
243
+	wp_enqueue_style('give-admin-bar-notification');
244 244
 
245 245
 	// Give Admin Only.
246
-	if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
246
+	if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
247 247
 		return;
248 248
 	}
249 249
 
250 250
 	// CSS.
251
-	wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' );
252
-	wp_enqueue_style( 'jquery-ui-css' );
253
-	wp_register_style( 'give-admin', $css_dir . 'give-admin' . $direction . $suffix . '.css', array(), GIVE_VERSION );
254
-	wp_enqueue_style( 'give-admin' );
255
-	wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION );
256
-	wp_enqueue_style( 'jquery-chosen' );
257
-	wp_enqueue_style( 'thickbox' );
251
+	wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css');
252
+	wp_enqueue_style('jquery-ui-css');
253
+	wp_register_style('give-admin', $css_dir.'give-admin'.$direction.$suffix.'.css', array(), GIVE_VERSION);
254
+	wp_enqueue_style('give-admin');
255
+	wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION);
256
+	wp_enqueue_style('jquery-chosen');
257
+	wp_enqueue_style('thickbox');
258 258
 
259 259
 	// JS.
260
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
261
-	wp_enqueue_script( 'jquery-chosen' );
260
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
261
+	wp_enqueue_script('jquery-chosen');
262 262
 
263
-	wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
264
-	wp_enqueue_script( 'give-accounting' );
263
+	wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
264
+	wp_enqueue_script('give-accounting');
265 265
 
266
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
267
-	wp_enqueue_script( 'give-admin-scripts' );
266
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
267
+	wp_enqueue_script('give-admin-scripts');
268 268
 
269
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
270
-	wp_enqueue_script( 'jquery-flot' );
269
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
270
+	wp_enqueue_script('jquery-flot');
271 271
 
272
-	wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
273
-	wp_enqueue_script( 'give-qtip' );
272
+	wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
273
+	wp_enqueue_script('give-qtip');
274 274
 
275
-	wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
276
-	wp_enqueue_script( 'give-repeatable-fields' );
275
+	wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
276
+	wp_enqueue_script('give-repeatable-fields');
277 277
 
278
-	wp_enqueue_script( 'jquery-ui-datepicker' );
279
-	wp_enqueue_script( 'thickbox' );
278
+	wp_enqueue_script('jquery-ui-datepicker');
279
+	wp_enqueue_script('thickbox');
280 280
 
281 281
 	// Forms CPT Script.
282
-	if ( $post_type === 'give_forms' ) {
283
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
284
-		wp_enqueue_script( 'give-admin-forms-scripts' );
282
+	if ($post_type === 'give_forms') {
283
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
284
+		wp_enqueue_script('give-admin-forms-scripts');
285 285
 	}
286 286
 
287 287
 	// Settings Scripts.
288
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) {
289
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
290
-		wp_enqueue_script( 'give-admin-settings-scripts' );
288
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
289
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
290
+		wp_enqueue_script('give-admin-settings-scripts');
291 291
 	}
292 292
 
293 293
 	// Price Separators.
@@ -295,60 +295,60 @@  discard block
 block discarded – undo
295 295
 	$decimal_separator  = give_get_price_decimal_separator();
296 296
 
297 297
 	// Localize strings & variables for JS.
298
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
299
-		'post_id'                        => isset( $post->ID ) ? $post->ID : null,
298
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
299
+		'post_id'                        => isset($post->ID) ? $post->ID : null,
300 300
 		'give_version'                   => GIVE_VERSION,
301 301
 		'thousands_separator'            => $thousand_separator,
302 302
 		'decimal_separator'              => $decimal_separator,
303
-		'quick_edit_warning'             => __( 'Not available for variable priced forms.', 'give' ),
304
-		'delete_payment'                 => __( 'Are you sure you wish to delete this payment?', 'give' ),
305
-		'delete_payment_note'            => __( 'Are you sure you wish to delete this note?', 'give' ),
306
-		'revoke_api_key'                 => __( 'Are you sure you wish to revoke this API key?', 'give' ),
307
-		'regenerate_api_key'             => __( 'Are you sure you wish to regenerate this API key?', 'give' ),
308
-		'resend_receipt'                 => __( 'Are you sure you wish to resend the donation receipt?', 'give' ),
309
-		'logo'                           => __( 'Logo', 'give' ),
310
-		'use_this_image'                 => __( 'Use this image', 'give' ),
311
-		'one_option'                     => __( 'Choose a form', 'give' ),
312
-		'one_or_more_option'             => __( 'Choose one or more forms', 'give' ),
313
-		'currency_sign'                  => give_currency_filter( '' ),
314
-		'currency_pos'                   => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
315
-		'currency_decimals'              => give_currency_decimal_filter( give_get_price_decimals() ),
316
-		'batch_export_no_class'          => __( 'You must choose a method.', 'give' ),
317
-		'batch_export_no_reqs'           => __( 'Required fields not completed.', 'give' ),
318
-		'reset_stats_warn'               => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
319
-		'price_format_guide'             => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
303
+		'quick_edit_warning'             => __('Not available for variable priced forms.', 'give'),
304
+		'delete_payment'                 => __('Are you sure you wish to delete this payment?', 'give'),
305
+		'delete_payment_note'            => __('Are you sure you wish to delete this note?', 'give'),
306
+		'revoke_api_key'                 => __('Are you sure you wish to revoke this API key?', 'give'),
307
+		'regenerate_api_key'             => __('Are you sure you wish to regenerate this API key?', 'give'),
308
+		'resend_receipt'                 => __('Are you sure you wish to resend the donation receipt?', 'give'),
309
+		'logo'                           => __('Logo', 'give'),
310
+		'use_this_image'                 => __('Use this image', 'give'),
311
+		'one_option'                     => __('Choose a form', 'give'),
312
+		'one_or_more_option'             => __('Choose one or more forms', 'give'),
313
+		'currency_sign'                  => give_currency_filter(''),
314
+		'currency_pos'                   => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
315
+		'currency_decimals'              => give_currency_decimal_filter(give_get_price_decimals()),
316
+		'batch_export_no_class'          => __('You must choose a method.', 'give'),
317
+		'batch_export_no_reqs'           => __('Required fields not completed.', 'give'),
318
+		'reset_stats_warn'               => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
319
+		'price_format_guide'             => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
320 320
 		/* translators : %s: Donation form options metabox */
321
-		'confirm_before_remove_row_text' => __( 'Do you want to delete this level?', 'give' ),
322
-		'matched_success_failure_page'   => __( 'You cannot set the success and failed pages to the same page', 'give' ),
323
-		'dismiss_notice_text'            => __( 'Dismiss this notice.', 'give' ),
321
+		'confirm_before_remove_row_text' => __('Do you want to delete this level?', 'give'),
322
+		'matched_success_failure_page'   => __('You cannot set the success and failed pages to the same page', 'give'),
323
+		'dismiss_notice_text'            => __('Dismiss this notice.', 'give'),
324 324
 		'bulk_action' => array(
325 325
 			'delete'         => array(
326
-				'zero_payment_selected' => __( 'You must choose at least one or more payments to delete.', 'give' ),
327
-				'delete_payment'        => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
328
-				'delete_payments'       => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
326
+				'zero_payment_selected' => __('You must choose at least one or more payments to delete.', 'give'),
327
+				'delete_payment'        => __('Are you sure you want to permanently delete this donation?', 'give'),
328
+				'delete_payments'       => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
329 329
 			),
330 330
 			'resend_receipt' => array(
331
-				'zero_recipient_selected' => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
332
-				'resend_receipt'          => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
333
-				'resend_receipts'         => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
331
+				'zero_recipient_selected' => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
332
+				'resend_receipt'          => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
333
+				'resend_receipts'         => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
334 334
 			),
335 335
 		),
336
-		'upgrade_confirmation' => __( 'Please make sure to create a database backup before initiating the upgrade.', 'give' ),
336
+		'upgrade_confirmation' => __('Please make sure to create a database backup before initiating the upgrade.', 'give'),
337 337
 		'metabox_fields' => array(
338 338
 			'media' => array(
339
-				'button_title' => esc_html__( 'Choose Attachment', 'give' ),
339
+				'button_title' => esc_html__('Choose Attachment', 'give'),
340 340
 			)
341 341
 		)
342
-	) );
342
+	));
343 343
 
344
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
344
+	if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) {
345 345
 		// call for new media manager.
346 346
 		wp_enqueue_media();
347 347
 	}
348 348
 
349 349
 }
350 350
 
351
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
351
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
352 352
 
353 353
 /**
354 354
  * Admin Give Icon
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 	?>
364 364
     <style type="text/css" media="screen">
365 365
 
366
-        <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?>
366
+        <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?>
367 367
         @font-face {
368 368
             font-family: 'give-icomoon';
369
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?ngjl88'; ?>');
370
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
371
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
372
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
369
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?ngjl88'; ?>');
370
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
371
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
372
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
373 373
             font-weight: normal;
374 374
             font-style: normal;
375 375
         }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	<?php
389 389
 }
390 390
 
391
-add_action( 'admin_head', 'give_admin_icon' );
391
+add_action('admin_head', 'give_admin_icon');
392 392
 
393 393
 /**
394 394
  * Admin js code
@@ -418,4 +418,4 @@  discard block
 block discarded – undo
418 418
 	<?php
419 419
 }
420 420
 
421
-add_action( 'admin_head', 'give_admin_hide_notice_shortly_js' );
421
+add_action('admin_head', 'give_admin_hide_notice_shortly_js');
Please login to merge, or discard this patch.
includes/class-give-email-access.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
 	 * @since  1.0
233 233
 	 * @access public
234 234
 	 *
235
-	 * @return bool
235
+	 * @return null|boolean
236 236
 	 */
237 237
 	public function check_for_token() {
238 238
 
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	public function __construct() {
97 97
 
98 98
 		// get it started
99
-		add_action( 'init', array( $this, 'init' ) );
99
+		add_action('init', array($this, 'init'));
100 100
 	}
101 101
 
102 102
 	/**
@@ -120,29 +120,29 @@  discard block
 block discarded – undo
120 120
 		 */
121 121
 		if (
122 122
 			is_user_logged_in()
123
-			|| ! give_is_setting_enabled( give_get_option( 'email_access' ) )
123
+			|| ! give_is_setting_enabled(give_get_option('email_access'))
124 124
 			|| is_admin()
125 125
 		) {
126 126
 			return;
127 127
 		}
128 128
 
129 129
 		// Are db columns setup?
130
-		$is_setup = give_get_option( 'email_access_installed' );
131
-		if ( empty( $is_setup ) ) {
130
+		$is_setup = give_get_option('email_access_installed');
131
+		if (empty($is_setup)) {
132 132
 			$this->create_columns();
133 133
 		}
134 134
 
135 135
 		// Timeouts.
136
-		$this->verify_throttle  = apply_filters( 'give_nl_verify_throttle', 300 );
137
-		$this->token_expiration = apply_filters( 'give_nl_token_expiration', 7200 );
136
+		$this->verify_throttle  = apply_filters('give_nl_verify_throttle', 300);
137
+		$this->token_expiration = apply_filters('give_nl_token_expiration', 7200);
138 138
 
139 139
 		// Setup login.
140 140
 		$this->check_for_token();
141 141
 
142
-		if ( $this->token_exists ) {
143
-			add_filter( 'give_can_view_receipt', '__return_true' );
144
-			add_filter( 'give_user_pending_verification', '__return_false' );
145
-			add_filter( 'give_get_users_donations_args', array( $this, 'users_donations_args' ) );
142
+		if ($this->token_exists) {
143
+			add_filter('give_can_view_receipt', '__return_true');
144
+			add_filter('give_user_pending_verification', '__return_false');
145
+			add_filter('give_get_users_donations_args', array($this, 'users_donations_args'));
146 146
 		}
147 147
 
148 148
 	}
@@ -157,25 +157,25 @@  discard block
 block discarded – undo
157 157
 	 *
158 158
 	 * @return bool
159 159
 	 */
160
-	public function can_send_email( $customer_id ) {
160
+	public function can_send_email($customer_id) {
161 161
 		/* @var WPDB $wpdb */
162 162
 		global $wpdb;
163 163
 
164 164
 		// Prevent multiple emails within X minutes
165
-		$throttle = date( 'Y-m-d H:i:s', time() - $this->verify_throttle );
165
+		$throttle = date('Y-m-d H:i:s', time() - $this->verify_throttle);
166 166
 
167 167
 		// Does a user row exist?
168 168
 		$exists = (int) $wpdb->get_var(
169
-			$wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}give_customers WHERE id = %d", $customer_id )
169
+			$wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}give_customers WHERE id = %d", $customer_id)
170 170
 		);
171 171
 
172
-		if ( 0 < $exists ) {
172
+		if (0 < $exists) {
173 173
 			$row_id = (int) $wpdb->get_var(
174
-				$wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d AND (verify_throttle < %s OR verify_key = '') LIMIT 1", $customer_id, $throttle )
174
+				$wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d AND (verify_throttle < %s OR verify_key = '') LIMIT 1", $customer_id, $throttle)
175 175
 			);
176 176
 
177
-			if ( $row_id < 1 ) {
178
-				give_set_error( 'give_email_access_attempts_exhausted', __( 'Please wait a few minutes before requesting a new email access link.', 'give' ) );
177
+			if ($row_id < 1) {
178
+				give_set_error('give_email_access_attempts_exhausted', __('Please wait a few minutes before requesting a new email access link.', 'give'));
179 179
 
180 180
 				return false;
181 181
 			}
@@ -195,34 +195,34 @@  discard block
 block discarded – undo
195 195
 	 *
196 196
 	 * @return void
197 197
 	 */
198
-	public function send_email( $customer_id, $email ) {
198
+	public function send_email($customer_id, $email) {
199 199
 
200
-		$verify_key = wp_generate_password( 20, false );
200
+		$verify_key = wp_generate_password(20, false);
201 201
 
202 202
 		// Generate a new verify key
203
-		$this->set_verify_key( $customer_id, $email, $verify_key );
203
+		$this->set_verify_key($customer_id, $email, $verify_key);
204 204
 
205 205
 		// Get the donation history page
206
-		$page_id = give_get_option( 'history_page' );
206
+		$page_id = give_get_option('history_page');
207 207
 
208
-		$access_url = add_query_arg( array(
208
+		$access_url = add_query_arg(array(
209 209
 			'give_nl' => $verify_key,
210
-		), get_permalink( $page_id ) );
210
+		), get_permalink($page_id));
211 211
 
212 212
 		// Nice subject and message.
213
-		$subject = apply_filters( 'give_email_access_token_subject', sprintf( __( 'Your Access Link to %s', 'give' ), get_bloginfo( 'name' ) ) );
213
+		$subject = apply_filters('give_email_access_token_subject', sprintf(__('Your Access Link to %s', 'give'), get_bloginfo('name')));
214 214
 
215
-		$message = __( 'You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give' ) . "\n\n";
216
-		$message .= '<a href="' . esc_url( $access_url ) . '" target="_blank">' . __( 'Access Donation Details &raquo;', 'give' ) . '</a>' . "\n\n";
215
+		$message = __('You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give')."\n\n";
216
+		$message .= '<a href="'.esc_url($access_url).'" target="_blank">'.__('Access Donation Details &raquo;', 'give').'</a>'."\n\n";
217 217
 		$message .= "\n\n";
218
-		$message .= __( 'Sincerely,', 'give' ) . "\n";
219
-		$message .= get_bloginfo( 'name' ) . "\n";
218
+		$message .= __('Sincerely,', 'give')."\n";
219
+		$message .= get_bloginfo('name')."\n";
220 220
 
221
-		$message = apply_filters( 'give_email_access_token_message', $message );
221
+		$message = apply_filters('give_email_access_token_message', $message);
222 222
 
223 223
 		// Send the email.
224
-		Give()->emails->__set( 'heading', apply_filters( 'give_email_access_token_heading', __( 'Your Access Link', 'give' ) ) );
225
-		Give()->emails->send( $email, $subject, $message );
224
+		Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', __('Your Access Link', 'give')));
225
+		Give()->emails->send($email, $subject, $message);
226 226
 
227 227
 	}
228 228
 
@@ -236,26 +236,26 @@  discard block
 block discarded – undo
236 236
 	 */
237 237
 	public function check_for_token() {
238 238
 
239
-		$token = isset( $_GET['give_nl'] ) ? $_GET['give_nl'] : '';
239
+		$token = isset($_GET['give_nl']) ? $_GET['give_nl'] : '';
240 240
 
241 241
 		// Check for cookie.
242
-		if ( empty( $token ) ) {
243
-			$token = isset( $_COOKIE['give_nl'] ) ? $_COOKIE['give_nl'] : '';
242
+		if (empty($token)) {
243
+			$token = isset($_COOKIE['give_nl']) ? $_COOKIE['give_nl'] : '';
244 244
 		}
245 245
 
246 246
 		// Must have a token.
247
-		if ( ! empty( $token ) ) {
247
+		if ( ! empty($token)) {
248 248
 
249
-			if ( ! $this->is_valid_token( $token ) ) {
250
-				if ( ! $this->is_valid_verify_key( $token ) ) {
249
+			if ( ! $this->is_valid_token($token)) {
250
+				if ( ! $this->is_valid_verify_key($token)) {
251 251
 					return;
252 252
 				}
253 253
 			}
254 254
 
255 255
 			$this->token_exists = true;
256 256
 			// Set cookie.
257
-			$lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time();
258
-			@setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
257
+			$lifetime = current_time('timestamp') + Give()->session->set_expiration_time();
258
+			@setcookie('give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
259 259
 
260 260
 			return true;
261 261
 		}
@@ -271,26 +271,26 @@  discard block
 block discarded – undo
271 271
 	 *
272 272
 	 * @return bool
273 273
 	 */
274
-	public function is_valid_token( $token ) {
274
+	public function is_valid_token($token) {
275 275
 
276 276
 		global $wpdb;
277 277
 
278 278
 		// Make sure token isn't expired.
279
-		$expires = date( 'Y-m-d H:i:s', time() - $this->token_expiration );
279
+		$expires = date('Y-m-d H:i:s', time() - $this->token_expiration);
280 280
 
281 281
 		$email = $wpdb->get_var(
282
-			$wpdb->prepare( "SELECT email FROM {$wpdb->prefix}give_customers WHERE token = %s AND verify_throttle >= %s LIMIT 1", $token, $expires )
282
+			$wpdb->prepare("SELECT email FROM {$wpdb->prefix}give_customers WHERE token = %s AND verify_throttle >= %s LIMIT 1", $token, $expires)
283 283
 		);
284 284
 
285
-		if ( ! empty( $email ) ) {
285
+		if ( ! empty($email)) {
286 286
 			$this->token_email = $email;
287 287
 			$this->token       = $token;
288 288
 			return true;
289 289
 		}
290 290
 
291 291
 		// Set error only if email access form isn't being submitted
292
-		if ( ! isset( $_POST['give_email'] ) && ! isset( $_POST['_wpnonce'] ) ) {
293
-			give_set_error( 'give_email_token_expired', apply_filters( 'give_email_token_expired_message', __( 'Your access token has expired. Please request a new one below:', 'give' ) ) );
292
+		if ( ! isset($_POST['give_email']) && ! isset($_POST['_wpnonce'])) {
293
+			give_set_error('give_email_token_expired', apply_filters('give_email_token_expired_message', __('Your access token has expired. Please request a new one below:', 'give')));
294 294
 		}
295 295
 
296 296
 		return false;
@@ -309,25 +309,25 @@  discard block
 block discarded – undo
309 309
 	 *
310 310
 	 * @return void
311 311
 	 */
312
-	public function set_verify_key( $customer_id, $email, $verify_key ) {
312
+	public function set_verify_key($customer_id, $email, $verify_key) {
313 313
 		global $wpdb;
314 314
 
315
-		$now = date( 'Y-m-d H:i:s' );
315
+		$now = date('Y-m-d H:i:s');
316 316
 
317 317
 		// Insert or update?
318 318
 		$row_id = (int) $wpdb->get_var(
319
-			$wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id )
319
+			$wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id)
320 320
 		);
321 321
 
322 322
 		// Update.
323
-		if ( ! empty( $row_id ) ) {
323
+		if ( ! empty($row_id)) {
324 324
 			$wpdb->query(
325
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id )
325
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id)
326 326
 			);
327 327
 		} // Insert.
328 328
 		else {
329 329
 			$wpdb->query(
330
-				$wpdb->prepare( "INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now )
330
+				$wpdb->prepare("INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now)
331 331
 			);
332 332
 		}
333 333
 	}
@@ -342,21 +342,21 @@  discard block
 block discarded – undo
342 342
 	 *
343 343
 	 * @return bool
344 344
 	 */
345
-	public function is_valid_verify_key( $token ) {
345
+	public function is_valid_verify_key($token) {
346 346
 		/* @var WPDB $wpdb */
347 347
 		global $wpdb;
348 348
 
349 349
 		// See if the verify_key exists.
350 350
 		$row = $wpdb->get_row(
351
-			$wpdb->prepare( "SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token )
351
+			$wpdb->prepare("SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token)
352 352
 		);
353 353
 
354
-		$now = date( 'Y-m-d H:i:s' );
354
+		$now = date('Y-m-d H:i:s');
355 355
 
356 356
 		// Set token and remove verify key.
357
-		if ( ! empty( $row ) ) {
357
+		if ( ! empty($row)) {
358 358
 			$wpdb->query(
359
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id )
359
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id)
360 360
 			);
361 361
 
362 362
 			$this->token_email = $row->email;
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	 *
381 381
 	 * @return mixed
382 382
 	 */
383
-	public function users_donations_args( $args ) {
383
+	public function users_donations_args($args) {
384 384
 		$args['user'] = $this->token_email;
385 385
 
386 386
 		return $args;
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 		global $wpdb;
402 402
 
403 403
 		// Create columns in customers table
404
-		$query = $wpdb->query( "ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`" );
404
+		$query = $wpdb->query("ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`");
405 405
 
406 406
 		// Columns added properly
407
-		if ( $query ) {
408
-			give_update_option( 'email_access_installed', 1 );
407
+		if ($query) {
408
+			give_update_option('email_access_installed', 1);
409 409
 		}
410 410
 
411 411
 	}
Please login to merge, or discard this patch.