First time ever I get this question. Thank you.
I thought there was a hook for this, but looking at the code there is not. I will add a hook for checking the entry.
I will get back on this, hopefully today or tomorrow.
Hi, with 3.1.2 there is a hook to check the input. You can set an error that is either non-fatal or fatal.
Example code
https://plugins.trac.ww.wp.xz.cn/browser/gwolle-gb/trunk/docs/filters/gwolle_gb_new_entry_frontend.txt
If you need to add anything to the form, like an extra input field, look at a filter like this:
https://plugins.trac.ww.wp.xz.cn/browser/gwolle-gb/trunk/docs/filters/gwolle_gb_write_add_after_website.txt
There are a few that are similar.
Thank you very much.
I’ll take a look and give it a go in the next few days.
Best,
Larry
Okay, good.
What are you trying to do anyway?
I want to filter the input my own way and reject the entry altogether before it reaches the backend in case of spam.
I prefer not to see the spam in the backend and sort it out there.
My goal is to minimize the task of the moderator.
Maybe I didn’t find the right way to do it with the hooks already available before your new extension…
There is an option to refuse spam, did you see it?
The included spamfilters like honeypot and timeout are quite good for spambots. Akismet and Stop Forum Spam can be quite good as well.
Yes, I saw those possibilities.
However it was my understanding that the entries would be marked as spam but still be in the backend to be “handled” by the moderator. And this is precisely what I want to avoid.
Maybe I’m missing something…
Being located in Germany, where the GDPR has everybody on their toes, I am a bit uneasy with external anti-spam services as their privacy policies may not agree with the german requirements.
-
This reply was modified 7 years, 2 months ago by
gwdsupport.
Hello again,
I have two questions:
1. New hooks
I took a look at the new hooks, but I’m not fit enough to achieve what I want to do.
I’d like to do the following:
If the entry ($entry?) contains words from an array, reject the entry and put out an error message.
It would look something like that:
$bad_words = array("list", "of", "bad", "words");
foreach ($bad_words as $bad_word) {
if (strpos($entry, $bad_word)!==false) {
echo /or return/ "Your entry could not be sent.";
}
}
So I need some advice on this.
2. Form Layout:
Is it possible to have the “Hinweis-Text” (with the privacy policy or equivalent) before the “Send” Button ?
Thanks again for your help.
Best,
Larry
I am not here to write your code 🙂
About the echo/return, the example code has a function call gwolle_gb_add_message, this will take care of the error that is seen by the user.
The one with a fatal error is the one with true as second parameter. The non-fatal error message has a false as second parameter.
About the privacy checkbox, I don’t know any good way to move that around. Maybe with CSS.
Hello again and just as an FYI,
I solved my second question by using the “gwolle_gb_write_add_form” hook.
Regarding my first question, I’ll take my chances modifying the PHP scripts directly.
Thanks.
Best,
Larry