• Hello,

    Thanks for the plugin, it adds a great entry portal for users.

    I want to make it so that if users log in from anywhere on the site, to go to the profile.

    But if they log in while in a single post view (is_single() ), I want the users to remain or be redirected to that same URL they came from.

    For example, if a user wants to comment on a blog article, I want the user to be able to login, and be redirected to that blog article.

    I tried this in your code:

    /*if the user is not site admin,redirect to his/her profile*/
    	if(!is_super_admin($user->ID) || is_single())
    		return '/activity/';
    	else
    		return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/

    I believe that code did what I intended in that if the user was in a single view, it didn’t do the redirect.

    However, the issue was that when a user uses the login (example.com/wp-login), then after login, they are redirected to that same login page.

    Is there anyway to do what I intend?

    Thank you,
    Jose

    https://www.ads-software.com/plugins/bp-redirect-to-profile/

  • The topic ‘When is_single, redirect to current URL’ is closed to new replies.