Make WordPress Core

Opened 2 years ago

Last modified 8 months ago

#55891 new defect (bug)

Please add an action for additions within the "comment-metadata" div

Reported by: jwz's profile jwz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Comments Keywords: has-patch
Focuses: Cc:


I would like to add additional data to the ".comment-metadata" div, and there is no way to do that.

If I want to display the extra info for admins only, I can use the 'comment_text' filter, but that's a nasty hack, and obviously only shows up for users who are able to edit comments, so it doesn't help the general case.

I suggest adding an action just before or just after the call to edit_comment_link in class-walker-comment.php around line 460 (and also 360?)

Change History (3)

#1 @rafiahmedd
2 years ago

  • Keywords needs-patch added

This ticket was mentioned in PR #5405 on WordPress/wordpress-develop by @lopo.

8 months ago

  • Keywords has-patch added; needs-patch removed

Added a comment_metadata hook to filter the content of the comment metadata div, except for the edit link.

Trac ticket:

#3 @lopo
8 months ago

I worked on this during the Yoast Contributor Day.

I decided to make it a bit more general than just adding an action by using a filter instead. The first argument is the content of the comment metadata div, except for the edit link: so basically the time and date displayed as a direct link to the comment.

Note: See TracTickets for help on using tickets.