9

BTW you can try this one. I just put together something. It should block gmail.com domain. This function will check for email domain when someone tries to register on your website and throws an error if email domain is matched. function wpse_disable_email_domain( $errors, $sanitized_user_login, $user_email ) { list( $email_user, $email_domain ) = ...


4

Please try the following, I think having a return from the site_url() function could be creating a problem with the $confirm_url variable. That and you have an unescaped slash in your url. $site_url = site_url(); $confirm_url = $site_url. '\/verification?id=' . $post_id . '&hash=' . $hash; // Send a verification e-mail to the user to confirm ...


4

You can use user_register hook add_action( 'user_register', 'my_registration', 10, 2 ); function my_registration( $user_id ) { // get user data $user_info = get_userdata($user_id); // create md5 code to verify later $code = md5(time()); // make it into a code to send it to user via email $string = array('id'=>$user_id, 'code'=>$...


3

I think someone entered the password reset form and you probably have an easy user login for the administrator like 'admin' or so, so that's what they probably entered. The email also says: You can safely ignore and delete this email if you do not want to take this action. So just ignore it.


3

I think there are two decent options here. Let WordPress keep its mail function, but hook in once or twice wp_mail() has several hooks that will be helpful for you to replace the built in behavior, which is basically to use php's simple little mailer. Here are a couple of those helpful hooks that I think you might use, since that's what you asked for: /...


3

I've tried a few different approaches for verifying the user's email. For now, what I am doing is this: When a user first registers, set the user's user_metadata 'email_not_verified' to 1. add_action( 'user_register', 'sc_user_email_not_verified' ); function sc_user_email_not_verified( $user_id ) { update_user_meta( $user_id, 'email_not_verified', 1 ); } ...


3

There's a great article explaining how to hook into 2 filters for this at http://www.sourcexpress.com/customize-wordpress-comment-notification-emails/ To send your notifications to a particular user and not the site admin, try this for a user with ID 123: function se_comment_moderation_recipients( $emails, $comment_id ) { $comment = get_comment( $...


2

I'm not aware of any hook that could change only the comment notification recipient... You would probably need to overwrite some kind of core function, but here's a small workaround you could use: 1. Disable the email feature from WordPress comments settings (unless you want to get notified too) 2. Send it manually using the comment_post action hook. Just ...


2

I had a look into the wp_usermeta table and noticed the default_password_nag meta key. I checked and this was introduced in #9710 about 7 years ago. If the user has an auto generated password then it's value is 1 and she will get a notice displayed on the dashboard screen. When she first registers, default_password_nag is 1 and when she resets the ...


2

Depending on which email provider you use, the easiest way is probably to use the user+tag@example.com format. Many common email systems will deliver mail as though it were addressed to user@example.com. The +tag portion of the email address can then be used both for filing mail and for screening it. WordPress, however, will see it as a different email ...


2

Hmm, should try harder before asking for help :) Was quite simple in the end (right or wrong) it works: $domain_array = array('googlemail.com','gmail.com'); $validemail = is_email($email_to_check); $exists_text = ''; if ($validemail): $exists = email_exists($email_to_check); list($user, $domain) = explode('@', $...


2

This new feature was added in 5.3 from core ticket #46349 Currently (in 5.3) we have [src] in wp-login.php: /** * Filters the interval for redirecting the user to the admin email confirmation screen. * If `0` (zero) is returned, the user will not be redirected. * * @since 5.3.0 * * @param int Interval time (in seconds). */ $...


1

There is actually nothing wrong with the code that you have (I tested it as you have it above and it works fine). But you have to account for some additional possibilities: The wp_new_user_notification() function is a pluggable function. So it can be replaced by a plugin or by custom code. And if it is replaced, there is a possibility that the custom ...


1

you need to pass the post id as parameter and check it will give the result you want in function.php function tr_count($post_id){ ob_start(); the_content(); $content = ob_get_clean(); return substr_count($content, '<tr>'); } in single.php echo tr_count(get_the_ID());


1

Actually, the arguments you are passing for the wp_new_user_notification() function are incorrect - it requires the user ID, not the username. Also, that may not be what you want to use in this case since it generates a link that will require the user to set a password (which is preferred). I'll go through two examples - one without the password, which the ...


1

You need to take a look at the hooks of the Contact Form 7 plugin website. Browse the documentation for the actions you need. Have a look at this topic: how-to-hook-into-contact-form-7-before-send All you need to do is to add your link with the hash into the e-mail. In addition, also have a look at "wp_mail()". That is the mechanism which triggers an e-...


1

Just copy the above code and paste it into your theme’s functions.php file. Here I am going to show you the code which will reject registration from all others domain's email addresses and Only allowing @uniname.ac.uk email addresses to create an account. See the code below function is_valid_email_domain($login, $email, $errors ){ $valid_email_domain =...


1

Requirements In Settings->General, the box Anyone can register must be checked. Email address entered in Email field of registration form, must have an email domain equal to '@uniname.ac.uk' Email address Validation To validate email address, we can use 'registration_errors' filter hook. Code Insert the following code into functions.php of your active ...


1

Instead of using the register_post action, you should use the registration_errors filter like this (copied from codex, then modified): function my_awesome_email_validation_filter( $errors, $sanitized_user_login, $user_email ) { $allowed_email_addresses = array('allowedaddress@email.com','anotherallowed@domain.com'); //be sure to write all the ...


1

Just copy the above code and paste it into your theme’s functions.php file. Here I am going to show you the code which will reject registration from all others email addresses and Only allowing some email addresses to create an account. See the code below function is_valid_emails($login, $email, $errors ){ $valid_emails = array("emailname@uniname.ac....


1

This is not the email sent from the reset password form. This email is sent when update_option_new_admin_email() is run, which is when the site_admin option is changed. This option is found under /wp-admin/options-general.php so whoever is attempting to change the site admin email has access to that page. This user must have the manage_options capability ...


1

As stated in the announcement post: A few account security enhancements have gone into WordPress 4.9. The intention is to make it more difficult for an attacker to take over a user account or a site by changing the email address associated with the user or the site, and also to reduce the chance of a mistaken or erroneous change causing you to get ...


1

1. Insert user data into wp_users table. Create a page called "Activation" or similar to it and get the ID of that page. An activation email will be sent with the activation link to the user. function new_user($data) { // Separate Data $default_newuser = array( 'user_pass' => wp_hash_password( $data['user_pass']), 'user_login' =&...


1

wp-api didn't has any route for new user registration as the route /users requires authentication for create operation As far as I know, using proper authentication (I'm using JWT), rest API does let you create new users. The problem is that if you go that way, you have to implement your own mail-verifcation system, since no confirmation mail is sent. (...


1

There is a filter for changing the text of the comment moderation email: function change_comment_email( $body, $comment_id ) { $body = preg_replace( "/(A new )comment/s", "$1review", $body ); $body = preg_replace( "/(Currently \d+ )comment/s", "$1review", $body ); $body = preg_replace( "/Comment:/", "Review:", $body ); return $body; } ...


1

Well I figured it out myself. I just did a simple trick. I reset the plugin and deleted it. And downloaded a copy of it in the computer, extracted it. Opened the pie-register.php and piewpnun.php on notepad++ renamed all the "pie_veification" and wp-login" with find button. Then I again installed it and before activating it just replaced those files in pie-...


1

Solved it by adding this code to save_extra_profile_fields() in add_action ( 'user_register', 'save_extra_profile_fields'); $hash = md5( $random_number ); add_user_meta( $user_id, 'hash', $hash ); $user_info = get_userdata($user_id); $to = $user_info->user_email; $subject = 'Member Verification'; $message = 'Hello,'; $message .= "\n\n"; $...


1

If you add a new user via the backend a confirmation email is sent automatically, unless you check the skip checkbox. The new user shouldn't appear in the UI until confirmed


Only top voted, non community-wiki answers of a minimum length are eligible