Completed
Pull Request — master (#1665)
by Ravinder
17:48
created
includes/admin/payments/view-order-details.php 1 patch
Spacing   +140 added lines, -140 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
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
  * @since 1.0
21 21
  * @return void
22 22
  */
23
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
24
-	wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
23
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
24
+	wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
25 25
 }
26 26
 
27 27
 // Setup the variables
28
-$payment_id = absint( $_GET['id'] );
29
-$payment    = new Give_Payment( $payment_id );
28
+$payment_id = absint($_GET['id']);
29
+$payment    = new Give_Payment($payment_id);
30 30
 
31 31
 // Sanity check... fail if donation ID is invalid
32 32
 $payment_exists = $payment->ID;
33
-if ( empty( $payment_exists ) ) {
34
-	wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
33
+if (empty($payment_exists)) {
34
+	wp_die(esc_html__('The specified ID does not belong to a donation. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
35 35
 }
36 36
 
37 37
 $number         = $payment->number;
38 38
 $payment_meta   = $payment->get_meta();
39
-$transaction_id = esc_attr( $payment->transaction_id );
39
+$transaction_id = esc_attr($payment->transaction_id);
40 40
 $user_id        = $payment->user_id;
41 41
 $customer_id    = $payment->customer_id;
42
-$payment_date   = strtotime( $payment->date );
43
-$user_info      = give_get_payment_meta_user_info( $payment_id );
42
+$payment_date   = strtotime($payment->date);
43
+$user_info      = give_get_payment_meta_user_info($payment_id);
44 44
 $address        = $payment->address;
45 45
 $currency_code  = $payment->currency;
46 46
 $gateway        = $payment->gateway;
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 	<h1 id="transaction-details-heading"><?php
53 53
 		printf(
54 54
 			/* translators: %s: donation number */
55
-			esc_html__( 'Donation %s', 'give' ),
55
+			esc_html__('Donation %s', 'give'),
56 56
 			$number
57 57
 		);
58
-		if ( $payment_mode == 'test' ) {
59
-			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>';
58
+		if ($payment_mode == 'test') {
59
+			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Donation', 'give').'</span>';
60 60
 		}
61 61
 		?></h1>
62 62
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @param int $payment_id Payment id.
70 70
 	 */
71
-	do_action( 'give_view_order_details_before', $payment_id );
71
+	do_action('give_view_order_details_before', $payment_id);
72 72
 	?>
73 73
 	<form id="give-edit-order-form" method="post">
74 74
 		<?php
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		 *
80 80
 		 * @param int $payment_id Payment id.
81 81
 		 */
82
-		do_action( 'give_view_order_details_form_top', $payment_id );
82
+		do_action('give_view_order_details_form_top', $payment_id);
83 83
 		?>
84 84
 		<div id="poststuff">
85 85
 			<div id="give-dashboard-widgets-wrap">
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 							 *
96 96
 							 * @param int $payment_id Payment id.
97 97
 							 */
98
-							do_action( 'give_view_order_details_sidebar_before', $payment_id );
98
+							do_action('give_view_order_details_sidebar_before', $payment_id);
99 99
 							?>
100 100
 
101 101
 							<div id="give-order-update" class="postbox give-order-data">
102 102
 
103
-								<h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3>
103
+								<h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3>
104 104
 
105 105
 								<div class="inside">
106 106
 									<div class="give-admin-box">
@@ -113,33 +113,33 @@  discard block
 block discarded – undo
113 113
 										 *
114 114
 										 * @param int $payment_id Payment id.
115 115
 										 */
116
-										do_action( 'give_view_order_details_totals_before', $payment_id );
116
+										do_action('give_view_order_details_totals_before', $payment_id);
117 117
 										?>
118 118
 
119 119
 										<div class="give-admin-box-inside">
120 120
 											<p>
121
-												<label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label>&nbsp;
121
+												<label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label>&nbsp;
122 122
 												<select id="give-payment-status" name="give-payment-status" class="medium-text">
123
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
124
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
123
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
124
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
125 125
 													<?php endforeach; ?>
126 126
 												</select>
127
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
127
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
128 128
 											</p>
129 129
 										</div>
130 130
 
131 131
 										<div class="give-admin-box-inside">
132 132
 											<p>
133
-												<label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label>&nbsp;
134
-												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
133
+												<label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label>&nbsp;
134
+												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/>
135 135
 											</p>
136 136
 										</div>
137 137
 
138 138
 										<div class="give-admin-box-inside">
139 139
 											<p>
140
-												<label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label>&nbsp;
141
-												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
142
-												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
140
+												<label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label>&nbsp;
141
+												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
142
+												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
143 143
 											</p>
144 144
 										</div>
145 145
 
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
 										 *
154 154
 										 * @param int $payment_id Payment id.
155 155
 										 */
156
-										do_action( 'give_view_order_details_update_inner', $payment_id );
156
+										do_action('give_view_order_details_update_inner', $payment_id);
157 157
 
158 158
 										// @TODO: Fees
159
-										$fees = give_get_payment_fees( $payment_id );
160
-										if ( ! empty( $fees ) ) : ?>
159
+										$fees = give_get_payment_fees($payment_id);
160
+										if ( ! empty($fees)) : ?>
161 161
 											<div class="give-order-fees give-admin-box-inside">
162
-												<p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p>
162
+												<p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p>
163 163
 												<ul class="give-payment-fees">
164
-													<?php foreach ( $fees as $fee ) : ?>
164
+													<?php foreach ($fees as $fee) : ?>
165 165
 														<li>
166 166
 															<span class="fee-label"><?php echo $fee['label']; ?>:</span>
167
-															<span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span>
167
+															<span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span>
168 168
 														</li>
169 169
 													<?php endforeach; ?>
170 170
 												</ul>
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 
174 174
 										<div class="give-order-payment give-admin-box-inside">
175 175
 											<p>
176
-												<label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label>&nbsp;
177
-												<?php echo give_currency_symbol( $payment->currency ); ?>
178
-												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/>
176
+												<label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label>&nbsp;
177
+												<?php echo give_currency_symbol($payment->currency); ?>
178
+												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/>
179 179
 											</p>
180 180
 										</div>
181 181
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 										 *
188 188
 										 * @param int $payment_id Payment id.
189 189
 										 */
190
-										do_action( 'give_view_order_details_totals_after', $payment_id );
190
+										do_action('give_view_order_details_totals_after', $payment_id);
191 191
 										?>
192 192
 
193 193
 									</div>
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
 									 *
206 206
 									 * @param int $payment_id Payment id.
207 207
 									 */
208
-									do_action( 'give_view_order_details_update_before', $payment_id );
208
+									do_action('give_view_order_details_update_before', $payment_id);
209 209
 									?>
210 210
 
211 211
 									<div id="major-publishing-actions">
212 212
 										<div id="publishing-action">
213
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/>
214
-											<?php if ( give_is_payment_complete( $payment_id ) ) : ?>
215
-												<a href="<?php echo esc_url( add_query_arg( array(
213
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/>
214
+											<?php if (give_is_payment_complete($payment_id)) : ?>
215
+												<a href="<?php echo esc_url(add_query_arg(array(
216 216
 													'give-action' => 'email_links',
217 217
 													'purchase_id' => $payment_id,
218
-												) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>
218
+												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a>
219 219
 											<?php endif; ?>
220 220
 										</div>
221 221
 										<div class="clear"></div>
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 									 *
230 230
 									 * @param int $payment_id Payment id.
231 231
 									 */
232
-									do_action( 'give_view_order_details_update_after', $payment_id );
232
+									do_action('give_view_order_details_update_after', $payment_id);
233 233
 									?>
234 234
 
235 235
 								</div>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 							<div id="give-order-details" class="postbox give-order-data">
242 242
 
243
-								<h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3>
243
+								<h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3>
244 244
 
245 245
 								<div class="inside">
246 246
 									<div class="give-admin-box">
@@ -253,44 +253,44 @@  discard block
 block discarded – undo
253 253
 										 *
254 254
 										 * @param int $payment_id Payment id.
255 255
 										 */
256
-										do_action( 'give_view_order_details_payment_meta_before', $payment_id );
256
+										do_action('give_view_order_details_payment_meta_before', $payment_id);
257 257
 
258
-										$gateway = give_get_payment_gateway( $payment_id );
259
-										if ( $gateway ) : ?>
258
+										$gateway = give_get_payment_gateway($payment_id);
259
+										if ($gateway) : ?>
260 260
 											<div class="give-order-gateway give-admin-box-inside">
261 261
 												<p>
262
-													<strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong>&nbsp;
263
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
262
+													<strong><?php esc_html_e('Gateway:', 'give'); ?></strong>&nbsp;
263
+													<?php echo give_get_gateway_admin_label($gateway); ?>
264 264
 												</p>
265 265
 											</div>
266 266
 										<?php endif; ?>
267 267
 
268 268
 										<div class="give-order-payment-key give-admin-box-inside">
269 269
 											<p>
270
-												<strong><?php esc_html_e( 'Key:', 'give' ); ?></strong>&nbsp;
271
-												<?php echo give_get_payment_key( $payment_id ); ?>
270
+												<strong><?php esc_html_e('Key:', 'give'); ?></strong>&nbsp;
271
+												<?php echo give_get_payment_key($payment_id); ?>
272 272
 											</p>
273 273
 										</div>
274 274
 
275 275
 										<div class="give-order-ip give-admin-box-inside">
276 276
 											<p>
277
-												<strong><?php esc_html_e( 'IP:', 'give' ); ?></strong>&nbsp;
278
-												<?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
277
+												<strong><?php esc_html_e('IP:', 'give'); ?></strong>&nbsp;
278
+												<?php echo esc_html(give_get_payment_user_ip($payment_id)); ?>
279 279
 											</p>
280 280
 										</div>
281 281
 
282
-										<?php if ( $transaction_id ) : ?>
282
+										<?php if ($transaction_id) : ?>
283 283
 											<div class="give-order-tx-id give-admin-box-inside">
284 284
 												<p>
285
-													<strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong>&nbsp;
286
-													<?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
285
+													<strong><?php esc_html_e('Donation ID:', 'give'); ?></strong>&nbsp;
286
+													<?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?>
287 287
 												</p>
288 288
 											</div>
289 289
 										<?php endif; ?>
290 290
 
291 291
 										<div class="give-admin-box-inside">
292
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?>
293
-												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
292
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?>
293
+												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor &raquo;', 'give'); ?></a>
294 294
 											</p>
295 295
 										</div>
296 296
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 										 *
303 303
 										 * @param int $payment_id Payment id.
304 304
 										 */
305
-										do_action( 'give_view_order_details_payment_meta_after', $payment_id );
305
+										do_action('give_view_order_details_payment_meta_after', $payment_id);
306 306
 										?>
307 307
 
308 308
 									</div>
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 							 *
323 323
 							 * @param int $payment_id Payment id.
324 324
 							 */
325
-							do_action( 'give_view_order_details_sidebar_after', $payment_id );
325
+							do_action('give_view_order_details_sidebar_after', $payment_id);
326 326
 							?>
327 327
 
328 328
 						</div>
@@ -342,55 +342,55 @@  discard block
 block discarded – undo
342 342
 							 *
343 343
 							 * @param int $payment_id Payment id.
344 344
 							 */
345
-							do_action( 'give_view_order_details_main_before', $payment_id );
345
+							do_action('give_view_order_details_main_before', $payment_id);
346 346
 							?>
347 347
 
348 348
 							<?php $column_count = 'columns-3'; ?>
349 349
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
350
-								<h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3>
350
+								<h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3>
351 351
 
352 352
 								<div class="inside">
353 353
 
354 354
 									<div class="column-container">
355 355
 										<div class="column">
356 356
 											<p>
357
-												<strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br>
357
+												<strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br>
358 358
 												<?php
359
-												if ( $payment_meta['form_id'] ) :
359
+												if ($payment_meta['form_id']) :
360 360
 													printf(
361 361
 														'<a href="%1$s" target="_blank">#%2$s</a>',
362
-														admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
362
+														admin_url('post.php?action=edit&post='.$payment_meta['form_id']),
363 363
 														$payment_meta['form_id']
364 364
 													);
365 365
 												endif;
366 366
 												?>
367 367
 											</p>
368 368
 											<p>
369
-												<strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
370
-												<?php give_get_form_dropdown( array(
369
+												<strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br>
370
+												<?php give_get_form_dropdown(array(
371 371
 													'id'       => $payment_meta['form_id'],
372 372
 													'selected' => $payment_meta['form_id'],
373 373
 													'chosen'   => true,
374
-												), true ); ?>
374
+												), true); ?>
375 375
 											</p>
376 376
 										</div>
377 377
 										<div class="column">
378 378
 											<p>
379
-												<strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br>
380
-												<?php echo date_i18n( give_date_format(), $payment_date ); ?>
379
+												<strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br>
380
+												<?php echo date_i18n(give_date_format(), $payment_date); ?>
381 381
 											</p>
382 382
 											<p>
383
-												<strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br>
383
+												<strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br>
384 384
 												<span class="give-donation-level">
385 385
 													<?php
386
-													$var_prices = give_has_variable_prices( $payment_meta['form_id'] );
387
-													if ( empty( $var_prices ) ) {
388
-														esc_html_e( 'n/a', 'give' );
386
+													$var_prices = give_has_variable_prices($payment_meta['form_id']);
387
+													if (empty($var_prices)) {
388
+														esc_html_e('n/a', 'give');
389 389
 													} else {
390 390
 														$prices_atts = '';
391
-														if( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) {
392
-															foreach ( $variable_prices as $variable_price ) {
393
-																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] );
391
+														if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) {
392
+															foreach ($variable_prices as $variable_price) {
393
+																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']);
394 394
 															}
395 395
 														}
396 396
 														// Variable price dropdown options.
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
 															'chosen'           => true,
401 401
 															'show_option_all'  => '',
402 402
 															'show_option_none' => '',
403
-															'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
403
+															'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
404 404
 															'selected'         => $payment_meta['price_id'],
405 405
 														);
406 406
 														// Render variable prices select tag html.
407
-														give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
407
+														give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
408 408
 													}
409 409
 													?>
410 410
 												</span>
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
 										</div>
413 413
 										<div class="column">
414 414
 											<p>
415
-												<strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
416
-												<?php echo esc_html( give_currency_filter( give_format_amount( $payment->total ), give_get_payment_currency_code( $payment->ID ) )  ); ?>
415
+												<strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br>
416
+												<?php echo esc_html(give_currency_filter(give_format_amount($payment->total), give_get_payment_currency_code($payment->ID))); ?>
417 417
 											</p>
418 418
 											<p>
419 419
 												<?php
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 												 *
427 427
 												 * @param int $payment_id Payment id.
428 428
 												 */
429
-												do_action( 'give_donation_details_thead_before', $payment_id );
429
+												do_action('give_donation_details_thead_before', $payment_id);
430 430
 
431 431
 
432 432
 												/**
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 												 *
439 439
 												 * @param int $payment_id Payment id.
440 440
 												 */
441
-												do_action( 'give_donation_details_thead_after', $payment_id );
441
+												do_action('give_donation_details_thead_after', $payment_id);
442 442
 
443 443
 												/**
444 444
 												 * Fires in order details page, in the donation-information metabox, before the body elements.
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 												 *
450 450
 												 * @param int $payment_id Payment id.
451 451
 												 */
452
-												do_action( 'give_donation_details_tbody_before', $payment_id );
452
+												do_action('give_donation_details_tbody_before', $payment_id);
453 453
 
454 454
 												/**
455 455
 												 * Fires in order details page, in the donation-information metabox, after the body elements.
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 												 *
461 461
 												 * @param int $payment_id Payment id.
462 462
 												 */
463
-												do_action( 'give_donation_details_tbody_after', $payment_id );
463
+												do_action('give_donation_details_tbody_after', $payment_id);
464 464
 												?>
465 465
 											</p>
466 466
 										</div>
@@ -480,57 +480,57 @@  discard block
 block discarded – undo
480 480
 							 *
481 481
 							 * @param int $payment_id Payment id.
482 482
 							 */
483
-							do_action( 'give_view_order_details_files_after', $payment_id );
483
+							do_action('give_view_order_details_files_after', $payment_id);
484 484
 							?>
485 485
 
486 486
 							<div id="give-donor-details" class="postbox">
487
-								<h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3>
487
+								<h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3>
488 488
 
489 489
 								<div class="inside">
490 490
 
491
-									<?php $customer = new Give_Customer( $customer_id ); ?>
491
+									<?php $customer = new Give_Customer($customer_id); ?>
492 492
 
493 493
 									<div class="column-container customer-info">
494 494
 										<div class="column">
495 495
 											<p>
496
-												<strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br>
496
+												<strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br>
497 497
 												<?php
498
-												if ( ! empty( $customer->id ) ) {
498
+												if ( ! empty($customer->id)) {
499 499
 													printf(
500 500
 														'<a href="%1$s" target="_blank">#%2$s</a>',
501
-														admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ),
501
+														admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id),
502 502
 														$customer->id
503 503
 													);
504 504
 												}
505 505
 												?>
506 506
 											</p>
507 507
 											<p>
508
-												<strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br>
509
-												<?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?>
508
+												<strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br>
509
+												<?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?>
510 510
 											</p>
511 511
 										</div>
512 512
 										<div class="column">
513 513
 											<p>
514
-												<strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br>
514
+												<strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br>
515 515
 												<?php echo $customer->name; ?>
516 516
 											</p>
517 517
 											<p>
518
-												<strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br>
518
+												<strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br>
519 519
 												<?php echo $customer->email; ?>
520 520
 											</p>
521 521
 										</div>
522 522
 										<div class="column">
523 523
 											<p>
524
-												<strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br>
524
+												<strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br>
525 525
 												<?php
526
-												echo Give()->html->donor_dropdown( array(
526
+												echo Give()->html->donor_dropdown(array(
527 527
 													'selected' => $customer->id,
528 528
 													'name'     => 'customer-id',
529
-												) );
529
+												));
530 530
 												?>
531 531
 											</p>
532 532
 											<p>
533
-												<a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a>
533
+												<a href="#new" class="give-payment-new-customer"><?php esc_html_e('Create New Donor', 'give'); ?></a>
534 534
 											</p>
535 535
 										</div>
536 536
 									</div>
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 									<div class="column-container new-customer" style="display: none">
539 539
 										<div class="column">
540 540
 											<p>
541
-												<label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label>
541
+												<label for="give-new-customer-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label>
542 542
 												<input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/>
543 543
 											</p>
544 544
 										</div>
545 545
 										<div class="column">
546 546
 											<p>
547
-												<label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label>
547
+												<label for="give-new-customer-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label>
548 548
 												<input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/>
549 549
 											</p>
550 550
 										</div>
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 											<p>
553 553
 												<input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>
554 554
 												<input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>
555
-												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
555
+												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a>
556 556
 												<br>
557
-												<em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
557
+												<em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em>
558 558
 											</p>
559 559
 										</div>
560 560
 									</div>
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 									 * @param array $payment_meta Payment meta.
571 571
 									 * @param array $user_info    User information.
572 572
 									 */
573
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
573
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
574 574
 
575 575
 									/**
576 576
 									 * Fires in order details page, in the donor-details metabox.
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 									 *
580 580
 									 * @param int $payment_id Payment id.
581 581
 									 */
582
-									do_action( 'give_payment_view_details', $payment_id );
582
+									do_action('give_payment_view_details', $payment_id);
583 583
 									?>
584 584
 
585 585
 								</div>
@@ -595,11 +595,11 @@  discard block
 block discarded – undo
595 595
 							 *
596 596
 							 * @param int $payment_id Payment id.
597 597
 							 */
598
-							do_action( 'give_view_order_details_billing_before', $payment_id );
598
+							do_action('give_view_order_details_billing_before', $payment_id);
599 599
 							?>
600 600
 
601 601
 							<div id="give-billing-details" class="postbox">
602
-								<h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3>
602
+								<h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3>
603 603
 
604 604
 								<div class="inside">
605 605
 
@@ -609,57 +609,57 @@  discard block
 block discarded – undo
609 609
 											<div class="data column-container">
610 610
 												<div class="column">
611 611
 													<div class="give-wrap-address-line1">
612
-														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label>
613
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
612
+														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label>
613
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
614 614
 													</div>
615 615
 													<div class="give-wrap-address-line2">
616
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label>
617
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
616
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label>
617
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
618 618
 													</div>
619 619
 												</div>
620 620
 												<div class="column">
621 621
 													<div class="give-wrap-address-city">
622
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
623
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
622
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
623
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
624 624
 													</div>
625 625
 													<div class="give-wrap-address-zip">
626
-														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label>
627
-														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
626
+														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label>
627
+														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
628 628
 
629 629
 													</div>
630 630
 												</div>
631 631
 												<div class="column">
632 632
 													<div id="give-order-address-country-wrap">
633
-														<label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label>
633
+														<label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label>
634 634
 														<?php
635
-														echo Give()->html->select( array(
635
+														echo Give()->html->select(array(
636 636
 															'options'          => give_get_country_list(),
637 637
 															'name'             => 'give-payment-address[0][country]',
638 638
 															'selected'         => $address['country'],
639 639
 															'show_option_all'  => false,
640 640
 															'show_option_none' => false,
641 641
 															'chosen'           => true,
642
-															'placeholder'      => esc_attr__( 'Select a country', 'give' ),
643
-														) );
642
+															'placeholder'      => esc_attr__('Select a country', 'give'),
643
+														));
644 644
 														?>
645 645
 													</div>
646 646
 													<div id="give-order-address-state-wrap">
647
-														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label>
647
+														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label>
648 648
 														<?php
649
-														$states = give_get_states( $address['country'] );
650
-														if ( ! empty( $states ) ) {
651
-															echo Give()->html->select( array(
649
+														$states = give_get_states($address['country']);
650
+														if ( ! empty($states)) {
651
+															echo Give()->html->select(array(
652 652
 																'options'          => $states,
653 653
 																'name'             => 'give-payment-address[0][state]',
654 654
 																'selected'         => $address['state'],
655 655
 																'show_option_all'  => false,
656 656
 																'show_option_none' => false,
657 657
 																'chosen'           => true,
658
-																'placeholder'      => esc_attr__( 'Select a state', 'give' ),
659
-															) );
658
+																'placeholder'      => esc_attr__('Select a state', 'give'),
659
+															));
660 660
 														} else {
661 661
 															?>
662
-															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
662
+															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
663 663
 															<?php
664 664
 														} ?>
665 665
 													</div>
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 									 *
680 680
 									 * @param int $payment_id Payment id.
681 681
 									 */
682
-									do_action( 'give_payment_billing_details', $payment_id );
682
+									do_action('give_payment_billing_details', $payment_id);
683 683
 									?>
684 684
 
685 685
 								</div>
@@ -695,32 +695,32 @@  discard block
 block discarded – undo
695 695
 							 *
696 696
 							 * @param int $payment_id Payment id.
697 697
 							 */
698
-							do_action( 'give_view_order_details_billing_after', $payment_id );
698
+							do_action('give_view_order_details_billing_after', $payment_id);
699 699
 							?>
700 700
 
701 701
 							<div id="give-payment-notes" class="postbox">
702
-								<h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3>
702
+								<h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3>
703 703
 
704 704
 								<div class="inside">
705 705
 									<div id="give-payment-notes-inner">
706 706
 										<?php
707
-										$notes = give_get_payment_notes( $payment_id );
708
-										if ( ! empty( $notes ) ) {
707
+										$notes = give_get_payment_notes($payment_id);
708
+										if ( ! empty($notes)) {
709 709
 											$no_notes_display = ' style="display:none;"';
710
-											foreach ( $notes as $note ) :
710
+											foreach ($notes as $note) :
711 711
 
712
-												echo give_get_payment_note_html( $note, $payment_id );
712
+												echo give_get_payment_note_html($note, $payment_id);
713 713
 
714 714
 											endforeach;
715 715
 										} else {
716 716
 											$no_notes_display = '';
717 717
 										}
718
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?>
718
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?>
719 719
 									</div>
720 720
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
721 721
 
722 722
 									<div class="give-clearfix">
723
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button>
723
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button>
724 724
 									</div>
725 725
 
726 726
 								</div>
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 							 *
737 737
 							 * @param int $payment_id Payment id.
738 738
 							 */
739
-							do_action( 'give_view_order_details_main_after', $payment_id );
739
+							do_action('give_view_order_details_main_after', $payment_id);
740 740
 							?>
741 741
 
742 742
 						</div>
@@ -758,11 +758,11 @@  discard block
 block discarded – undo
758 758
 		 *
759 759
 		 * @param int $payment_id Payment id.
760 760
 		 */
761
-		do_action( 'give_view_order_details_form_bottom', $payment_id );
761
+		do_action('give_view_order_details_form_bottom', $payment_id);
762 762
 
763
-		wp_nonce_field( 'give_update_payment_details_nonce' );
763
+		wp_nonce_field('give_update_payment_details_nonce');
764 764
 		?>
765
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
765
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
766 766
 		<input type="hidden" name="give_action" value="update_payment_details"/>
767 767
 	</form>
768 768
 	<?php
@@ -773,6 +773,6 @@  discard block
 block discarded – undo
773 773
 	 *
774 774
 	 * @param int $payment_id Payment id.
775 775
 	 */
776
-	do_action( 'give_view_order_details_after', $payment_id );
776
+	do_action('give_view_order_details_after', $payment_id);
777 777
 	?>
778 778
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.