Email AS Username & Nickname AS Publicname

This topic contains 4 reply and 2 voices, and was last updated by Sekander Badsha 9 years, 9 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
July 9, 2014 at 1:56 pm 23229
Sekander Badsha 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
July 10, 2014 at 3:18 pm 23288
Sekander Badsha Sekander Badsha

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. 🙂

July 10, 2014 at 6:48 pm 23308
Denis Denis

Thanks a lot, this helps!

July 11, 2014 at 4:33 am 23334
Denis Denis

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?

July 12, 2014 at 5:35 pm 23380
Sekander Badsha Sekander Badsha

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

Viewing 4 Posts - 1 through 4 (of 4 total)