Home Forums Plugin Support WP User Frontend Pro Email AS Username & Nickname AS Publicname

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Sekander Badsha 4 years, 10 months ago.

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

    Denis
    Participant
    Post count: 165

    Hi there,

    thanks for creating a new registration prosess!
    I got two questions. I want the Email Address to be the USERNAME, and the NICKNAME should be the PUBLICNAME.
    How can this be done?
    Cheers,
    Denis

    #23288

    Sekander Badsha
    Member
    Post count: 2067

    Hello Denis,
    If you want to set the mail address as a user name. just simply use the email field but do not any username field. In this way WordPress will assign the mail to username. And to make the NickName use the Nick Name field in the form and add the following codes in your themes function.php
    [php]
    function wpufe_set_nick_as_disp_reg( $user_id ) {
    if ( isset( $_POST[‘nickname'] ) ) {
    wp_update_user( array( ‘ID' => $user_id, ‘display_name' => $_POST[‘nickname'] ) );
    }
    }

    add_action( ‘wpuf_update_profile', ‘wpufe_set_nick_as_disp_reg' );
    [/php]

    We had some discussion before on this topic here: http://wedevs.com/support/topic/default-display-name/ You may see the thread for more clarification.

    Hope this helps. Let me know if you feel any difficulties. ๐Ÿ™‚

    #23308

    Denis
    Participant
    Post count: 165

    Thanks a lot, this helps!

    #23334

    Denis
    Participant
    Post count: 165

    Hey Sekander,
    if I only use the Email field, then the email will be splittet before the @ and then stored.

    like

    meister@denis-online.de becomes just meister

    And to getting the display_name from Nickname its this function.

    function wpufe_set_nick_as_disp( $user_data ) {
        if ( isset( $_POST['nickname'] ) ) {
            $user_data['display_name'] = $_POST['nickname'];
        }
     
        return $user_data;
    }
     
    add_filter( 'wpuf_update_profile_vars', 'wpufe_set_nick_as_disp' );

    Should I do the same for the username?

    #23380

    Sekander Badsha
    Member
    Post count: 2067

    Currently its not possible in our plugin system and we don't have plan to do such.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Email AS Username & Nickname AS Publicname’ is closed to new replies.