Skip to content

Commit

Permalink
Coding Standards: Fix WPCS issues in `wp-admin/includes/class-wp-comm…
Browse files Browse the repository at this point in the history
…ents-list-table.php`.

* Rename method argument in `WP_Comments_List_Table::floated_admin_avatar()` per the naming conventions.
* Use strict comparison in `WP_Comments_List_Table::handle_row_actions()`.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50768 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Apr 18, 2021
1 parent 5e8b165 commit e01bbd4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/wp-admin/includes/class-wp-comments-list-table.php
Expand Up @@ -61,11 +61,11 @@ public function __construct( $args = array() ) {
* @since 3.1.0
*
* @param string $name Comment author name.
* @param int $comment_ID Comment ID.
* @param int $comment_id Comment ID.
* @return string Avatar with the user name.
*/
public function floated_admin_avatar( $name, $comment_ID ) {
$comment = get_comment( $comment_ID );
public function floated_admin_avatar( $name, $comment_id ) {
$comment = get_comment( $comment_id );
$avatar = get_avatar( $comment, 32, 'mystery' );
return "$avatar $name";
}
Expand Down Expand Up @@ -832,7 +832,7 @@ protected function handle_row_actions( $comment, $column_name, $primary ) {
} elseif ( ( 'untrash' === $action && 'trash' === $the_comment_status )
|| ( 'unspam' === $action && 'spam' === $the_comment_status )
) {
if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {
if ( '1' === get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {
$action .= ' approve';
} else {
$action .= ' unapprove';
Expand Down Expand Up @@ -1026,7 +1026,7 @@ public function column_default( $comment, $column_name ) {
* @since 2.8.0
*
* @param string $column_name The custom column's name.
* @param int $comment_ID The custom column's unique ID number.
* @param int $comment_id The custom column's unique ID number.
*/
do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
}
Expand Down

0 comments on commit e01bbd4

Please sign in to comment.