[wp-trac] [WordPress Trac] #27140: possible bug in pre_comment_approved filter
WordPress Trac
noreply at wordpress.org
Mon Feb 17 15:46:59 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:
-----------------------------+----------------------
Comment (by realblueorange):
Replying to [comment:4 danielbachhuber]:
> > Ah, in that case I think the codex needs changing.
>
> The Codex is a wiki that anyone can edit. Feel free to change it :)
OK, will give that a shot.
> > 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.
Thanks for the idea. I'll go that way. This filter sounded like the
perfect place for such a thing, and after some googling I thought there
might be a big demand for such a simple solution.
>
> 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.
Oh, yes. But it still is a great system. I like it a lot.
>
> > sorry, this is my first time on trac
>
> No worries — welcome to WordPress Trac!
Thanks.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27140#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list