here’s an example that hooks login_redirect and checks when their account was created, then redirects them to a url of your choice if it’s been less than 48 hours:
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);
Related Posts:
- Is it possible to sign in with user_email in WordPress?
- Website Visible only to Registered users
- moving server can not login
- how to update current logged user username
- How can I allow access to two user accounts using one login?
- Share user table from WP with Drupal
- Password protect media attachment – share across guests
- WordPress login problem
- Good way to block users within a multisite setup without deleting them?
- Reset Password policy
- WordPress Login redirection according to user role
- How do you manage your pages or functions that require logged-in users?
- How to restrict access to a single for users I’ve authorized? [closed]
- Delete a user from frontend
- Sign in with social media accounts without creating a WP account [closed]
- define two login page url
- Custom user roles are unable to login
- How to password protect pages in WordPress
- How to lock WordPress front-end with login and password?
- Creating Custom Login Form Where Password Field is Dropdown Menu
- determine active user browser at the same time
- In Django, how do I know the currently logged-in user?
- Disallow user from editing their own profile information
- What exactly is ReAuth?
- What are the differences between wp_users and wp_usermeta tables?
- How can I send a welcome email to a user AFTER they login for the first time?
- Can not login with correct username and password
- Post list based on the user that is logged in
- Stop users from logging in from multiple locations
- Why does is_user_logged_in() return false after redirect from another site?
- My login form does not work
- Copy a user from one WordPress site to another
- Get user info outside WordPress
- Cookie settings for session across WPML subdomains using custom AJAX login
- Is there a way to remove wp-login.php alias (login)?
- How do I create a specific login page for a specific user?
- wp-admin redirecting to wp-login.php
- Check for user meta data at Login
- Restrict PDF links
- Remote REST request to check login status
- How can I test the login for an expired session?
- Force user to login in home page
- Last time a user logged in
- Login as a client no dashboard menu?
- Allow access to a page for admins only
- Customizing the WordPress login form
- How to display username and password after registration
- wp-login gives 404 error, but wp-admin is working fine
- Custom login message for single post pages only
- Private page protected with username and password
- Restrict users post for himself
- Password reset – Disabled for LDAP accounts
- Completely replacing the login form
- When I try to login in wordpress it is showing “USER Doesn’t Exists”
- Displaying different in-page content to cliente/admin
- Single sign on with custom site
- By registering always make uppercase the first letter of the login
- Best option to implement external register/login to WP from self-made API
- Enqueue new login style sheet
- WordPress Conditional Login Links
- Do more action after login successfully
- I cannot login and am getting this error message. .
- Allow admins to login as other users
- Cannot log into migrated site
- WordPress SSL not working [closed]
- How to unpublish my new site while working on it?
- How to force “remember me” users to login again?
- User not able to sign in after wp_authenticate() and wp_signon() wordpress
- WordPress site login Redirect
- Thank You Page Layout Differs on User Logged In Status
- On Homepage “is_user_logged_in()” function is not working after login and it is working after refresh the page?
- Problem in auto login after registration
- Cant reset password my wordpress password not even with phpMyAdmin
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- wp-cron event doesn’t run when custom login API is enabled
- Does it make sense to check a nonce on user log in?
- restrict admin panel sections to users
- Multisite – site user limited only for this site
- $user_login is not working if author has only 1 post
- Building a custom login form – encountering issues
- Site login failed due to strange warning
- Chosen user password in registration is not being accepted on Login
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- loging to Admin page not working at all
- WordPress Cookies – wp_set_auth_cookie
- Authenticate return value
- Current User Seeing Another Logged In User Info
- Front-end login problem: requires re-authorization when accessing dashboard
- When trying to login if already logged in, form just shakes – error message remains empty
- Handle POST request sent from an external site for login?
- Unable to login after adding ReCaptacha without API key
- Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
- How to create an alternative login page that does not use any plugins?
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- Cant edit profile from frontend
- Login and register by API
- Log in a user upon password reset?
- How to remove/limit Editor accounts privileges, to prevent them from deleting media and pages created by Admin
- index.php file shown when trying to load wesite