Home Forums Plugin Support WP User Frontend (Free Version) use user 'name' as user nickname in profile

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  towhid 3 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #72968

    Marc Peacock-Smith
    Member
    Post count: 2

    hi currently, when a guest submits a form on my site, if they are not a user then wp frontend user registers them as a user – wonderful.

    At the moment the field ‘name' on the form goes into display name in the user profile

    and the new ‘user name' that the plugin creates, goes into Nickname

    How can I change the plugin files so that the ‘Name' field that the user creates goes into Nickname in their profile – as opposed to their user name?

    Id also like to use the full email address as their user name too?

    Can anyone help?

    #72992

    Marc Peacock-Smith
    Member
    Post count: 2

    Ive managed to put their full name into nickname with wp_update_user( array(‘ID' => $user_id, ‘nickname' => $guest_name) );

    But I cant work out how to use the full email address as username?

    Currently when I log a new user my email address marc@myurl.com gets transformed to a user name of marc23 or some other random number. Even though my user doesnt exist as an active user.

    #73532

    towhid
    Participant
    Post count: 4505

    Hello Marc,

    To use email as username please follow this steps:

    Step 1: Please navigate to plugins/wp-user-frontend/class/render-form.php

    Step 2: Find
    $username = sanitize_user( substr( $email, 0, strpos( $email, '@' ) ) );

    Step 3: Replace the following line over the previous line.
    $username = $email;

    Thanks

    #74313

    Marc Peacock-Smith
    Member
    Post count: 2

    Thank you – that works…much apreciated

    #74330

    towhid
    Participant
    Post count: 4505
    This reply has been marked as private.
Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘use user 'name' as user nickname in profile’ is closed to new replies.