WordPress.org

Ready to get started?Download WordPress

Forums

WP prepending e-mail with the word 'Email' (2 posts)

  1. annehm
    Member
    Posted 4 years ago #

    Hello,

    I have written a plugin to validate users by calling a java servlet and processing the response. I add new users to wp_users via wp_insert_user and update users via wp_update_user. All is well, except that the e-mail address is being prepended with the word "Email".

    Here's the debug coded I added for a new user:

    foreach ( $userarray as $key=>$value ) {
     echo '<br />'.$key.' '.$value;
    }

    RESULT:
    user_login usernewtest10
    user_pass secretpassword
    first_name
    last_name Besancon
    user_url
    user_email annem@car.org
    description 123456789
    aim
    yim
    jabber
    display_name usernewtest10

    Then I execute this code:

    if ($id = username_exists($username)) {
     $userarray['ID'] = $id;
     wp_update_user($userarray);
    } else {
     wp_insert_user($userarray);
    }
    echo '<br />Has my e-mail changed??? '.$userarray['user_email'];

    RESULT: Has my e-mail changed??? annem@car.org

    All good, right? Except the e-mail address has been stored as Emailannem@car.org. Since I can't show you a screen shot of the admin screen, here's some sql that shows the result:

    select user_login, user_email
    from wp_users
    where user_login = 'usernewtest10'

    RESULT:
    user_login user_email
    ---------- ----------
    usernewtest10 Emailannem@car.org

    Does anyone have any idea why this is happening? I checked the other plugins that were installed, and none of them appear to have anything to do with e-mail addresses.

    Thank you in advance!

  2. annemaxwell
    Member
    Posted 4 years ago #

    I have figured out what the problem is -- user error. Sorry!

Topic Closed

This topic has been closed to new replies.

About this Topic