Switch from Email to Username

How difficult would it be to augment this plugin to rely on usernames instead of email addresses? Where email addresses can be easily changed by users, and are therefore potentially difficult to track (require a manual check to see if the user has changed from gmail to yahoo to whatever), the username cannot be changed after sign-up, so I can always depend on it staying static. I thought I could perhaps just change any call of $user_email to $user_login, but I went in to look, and got lost.

  • DavidM
    • DEV MAN’s Mascot

    Hi mrjarbenne,

    It actually would be quite a process to alter it to work by username instead.

    Line 57 details the function queue_process() which processes the existing queue and you’ll notice on line 166 the following, which appears to be the line that gets the user by their email:

    $tmp_user = get_user_by_email( $user['add_users_user_email'] );

    You might be able to get the username instead using ger_userdata.

    http://codex.wordpress.org/Function_Reference/get_userdata

    However, there’s likely more to be accounted for with that still. Perhaps you might consider posting this to the feature request forum?

    Cheers,

    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.