Hook for custom message after registration
-
Hello
Is there a hook/filter for changing the custom message after somebody registers?
To be clear I know you can do it in the settings under each role but I have some custom variables to pass into the message.
I want to change the message with the status “Require admin review”.
Thanks
-
You can customize the Message page template file
message.php.Follow the guidelines explained here
That’s great thanks.
Is there a way to access the form data here?
You have only access to the URL arguments for the Message page via the
$_REQUESTarray.?message=checkmail&um_role=um_prospect&um_form_id=4844Ok thanks.
Is there a way to extend the
$_REQUESTarray to include one or two form fields?You can try this code snippet and make changes both for the
form_idand the profile fieldsfirst_nameandlast_nameI used in this example.?message=checkmail&um_role=um_prospect&um_form_id=4844&first_name=Some&last_name=SmithInstall the code snippet to your active theme’s
functions.phpfile
or use the “Code Snippets” plugin.https://wordpress.org/plugins/code-snippets/
add_filter( 'wp_redirect', 'wp_redirect_extend_message', 10, 2 ); function wp_redirect_extend_message( $location, $status ) { if ( strpos( $location, 'message=checkmail' ) !== false && strpos( $location, 'um_form_id=4844' ) !== false ) { $location = add_query_arg( 'first_name', esc_attr( um_user( 'first_name' ) ), $location ); $location = add_query_arg( 'last_name', esc_attr( um_user( 'last_name' ) ), $location ); } return $location; }-
This reply was modified 2 years, 10 months ago by
missveronica.
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 if any other questions come up and we’d be happy to help. 🙂
Regards
-
This reply was modified 2 years, 10 months ago by
The topic ‘Hook for custom message after registration’ is closed to new replies.