#22380 closed enhancement (fixed)
Consolidate the API hooks comment
| Reported by: | momo360modena | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.1 |
| Component: | Comments | Version: | 3.4 |
| Severity: | minor | Keywords: | has-patch needs-refresh good-first-bug |
| Cc: | Focuses: |
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
@
12 years ago
- Keywords needs-testing removed
- Milestone Awaiting Review → Future Release
These go in as soon as we get a refresh and the docs that jorbin refers to above <3
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.