#22380 closed enhancement (fixed)
Consolidate the API hooks comment
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | minor | Version: | 3.4 |
Component: | Comments | Keywords: | has-patch needs-refresh good-first-bug |
Focuses: | Cc: |
Description
Many functions of API comments have hooks unusable because they do not provide parameters that provides the function.
In general, these functions provides a $comment_ID argument, but it's not present in the hook...
Sample
function comment_author( $comment_ID = 0 ) { $author = apply_filters('comment_author', get_comment_author( $comment_ID ) ); echo $author; }
Fixed sample :
function comment_author( $comment_ID = 0 ) { $author = apply_filters('comment_author', get_comment_author( $comment_ID ), $comment_ID ); echo $author; }
Attachments (2)
Change History (11)
#4
@
11 years ago
- Keywords needs-testing removed
- Milestone changed from Awaiting Review to Future Release
These go in as soon as we get a refresh and the docs that jorbin refers to above <3
#6
@
10 years ago
- Owner set to westi
- Resolution set to fixed
- Status changed from new to closed
In 30092:
Note: See
TracTickets for help on using
tickets.
Thanks for the suggestion momo360modena. Sorry you never got a response.
I like adding additional context to many of these filters. It definitely makes these filters more flexible and opens up a number of possibilities.
Perhaps though it make sense to be consistent with all of them and only include $comment_ID for all of them rather then sometimes including both $comment_ID and $comment.
When refreshing, some of these now have hook docs (which didn't exist when this patch was originally written), so please make sure to add the new @param value.