The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

Question [Solved] prevent name reuse

5 Posts
2 Users
0 Reactions
4,652 Views
(@chuck)
Posts: 2
New Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#9360]

Everyone commenting on our website is a guest, without a login and password.

Once a comment has been made by a "name" and an "email address", we would like to require all future comments that use that "name" to have to use that "email address", or give an error message something like "name already in use by someone else, please choose a different name".  

The idea being that we do not want different people using the same "name".

Is this already possible with a combination of plugins and or addons?

How can this be done?

 


 
Posted : 07/12/2024 2:47 am
Asti
 Asti
(@asti)
Posts: 8264
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi,

You can use the preprocess_comment hook to make the customization you want. 

More info here:  https://developer.wordpress.org/reference/hooks/preprocess_comment/


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.

 
Posted : 09/12/2024 12:38 pm
(@chuck)
Posts: 2
New Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

How do I find all of the previously used 'comment_author' + 'comment_author_email' pairs to verify that the current 'comment_author' has not previously been associated with a different  'comment_author_email' ?


 
Posted : 09/12/2024 7:21 pm
Asti
 Asti
(@asti)
Posts: 8264
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@chuck 

Here is the code provided by our developers: 

add_filter('preprocess_comment', function ($commentdata) {
    global $wpdb;
    $sql = "SELECT `comment_author_email` FROM `{$wpdb->comments}` WHERE `comment_author` = %s LIMIT 1";
    $author_email = $wpdb->get_var($wpdb->prepare($sql, $commentdata['comment_author']));
    if (!empty($author_email) && $commentdata['comment_author_email'] !== $author_email) {
        wp_die('name already in use by someone else, please choose a different name.');
    }
    return $commentdata;
});

Insert the code into your WordPress active theme's function.php file. 


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.

 
Posted : 12/12/2024 2:00 pm
Asti
 Asti
(@asti)
Posts: 8264
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

We have not received a reply from you for over a couple of weeks, therefore we will be closing this topic. Please create a new one if you require any additional help.

Thank You!


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.

 
Posted : 28/12/2024 1:38 pm