Hi @shashwata2003
You can change the redirection in the User Role settings. Please go to WP Admin > Ultimate Member > User Roles > Edit a role > Registration Options > “Action to be taken after registration ” > select “Redirect to URL”.
If you need to dynamically change the redirection URL, you need to customize it.
You can try this code snippet:
add_action("um_registration_after_auto_login","um_111921_dynamic_url_redirection");
function um_111921_dynamic_url_redirection( $user_id ){
$url = site_url();
um_fetch_user( $user_id );
$url = $url ."?number=" . um_user("mobile_number");
exit( wp_redirect( $url ) );
}
The above code will only work when the Registration settings have an auto-approve.
Regards,
Where do I add this file. Please reply.
What, I know is, I have to add the code snippet in theme functions.php file right.
Hi @shashwata2003
Yes, you can add it to your theme/child-theme’s functions.php file. I also recommend using the Code Snippet plugin for all the custom codes to your site.
Regards,
Thanks a lot for helping me out.
Thanks for letting us know.
Regards,