WordPress.org

Ready to get started?Download WordPress

Forums

Social Login
[resolved] How to redirect user to profile upon login or registration (5 posts)

  1. DaveTheKnave
    Member
    Posted 1 year ago #

    Social Login overrides any php calls to redirect to profile, any fix for this?

    http://wordpress.org/extend/plugins/oa-social-login/

  2. Claude
    Member
    Plugin Author

    Posted 1 year ago #

    Yes! In the new version we have added two filters for the redirection URLS. Please have a look at the file communication.php (line ~400).

  3. DaveTheKnave
    Member
    Posted 1 year ago #

    Thank you Claude.

    This snippet is working in functions.php with no errors.

    Login redirect to Buddypress Profile -

    /*Add a filter to filter the redirect url for login*/
    add_filter("oa_social_login_filter_login_redirect_url","bpdev_redirect_to_profile",100,3);
    add_filter("login_redirect","bpdev_redirect_to_profile",100,3);
    
    function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user){
    /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/
    if(empty($redirect_to_calculated))
    $redirect_to_calculated=admin_url();
    
    /*if the user is not super admin,redirect to his/her profile*/
    if(!is_super_admin($user->user_login))
    return apply_filters("bpdev_login_redicrect_url",bp_core_get_user_domain($user->ID ),$user->ID);//allow top redirect at other place if they want
    else
    return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/
    
    }

    Credit:
    Plugin Name: BP Redirect to Profile for Buddypress
    Author: Brajesh Singh
    Author URI: http://buddydev.com
    Plugin URI:http://buddydev.com/buddypress/bp-redirect-to-profile-plugin-redirect-users-to-their-profile-on-login-on-buddypress-sites/

  4. haagsekak
    Member
    Posted 1 year ago #

    Thanks for the code it works great, but is there a way to change the landing page? Now you land on Activity but I would like to have the user land on Messages. Any thoughts?
    Thanks.

  5. haagsekak
    Member
    Posted 1 year ago #

    @DaveTheNave
    I am really hoping someone can help me and since you provided that code for the functions.php which worked like a charm, perhaps you can tell me how to change the default to be Messages instead of Activity (Personal)?
    I hope to hear back soon.
    Thanks!

    Thank you Claude.

    This snippet is working in functions.php with no errors.

    Login redirect to Buddypress Profile -
    `/*Add a filter to filter the redirect url for login*/
    add_filter("oa_social_login_filter_login_redirect_url","bpdev_redirect_to_profile",100,3);
    add_filter("login_redirect","bpdev_redirect_to_profile",100,3);

    function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user){
    /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/
    if(empty($redirect_to_calculated))
    $redirect_to_calculated=admin_url();

    /*if the user is not super admin,redirect to his/her profile*/
    if(!is_super_admin($user->user_login))
    return apply_filters("bpdev_login_redicrect_url",bp_core_get_user_domain($user->ID ),$user->ID);//allow top redirect at other place if they want
    else
    return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/

    } `Credit:
    Plugin Name: BP Redirect to Profile for Buddypress
    Author: Brajesh Singh
    Author URI: http://buddydev.com
    Plugin URI:http://buddydev.com/buddypress/bp-redirect-to-profile-plugin-redirect-users-to-their-profile-on-login-on-buddypress-sites/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.