• Resolved futureyoon

    (@futureyoon)


    Hi

    I would like to check the differences between 2 redirect URL functions.

    I can see there are 2 features available. May I know what is the differences? and it will be overwriting each other’s settings on any circumstances?

    1. default redirect URL
    2. Fixed redirect URL

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Gabor

    (@nextendweb_gabor)

    Hi @futureyoon!

    1. When you publish a social login button, you have an option to add “redirect” parameter to it. For example with shortcode:
    https://nextendweb.com/nextend-social-login-docs/theme-developer/#shortcode
    you can define where you would like the logged in user to be redirected to:
    [nextend_social_login redirect="https://example.com/welcome/"]

    You can also use your own HTML code:
    https://nextendweb.com/nextend-social-login-docs/usage/
    where a redirect link could be added:
    https://example.com/wp-login.php?loginSocial=google&redirect=https://example.com/welcome/
    and in that case, the logged in user will be redirected to the https://example.com/welcome/ page.

    Default redirect url means, that if there is no “redirect” parameter, that is where the logged in user will be redirected to. While with “redirect” parameter, the defined url will be used.

    2. Fixed redirect url: This is a fix url a logged in user will be redirected to. So this overwrites everything.

    Thread Starter futureyoon

    (@futureyoon)

    Hi Gabor,

    Thank you for the udpate with detail info.

    I have a couple of further questions.
    I am not sure if the following scenario is possible with the redirect function.

    I am running a BuddyPress based site whereby we wish all users to update their profile picture.

    so.. is it possible to add some conditions something like below.

    if a user didnt update profile picture (let’s say profile_pic_status = 0)
    then redirect to the profile page upon login & register (example.com/profile)

    if a user already updated the profile picture, do not initiate the redirect, just reload the same page with logged-in status

    Do you think if it’s possible?
    I understand this may not fall into your support scope directly but do you think you can roughly come out with some sample codes with your expertise?

    Thank you

    • This reply was modified 4 years, 1 month ago by futureyoon.
    • This reply was modified 4 years, 1 month ago by futureyoon.
    Plugin Support Gabor

    (@nextendweb_gabor)

    To do this, you will need to do some custom coding. You can find a sample code here, which could be written into a plugin you create, or into your theme’s functions.php file:
    https://nextendweb.com/nextend-social-login-docs/backend-developer/#role-redirect
    just in your case you wouldn’t check the role of the user, but the profile picture.

    This code was written only for login, so the nsl_login action is used with {{provider-id}}_login_redirect_url filter, but in your case if you want to cover registration too, you would need the same code for nsl_register_new_user action, with {{provider-id}}_register_redirect_url filter.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘2 redirect urls’ is closed to new replies.