Code Duplication    Length = 10-10 lines in 2 locations

includes/admin/payments/actions.php 1 location

@@ 409-418 (lines=10) @@
406
	if ( ! give_has_upgrade_completed( 'v230_move_donor_note' ) ) {
407
		// Backward compatibility.
408
		$note_id = give_insert_payment_note( $payment_id, $note );
409
	} else {
410
		$note_id = Give()->comment->db->add(
411
			array(
412
				'comment_parent'  => $payment_id,
413
				'user_id'         => get_current_user_id(),
414
				'comment_content' => $note,
415
				'comment_type'    => 'donation',
416
			)
417
		);
418
	}
419
420
	if( $note_id && $note_type ) {
421

includes/class-give-donor.php 1 location

@@ 995-1004 (lines=10) @@
992
		if ( ! give_has_upgrade_completed( 'v230_move_donor_note' ) ) {
993
			// Backward compatibility.
994
			$updated = $this->update( array( 'notes' => $notes ) );
995
		} else {
996
			$updated = Give()->comment->db->add(
997
				array(
998
					'comment_content' => $note,
999
					'user_id'         => get_current_user_id(),
1000
					'comment_parent'  => $this->id,
1001
					'comment_type'    => 'donor',
1002
				)
1003
			);
1004
		}
1005
1006
		if ( $updated ) {
1007
			$this->notes = $this->get_notes();