Skip to content

Commit

Permalink
Merge pull request #1135 from kevinwhoffman/issue/1131
Browse files Browse the repository at this point in the history
Issue/1131
  • Loading branch information
Devin Walker committed Oct 19, 2016
2 parents 0fbc1eb + 58901b0 commit 2688d6a
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions includes/admin/customers/customer-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,11 @@ function give_edit_customer( $args ) {

$defaults = array(
'name' => '',
'email' => '',
'user_id' => 0
);

$customer_info = wp_parse_args( $customer_info, $defaults );

if ( ! is_email( $customer_info['email'] ) ) {
give_set_error( 'give-invalid-email', esc_html__( 'Please enter a valid email address.', 'give' ) );
}

if ( (int) $customer_info['user_id'] != (int) $customer->user_id ) {

// Make sure we don't already have this user attached to a customer
Expand Down Expand Up @@ -117,7 +112,6 @@ function give_edit_customer( $args ) {
// Sanitize the inputs
$customer_data = array();
$customer_data['name'] = strip_tags( stripslashes( $customer_info['name'] ) );
$customer_data['email'] = $customer_info['email'];
$customer_data['user_id'] = $customer_info['user_id'];

$customer_data = apply_filters( 'give_edit_customer_info', $customer_data, $customer_id );
Expand All @@ -139,7 +133,6 @@ function give_edit_customer( $args ) {
do_action( 'give_pre_edit_customer', $customer_id, $customer_data, $address );

$output = array();
$previous_email = $customer->email;

if ( $customer->update( $customer_data ) ) {

Expand All @@ -150,12 +143,6 @@ function give_edit_customer( $args ) {
// Update some donation meta if we need to
$payments_array = explode( ',', $customer->payment_ids );

if ( $customer->email != $previous_email ) {
foreach ( $payments_array as $payment_id ) {
give_update_payment_meta( $payment_id, 'email', $customer->email );
}
}

if ( $customer->user_id != $previous_user_id ) {
foreach ( $payments_array as $payment_id ) {
give_update_payment_meta( $payment_id, '_give_payment_user_id', $customer->user_id );
Expand Down

0 comments on commit 2688d6a

Please sign in to comment.