Forum Replies Created

Viewing 1 replies (of 1 total)
  • At this points $current_user is not created yet. at least that, what it looks like. you can get user_login directly from wp_login action like this:

    function access_log_insert_record($login)
    {
    	global $wpdb;
    	$table = $wpdb->prefix."access_log";
    	$wpdb->query("INSERT INTO $table (access_user, access_date_time) VALUES($login, NOW()) ");
    
    }
    
    add_action('wp_login', 'access_log_insert_record');

    At least, thats how i got user thats loggin in from wp_login hook.

Viewing 1 replies (of 1 total)