Opened 7 years ago
Closed 7 years ago
#42380 closed enhancement (wontfix)
Add comment url filter to comment list table
Reported by: | danieltj | Owned by: | ashokrd2013 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8.2 |
Component: | Comments | Keywords: | good-first-bug has-patch needs-testing |
Focuses: | Cc: |
Description
In class-wp-comments-list-table.php
on line 684 we get the author url like so:
$author_url = get_comment_author_url( $comment );
Even though slightly further down there is a filter for the comment author email address, there isn't a filter for the comment author url. Directly below the code listed above, there should be another filter (for completeness if not for anything else).
I'd suggest something like this:
$author_url = apply_filters( 'comment_website', $author_url, $comment );
This would then allow the author url to be altered with the added bonus of the comment object for extra flexibility, much like the email address.
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Thanks for the patch @ashokrd2013
In the Core Contributor Handbook there's a good description how to document filters:
https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#4-hooks-actions-and-filters
but I noticed that the function
get_comment_author_url()
contains the following filter:https://core.trac.wordpress.org/browser/tags/4.9.1/src/wp-includes/comment-template.php#L302