Make WordPress Core

Opened 22 months ago

Last modified 6 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:

Description

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
22 months ago

  • Keywords needs-patch added

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


6 months ago
#2

  • 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: https://core.trac.wordpress.org/ticket/55891

#3 @lopo
6 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.