User registration problem on multisites web
User registration problem on multisites web
User registration problem on multisites web
I found a good answer and slightly modified it on a related question . It uses htaccess, and redirects any requests to wp-login.php?action=register. # BLOCK SPAM REGISTRATION REQUESTS (wp-login.php?action=register) <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{THE_REQUEST} ^.*(wp-login.php\?action=register).* [NC] RewriteRule ^(.*)$ http://isoreiki.com/about/account </IfModule> Notes: In the answer I linked to he totally blocked these requests. However I … Read more
You might simply want to go to Settings > General. Here you can select the standard role a user gets, once he registers.
Just install a plugin called – Snippets & Activate. Than on left panel click Snippets -> Add new. Type a title of your own & paste below code. After that click a option there in the bottom “Run snippet everywhere” and press Save/Active. That’s all you need to do. Enjoy… add_action(‘user_profile_update_errors’, ‘my_user_profile_update_errors’, 10, 3); function … Read more
You’re not handling the names the same way as the other fields: //// VERIFIES CREDENTIALS $username = isset($_POST[‘username’]) ? trim($_POST[‘username’]) : ”; $first_name = isset($fields[‘user_first_name’]) ? sanitize_text_field(trim($fields[‘user_first_name’])) : ”; $last_name = isset($fields[‘user_last_name’]) ? sanitize_text_field(trim($fields[‘user_last_name’])) : ”; $email = isset($_POST[’email’]) ? trim($_POST[’email’]) : ”; Notice how you use $_POST[’email’] and $_POST[‘username’], but then you use $fields[‘user_last_name’], … Read more
You can use the same method as described in the link you mentioned, but simply use the created user ID and add 1000 so you get four digits. So user_id = 5 gets the meta number of 1005. add_action( ‘user_register’, ‘my_on_user_register’ ); function my_on_user_register( $user_id ) { $unique_id = 1000 + $user_id; update_user_meta( $user_id, ‘my_unique_id’, … Read more
http://eatstaylovelondon.com/wp-login.php?action=register You can create a register now link which will redirect to the above page. Just adding “?action=register” at the end of the URL will do the work for you. You can Create a Register page too. Do Search how to display Register form.
How to make user to logged into website & redirect to homepage after successful registration?
I might be wrong but I think wp_insert_user function doesn’t call wp_new_user_notification function. As your edit you need to call this function manually. As you are testing your plugin in a live site I presume the error reporting is turned off and hence you are not getting any error. if (empty($errors)) { $myplugin_newuser = wp_insert_user(array( … Read more
Add this in functions.php This will automatically add a custom field to a user when they register on your site with a key of: user_registration_no add_action(‘user_register’, ‘add_user_registration_number’); function add_user_registration_number ($user_id) { $reg_number = date(‘y’).date(‘m’).’SY’.’0′.$user_id; update_user_meta($user_id, ‘user_registration_no’, $reg_number); } This should be formatted in the way in which you specified..