• Dear UM-Team,

    does your Plugin uses the default wp_set_auth_cookie functionality?
    I ask this because I’m struggeling with the implementation of programmatic login (a login without having to fill username and password in a field).
    There are some scripts about this but none of them works. So I figured that maybe your plugin does something additional at the login beside the default WP stuff.

    Or do you have any suggestion how to implement a programmatic login with UM?

    Sample code:
    //get user’s ID
    $user = get_user_by(‘login’, $loginusername);
    $user_id = $user->ID;
    //login
    wp_set_current_user($user_id, $loginusername);
    wp_set_auth_cookie($user_id);
    do_action(‘wp_login’, $loginusername);

    Thanks,
    Robert

The topic ‘Programmatically login’ is closed to new replies.