Use email address as userid

Hello,

I have installed and activated membership plugin. I wanted to customize the signup screen so that the email-address of the user is used as user id so the signup form is simplified to just two fields, email address and password. Is this doable.

Regards
Bhavi

  • DavidM
    • DEV MAN’s Mascot

    Hi Bhavi,

    I couldn't really see a way to do that apart from editing the core registration forms. To do that though, you can edit one of the following two, depending on whether you're using BuddyPress:
    /membership/membershipincludes/includes/bp.registration.form.php
    /membership/membershipincludes/includes/registration.form.php

    You can easily hide the "user_login" form field by changing it to a hidden type like so:
    <input type="hidden" value="<?php echo esc_attr($_POST['user_login']); ?>" class="regtext" name="user_login"></p>

    And you could use javascript to change the "user_login" value based on any changes to the "user_email" value, though getting that javascript included in that page may require a bit of work, unless you don't mind including it in your theme's header.

    I'll ask the developer if there's a simpler way though.

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.