Completed
Branch master (34b06a)
by Devin
20:06
created
includes/admin/payments/class-payments-table.php 1 patch
Spacing   +185 added lines, -185 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded.
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 	public function __construct() {
119 119
 
120 120
 		// Set parent defaults.
121
-		parent::__construct( array(
122
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
123
-			'plural'   => give_get_forms_label_plural(),      // Plural name of the listed records.
124
-			'ajax'     => false,                              // Does this table support ajax?
125
-		) );
121
+		parent::__construct(array(
122
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
123
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
124
+			'ajax'     => false, // Does this table support ajax?
125
+		));
126 126
 
127 127
 		$this->get_payment_counts();
128 128
 		$this->process_bulk_action();
129
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
129
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
130 130
 	}
131 131
 
132 132
 	/**
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
 	 * @return void
136 136
 	 */
137 137
 	public function advanced_filters() {
138
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
139
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
140
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : '';
138
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
139
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
140
+		$status     = isset($_GET['status']) ? $_GET['status'] : '';
141 141
 		?>
142 142
 		<div id="give-payment-filters">
143 143
 			<span id="give-payment-date-filters">
144
-				<label for="start-date" class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label>
144
+				<label for="start-date" class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label>
145 145
 				<input type="text" id="start-date" name="start-date" class="give_datepicker" value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/>
146
-				<label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label>
146
+				<label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label>
147 147
 				<input type="text" id="end-date" name="end-date" class="give_datepicker" value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/>
148
-				<input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/>
148
+				<input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/>
149 149
 			</span>
150
-			<?php if ( ! empty( $status ) ) : ?>
151
-				<input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/>
150
+			<?php if ( ! empty($status)) : ?>
151
+				<input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/>
152 152
 			<?php endif; ?>
153
-			<?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>
154
-				<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a>
153
+			<?php if ( ! empty($start_date) || ! empty($end_date)) : ?>
154
+				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a>
155 155
 			<?php endif; ?>
156
-			<?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?>
156
+			<?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?>
157 157
 		</div>
158 158
 
159 159
 		<?php
@@ -170,18 +170,18 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return void
172 172
 	 */
173
-	public function search_box( $text, $input_id ) {
174
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
173
+	public function search_box($text, $input_id) {
174
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
175 175
 			return;
176 176
 		}
177 177
 
178
-		$input_id = $input_id . '-search-input';
178
+		$input_id = $input_id.'-search-input';
179 179
 
180
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
181
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
180
+		if ( ! empty($_REQUEST['orderby'])) {
181
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
182 182
 		}
183
-		if ( ! empty( $_REQUEST['order'] ) ) {
184
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
183
+		if ( ! empty($_REQUEST['order'])) {
184
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
185 185
 		}
186 186
 		?>
187 187
 		<p class="search-box" role="search">
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
 			 *
194 194
 			 * @since 1.7
195 195
 			 */
196
-			do_action( 'give_payment_history_search' );
196
+			do_action('give_payment_history_search');
197 197
 			?>
198 198
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
199 199
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
200
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/>
200
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/>
201 201
 		</p>
202 202
 		<?php
203 203
 	}
@@ -211,52 +211,52 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	public function get_views() {
213 213
 
214
-		$current         = isset( $_GET['status'] ) ? $_GET['status'] : '';
215
-		$total_count     = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
216
-		$complete_count  = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
217
-		$cancelled_count = '&nbsp;<span class="count">(' . $this->cancelled_count . ')</span>';
218
-		$pending_count   = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
219
-		$refunded_count  = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
220
-		$failed_count    = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
221
-		$abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
222
-		$revoked_count   = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
214
+		$current         = isset($_GET['status']) ? $_GET['status'] : '';
215
+		$total_count     = '&nbsp;<span class="count">('.$this->total_count.')</span>';
216
+		$complete_count  = '&nbsp;<span class="count">('.$this->complete_count.')</span>';
217
+		$cancelled_count = '&nbsp;<span class="count">('.$this->cancelled_count.')</span>';
218
+		$pending_count   = '&nbsp;<span class="count">('.$this->pending_count.')</span>';
219
+		$refunded_count  = '&nbsp;<span class="count">('.$this->refunded_count.')</span>';
220
+		$failed_count    = '&nbsp;<span class="count">('.$this->failed_count.')</span>';
221
+		$abandoned_count = '&nbsp;<span class="count">('.$this->abandoned_count.')</span>';
222
+		$revoked_count   = '&nbsp;<span class="count">('.$this->revoked_count.')</span>';
223 223
 
224 224
 		$views = array(
225
-			'all'       => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(
225
+			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array(
226 226
 				'status',
227 227
 				'paged',
228
-			) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ),
229
-			'publish'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
228
+			)), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count),
229
+			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
230 230
 				'status' => 'publish',
231 231
 				'paged'  => false,
232
-			) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ),
233
-			'pending'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
232
+			))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count),
233
+			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
234 234
 				'status' => 'pending',
235 235
 				'paged'  => false,
236
-			) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ),
237
-			'refunded'  => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
236
+			))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count),
237
+			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
238 238
 				'status' => 'refunded',
239 239
 				'paged'  => false,
240
-			) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ),
241
-			'revoked'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
240
+			))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count),
241
+			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
242 242
 				'status' => 'revoked',
243 243
 				'paged'  => false,
244
-			) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ),
245
-			'failed'    => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
244
+			))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count),
245
+			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
246 246
 				'status' => 'failed',
247 247
 				'paged'  => false,
248
-			) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ),
249
-			'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
248
+			))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count),
249
+			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
250 250
 				'status' => 'cancelled',
251 251
 				'paged'  => false,
252
-			) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ),
253
-			'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
252
+			))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count),
253
+			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
254 254
 				'status' => 'abandoned',
255 255
 				'paged'  => false,
256
-			) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count ),
256
+			))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count),
257 257
 		);
258 258
 
259
-		return apply_filters( 'give_payments_table_views', $views );
259
+		return apply_filters('give_payments_table_views', $views);
260 260
 	}
261 261
 
262 262
 	/**
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 	public function get_columns() {
270 270
 		$columns = array(
271 271
 			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text.
272
-			'donation'      => esc_html__( 'Donation', 'give' ),
273
-			'donation_form' => esc_html__( 'Donation Form', 'give' ),
274
-			'status'        => esc_html__( 'Status', 'give' ),
275
-			'date'          => esc_html__( 'Date', 'give' ),
276
-			'amount'        => esc_html__( 'Amount', 'give' ),
277
-			'details'       => esc_html__( 'Details', 'give' ),
272
+			'donation'      => esc_html__('Donation', 'give'),
273
+			'donation_form' => esc_html__('Donation Form', 'give'),
274
+			'status'        => esc_html__('Status', 'give'),
275
+			'date'          => esc_html__('Date', 'give'),
276
+			'amount'        => esc_html__('Amount', 'give'),
277
+			'details'       => esc_html__('Details', 'give'),
278 278
 		);
279 279
 
280
-		return apply_filters( 'give_payments_table_columns', $columns );
280
+		return apply_filters('give_payments_table_columns', $columns);
281 281
 	}
282 282
 
283 283
 	/**
@@ -289,14 +289,14 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	public function get_sortable_columns() {
291 291
 		$columns = array(
292
-			'donation'      => array( 'ID', true ),
293
-			'donation_form' => array( 'donation_form', false ),
294
-			'status'        => array( 'status', false ),
295
-			'amount'        => array( 'amount', false ),
296
-			'date'          => array( 'date', false ),
292
+			'donation'      => array('ID', true),
293
+			'donation_form' => array('donation_form', false),
294
+			'status'        => array('status', false),
295
+			'amount'        => array('amount', false),
296
+			'date'          => array('date', false),
297 297
 		);
298 298
 
299
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
299
+		return apply_filters('give_payments_table_sortable_columns', $columns);
300 300
 	}
301 301
 
302 302
 	/**
@@ -322,65 +322,65 @@  discard block
 block discarded – undo
322 322
 	 *
323 323
 	 * @return string Column Name
324 324
 	 */
