Hello Jennifer,
Thank you for posting. Please try the following code to redirect non logged-in user to Activity author profile when try to access single activity.
/** * Redirect user to user profile. */ add_action( 'bp_template_redirect', function() { if ( ! is_user_logged_in() && bp_is_single_activity() ) { $profile_link = trailingslashit( bp_displayed_user_domain() ) . bp_get_profile_slug(); bp_core_redirect( $profile_link ); } } );
Let me know it is works or not.
Regards
RaviHi Jennifer,
Thank you.The above code by @ravisharma only checks for single activity page and redirect.
Can you please post your issue and help us understand it better. That will help us assist you better.
Regards
BrajeshGreat i open this post : https://buddydev.com/support/forums/topic/redirect-subpage-of-members/
Thanks!Thank you.
Please remove this code and use the code shared in the other thread.
Regards
Brajesh
Viewing 6 posts - 1 through 6 (of 6 total)
The topic ‘ [Resolved] Redirect a unregistered user’ is closed to new replies.
This topic is: resolved