Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Starting from version 7.6.28, a new hook "wpdiscuz_before_wp_new_comment", has been added.
This action allows you to perform tasks based on comment data. For example, you can use it to prevent guests from using registered users’ email addresses.
To achieve this, use the following hook code:
add_action("wpdiscuz_before_wp_new_comment", function($commentdata){
if (!empty($commentdata["comment_author_email"]) && empty($commentdata["user_id"])) {
$is_user_exist = get_user_by("email", sanitize_text_field($commentdata["comment_author_email"]));
if ($is_user_exist) {
wp_die(esc_html__("A user with this email is already registered! Please log in or use a different one!", "wpdiscuz"));
}
}
});
The red-marked text can be customized as needed.
For a step-by-step guide on adding custom code to WordPress without breaking your site, check out this article: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.