Simple Membership Plugin › Forums › Simple Membership Plugin › Re-direct after free registration
- This topic has 13 replies, 5 voices, and was last updated 8 years, 1 month ago by
admin.
-
AuthorPosts
-
December 26, 2017 at 12:33 pm #12788
tystra
ParticipantHi there, wondering how to re-direct the user to a custom ‘Welcome’ page after registering for our membership, which is a Free membership?
Right now, the page just refreshes with the text “Registration Successful, please login”, but I want them to be re-directed to a different page entirely.
Thanks for the help.
December 26, 2017 at 9:47 pm #12790mbrsolution
ModeratorHi, have you installed the following plugin/addon?
Thank you
December 27, 2017 at 1:42 am #12792tystra
ParticipantYes, I have, but that’s for login though, right?
For login, they should just direct to the previous page they were on, which is how it’s set up. But I want the redirection only once for new users after they Register successfully from the membership form page.
December 27, 2017 at 2:23 am #12793mbrsolution
ModeratorHi, in that case add the following function to your theme functions.php file.
add_action('swpm_front_end_registration_complete', 'sam_after_registration_redirection'); function sam_after_registration_redirection() { $url = 'http://www.yourwebsite.com/thank-you/';//TODO - Specify the URL that you want to redirect to wp_redirect($url); }Let me know if it works for you.
Thank you
December 27, 2017 at 2:31 am #12794tystra
ParticipantOkay I tried that, but it still just reloaded the registration form page with the ‘Registration Successful..’ message, and didn’t re-direct to the page I added in that code. Anything else to try?
December 27, 2017 at 2:55 am #12795mbrsolution
ModeratorOkay try the following.
Disable all other plugins except this plugin. Also disable any other addon for Simple Membership if you have any installed. Then try the code above.
Also are you using the Form Builder addon?
Regards
December 27, 2017 at 3:15 am #12796tystra
ParticipantOkay I disabled everything and still got the same result. I’m not using the form builder add-on, just the default form.
December 27, 2017 at 3:24 am #12797mbrsolution
ModeratorI have run out of ideas. Sorry about this.
I have submitted a message to the developers to investigate further your issue.
Thank you
December 29, 2017 at 3:19 am #12819admin
KeymasterThat code (if used properly) should just work. Are you using the form builder addon by any chance? If are then you should use the following (it will cover the form builder addon also):
add_action('swpm_front_end_registration_complete', 'sam_after_registration_redirection'); add_action('swpm_front_end_registration_complete_fb', 'sam_after_registration_redirection'); function sam_after_registration_redirection() { //TODO - Specify the URL that you want to redirect to $url = 'http://www.yourwebsite.com/thank-you-for-registering/'; wp_redirect($url); }December 30, 2017 at 8:44 am #12824Jack
ParticipantHi,
I am running into the same problem so wonder if there is any solution?
I don’t have any add-on installed or any other WP plugins except for the default ones. I added the codes to the top of the functions.php file under the WP Twenty Sixteen theme.
After registering the registration page is displayed again with no body text.
Thanks.
JackDecember 30, 2017 at 8:46 am #12825Jack
ParticipantBtw, the following is the code excerpt from functions.php. The site is running in localhost hence the localhost URL.
<?php /** * Twenty Sixteen functions and definitions * * Set up the theme and provides some helper functions, which are used in the * theme as custom template tags. Others are attached to action and filter * hooks in WordPress to change core functionality. * * When using a child theme you can override certain functions (those wrapped * in a function_exists() call) by defining them first in your child theme's * functions.php file. The child theme's functions.php file is included before * the parent theme's file, so the child theme functions would be used. * * @link https://codex.wordpress.org/Theme_Development * @link https://codex.wordpress.org/Child_Themes * * Functions that are not pluggable (not wrapped in function_exists()) are * instead attached to a filter or action hook. * * For more information on hooks, actions, and filters, * {@link https://codex.wordpress.org/Plugin_API} * * @package WordPress * @subpackage Twenty_Sixteen * @since Twenty Sixteen 1.0 */ /** * Supprt for registration redirection in Simple Membership plugin. */ add_action('swpm_front_end_registration_complete', 'do_after_rego_redirection'); add_action('swpm_front_end_registration_complete_fb', 'do_after_rego_redirection'); function do_after_rego_redirection() { //TODO - Specify the URL that you want to redirect to $url = 'http://localhost/'; wp_redirect($url); } /** * Twenty Sixteen only works in WordPress 4.4 or later. */ if ( version_compare( $GLOBALS['wp_version'], '4.4-alpha', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; }January 20, 2018 at 10:56 pm #13067mbrsolution
ModeratorHi @Jack, the latest version of the plugin has this feature added to the plugin under Advance Settings. Can you update the plugin to the latest version and give this a try. Let me know if it works for you.
Kind regards
March 8, 2018 at 6:30 pm #13626vinaysamant
Participanti have submitted paid request for this thing. Just to reconform… i am trying to use same action hook but it’s not working. I am trying to force login user post registration before sending him to offer-zone. But i have Form Builder installed. So this action-hook is not called/ignored.. how can i access action hook of post registration??
March 12, 2018 at 4:11 am #13673admin
KeymasterI replied to your email. The new version of the plugin will address the issue.
-
AuthorPosts
- You must be logged in to reply to this topic.