@@ -539,23 +539,23 @@ |
||
| 539 | 539 | public function get_donor( $payment ) { |
| 540 | 540 | |
| 541 | 541 | $donor_id = give_get_payment_customer_id( $payment->ID ); |
| 542 | - $donor_billing_name = give_get_donor_name_by( $payment->ID, 'donation'); |
|
| 543 | - $donor_name = give_get_donor_name_by( $donor_id, 'donor'); |
|
| 542 | + $donor_billing_name = give_get_donor_name_by( $payment->ID, 'donation'); |
|
| 543 | + $donor_name = give_get_donor_name_by( $donor_id, 'donor'); |
|
| 544 | 544 | |
| 545 | - $value = ''; |
|
| 545 | + $value = ''; |
|
| 546 | 546 | if ( ! empty( $donor_id ) ) { |
| 547 | 547 | |
| 548 | - // Check whether the donor name and WP_User name is same or not. |
|
| 549 | - if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
| 550 | - $value .= $donor_billing_name . ' ('; |
|
| 551 | - } |
|
| 548 | + // Check whether the donor name and WP_User name is same or not. |
|
| 549 | + if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
| 550 | + $value .= $donor_billing_name . ' ('; |
|
| 551 | + } |
|
| 552 | 552 | |
| 553 | 553 | $value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>'; |
| 554 | 554 | |
| 555 | - // Check whether the donor name and WP_User name is same or not. |
|
| 556 | - if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
| 557 | - $value .= ')'; |
|
| 558 | - } |
|
| 555 | + // Check whether the donor name and WP_User name is same or not. |
|
| 556 | + if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
| 557 | + $value .= ')'; |
|
| 558 | + } |
|
| 559 | 559 | |
| 560 | 560 | } else { |
| 561 | 561 | $email = give_get_payment_user_email( $payment->ID ); |
@@ -514,16 +514,16 @@ |
||
| 514 | 514 | <p> |
| 515 | 515 | <strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br> |
| 516 | 516 | <?php |
| 517 | - $donor_billing_name = give_get_donor_name_by( $payment_id, 'donation' ); |
|
| 518 | - $donor_name = give_get_donor_name_by( $donor_id, 'donor' ); |
|
| 519 | - |
|
| 520 | - // Check whether the donor name and WP_User name is same or not. |
|
| 521 | - if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
| 522 | - echo $donor_billing_name . ' (<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>)'; |
|
| 523 | - }else{ |
|
| 524 | - echo $donor_name; |
|
| 525 | - } |
|
| 526 | - ?> |
|
| 517 | + $donor_billing_name = give_get_donor_name_by( $payment_id, 'donation' ); |
|
| 518 | + $donor_name = give_get_donor_name_by( $donor_id, 'donor' ); |
|
| 519 | + |
|
| 520 | + // Check whether the donor name and WP_User name is same or not. |
|
| 521 | + if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
| 522 | + echo $donor_billing_name . ' (<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>)'; |
|
| 523 | + }else{ |
|
| 524 | + echo $donor_name; |
|
| 525 | + } |
|
| 526 | + ?> |
|
| 527 | 527 | </p> |
| 528 | 528 | <p> |
| 529 | 529 | <strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br> |
@@ -610,31 +610,31 @@ |
||
| 610 | 610 | */ |
| 611 | 611 | function give_get_donor_name_by( $id = 0, $from = 'donation' ) { |
| 612 | 612 | |
| 613 | - // ID shouldn't be empty |
|
| 614 | - if( empty( $id ) ){ |
|
| 615 | - return; |
|
| 616 | - } |
|
| 613 | + // ID shouldn't be empty |
|
| 614 | + if( empty( $id ) ){ |
|
| 615 | + return; |
|
| 616 | + } |
|
| 617 | 617 | |
| 618 | - $name = ''; |
|
| 618 | + $name = ''; |
|
| 619 | 619 | |
| 620 | - switch( $from ){ |
|
| 620 | + switch( $from ){ |
|
| 621 | 621 | |
| 622 | - case 'donation': |
|
| 622 | + case 'donation': |
|
| 623 | 623 | |
| 624 | - $user_info = give_get_payment_meta_user_info( $id ); |
|
| 625 | - $name = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
| 624 | + $user_info = give_get_payment_meta_user_info( $id ); |
|
| 625 | + $name = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
| 626 | 626 | |
| 627 | - break; |
|
| 627 | + break; |
|
| 628 | 628 | |
| 629 | - case 'donor': |
|
| 629 | + case 'donor': |
|
| 630 | 630 | |
| 631 | - $donor = new Give_Customer( $id ); |
|
| 632 | - $name = $donor->name; |
|
| 631 | + $donor = new Give_Customer( $id ); |
|
| 632 | + $name = $donor->name; |
|
| 633 | 633 | |
| 634 | - break; |
|
| 634 | + break; |
|
| 635 | 635 | |
| 636 | - } |
|
| 636 | + } |
|
| 637 | 637 | |
| 638 | - return trim( $name ); |
|
| 638 | + return trim( $name ); |
|
| 639 | 639 | |
| 640 | 640 | } |