[wp-trac] [WordPress Trac] #27140: possible bug in pre_comment_approved filter
WordPress Trac
noreply at wordpress.org
Mon Feb 17 15:41:18 UTC 2014
#27140: possible bug in pre_comment_approved filter
-----------------------------+----------------------
Reporter: realblueorange | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Comments | Version:
Severity: normal | Resolution: wontfix
Keywords: | Focuses:
-----------------------------+----------------------
Changes (by danielbachhuber):
* status: reopened => closed
* resolution: => wontfix
Comment:
> Ah, in that case I think the codex needs changing.
The Codex is a wiki that anyone can edit. Feel free to change it :)
> Isn't it an idea to have another returncode that has as an effect that
the comment is totally disregarded?
I don't think the `pre_comment_approved` filter is the right thing to
modify in this case. What you could do instead is mark the comment as
"spam" if it doesn't meet the criteria you want, and then automatically
delete spam comments on the `wp_insert_comment` action. Or, you can store
some marker to "delete just this comment" in a global variable that you
can access in your later action.
It's not a perfect solution, but I think you'll find working with
WordPress to be full of imperfect solutions that work well-enough.
> sorry, this is my first time on trac
No worries — welcome to WordPress Trac!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27140#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list