#40664 (Handling of empty comments) – WordPress Trac (original) (raw)

#40664 closed enhancement (duplicate)

Reported by: zakalwe's profile Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: ui Cc:

I couldn't find any decent way of avoiding the "ERROR: please type a comment" message to appear if an empty comment is submitted. I was hoping to hook in somewhere and perform some custom action if an empty comment is encountered. The attached patch simply provides an action "require_valid_comment" that can be hooked into passing the post ID as the only argument. For my own use, I would redirect the user back to the post and tag on an error to be picked up in a custom comments template.