Skip to content

Commit

Permalink
Merge pull request #4213 from impress-org/issue/4211
Browse files Browse the repository at this point in the history
fix: allow title to be set to blank to remove it entirely #4211
  • Loading branch information
Devin Walker committed Aug 1, 2019
2 parents b7ce35d + f15207a commit ee86c9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions includes/admin/donors/donor-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ function give_connect_user_donor_profile( $donor, $donor_data, $address ) {
$donor->update_meta( '_give_donor_first_name', $donor_data['first_name'] );
}

if ( ! empty( $donor_data['last_name'] ) ) {
if ( isset( $donor_data['last_name'] ) ) {
$donor->update_meta( '_give_donor_last_name', $donor_data['last_name'] );
}

if ( ! empty( $donor_data['title'] ) ) {
if ( isset( $donor_data['title'] ) ) {
$donor->update_meta( '_give_donor_title_prefix', $donor_data['title'] );
}

Expand Down
3 changes: 2 additions & 1 deletion includes/admin/donors/donors.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ function give_donor_view( $donor ) {
<span class="donor-name info-item edit-item">
<select name="donor_info[title]">
<option disabled value="0"><?php esc_html_e( 'Title', 'give' ); ?></option>
<option value=""><?php esc_html_e( '', 'give' ); ?></option>
<?php
if ( is_array( $title_prefixes ) && count( $title_prefixes ) > 0 ) {
foreach ( $title_prefixes as $title ) {
Expand Down Expand Up @@ -1036,7 +1037,7 @@ function give_donor_notes_view( $donor ) {
}

/**
* Thw donor delete view.
* The donor delete view.
*
* @since 1.0
*
Expand Down

0 comments on commit ee86c9c

Please sign in to comment.