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