Home › Forums › Front-end Issues › Comment spam via front end form textarea field › Reply To: Comment spam via front end form textarea field
Ok I had to return post_id for it to be saved.
Still, I don’t get why with this code, when the honeypot ‘surname3’ is not empty, the form still get saved, altough completely empty.
Isn’t die supposed to terminate the whole process?
function my_honey_pot( $post_id ) {
if(! empty($_POST['surname3'])){
die("");
} else {
return $post_id;
}
}
add_action('acf/pre_save_post' , 'my_honey_pot' );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.