Opened 13 years ago
Closed 13 years ago
#26943 closed enhancement (invalid)
The comment_text() function retrieve the comment text 2 times
| Reported by: | alexvorn2 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Comments | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
The comment_text() function loads two function that retrieves the comment, so I think It should retrieve only one...
See the function here:
function comment_text( $comment_ID = 0, $args = array() ) {
$comment = get_comment( $comment_ID );
$comment_text = get_comment_text( $comment_ID , $args );
echo apply_filters( 'comment_text', $comment_text, $comment, $args );
}
what get_comment_text() does?:
function get_comment_text( $comment_ID = 0, $args = array() ) {
$comment = get_comment( $comment_ID );
return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args );
}
So if you see the get_comment() is called twice...
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Given that the whole $comment object is passed as context to the filters, I don't see that working out. It's cached anyway, doesn't hit the DB twice.