Code Duplication    Length = 3-5 lines in 4 locations

includes/admin/payments/actions.php 3 locations

@@ 30-32 (lines=3) @@
27
 */
28
function give_update_payment_details( $data ) {
29
30
	if ( ! current_user_can( 'edit_give_payments', $data['give_payment_id'] ) ) {
31
		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
32
	}
33
34
	check_admin_referer( 'give_update_payment_details_nonce' );
35
@@ 458-460 (lines=3) @@
455
		return;
456
	}
457
458
	if ( ! current_user_can( 'edit_give_payments', $data['payment_id'] ) ) {
459
		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
460
	}
461
462
	$edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-messages[]=donation-note-deleted&id=' . absint( $data['payment_id'] ) );
463
@@ 480-482 (lines=3) @@
477
 */
478
function give_ajax_delete_payment_note() {
479
480
	if ( ! current_user_can( 'edit_give_payments', $_POST['payment_id'] ) ) {
481
		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
482
	}
483
484
	if ( give_delete_payment_note( $_POST['note_id'], $_POST['payment_id'] ) ) {
485
		die( '1' );

includes/admin/emails/class-donation-receipt-email.php 1 location

@@ 298-302 (lines=5) @@
295
			// Get donation payment information.
296
			$this->payment = new Give_Payment( $purchase_id );
297
298
			if ( ! current_user_can( 'edit_give_payments', $this->payment->ID ) ) {
299
				wp_die( esc_html__( 'You do not have permission to edit donations.', 'give' ), esc_html__( 'Error', 'give' ), array(
300
					'response' => 403,
301
				) );
302
			}
303
304
			// Setup email data.
305
			$this->setup_email_data();