WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Social Login
[resolved] Hook/Filter after user is created (5 posts)

  1. latinosamorir
    Member
    Posted 1 year ago #

    Hello,

    I'd like to change the user_status field in the wp_users table to some # after the user gets created with WSL.

    I tried looking through the code but I'm not expert and could not find a do_action hook to make the change.

    Can you please advice?

    Thank you,
    Giovanni

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

  2. Miled
    Member
    Plugin Author

    Posted 1 year ago #

    as far as i know the "user_status", may he rest in peace, cannot be set in wp_insert_user and therefore not by the wsl hook

    however, and to solve this kind of issue, i will add another hook to trigger right after a user created

  3. Info Man
    Member
    Posted 1 year ago #

    what about the hook wp_login it is called when you login via this plugin!

  4. Gabriel82
    Member
    Posted 1 year ago #

    the wp_login hook is not called after the connect.

    I did some research and thats how i resolved my issue:

    add_action('wsl_hook_process_login_before_redirect',  'wplogin_myplugin_afterconnect', 10, 3);
    function wplogin_myplugin_afterconnect($user_id, $provider, $hybridauth_user_profile){
        update_user_meta($user_id, 'last_login', current_time('mysql'));
    }

    This is a small example i hope it helps.

  5. Gabriel82
    Member
    Posted 1 year ago #

    Or you can trigger the action wp_login.

    add_action('wsl_hook_process_login_before_redirect',  'wplflogin_afterconnect', 10, 3);
    function wplflogin_afterconnect($user_id, $provider, $hybridauth_user_profile){
        $user_login = get_userdata($user_id);
        do_action('wp_login', $user_login->user_login);
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic