Conditionally registering users
Conditionally registering users
Conditionally registering users
You can’t really eliminate usernames, they are an essential part of WordPress core. The best you could do was create a custom form and then save the data to the DB using the built-in fields. For example, you could set the email they enter to equal both the email and the username field so both … Read more
New users CAN be allowed to register remotely without setting “anyone can register” in “general/settings”. The client is android and in addition to the android java client code using the ‘org.xmlrpc library’, the following was added to ‘functions.php’ in the child theme: function xml_add_method( $methods ) { $methods[‘xxx.wp_create_user’] = ‘xxx_wp_create_user’; return $methods; } add_filter( ‘xmlrpc_methods’, … Read more
It looks like you’re calling wp_new_user_notification() explicitly in your code snippet. Here are two ideas, how you could get around this problem: Idea 1: The wp_new_user_notification() function is pluggable, so you can modify it to your needs. You could for example, override it with: if ( ! function_exists( ‘wp_new_user_notification’ ) ): function wp_new_user_notification( $user_id, $plaintext_pass=”” … Read more
There is a registration_errors filter, which native errors go through and which allows you to provide your own. Returning filled in WP_Error object in this filter will smoothly prevent user from being created. The one downside is that that filter is not passed much additional data — only login and email. You will probably have … Read more
Following code should work for you, but I can not guarantee that because your form is so heavily (and badly) customized. I have tested it on not customized registration form and it worked just fine. function cyhorge_check_fields( $errors, $sanitized_user_login, $user_email ) { if ( preg_match(‘/(CyhorgeVH)/’, $sanitized_user_login ) ) { $errors->add( ‘username_error’, __( ‘<strong>ERROR</strong>: User contains … Read more
My research: “By default, WordPress websites allow for user registrations from a specific link: http://www.example.com/wp-login.php?action=register. These spambots are programmed to go looking for that link to register fake users.” So, your first step is to change the login page from wp-login.php to something else. Unfortunately, this is not the easiest thing to do by yourself. … Read more
Problem solved! I had a filter hooked onto random_password filter to generate passwords with custom rules and get_password_reset_key uses the function wp_generate_password to generate the key, and that is why I was getting the behavior I was getting. Allz I had to do was to remove my filter from it, and bada bing bada boom, … Read more
i found answer If you also encountered this problem, you can use “wp smtp config” plugins https://wordpress.org/plugins/wp-smtp-config/
The “Settings > General” Screen has a checkbox for “anyone can register.” This answers your second and third questions – it depends on how that setting is set. For your first question, that functionality is not built into WordPress. Perhaps a plugin like WP User Registration would suit your needs for this bit of functionality. … Read more