WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 5 months ago

#40664 closed enhancement (duplicate)

Handling of empty comments

Reported by: zakalwe Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: ui Cc:
PR Number:

Description

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.

Attachments (1)

comment.patch (349 bytes) - added by zakalwe 3 years ago.

Download all attachments as: .zip

Change History (2)

@zakalwe
3 years ago

#1 @earnjam
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 4.7.4 deleted

Hey @zakalwe thanks for the ticket. Sorry it took so long for someone to respond to this.

This is actually a duplicate of #18630. If you read the first comment there, there's quite a bit more to solving this than it appears at first glance.

Closing this to consolidate discussion to that ticket.

Note: See TracTickets for help on using tickets.