Since get_option('users_can_register')
will return the setting value for the “Anyone can register” setting used for displaying the registration link, you could probably add a get_option
filter overriding the value for the users_can_register
key. In this case i even think the pre_option_%s
filter is your best bet, since the actual value of the settings is irrelevant. Something like this might work:
add_filter('pre_option_users_can_register', 'wpse_87341_users_can_register');
function wpse_87341_users_can_register() {
// Obviously here you'd populate $user_in_allowed_range
// ...
return intval($user_in_allowed_range); // We need to return an int since get_option does not like false return values
}
Related Posts:
- Separate registration and login for different roles
- SSO / authentication integration with external ‘directory service’
- How to prefill WordPress registration with social details
- Woocommerce registration page [closed]
- WordPress registration message
- How to remove the WordPress logo from login and register page?
- Login email after registration never sent or received
- I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
- How do I check if a post is private?
- Receiving “This content cannot be displayed in a frame” error on login page
- How to customise wp-login.php only for users who are setting a password for the first time?
- What hooks should I use for pre-login and pre-registration actions?
- Change register form action url
- Problem with logging in WP users automatically
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- Register/Login using only phone number?
- Force users to register in order to view website [duplicate]
- How do I force “users must be registered and logged in” on subsites?
- auto login after registeration for wp-members plugin
- How To Change Wp Register/Login URL Permanently To My Custom Page
- How to modify the action attribute of the wp-login.php?action=register form?
- Correct passwords keep appearing as incorrect
- Disabling standard registration login with username/email and password?
- Login form doesn’t log in
- Get the url of custom login page in the registration page
- By registering always make uppercase the first letter of the login
- Show reCaptcha on Custom Frontend Login & Register Form [closed]
- Best option to implement external register/login to WP from self-made API
- Auto Login After Registration
- Disable all other page except index,register,login till user login
- What speaks against using a custom login.php / register.php to wordpress?
- How do I add Login fields and registration link to the header?
- How to make a user be able to register if such a login already exists?
- Sending new registration meta values to admin by email
- Are login functions considered part of the WP backend?
- WordPress registration page template
- Removing “public” user registration without completely turning it off?
- what is the best and safest way to allow users to register to site
- Updated : how to make email optional while user registration using default wordpress form
- Problem in auto login after registration
- How to invalidate `password reset key` after being used
- Updating usermeta from login redirect to billing address
- Chosen user password in registration is not being accepted on Login
- WordPress auto login user after registration only from a specific page
- User account activation links are lacking query strings
- Login user after registration programmatically
- How to get rid of the username of registration form in theme my login wp plugin?
- Where do I find “log in” and “register” link which are located on the top right corner?
- How to force login after user browses for a few minutes or browses a few pages?
- Registration and Login form
- WordPress and Magento: let WordPress manage user registration and logins?
- how to add custom word press regisration form in word press 3.5 with out module [closed]
- Click on banner to register to the blog
- How to put Login, Register and newsletter widget on the same page?
- make a login system for site visitors
- How to create a fully functional user registration in WordPress?
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- Preventing session timeout
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- how to display the wordpress login and register forms on a page?
- How can I add a custom script to footer of login page?
- How do I turn off the ability to login?
- Give visitor access to password protected page/post via external script
- WordPress Login Footer URL
- moving server can not login
- Save last login date in global before change it?
- Store brute-force IP addresses
- WordPress Security – How to block alternative WordPress access
- reset password link redirect to login page
- Deregister default wp-admin css on login screen only?
- How can I login as admin after redirect to custom login page
- Could be a namespace conflict (?) with login form and register form on the same page
- Why would the login page reload indefinitely?
- Set Default User Role
- Creating custom login errors
- Keep Logged in Users out of Admin Panel
- Removing wordpress cookie from non-wordpress site
- Why is wp-login trying to send an email?
- Replacing default display name to login name
- Why does is_user_logged_in() return false after I change user password on the front end?
- How to generate “WP_Error” Object for user login?
- ?login=failed only attached to URL under certain circumstances
- WordPress not logged in locally with correct username and password
- my wp-login page doesn’t load [closed]
- Require re-login when logged-in user attempts to access restricted page
- User not able to sign in after wp_authenticate() and wp_signon() wordpress
- WordPress site login Redirect
- On Homepage “is_user_logged_in()” function is not working after login and it is working after refresh the page?
- Cant reset password my wordpress password not even with phpMyAdmin
- wp-cron event doesn’t run when custom login API is enabled
- Does it make sense to check a nonce on user log in?
- Global login to password protected pages
- Disable / Remove Password for Login WordPress
- WordPress Auto Login From Email Link
- Building a custom login form – encountering issues
- Newbie question. Login/Registration. New PHP page
- How do i Redirect specific user(WooCommerce Sign-in not wordpress admin page sign-in) to specific page
- Add a required field to Registration
- Handle POST request sent from an external site for login?
- Unable to login after adding ReCaptacha without API key