function modify_registration_redirect($redirect_to, $user_data) {
error_log('OA registration redirect to: '. $redirect_to);
return $redirect_to;
}
add_filter ('oa_social_login_filter_registration_redirect_url', 'modify_registration_redirect', 10, 2);
Please sign in to your OneAll account to ask a new question or to contribute to the discussions.
Please click on the link below to connect to the forum with your OneAll account.
Answers
I understand that. What is the solution?
Thanks.
Copied over from your post at WPMU DEV: In the Oneall plugin setting, you can redirect new users to a URL of your choice. Maybe you can find the membership page URL and set it there.
Setting a default membership is feasible, because there are hooks you can use. That would require to look into the membership pro plugin, which can do to some extent.
Let us know what you prefer, and if the redirect URL to membership works for you.
Regards.
The page redirect feature is not working and here is why it will not. When a user clicks the Login link and completes the social login process, the site is setup to automatically return the user to the referring page. I do not think the plugin has enough priority over my code to instead redirect to the memberships page.
We will have to use hooks, sorry.
Thanks.
Ok then. What is tricky is that we're interacting with other code.
So, do you know how (a hook?) the current redirect to referring page occurs?
There are several Oneall hooks, plus the standard ones (plus perhaps other modules'), you could use. We need to identify one that is triggered before your current redirect.
For information, here are Oneall hook triggers, in order, for registration:
- filter: 'oa_social_login_filter_new_user_fields' before user insert
- action: 'oa_social_login_action_before_user_insert'
- the standard wp_user_insert() actions and filters
- action: 'user_register'
- action: 'oa_social_login_action_after_user_insert'
- action: 'oa_social_login_action_before_user_login'
- action: 'wp_login'
then the redirect hooks, which may not all get executed:
- filter: 'registration_redirect'
- filter: 'oa_social_login_filter_registration_redirect_url'
- action: 'oa_social_login_action_before_user_redirect'
then the redirect call (which you report is not executed)
Regards.
I have no idea really even how to code. This does not help me.
Thanks.
Do you know how the site is setup so that it redirects to the referring page?
We'll see if we can reproduce this error with the free trial of membership2 pro.
Regards.
I used these functions in header.php.
<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a> <a href="<?php echo wp_logout_url( get_permalink() ); ?>">Logout</a>
Thanks.
Thank you.
The filter below should allow you to modify the redirect URI for new users registering with Oneall.
You add this code to the theme functions.php file (accessible via the admin: Appearance | Editor | Theme functions).
The example filter below just logs (debug.log) the redirect URI.
We can check that the Oneall login process reaches this point.
function modify_registration_redirect($redirect_to, $user_data) { error_log('OA registration redirect to: '. $redirect_to); return $redirect_to; } add_filter ('oa_social_login_filter_registration_redirect_url', 'modify_registration_redirect', 10, 1);
If this does get executed, then you would need to point to the Membership URI you wish.
Regards
I got the following error on redirect.
Warning: Missing argument 2 for modify_registration_redirect() in /public_html/wp-content/themes/wpex-thoughts/functions.php on line 430
Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-content/themes/wpex-thoughts/functions.php:430) in /public_html/wp-includes/pluggable.php on line 1228
Thanks.
I give up with this. To much coding. Also some how my Twitter picture is now attached to my account just because it is the same email address. Tried disconnecting Twitter, did not work, revoked access in Twitter settings, did not work. I will not put my users through this, I deactivated the plugin. If you wish, please delete my account.
Thanks.