// hook when user logs in
add_action(\'wp_login\', \'your_function\', 10, 2);
function your_function($user_login, $user) {
$user_id = $user->ID;
// getting prev. saved meta
$first_login = get_user_meta($user_id, \'points\', true);
// if first time login
if( $first_login == \'1\' ) {
// update meta after first login
update_user_meta($user_id, \'points\', \'1000\');
// redirect to given URL
wp_redirect( \'http://levangiang.net/\' );
exit;
}
}
谢谢大家的帮助