• Resolved emanuele303

    (@emanuele303)


    Hi,
    is it possible generate a same password from registration form?

    Example form field:
    name surname email

    After registration the users login by same password “myaccessesite”.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @emanuele303

    You can try this code snippet to apply the same password to new users registered on your site:

    add_action("um_registration_complete","um_051121_apply_same_password", 1, 2 );
    function m_051121_apply_same_password( $user_id, $args ){
       wp_set_password( "myaccessesite", $user_id );
    }

    You can add this in the theme’s functions.php file or use the Code Snippets plugin to run the code.

    Regards,

    Thread Starter emanuele303

    (@emanuele303)

    Thank you for your help.

    I try:
    add_action(“um_registration_complete”,”um_051121_apply_same_password”, 1, 2 );
    and
    add_action(“um_before_save_registration_details”,”um_051121_apply_same_password”, 1, 2 );

    But dosen’t work…

    i don’t understand

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @emanuele303

    When you added the code, did you try registering a new user and see if the password myaccessesite has been set to that user? It will only apply to newly registered users.

    Regards,

    Thread Starter emanuele303

    (@emanuele303)

    Hi ,
    When you added the code, did you try registering a new user and see if the password myaccessesite has been set to that user?

    yes i have follow this.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @emanuele303

    Sorry, there was a typo in the code. Please try this instead:

    add_action("um_registration_complete","um_051121_apply_same_password", 1, 2 );
    function um_051121_apply_same_password( $user_id, $args ){
       wp_set_password( "myaccessesite", $user_id );
    }

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Password generator’ is closed to new replies.