function my_redirect( $to, $requested, $user ){
if( !isset( $user->user_login ) ){ // we only want this to run when credentials have been supplied
return $to;
}
$regtime = strtotime($user->user_registered);
$now = strtotime("now");
$diff = $now - $regtime;
$hours = $diff / 60 / 60;
if( $hours < 48 ){
return "/somepage/"; // it's been less than 48 hours, redirect to message.
} else {
return admin_url();
}
}
add_filter('login_redirect', 'my_redirect', 10, 3);