Trouble adding customized redirect in functions
-
Hello! First of all, love the the plugin! I’ve been searching for this ALL day! Literally.
So everything is well except I’m having trouble creating an alternate redirect page for users not logged in.
I added the:
` function redirect_nonloggedin_users($current_uri, $redirect_to) {
// Redirect users to the homepage
// Caution! Exclude the homepage from ‘Private BuddyPress’ options
// to avoid redirection loops!
return get_option(‘siteurl’) . ‘/?from=’ . $redirect_to;
}add_filter(‘pbp_redirect_login_page’, ‘redirect_nonloggedin_users’, 10, 2); `
Code verbatim to a fresh functions.php page, but with no luck. I replace the ‘siteurl’ with http://www.mysite.com/register as I want it to redirect to the buddypress registration page instead of the wp login page.
Am I doing something wrong? Should there be any other code in the functions page to make it work? Does the url go somewhere else or need to be formatted differently?
Thanks in advance for all of your help!
You must be logged in to reply to this topic.
