#25814 closed enhancement (fixed)
Not enough params for get_comment_class in WP_Comments_List_Table->display()
| Reported by: | drozdz | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.8 |
| Component: | Administration | Version: | 3.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
On line 314 you can find:
function single_row( $a_comment ) {
global $post, $comment;
$comment = $a_comment;
$the_comment_class = join( ' ', get_comment_class( wp_get_comment_status( $comment->comment_ID ) ) );
$post = get_post( $comment->comment_post_ID );
$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
$this->single_row_columns( $comment );
echo "</tr>\n";
}
It would be much easier to work with it, if get_comment_class would get all params (including comment_ID and post_ID).
Attachments (1)
Change History (3)
#1
@
13 years ago
- Component General → Administration
- Milestone Awaiting Review → 3.8
- Version 3.7.1 → 3.3
Related: [18594] (for #18447).
This would also fix the inconsistent (and potentially incorrect) addition of bypostauthor class in the admin. Currently it depends on the $post global, which is set after get_comment_class() is called:
tags/3.7.1/src/wp-admin/includes/class-wp-comments-list-table.php#L310
tags/3.7.1/src/wp-includes/comment-template.php#L348
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
class-wp-comments-list-table - patch