• Plugin Contributor eppu

    (@eppu)


    Hi,

    I noticed that using isset function in rusac_prepare_registered_user_data function causes the empty values to erase values from AC.

    Example if I had a user in AC who had first name and last name added from another source and then I would sync the AC account with my WordPress site and in WordPress there would not be first name nor the last name. Then the synchronization would would remove names from AC.

    Code should use ! empty() instead of isset()

    In function rusac_prepare_registered_user_data change

           if (isset($first_name)) {
                $user_data['first_name'] = $first_name;
            }
            if (isset($last_name)) {
                $user_data['last_name'] = $last_name;
            }
            if(isset($mobile)) {
                $user_data['phone'] = $mobile;
            }

    to

            if ( ! empty($first_name)) {
                $user_data['first_name'] = $first_name;
            }
            if ( ! empty($last_name)) {
                $user_data['last_name'] = $last_name;
            }
            if ( ! empty($mobile)) {
                $user_data['phone'] = $mobile;
            }

    Thank you for your time
    Sincerely
    -Eppu

  • The topic ‘Using !empty instead of isset in registered user data’ is closed to new replies.