325
-	public function column_default( $payment, $column_name ) {
325
+	public function column_default($payment, $column_name) {
326 326
 
327
-		$single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) );
328
-		$row_actions         = $this->get_row_actions( $payment );
327
+		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details')));
328
+		$row_actions         = $this->get_row_actions($payment);
329 329
 
330
-		switch ( $column_name ) {
330
+		switch ($column_name) {
331 331
 			case 'donation' :
332 332
 				$value = sprintf(
333 333
 					'<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>',
334 334
 					$single_donation_url,
335
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID ),
335
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID),
336 336
 					$payment->ID,
337
-					esc_html__( 'by', 'give' ),
338
-					$this->get_donor( $payment )
337
+					esc_html__('by', 'give'),
338
+					$this->get_donor($payment)
339 339
 				);
340
-				$value .= $this->get_donor_email( $payment );
341
-				$value .= $this->row_actions( $row_actions );
340
+				$value .= $this->get_donor_email($payment);
341
+				$value .= $this->row_actions($row_actions);
342 342
 				break;
343 343
 
344 344
 			case 'amount' :
345
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
346
-				$value  = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );
345
+				$amount = ! empty($payment->total) ? $payment->total : 0;
346
+				$value  = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));
347 347
 				break;
348 348
 
349 349
 			case 'donation_form' :
350 350
 
351
-				$value = empty( $payment->form_title ) ? __( 'Untitled', 'give' ) : '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $payment->form_title . '</a>';
352
-				$level = give_get_payment_form_title( $payment->meta, true );
351
+				$value = empty($payment->form_title) ? __('Untitled', 'give') : '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$payment->form_title.'</a>';
352
+				$level = give_get_payment_form_title($payment->meta, true);
353 353
 
354
-				if ( ! empty( $level ) ) {
354
+				if ( ! empty($level)) {
355 355
 					$value .= $level;
356 356
 				}
357 357
 
358 358
 				break;
359 359
 
360 360
 			case 'date' :
361
-				$date  = strtotime( $payment->date );
362
-				$value = date_i18n( give_date_format(), $date );
361
+				$date  = strtotime($payment->date);
362
+				$value = date_i18n(give_date_format(), $date);
363 363
 				break;
364 364
 
365 365
 			case 'status' :
366
-				$value = $this->get_payment_status( $payment );
366
+				$value = $this->get_payment_status($payment);
367 367
 				break;
368 368
 
369 369
 			case 'details' :
370 370
 				$value = sprintf(
371 371
 					'<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>',
372 372
 					$single_donation_url,
373
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID )
373
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID)
374 374
 				);
375 375
 				break;
376 376
 
377 377
 			default:
378
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
378
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
379 379
 				break;
380 380
 
381 381
 		}
382 382
 
383
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
383
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
384 384
 	}
385 385
 
386 386
 	/**
@@ -393,17 +393,17 @@  discard block
 block discarded – undo
393 393
 	 *
394 394
 	 * @return string                Data shown in the Email column
395 395
 	 */
396
-	public function get_donor_email( $payment ) {
396
+	public function get_donor_email($payment) {
397 397
 
398
-		$email = give_get_payment_user_email( $payment->ID );
398
+		$email = give_get_payment_user_email($payment->ID);
399 399
 
400
-		if ( empty( $email ) ) {
401
-			$email = esc_html__( '(unknown)', 'give' );
400
+		if (empty($email)) {
401
+			$email = esc_html__('(unknown)', 'give');
402 402
 		}
403 403
 
404
-		$value = '<a href="mailto:' . $email . '" data-tooltip="' . esc_attr__( 'Email donor', 'give' ) . '">' . $email . '</a>';
404
+		$value = '<a href="mailto:'.$email.'" data-tooltip="'.esc_attr__('Email donor', 'give').'">'.$email.'</a>';
405 405
 
406
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
406
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
407 407
 	}
408 408
 
409 409
 	/**
@@ -413,18 +413,18 @@  discard block
 block discarded – undo
413 413
 	 *
414 414
 	 * @return mixed|void
415 415
 	 */
416
-	function get_row_actions( $payment ) {
416
+	function get_row_actions($payment) {
417 417
 
418 418
 		$actions = array();
419
-		$email   = give_get_payment_user_email( $payment->ID );
419
+		$email   = give_get_payment_user_email($payment->ID);
420 420
 
421 421
 		// Add search term string back to base URL.
422
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
423
-		if ( ! empty( $search_terms ) ) {
424
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
422
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
423
+		if ( ! empty($search_terms)) {
424
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
425 425
 		}
426 426
 
427
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
427
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
428 428
 
429 429
 			$actions['email_links'] = sprintf(
430 430
 				'<a href="%1$s" aria-label="%2$s">%3$s</a>',
@@ -438,8 +438,8 @@  discard block
 block discarded – undo
438 438
 					),
439 439
 					'give_payment_nonce'
440 440
 				),
441
-				sprintf( esc_attr__( 'Resend Donation %s Receipt', 'give' ), $payment->ID ),
442
-				esc_html__( 'Resend Receipt', 'give' )
441
+				sprintf(esc_attr__('Resend Donation %s Receipt', 'give'), $payment->ID),
442
+				esc_html__('Resend Receipt', 'give')
443 443
 			);
444 444
 
445 445
 		}
@@ -456,11 +456,11 @@  discard block
 block discarded – undo
456 456
 				),
457 457
 				'give_donation_nonce'
458 458
 			),
459
-			sprintf( esc_attr__( 'Delete Donation %s', 'give' ), $payment->ID ),
460
-			esc_html__( 'Delete', 'give' )
459
+			sprintf(esc_attr__('Delete Donation %s', 'give'), $payment->ID),
460
+			esc_html__('Delete', 'give')
461 461
 		);
462 462
 
463
-		return apply_filters( 'give_payment_row_actions', $actions, $payment );
463
+		return apply_filters('give_payment_row_actions', $actions, $payment);
464 464
 	}
465 465
 
466 466
 
@@ -474,10 +474,10 @@  discard block
 block discarded – undo
474 474
 	 *
475 475
 	 * @return string                Data shown in the Email column
476 476
 	 */
477
-	function get_payment_status( $payment ) {
478
-		$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
479
-		if ( $payment->mode == 'test' ) {
480
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>';
477
+	function get_payment_status($payment) {
478
+		$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
479
+		if ($payment->mode == 'test') {
480
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>';
481 481
 		}
482 482
 
483 483
 		return $value;
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 	 *
494 494
 	 * @return string Displays a checkbox.
495 495
 	 */
496
-	public function column_cb( $payment ) {
496
+	public function column_cb($payment) {
497 497
 		return sprintf(
498 498
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
499 499
 			'payment',
@@ -511,8 +511,8 @@  discard block
 block discarded – undo
511 511
 	 *
512 512
 	 * @return string Displays a checkbox.
513 513
 	 */
514
-	public function get_payment_id( $payment ) {
515
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
514
+	public function get_payment_id($payment) {
515
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
516 516
 	}
517 517
 
518 518
 	/**
@@ -525,19 +525,19 @@  discard block
 block discarded – undo
525 525
 	 *
526 526
 	 * @return string Data shown in the User column
527 527
 	 */
528
-	public function get_donor( $payment ) {
528
+	public function get_donor($payment) {
529 529
 
530
-		$customer_id = give_get_payment_customer_id( $payment->ID );
530
+		$customer_id = give_get_payment_customer_id($payment->ID);
531 531
 
532
-		if ( ! empty( $customer_id ) ) {
533
-			$customer = new Give_Customer( $customer_id );
534
-			$value    = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>';
532
+		if ( ! empty($customer_id)) {
533
+			$customer = new Give_Customer($customer_id);
534
+			$value    = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>';
535 535
 		} else {
536
-			$email = give_get_payment_user_email( $payment->ID );
537
-			$value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>';
536
+			$email = give_get_payment_user_email($payment->ID);
537
+			$value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>';
538 538
 		}
539 539
 
540
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
540
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
541 541
 	}
542 542
 
543 543
 	/**
@@ -549,18 +549,18 @@  discard block
 block discarded – undo
549 549
 	 */
550 550
 	public function get_bulk_actions() {
551 551
 		$actions = array(
552
-			'delete'               => esc_html__( 'Delete', 'give' ),
553
-			'set-status-publish'   => esc_html__( 'Set To Completed', 'give' ),
554
-			'set-status-pending'   => esc_html__( 'Set To Pending', 'give' ),
555
-			'set-status-refunded'  => esc_html__( 'Set To Refunded', 'give' ),
556
-			'set-status-revoked'   => esc_html__( 'Set To Revoked', 'give' ),
557
-			'set-status-failed'    => esc_html__( 'Set To Failed', 'give' ),
558
-			'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ),
559
-			'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ),
560
-			'resend-receipt'       => esc_html__( 'Resend Email Receipts', 'give' ),
552
+			'delete'               => esc_html__('Delete', 'give'),
553
+			'set-status-publish'   => esc_html__('Set To Completed', 'give'),
554
+			'set-status-pending'   => esc_html__('Set To Pending', 'give'),
555
+			'set-status-refunded'  => esc_html__('Set To Refunded', 'give'),
556
+			'set-status-revoked'   => esc_html__('Set To Revoked', 'give'),
557
+			'set-status-failed'    => esc_html__('Set To Failed', 'give'),
558
+			'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'),
559
+			'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'),
560
+			'resend-receipt'       => esc_html__('Resend Email Receipts', 'give'),
561 561
 		);
562 562
 
563
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
563
+		return apply_filters('give_payments_table_bulk_actions', $actions);
564 564
 	}
565 565
 
566 566
 	/**
@@ -571,59 +571,59 @@  discard block
 block discarded – undo
571 571
 	 * @return void
572 572
 	 */
573 573
 	public function process_bulk_action() {
574
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
574
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
575 575
 		$action = $this->current_action();
576 576
 
577
-		if ( ! is_array( $ids ) ) {
578
-			$ids = array( $ids );
577
+		if ( ! is_array($ids)) {
578
+			$ids = array($ids);
579 579
 		}
580 580
 
581
-		if ( empty( $action ) ) {
581
+		if (empty($action)) {
582 582
 			return;
583 583
 		}
584 584
 
585
-		foreach ( $ids as $id ) {
585
+		foreach ($ids as $id) {
586 586
 
587 587
 			// Detect when a bulk action is being triggered.
588
-			switch ( $this->current_action() ) {
588
+			switch ($this->current_action()) {
589 589
 
590 590
 				case'delete':
591
-					give_delete_purchase( $id );
591
+					give_delete_purchase($id);
592 592
 					break;
593 593
 
594 594
 				case 'set-status-publish':
595
-					give_update_payment_status( $id, 'publish' );
595
+					give_update_payment_status($id, 'publish');
596 596
 					break;
597 597
 
598 598
 				case 'set-status-pending':
599
-					give_update_payment_status( $id, 'pending' );
599
+					give_update_payment_status($id, 'pending');
600 600
 					break;
601 601
 
602 602
 				case 'set-status-refunded':
603
-					give_update_payment_status( $id, 'refunded' );
603
+					give_update_payment_status($id, 'refunded');
604 604
 					break;
605 605
 				case 'set-status-revoked':
606
-					give_update_payment_status( $id, 'revoked' );
606
+					give_update_payment_status($id, 'revoked');
607 607
 					break;
608 608
 
609 609
 				case 'set-status-failed':
610
-					give_update_payment_status( $id, 'failed' );
610
+					give_update_payment_status($id, 'failed');
611 611
 					break;
612 612
 
613 613
 				case 'set-status-cancelled':
614
-					give_update_payment_status( $id, 'cancelled' );
614
+					give_update_payment_status($id, 'cancelled');
615 615
 					break;
616 616
 
617 617
 				case 'set-status-abandoned':
618
-					give_update_payment_status( $id, 'abandoned' );
618
+					give_update_payment_status($id, 'abandoned');
619 619
 					break;
620 620
 
621 621
 				case 'set-status-preapproval':
622
-					give_update_payment_status( $id, 'preapproval' );
622
+					give_update_payment_status($id, 'preapproval');
623 623
 					break;
624 624
 
625 625
 				case 'resend-receipt':
626
-					give_email_donation_receipt( $id, false );
626
+					give_email_donation_receipt($id, false);
627 627
 					break;
628 628
 			}
629 629
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 			 * @param int    $id             The ID of the payment.
636 636
 			 * @param string $current_action The action that is being triggered.
637 637
 			 */
638
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
638
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
639 639
 		}
640 640
 
641 641
 	}
@@ -651,27 +651,27 @@  discard block
 block discarded – undo
651 651
 
652 652
 		$args = array();
653 653
 
654
-		if ( isset( $_GET['user'] ) ) {
655
-			$args['user'] = urldecode( $_GET['user'] );
656
-		} elseif ( isset( $_GET['s'] ) ) {
657
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
658
-			if ( $is_user ) {
659
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
660
-				unset( $args['s'] );
654
+		if (isset($_GET['user'])) {
655
+			$args['user'] = urldecode($_GET['user']);
656
+		} elseif (isset($_GET['s'])) {
657
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
658
+			if ($is_user) {
659
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
660
+				unset($args['s']);
661 661
 			} else {
662
-				$args['s'] = sanitize_text_field( $_GET['s'] );
662
+				$args['s'] = sanitize_text_field($_GET['s']);
663 663
 			}
664 664
 		}
665 665
 
666
-		if ( ! empty( $_GET['start-date'] ) ) {
667
-			$args['start-date'] = urldecode( $_GET['start-date'] );
666
+		if ( ! empty($_GET['start-date'])) {
667
+			$args['start-date'] = urldecode($_GET['start-date']);
668 668
 		}
669 669
 
670
-		if ( ! empty( $_GET['end-date'] ) ) {
671
-			$args['end-date'] = urldecode( $_GET['end-date'] );
670
+		if ( ! empty($_GET['end-date'])) {
671
+			$args['end-date'] = urldecode($_GET['end-date']);
672 672
 		}
673 673
 
674
-		$payment_count         = give_count_payments( $args );
674
+		$payment_count         = give_count_payments($args);
675 675
 		$this->complete_count  = $payment_count->publish;
676 676
 		$this->pending_count   = $payment_count->pending;
677 677
 		$this->refunded_count  = $payment_count->refunded;
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 		$this->cancelled_count = $payment_count->cancelled;
681 681
 		$this->abandoned_count = $payment_count->abandoned;
682 682
 
683
-		foreach ( $payment_count as $count ) {
683
+		foreach ($payment_count as $count) {
684 684
 			$this->total_count += $count;
685 685
 		}
686 686
 	}
@@ -695,26 +695,26 @@  discard block
 block discarded – undo
695 695
 	public function payments_data() {
696 696
 
697 697
 		$per_page   = $this->per_page;
698
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
699
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
700
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
701
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
702
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
703
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
704
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
705
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
706
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
707
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
708
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
709
-
710
-		if ( ! empty( $search ) ) {
698
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
699
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
700
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
701
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
702
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
703
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
704
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
705
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
706
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
707
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
708
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
709
+
710
+		if ( ! empty($search)) {
711 711
 			$status = 'any'; // Force all payment statuses when searching.
712 712
 		}
713 713
 
714 714
 		$args = array(
715 715
 			'output'     => 'payments',
716 716
 			'number'     => $per_page,
717
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
717
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
718 718
 			'orderby'    => $orderby,
719 719
 			'order'      => $order,
720 720
 			'user'       => $user,
@@ -728,14 +728,14 @@  discard block
 block discarded – undo
728 728
 			'end_date'   => $end_date,
729 729
 		);
730 730
 
731
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
731
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
732 732
 
733 733
 			$args['search_in_notes'] = true;
734
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
734
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
735 735
 
736 736
 		}
737 737
 
738
-		$p_query = new Give_Payments_Query( $args );
738
+		$p_query = new Give_Payments_Query($args);
739 739
 
740 740
 		return $p_query->get_payments();
741 741
 
@@ -755,17 +755,17 @@  discard block
 block discarded – undo
755 755
 	 */
756 756
 	public function prepare_items() {
757 757
 
758
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
758
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
759 759
 
760 760
 		$columns  = $this->get_columns();
761 761
 		$hidden   = array(); // No hidden columns.
762 762
 		$sortable = $this->get_sortable_columns();
763 763
 		$data     = $this->payments_data();
764
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
764
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
765 765
 
766
-		$this->_column_headers = array( $columns, $hidden, $sortable );
766
+		$this->_column_headers = array($columns, $hidden, $sortable);
767 767
 
768
-		switch ( $status ) {
768
+		switch ($status) {
769 769
 			case 'publish':
770 770
 				$total_items = $this->complete_count;
771 771
 				break;
@@ -792,19 +792,19 @@  discard block
 block discarded – undo
792 792
 				break;
793 793
 			default:
794 794
 				// Retrieve the count of the non-default-Give status.
795
-				$count       = wp_count_posts( 'give_payment' );
795
+				$count       = wp_count_posts('give_payment');
796 796
 				$total_items = $count->{$status};
797 797
 				break;
798 798
 		}
799 799
 
800 800
 		$this->items = $data;
801 801
 
802
-		$this->set_pagination_args( array(
802
+		$this->set_pagination_args(array(
803 803
 				'total_items' => $total_items,
804 804
 				// We have to calculate the total number of items.
805 805
 				'per_page'    => $this->per_page,
806 806
 				// We have to determine how many items to show on a page.
807
-				'total_pages' => ceil( $total_items / $this->per_page ),
807
+				'total_pages' => ceil($total_items / $this->per_page),
808 808
 				// We have to calculate the total number of pages.
809 809
 			)
810 810
 		);
Please login to merge, or discard this patch.
includes/admin/payments/view-order-details.php 1 patch
Spacing   +136 added lines, -136 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
 $gateway        = $payment->gateway;
46 46
 $currency_code  = $payment->currency;
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 	<h1 id="transaction-details-heading"><?php
54 54
 		printf(
55 55
 			/* translators: %s: donation number */
56
-			esc_html__( 'Donation %s', 'give' ),
56
+			esc_html__('Donation %s', 'give'),
57 57
 			$number
58 58
 		);
59
-		if ( $payment_mode == 'test' ) {
60
-			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>';
59
+		if ($payment_mode == 'test') {
60
+			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>';
61 61
 		}
62 62
 		?></h1>
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @param int $payment_id Payment id.
71 71
 	 */
72
-	do_action( 'give_view_order_details_before', $payment_id );
72
+	do_action('give_view_order_details_before', $payment_id);
73 73
 	?>
74 74
 	<form id="give-edit-order-form" method="post">
75 75
 		<?php
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		 *
81 81
 		 * @param int $payment_id Payment id.
82 82
 		 */
83
-		do_action( 'give_view_order_details_form_top', $payment_id );
83
+		do_action('give_view_order_details_form_top', $payment_id);
84 84
 		?>
85 85
 		<div id="poststuff">
86 86
 			<div id="give-dashboard-widgets-wrap">
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
 							 *
97 97
 							 * @param int $payment_id Payment id.
98 98
 							 */
99
-							do_action( 'give_view_order_details_sidebar_before', $payment_id );
99
+							do_action('give_view_order_details_sidebar_before', $payment_id);
100 100
 							?>
101 101
 
102 102
 							<div id="give-order-update" class="postbox give-order-data">
103 103
 
104
-								<h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3>
104
+								<h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3>
105 105
 
106 106
 								<div class="inside">
107 107
 									<div class="give-admin-box">
@@ -114,33 +114,33 @@  discard block
 block discarded – undo
114 114
 										 *
115 115
 										 * @param int $payment_id Payment id.
116 116
 										 */
117
-										do_action( 'give_view_order_details_totals_before', $payment_id );
117
+										do_action('give_view_order_details_totals_before', $payment_id);
118 118
 										?>
119 119
 
120 120
 										<div class="give-admin-box-inside">
121 121
 											<p>
122
-												<label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label>&nbsp;
122
+												<label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label>&nbsp;
123 123
 												<select id="give-payment-status" name="give-payment-status" class="medium-text">
124
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
125
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
124
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
125
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
126 126
 													<?php endforeach; ?>
127 127
 												</select>
128
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
128
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
129 129
 											</p>
130 130
 										</div>
131 131
 
132 132
 										<div class="give-admin-box-inside">
133 133
 											<p>
134
-												<label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label>&nbsp;
135
-												<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"/>
134
+												<label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label>&nbsp;
135
+												<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"/>
136 136
 											</p>
137 137
 										</div>
138 138
 
139 139
 										<div class="give-admin-box-inside">
140 140
 											<p>
141
-												<label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label>&nbsp;
142
-												<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;
143
-												<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"/>
141
+												<label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label>&nbsp;
142
+												<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;
143
+												<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"/>
144 144
 											</p>
145 145
 										</div>
146 146
 
@@ -154,18 +154,18 @@  discard block
 block discarded – undo
154 154
 										 *
155 155
 										 * @param int $payment_id Payment id.
156 156
 										 */
157
-										do_action( 'give_view_order_details_update_inner', $payment_id );
157
+										do_action('give_view_order_details_update_inner', $payment_id);
158 158
 
159 159
 										// @TODO: Fees
160
-										$fees = give_get_payment_fees( $payment_id );
161
-										if ( ! empty( $fees ) ) : ?>
160
+										$fees = give_get_payment_fees($payment_id);
161
+										if ( ! empty($fees)) : ?>
162 162
 											<div class="give-order-fees give-admin-box-inside">
163
-												<p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p>
163
+												<p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p>
164 164
 												<ul class="give-payment-fees">
165
-													<?php foreach ( $fees as $fee ) : ?>
165
+													<?php foreach ($fees as $fee) : ?>
166 166
 														<li>
167 167
 															<span class="fee-label"><?php echo $fee['label']; ?>:</span>
168
-															<span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span>
168
+															<span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span>
169 169
 														</li>
170 170
 													<?php endforeach; ?>
171 171
 												</ul>
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 
175 175
 										<div class="give-order-payment give-admin-box-inside">
176 176
 											<p>
177
-												<label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label>&nbsp;
178
-												<?php echo give_currency_symbol( $payment->currency ); ?>
179
-												&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 ) ) ); ?>"/>
177
+												<label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label>&nbsp;
178
+												<?php echo give_currency_symbol($payment->currency); ?>
179
+												&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))); ?>"/>
180 180
 											</p>
181 181
 										</div>
182 182
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 										 *
189 189
 										 * @param int $payment_id Payment id.
190 190
 										 */
191
-										do_action( 'give_view_order_details_totals_after', $payment_id );
191
+										do_action('give_view_order_details_totals_after', $payment_id);
192 192
 										?>
193 193
 
194 194
 									</div>
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
 									 *
207 207
 									 * @param int $payment_id Payment id.
208 208
 									 */
209
-									do_action( 'give_view_order_details_update_before', $payment_id );
209
+									do_action('give_view_order_details_update_before', $payment_id);
210 210
 									?>
211 211
 
212 212
 									<div id="major-publishing-actions">
213 213
 										<div id="publishing-action">
214
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/>
215
-											<?php if ( give_is_payment_complete( $payment_id ) ) : ?>
216
-												<a href="<?php echo esc_url( add_query_arg( array(
214
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/>
215
+											<?php if (give_is_payment_complete($payment_id)) : ?>
216
+												<a href="<?php echo esc_url(add_query_arg(array(
217 217
 													'give-action' => 'email_links',
218 218
 													'purchase_id' => $payment_id,
219
-												) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>
219
+												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a>
220 220
 											<?php endif; ?>
221 221
 										</div>
222 222
 										<div class="clear"></div>
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 									 *
231 231
 									 * @param int $payment_id Payment id.
232 232
 									 */
233
-									do_action( 'give_view_order_details_update_after', $payment_id );
233
+									do_action('give_view_order_details_update_after', $payment_id);
234 234
 									?>
235 235
 
236 236
 								</div>
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 							<div id="give-order-details" class="postbox give-order-data">
243 243
 
244
-								<h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3>
244
+								<h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3>
245 245
 
246 246
 								<div class="inside">
247 247
 									<div class="give-admin-box">
@@ -254,44 +254,44 @@  discard block
 block discarded – undo
254 254
 										 *
255 255
 										 * @param int $payment_id Payment id.
256 256
 										 */
257
-										do_action( 'give_view_order_details_payment_meta_before', $payment_id );
257
+										do_action('give_view_order_details_payment_meta_before', $payment_id);
258 258
 
259
-										$gateway = give_get_payment_gateway( $payment_id );
260
-										if ( $gateway ) : ?>
259
+										$gateway = give_get_payment_gateway($payment_id);
260
+										if ($gateway) : ?>
261 261
 											<div class="give-order-gateway give-admin-box-inside">
262 262
 												<p>
263
-													<strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong>&nbsp;
264
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
263
+													<strong><?php esc_html_e('Gateway:', 'give'); ?></strong>&nbsp;
264
+													<?php echo give_get_gateway_admin_label($gateway); ?>
265 265
 												</p>
266 266
 											</div>
267 267
 										<?php endif; ?>
268 268
 
269 269
 										<div class="give-order-payment-key give-admin-box-inside">
270 270
 											<p>
271
-												<strong><?php esc_html_e( 'Key:', 'give' ); ?></strong>&nbsp;
272
-												<?php echo give_get_payment_key( $payment_id ); ?>
271
+												<strong><?php esc_html_e('Key:', 'give'); ?></strong>&nbsp;
272
+												<?php echo give_get_payment_key($payment_id); ?>
273 273
 											</p>
274 274
 										</div>
275 275
 
276 276
 										<div class="give-order-ip give-admin-box-inside">
277 277
 											<p>
278
-												<strong><?php esc_html_e( 'IP:', 'give' ); ?></strong>&nbsp;
279
-												<?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
278
+												<strong><?php esc_html_e('IP:', 'give'); ?></strong>&nbsp;
279
+												<?php echo esc_html(give_get_payment_user_ip($payment_id)); ?>
280 280
 											</p>
281 281
 										</div>
282 282
 
283
-										<?php if ( $transaction_id ) : ?>
283
+										<?php if ($transaction_id) : ?>
284 284
 											<div class="give-order-tx-id give-admin-box-inside">
285 285
 												<p>
286
-													<strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong>&nbsp;
287
-													<?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
286
+													<strong><?php esc_html_e('Donation ID:', 'give'); ?></strong>&nbsp;
287
+													<?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?>
288 288
 												</p>
289 289
 											</div>
290 290
 										<?php endif; ?>
291 291
 
292 292
 										<div class="give-admin-box-inside">
293
-											<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 ) ) ) ); ?>
294
-												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
293
+											<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)))); ?>
294
+												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor &raquo;', 'give'); ?></a>
295 295
 											</p>
296 296
 										</div>
297 297
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 										 *
304 304
 										 * @param int $payment_id Payment id.
305 305
 										 */
306
-										do_action( 'give_view_order_details_payment_meta_after', $payment_id );
306
+										do_action('give_view_order_details_payment_meta_after', $payment_id);
307 307
 										?>
308 308
 
309 309
 									</div>
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 							 *
324 324
 							 * @param int $payment_id Payment id.
325 325
 							 */
326
-							do_action( 'give_view_order_details_sidebar_after', $payment_id );
326
+							do_action('give_view_order_details_sidebar_after', $payment_id);
327 327
 							?>
328 328
 
329 329
 						</div>
@@ -343,50 +343,50 @@  discard block
 block discarded – undo
343 343
 							 *
344 344
 							 * @param int $payment_id Payment id.
345 345
 							 */
346
-							do_action( 'give_view_order_details_main_before', $payment_id );
346
+							do_action('give_view_order_details_main_before', $payment_id);
347 347
 							?>
348 348
 
349 349
 							<?php $column_count = 'columns-3'; ?>
350 350
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
351
-								<h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3>
351
+								<h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3>
352 352
 
353 353
 								<div class="inside">
354 354
 
355 355
 									<div class="column-container">
356 356
 										<div class="column">
357 357
 											<p>
358
-												<strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br>
358
+												<strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br>
359 359
 												<?php
360
-												if ( $payment_meta['form_id'] ) :
360
+												if ($payment_meta['form_id']) :
361 361
 													printf(
362 362
 														'<a href="%1$s" target="_blank">#%2$s</a>',
363
-														admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
363
+														admin_url('post.php?action=edit&post='.$payment_meta['form_id']),
364 364
 														$payment_meta['form_id']
365 365
 													);
366 366
 												endif;
367 367
 												?>
368 368
 											</p>
369 369
 											<p>
370
-												<strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
371
-												<?php give_get_form_dropdown( array(
370
+												<strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br>
371
+												<?php give_get_form_dropdown(array(
372 372
 													'id'       => $payment_meta['form_id'],
373 373
 													'selected' => $payment_meta['form_id'],
374 374
 													'chosen'   => true,
375
-												), true ); ?>
375
+												), true); ?>
376 376
 											</p>
377 377
 										</div>
378 378
 										<div class="column">
379 379
 											<p>
380
-												<strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br>
381
-												<?php echo date_i18n( give_date_format(), $payment_date ); ?>
380
+												<strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br>
381
+												<?php echo date_i18n(give_date_format(), $payment_date); ?>
382 382
 											</p>
383 383
 											<p>
384
-												<strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br>
384
+												<strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br>
385 385
 												<span class="give-donation-level">
386 386
 													<?php
387
-													$var_prices = give_has_variable_prices( $payment_meta['form_id'] );
388
-													if ( empty( $var_prices ) ) {
389
-														esc_html_e( 'n/a', 'give' );
387
+													$var_prices = give_has_variable_prices($payment_meta['form_id']);
388
+													if (empty($var_prices)) {
389
+														esc_html_e('n/a', 'give');
390 390
 													} else {
391 391
 														// Variable price dropdown options.
392 392
 														$variable_price_dropdown_option = array(
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 															'selected'        => $payment_meta['price_id'],
398 398
 														);
399 399
 														// Render variable prices select tag html.
400
-														give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
400
+														give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
401 401
 													}
402 402
 													?>
403 403
 												</span>
@@ -405,8 +405,8 @@  discard block
 block discarded – undo
405 405
 										</div>
406 406
 										<div class="column">
407 407
 											<p>
408
-												<strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
409
-												<?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?>
408
+												<strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br>
409
+												<?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?>
410 410
 											</p>
411 411
 											<p>
412 412
 												<?php
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 												 *
420 420
 												 * @param int $payment_id Payment id.
421 421
 												 */
422
-												do_action( 'give_donation_details_thead_before', $payment_id );
422
+												do_action('give_donation_details_thead_before', $payment_id);
423 423
 
424 424
 
425 425
 												/**
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 												 *
432 432
 												 * @param int $payment_id Payment id.
433 433
 												 */
434
-												do_action( 'give_donation_details_thead_after', $payment_id );
434
+												do_action('give_donation_details_thead_after', $payment_id);
435 435
 
436 436
 												/**
437 437
 												 * Fires in order details page, in the donation-information metabox, before the body elements.
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 												 *
443 443
 												 * @param int $payment_id Payment id.
444 444
 												 */
445
-												do_action( 'give_donation_details_tbody_before', $payment_id );
445
+												do_action('give_donation_details_tbody_before', $payment_id);
446 446
 
447 447
 												/**
448 448
 												 * Fires in order details page, in the donation-information metabox, after the body elements.
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 												 *
454 454
 												 * @param int $payment_id Payment id.
455 455
 												 */
456
-												do_action( 'give_donation_details_tbody_after', $payment_id );
456
+												do_action('give_donation_details_tbody_after', $payment_id);
457 457
 												?>
458 458
 											</p>
459 459
 										</div>
@@ -473,57 +473,57 @@  discard block
 block discarded – undo
473 473
 							 *
474 474
 							 * @param int $payment_id Payment id.
475 475
 							 */
476
-							do_action( 'give_view_order_details_files_after', $payment_id );
476
+							do_action('give_view_order_details_files_after', $payment_id);
477 477
 							?>
478 478
 
479 479
 							<div id="give-donor-details" class="postbox">
480
-								<h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3>
480
+								<h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3>
481 481
 
482 482
 								<div class="inside">
483 483
 
484
-									<?php $customer = new Give_Customer( $customer_id ); ?>
484
+									<?php $customer = new Give_Customer($customer_id); ?>
485 485
 
486 486
 									<div class="column-container customer-info">
487 487
 										<div class="column">
488 488
 											<p>
489
-												<strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br>
489
+												<strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br>
490 490
 												<?php
491
-												if ( ! empty( $customer->id ) ) {
491
+												if ( ! empty($customer->id)) {
492 492
 													printf(
493 493
 														'<a href="%1$s" target="_blank">#%2$s</a>',
494
-														admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ),
494
+														admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id),
495 495
 														$customer->id
496 496
 													);
497 497
 												}
498 498
 												?>
499 499
 											</p>
500 500
 											<p>
501
-												<strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br>
502
-												<?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?>
501
+												<strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br>
502
+												<?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?>
503 503
 											</p>
504 504
 										</div>
505 505
 										<div class="column">
506 506
 											<p>
507
-												<strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br>
507
+												<strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br>
508 508
 												<?php echo $customer->name; ?>
509 509
 											</p>
510 510
 											<p>
511
-												<strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br>
511
+												<strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br>
512 512
 												<?php echo $customer->email; ?>
513 513
 											</p>
514 514
 										</div>
515 515
 										<div class="column">
516 516
 											<p>
517
-												<strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br>
517
+												<strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br>
518 518
 												<?php
519
-												echo Give()->html->donor_dropdown( array(
519
+												echo Give()->html->donor_dropdown(array(
520 520
 													'selected' => $customer->id,
521 521
 													'name'     => 'customer-id',
522
-												) );
522
+												));
523 523
 												?>
524 524
 											</p>
525 525
 											<p>
526
-												<a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a>
526
+												<a href="#new" class="give-payment-new-customer"><?php esc_html_e('Create New Donor', 'give'); ?></a>
527 527
 											</p>
528 528
 										</div>
529 529
 									</div>
@@ -531,13 +531,13 @@  discard block
 block discarded – undo
531 531
 									<div class="column-container new-customer" style="display: none">
532 532
 										<div class="column">
533 533
 											<p>
534
-												<label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label>
534
+												<label for="give-new-customer-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label>
535 535
 												<input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/>
536 536
 											</p>
537 537
 										</div>
538 538
 										<div class="column">
539 539
 											<p>
540
-												<label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label>
540
+												<label for="give-new-customer-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label>
541 541
 												<input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/>
542 542
 											</p>
543 543
 										</div>
@@ -545,9 +545,9 @@  discard block
 block discarded – undo
545 545
 											<p>
546 546
 												<input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>
547 547
 												<input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>
548
-												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
548
+												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a>
549 549
 												<br>
550
-												<em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
550
+												<em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em>
551 551
 											</p>
552 552
 										</div>
553 553
 									</div>
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 									 * @param array $payment_meta Payment meta.
564 564
 									 * @param array $user_info    User information.
565 565
 									 */
566
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
566
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
567 567
 
568 568
 									/**
569 569
 									 * Fires in order details page, in the donor-details metabox.
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 									 *
573 573
 									 * @param int $payment_id Payment id.
574 574
 									 */
575
-									do_action( 'give_payment_view_details', $payment_id );
575
+									do_action('give_payment_view_details', $payment_id);
576 576
 									?>
577 577
 
578 578
 								</div>
@@ -588,11 +588,11 @@  discard block
 block discarded – undo
588 588
 							 *
589 589
 							 * @param int $payment_id Payment id.
590 590
 							 */
591
-							do_action( 'give_view_order_details_billing_before', $payment_id );
591
+							do_action('give_view_order_details_billing_before', $payment_id);
592 592
 							?>
593 593
 
594 594
 							<div id="give-billing-details" class="postbox">
595
-								<h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3>
595
+								<h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3>
596 596
 
597 597
 								<div class="inside">
598 598
 
@@ -602,57 +602,57 @@  discard block
 block discarded – undo
602 602
 											<div class="data column-container">
603 603
 												<div class="column">
604 604
 													<div class="give-wrap-address-line1">
605
-														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1', 'give' ); ?>:</label>
606
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
605
+														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1', 'give'); ?>:</label>
606
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
607 607
 													</div>
608 608
 													<div class="give-wrap-address-line2">
609
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2', 'give' ); ?>:</label>
610
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
609
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2', 'give'); ?>:</label>
610
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
611 611
 													</div>
612 612
 												</div>
613 613
 												<div class="column">
614 614
 													<div class="give-wrap-address-city">
615
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
616
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
615
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
616
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
617 617
 													</div>
618 618
 													<div class="give-wrap-address-zip">
619
-														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label>
620
-														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
619
+														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label>
620
+														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
621 621
 
622 622
 													</div>
623 623
 												</div>
624 624
 												<div class="column">
625 625
 													<div id="give-order-address-country-wrap">
626
-														<label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label>
626
+														<label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label>
627 627
 														<?php
628
-														echo Give()->html->select( array(
628
+														echo Give()->html->select(array(
629 629
 															'options'          => give_get_country_list(),
630 630
 															'name'             => 'give-payment-address[0][country]',
631 631
 															'selected'         => $address['country'],
632 632
 															'show_option_all'  => false,
633 633
 															'show_option_none' => false,
634 634
 															'chosen'           => true,
635
-															'placeholder'      => esc_attr__( 'Select a country', 'give' ),
636
-														) );
635
+															'placeholder'      => esc_attr__('Select a country', 'give'),
636
+														));
637 637
 														?>
638 638
 													</div>
639 639
 													<div id="give-order-address-state-wrap">
640
-														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label>
640
+														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label>
641 641
 														<?php
642
-														$states = give_get_states( $address['country'] );
643
-														if ( ! empty( $states ) ) {
644
-															echo Give()->html->select( array(
642
+														$states = give_get_states($address['country']);
643
+														if ( ! empty($states)) {
644
+															echo Give()->html->select(array(
645 645
 																'options'          => $states,
646 646
 																'name'             => 'give-payment-address[0][state]',
647 647
 																'selected'         => $address['state'],
648 648
 																'show_option_all'  => false,
649 649
 																'show_option_none' => false,
650 650
 																'chosen'           => true,
651
-																'placeholder'      => esc_attr__( 'Select a state', 'give' ),
652
-															) );
651
+																'placeholder'      => esc_attr__('Select a state', 'give'),
652
+															));
653 653
 														} else {
654 654
 															?>
655
-															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
655
+															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
656 656
 															<?php
657 657
 														} ?>
658 658
 													</div>
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 									 *
673 673
 									 * @param int $payment_id Payment id.
674 674
 									 */
675
-									do_action( 'give_payment_billing_details', $payment_id );
675
+									do_action('give_payment_billing_details', $payment_id);
676 676
 									?>
677 677
 
678 678
 								</div>
@@ -688,32 +688,32 @@  discard block
 block discarded – undo
688 688
 							 *
689 689
 							 * @param int $payment_id Payment id.
690 690
 							 */
691
-							do_action( 'give_view_order_details_billing_after', $payment_id );
691
+							do_action('give_view_order_details_billing_after', $payment_id);
692 692
 							?>
693 693
 
694 694
 							<div id="give-payment-notes" class="postbox">
695
-								<h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3>
695
+								<h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3>
696 696
 
697 697
 								<div class="inside">
698 698
 									<div id="give-payment-notes-inner">
699 699
 										<?php
700
-										$notes = give_get_payment_notes( $payment_id );
701
-										if ( ! empty( $notes ) ) {
700
+										$notes = give_get_payment_notes($payment_id);
701
+										if ( ! empty($notes)) {
702 702
 											$no_notes_display = ' style="display:none;"';
703
-											foreach ( $notes as $note ) :
703
+											foreach ($notes as $note) :
704 704
 
705
-												echo give_get_payment_note_html( $note, $payment_id );
705
+												echo give_get_payment_note_html($note, $payment_id);
706 706
 
707 707
 											endforeach;
708 708
 										} else {
709 709
 											$no_notes_display = '';
710 710
 										}
711
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?>
711
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?>
712 712
 									</div>
713 713
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
714 714
 
715 715
 									<div class="give-clearfix">
716
-										<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>
716
+										<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>
717 717
 									</div>
718 718
 
719 719
 								</div>
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 							 *
730 730
 							 * @param int $payment_id Payment id.
731 731
 							 */
732
-							do_action( 'give_view_order_details_main_after', $payment_id );
732
+							do_action('give_view_order_details_main_after', $payment_id);
733 733
 							?>
734 734
 
735 735
 						</div>
@@ -751,11 +751,11 @@  discard block
 block discarded – undo
751 751
 		 *
752 752
 		 * @param int $payment_id Payment id.
753 753
 		 */
754
-		do_action( 'give_view_order_details_form_bottom', $payment_id );
754
+		do_action('give_view_order_details_form_bottom', $payment_id);
755 755
 
756
-		wp_nonce_field( 'give_update_payment_details_nonce' );
756
+		wp_nonce_field('give_update_payment_details_nonce');
757 757
 		?>
758
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
758
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
759 759
 		<input type="hidden" name="give_action" value="update_payment_details"/>
760 760
 	</form>
761 761
 	<?php
@@ -766,6 +766,6 @@  discard block
 block discarded – undo
766 766
 	 *
767 767
 	 * @param int $payment_id Payment id.
768 768
 	 */
769
-	do_action( 'give_view_order_details_after', $payment_id );
769
+	do_action('give_view_order_details_after', $payment_id);
770 770
 	?>
771 771
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.
includes/scripts.php 1 patch
Spacing   +148 added lines, -148 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_get_option( 'scripts_footer' ) == 'on' ) ? true : false;
28
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
29
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
30
+	$scripts_footer = (give_get_option('scripts_footer') == 'on') ? 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_get_option( 'disable_css', false ) ) {
147
+	if (give_get_option('disable_css', false)) {
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,70 +221,70 @@  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', 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', 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_enqueue_script( 'jquery-ui-datepicker' );
276
-	wp_enqueue_script( 'thickbox' );
275
+	wp_enqueue_script('jquery-ui-datepicker');
276
+	wp_enqueue_script('thickbox');
277 277
 
278 278
 	// Forms CPT Script.
279
-	if ( $post_type === 'give_forms' ) {
280
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
281
-		wp_enqueue_script( 'give-admin-forms-scripts' );
279
+	if ($post_type === 'give_forms') {
280
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
281
+		wp_enqueue_script('give-admin-forms-scripts');
282 282
 	}
283 283
 
284 284
 	// Settings Scripts.
285
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) {
286
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
287
-		wp_enqueue_script( 'give-admin-settings-scripts' );
285
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
286
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
287
+		wp_enqueue_script('give-admin-settings-scripts');
288 288
 	}
289 289
 
290 290
 	// Price Separators.
@@ -292,46 +292,46 @@  discard block
 block discarded – undo
292 292
 	$decimal_separator  = give_get_price_decimal_separator();
293 293
 
294 294
 	// Localize strings & variables for JS.
295
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
296
-		'post_id'                 => isset( $post->ID ) ? $post->ID : null,
295
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
296
+		'post_id'                 => isset($post->ID) ? $post->ID : null,
297 297
 		'give_version'            => GIVE_VERSION,
298 298
 		'thousands_separator'     => $thousand_separator,
299 299
 		'decimal_separator'       => $decimal_separator,
300
-		'quick_edit_warning'      => __( 'Not available for variable priced forms.', 'give' ),
301
-		'delete_payment'          => __( 'Are you sure you wish to delete this payment?', 'give' ),
302
-		'delete_payment_note'     => __( 'Are you sure you wish to delete this note?', 'give' ),
303
-		'revoke_api_key'          => __( 'Are you sure you wish to revoke this API key?', 'give' ),
304
-		'regenerate_api_key'      => __( 'Are you sure you wish to regenerate this API key?', 'give' ),
305
-		'resend_receipt'          => __( 'Are you sure you wish to resend the donation receipt?', 'give' ),
306
-		'copy_download_link_text' => __( 'Copy these links to your clipboard and give them to your donor.', 'give' ),
307
-		'delete_payment_download' => __( 'Are you sure you wish to delete this form?', 'give' ),
308
-		'one_price_min'           => __( 'You must have at least one price.', 'give' ),
309
-		'one_file_min'            => __( 'You must have at least one file.', 'give' ),
310
-		'one_field_min'           => __( 'You must have at least one field.', 'give' ),
311
-		'one_option'              => __( 'Choose a form', 'give' ),
312
-		'one_or_more_option'      => __( 'Choose one or more forms', 'give' ),
313
-		'numeric_item_price'      => __( 'Item price must be numeric.', 'give' ),
314
-		'numeric_quantity'        => __( 'Quantity must be numeric.', 'give' ),
315
-		'currency_sign'           => give_currency_filter( '' ),
316
-		'currency_pos'            => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
317
-		'currency_decimals'       => give_currency_decimal_filter( give_get_price_decimals() ),
318
-		'new_media_ui'            => apply_filters( 'give_use_35_media_ui', 1 ),
319
-		'remove_text'             => __( 'Remove', 'give' ),
320
-		'type_to_search'          => __( 'Type to search forms', 'give' ),
321
-		'batch_export_no_class'   => __( 'You must choose a method.', 'give' ),
322
-		'batch_export_no_reqs'    => __( 'Required fields not completed.', 'give' ),
323
-		'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' ),
324
-		'price_format_guide'      => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
325
-	) );
326
-
327
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
300
+		'quick_edit_warning'      => __('Not available for variable priced forms.', 'give'),
301
+		'delete_payment'          => __('Are you sure you wish to delete this payment?', 'give'),
302
+		'delete_payment_note'     => __('Are you sure you wish to delete this note?', 'give'),
303
+		'revoke_api_key'          => __('Are you sure you wish to revoke this API key?', 'give'),
304
+		'regenerate_api_key'      => __('Are you sure you wish to regenerate this API key?', 'give'),
305
+		'resend_receipt'          => __('Are you sure you wish to resend the donation receipt?', 'give'),
306
+		'copy_download_link_text' => __('Copy these links to your clipboard and give them to your donor.', 'give'),
307
+		'delete_payment_download' => __('Are you sure you wish to delete this form?', 'give'),
308
+		'one_price_min'           => __('You must have at least one price.', 'give'),
309
+		'one_file_min'            => __('You must have at least one file.', 'give'),
310
+		'one_field_min'           => __('You must have at least one field.', 'give'),
311
+		'one_option'              => __('Choose a form', 'give'),
312
+		'one_or_more_option'      => __('Choose one or more forms', 'give'),
313
+		'numeric_item_price'      => __('Item price must be numeric.', 'give'),
314
+		'numeric_quantity'        => __('Quantity must be numeric.', 'give'),
315
+		'currency_sign'           => give_currency_filter(''),
316
+		'currency_pos'            => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
317
+		'currency_decimals'       => give_currency_decimal_filter(give_get_price_decimals()),
318
+		'new_media_ui'            => apply_filters('give_use_35_media_ui', 1),
319
+		'remove_text'             => __('Remove', 'give'),
320
+		'type_to_search'          => __('Type to search forms', 'give'),
321
+		'batch_export_no_class'   => __('You must choose a method.', 'give'),
322
+		'batch_export_no_reqs'    => __('Required fields not completed.', 'give'),
323
+		'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'),
324
+		'price_format_guide'      => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
325
+	));
326
+
327
+	if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) {
328 328
 		// call for new media manager.
329 329
 		wp_enqueue_media();
330 330
 	}
331 331
 
332 332
 }
333 333
 
334
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
334
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
335 335
 
336 336
 /**
337 337
  * Admin Give Icon
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
 	?>
347 347
     <style type="text/css" media="screen">
348 348
 
349
-        <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?>
349
+        <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?>
350 350
         @font-face {
351 351
             font-family: 'give-icomoon';
352
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>');
353
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
354
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
355
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
352
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>');
353
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
354
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
355
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
356 356
             font-weight: normal;
357 357
             font-style: normal;
358 358
         }
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	<?php
372 372
 }
373 373
 
374
-add_action( 'admin_head', 'give_admin_icon' );
374
+add_action('admin_head', 'give_admin_icon');
375 375
 
376 376
 /**
377 377
  * Admin js code
@@ -401,4 +401,4 @@  discard block
 block discarded – undo
401 401
 	<?php
402 402
 }
403 403
 
404
-add_action( 'admin_head', 'give_admin_hide_notice_shortly_js' );
404
+add_action('admin_head', 'give_admin_hide_notice_shortly_js');
Please login to merge, or discard this patch.