Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (9 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r41683 r42343  
    4646                }
    4747
    48                 parent::__construct( array(
    49                         'plural' => 'comments',
    50                         'singular' => 'comment',
    51                         'ajax' => true,
    52                         'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
    53                 ) );
     48                parent::__construct(
     49                        array(
     50                                'plural'   => 'comments',
     51                                'singular' => 'comment',
     52                                'ajax'     => true,
     53                                'screen'   => isset( $args['screen'] ) ? $args['screen'] : null,
     54                        )
     55                );
    5456        }
    5557
    5658        public function floated_admin_avatar( $name, $comment_ID ) {
    5759                $comment = get_comment( $comment_ID );
    58                 $avatar = get_avatar( $comment, 32, 'mystery' );
     60                $avatar  = get_avatar( $comment, 32, 'mystery' );
    5961                return "$avatar $name";
    6062        }
     
    6466         */
    6567        public function ajax_user_can() {
    66                 return current_user_can('edit_posts');
    67         }
    68 
    69         /**
    70          *
     68                return current_user_can( 'edit_posts' );
     69        }
     70
     71        /**
    7172         * @global int    $post_id
    7273         * @global string $comment_status
     
    7879
    7980                $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
    80                 if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
     81                if ( ! in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) ) {
    8182                        $comment_status = 'all';
    82 
    83                 $comment_type = !empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
     83                }
     84
     85                $comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
    8486
    8587                $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
     
    9092
    9193                $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';
    92                 $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
     94                $order   = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
    9395
    9496                $comments_per_page = $this->get_per_page( $comment_status );
     
    98100                if ( isset( $_REQUEST['number'] ) ) {
    99101                        $number = (int) $_REQUEST['number'];
    100                 }
    101                 else {
     102                } else {
    102103                        $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
    103104                }
     
    117118                $status_map = array(
    118119                        'moderated' => 'hold',
    119                         'approved' => 'approve',
    120                         'all' => '',
     120                        'approved'  => 'approve',
     121                        'all'       => '',
    121122                );
    122123
    123124                $args = array(
    124                         'status' => isset( $status_map[$comment_status] ) ? $status_map[$comment_status] : $comment_status,
    125                         'search' => $search,
    126                         'user_id' => $user_id,
    127                         'offset' => $start,
    128                         'number' => $number,
    129                         'post_id' => $post_id,
    130                         'type' => $comment_type,
    131                         'orderby' => $orderby,
    132                         'order' => $order,
     125                        'status'    => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,
     126                        'search'    => $search,
     127                        'user_id'   => $user_id,
     128                        'offset'    => $start,
     129                        'number'    => $number,
     130                        'post_id'   => $post_id,
     131                        'type'      => $comment_type,
     132                        'orderby'   => $orderby,
     133                        'order'     => $order,
    133134                        'post_type' => $post_type,
    134135                );
     
    138139                        update_comment_cache( $_comments );
    139140
    140                         $this->items = array_slice( $_comments, 0, $comments_per_page );
     141                        $this->items       = array_slice( $_comments, 0, $comments_per_page );
    141142                        $this->extra_items = array_slice( $_comments, $comments_per_page );
    142143
     
    146147                }
    147148
    148                 $total_comments = get_comments( array_merge( $args, array(
    149                         'count' => true,
    150                         'offset' => 0,
    151                         'number' => 0
    152                 ) ) );
    153 
    154                 $this->set_pagination_args( array(
    155                         'total_items' => $total_comments,
    156                         'per_page' => $comments_per_page,
    157                 ) );
    158         }
    159 
    160         /**
    161          *
     149                $total_comments = get_comments(
     150                        array_merge(
     151                                $args, array(
     152                                        'count'  => true,
     153                                        'offset' => 0,
     154                                        'number' => 0,
     155                                )
     156                        )
     157                );
     158
     159                $this->set_pagination_args(
     160                        array(
     161                                'total_items' => $total_comments,
     162                                'per_page'    => $comments_per_page,
     163                        )
     164                );
     165        }
     166
     167        /**
    162168         * @param string $comment_status
    163169         * @return int
     
    177183
    178184        /**
    179          *
    180185         * @global string $comment_status
    181186         */
     
    191196
    192197        /**
    193          *
    194198         * @global int $post_id
    195199         * @global string $comment_status
     
    204208                $stati = array(
    205209                        /* translators: %s: all comments count */
    206                         'all' => _nx_noop(
     210                        'all'       => _nx_noop(
    207211                                'All <span class="count">(%s)</span>',
    208212                                'All <span class="count">(%s)</span>',
     
    218222
    219223                        /* translators: %s: approved comments count */
    220                         'approved' => _nx_noop(
     224                        'approved'  => _nx_noop(
    221225                                'Approved <span class="count">(%s)</span>',
    222226                                'Approved <span class="count">(%s)</span>',
     
    225229
    226230                        /* translators: %s: spam comments count */
    227                         'spam' => _nx_noop(
     231                        'spam'      => _nx_noop(
    228232                                'Spam <span class="count">(%s)</span>',
    229233                                'Spam <span class="count">(%s)</span>',
     
    232236
    233237                        /* translators: %s: trashed comments count */
    234                         'trash' => _nx_noop(
     238                        'trash'     => _nx_noop(
    235239                                'Trash <span class="count">(%s)</span>',
    236240                                'Trash <span class="count">(%s)</span>',
    237241                                'comments'
    238                         )
    239                 );
    240 
    241                 if ( !EMPTY_TRASH_DAYS )
    242                         unset($stati['trash']);
     242                        ),
     243                );
     244
     245                if ( ! EMPTY_TRASH_DAYS ) {
     246                        unset( $stati['trash'] );
     247                }
    243248
    244249                $link = admin_url( 'edit-comments.php' );
    245                 if ( !empty($comment_type) && 'all' != $comment_type )
     250                if ( ! empty( $comment_type ) && 'all' != $comment_type ) {
    246251                        $link = add_query_arg( 'comment_type', $comment_type, $link );
     252                }
    247253
    248254                foreach ( $stati as $status => $label ) {
     
    253259                        }
    254260
    255                         if ( !isset( $num_comments->$status ) )
     261                        if ( ! isset( $num_comments->$status ) ) {
    256262                                $num_comments->$status = 10;
     263                        }
    257264                        $link = add_query_arg( 'comment_status', $status, $link );
    258                         if ( $post_id )
     265                        if ( $post_id ) {
    259266                                $link = add_query_arg( 'p', absint( $post_id ), $link );
     267                        }
    260268                        /*
    261269                        // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
     
    265273                        $status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf(
    266274                                translate_nooped_plural( $label, $num_comments->$status ),
    267                                 sprintf( '<span class="%s-count">%s</span>',
     275                                sprintf(
     276                                        '<span class="%s-count">%s</span>',
    268277                                        ( 'moderated' === $status ) ? 'pending' : $status,
    269278                                        number_format_i18n( $num_comments->$status )
     
    284293
    285294        /**
    286          *
    287295         * @global string $comment_status
    288296         *
     
    293301
    294302                $actions = array();
    295                 if ( in_array( $comment_status, array( 'all', 'approved' ) ) )
     303                if ( in_array( $comment_status, array( 'all', 'approved' ) ) ) {
    296304                        $actions['unapprove'] = __( 'Unapprove' );
    297                 if ( in_array( $comment_status, array( 'all', 'moderated' ) ) )
     305                }
     306                if ( in_array( $comment_status, array( 'all', 'moderated' ) ) ) {
    298307                        $actions['approve'] = __( 'Approve' );
    299                 if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) )
     308                }
     309                if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) {
    300310                        $actions['spam'] = _x( 'Mark as Spam', 'comment' );
     311                }
    301312
    302313                if ( 'trash' === $comment_status ) {
     
    306317                }
    307318
    308                 if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS )
     319                if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || ! EMPTY_TRASH_DAYS ) {
    309320                        $actions['delete'] = __( 'Delete Permanently' );
    310                 else
     321                } else {
    311322                        $actions['trash'] = __( 'Move to Trash' );
     323                }
    312324
    313325                return $actions;
     
    315327
    316328        /**
    317          *
    318329         * @global string $comment_status
    319330         * @global string $comment_type
     
    331342                <div class="alignleft actions">
    332343<?php
    333                 if ( 'top' === $which ) {
     344if ( 'top' === $which ) {
    334345?>
    335                         <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
    336                         <select id="filter-by-comment-type" name="comment_type">
    337                                 <option value=""><?php _e( 'All comment types' ); ?></option>
     346        <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
     347        <select id="filter-by-comment-type" name="comment_type">
     348                <option value=""><?php _e( 'All comment types' ); ?></option>
    338349<?php
    339                                 /**
    340                                  * Filters the comment types dropdown menu.
    341                                  *
    342                                  * @since 2.7.0
    343                                  *
    344                                  * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
    345                                  */
    346                                 $comment_types = apply_filters( 'admin_comment_types_dropdown', array(
    347                                         'comment' => __( 'Comments' ),
    348                                         'pings' => __( 'Pings' ),
    349                                 ) );
    350 
    351                                 foreach ( $comment_types as $type => $label )
    352                                         echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
    353                         ?>
    354                         </select>
     350                /**
     351                 * Filters the comment types dropdown menu.
     352                 *
     353                 * @since 2.7.0
     354                 *
     355                 * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
     356                 */
     357                $comment_types = apply_filters(
     358                        'admin_comment_types_dropdown', array(
     359                                'comment' => __( 'Comments' ),
     360                                'pings'   => __( 'Pings' ),
     361                        )
     362                );
     363
     364foreach ( $comment_types as $type => $label ) {
     365        echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
     366}
     367        ?>
     368        </select>
    355369<?php
    356                         /**
    357                         * Fires just before the Filter submit button for comment types.
    358                         *
    359                         * @since 3.5.0
    360                         */
    361                         do_action( 'restrict_manage_comments' );
    362                         submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    363                 }
    364 
    365                 if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
    366                         wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    367                         $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
    368                         submit_button( $title, 'apply', 'delete_all', false );
    369                 }
     370        /**
     371        * Fires just before the Filter submit button for comment types.
     372        *
     373        * @since 3.5.0
     374        */
     375        do_action( 'restrict_manage_comments' );
     376        submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
     377}
     378
     379if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
     380        wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
     381        $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
     382        submit_button( $title, 'apply', 'delete_all', false );
     383}
    370384                /**
    371385                 * Fires after the Filter submit button for comment types.
     
    383397         */
    384398        public function current_action() {
    385                 if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
     399                if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
    386400                        return 'delete_all';
     401                }
    387402
    388403                return parent::current_action();
     
    390405
    391406        /**
    392          *
    393407         * @global int $post_id
    394408         *
     
    400414                $columns = array();
    401415
    402                 if ( $this->checkbox )
     416                if ( $this->checkbox ) {
    403417                        $columns['cb'] = '<input type="checkbox" />';
    404 
    405                 $columns['author'] = __( 'Author' );
     418                }
     419
     420                $columns['author']  = __( 'Author' );
    406421                $columns['comment'] = _x( 'Comment', 'column name' );
    407422
     
    417432
    418433        /**
    419          *
    420434         * @return array
    421435         */
     
    424438                        'author'   => 'comment_author',
    425439                        'response' => 'comment_post_ID',
    426                         'date'     => 'comment_date'
     440                        'date'     => 'comment_date',
    427441                );
    428442        }
     
    442456         */
    443457        public function display() {
    444                 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
     458                wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
    445459
    446460                $this->display_tablenav( 'top' );
     
    508522        }
    509523
    510         /**
    511          * Generate and display row actions links.
    512          *
    513          * @since 4.3.0
    514          *
    515          * @global string $comment_status Status for the current listed comments.
    516          *
    517          * @param WP_Comment $comment     The comment object.
    518          * @param string     $column_name Current column name.
    519          * @param string     $primary     Primary column name.
    520          * @return string|void Comment row actions output.
    521          */
    522         protected function handle_row_actions( $comment, $column_name, $primary ) {
    523                 global $comment_status;
     524        /**
     525         * Generate and display row actions links.
     526         *
     527         * @since 4.3.0
     528         *
     529         * @global string $comment_status Status for the current listed comments.
     530         *
     531         * @param WP_Comment $comment     The comment object.
     532         * @param string     $column_name Current column name.
     533         * @param string     $primary     Primary column name.
     534         * @return string|void Comment row actions output.
     535         */
     536        protected function handle_row_actions( $comment, $column_name, $primary ) {
     537                global $comment_status;
    524538
    525539                if ( $primary !== $column_name ) {
     
    527541                }
    528542
    529                 if ( ! $this->user_can ) {
    530                         return;
     543                if ( ! $this->user_can ) {
     544                        return;
    531545                }
    532546
     
    535549                $out = '';
    536550
    537                 $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
     551                $del_nonce     = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
    538552                $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
    539553
    540554                $url = "comment.php?c=$comment->comment_ID";
    541555
    542                 $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );
     556                $approve_url   = esc_url( $url . "&action=approvecomment&$approve_nonce" );
    543557                $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" );
    544                 $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );
    545                 $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );
    546                 $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );
    547                 $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );
    548                 $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );
     558                $spam_url      = esc_url( $url . "&action=spamcomment&$del_nonce" );
     559                $unspam_url    = esc_url( $url . "&action=unspamcomment&$del_nonce" );
     560                $trash_url     = esc_url( $url . "&action=trashcomment&$del_nonce" );
     561                $untrash_url   = esc_url( $url . "&action=untrashcomment&$del_nonce" );
     562                $delete_url    = esc_url( $url . "&action=deletecomment&$del_nonce" );
    549563
    550564                // Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash.
    551565                $actions = array(
    552                         'approve' => '', 'unapprove' => '',
    553                         'reply' => '',
     566                        'approve'   => '',
     567                        'unapprove' => '',
     568                        'reply'     => '',
    554569                        'quickedit' => '',
    555                         'edit' => '',
    556                         'spam' => '', 'unspam' => '',
    557                         'trash' => '', 'untrash' => '', 'delete' => ''
     570                        'edit'      => '',
     571                        'spam'      => '',
     572                        'unspam'    => '',
     573                        'trash'     => '',
     574                        'untrash'   => '',
     575                        'delete'    => '',
    558576                );
    559577
     
    566584                        }
    567585                } else {
    568                         $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     586                        $actions['approve']   = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    569587                        $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    570588                }
     
    580598                }
    581599
    582                 if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || !EMPTY_TRASH_DAYS ) {
     600                if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) {
    583601                        $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive' aria-label='" . esc_attr__( 'Delete this comment permanently' ) . "'>" . __( 'Delete Permanently' ) . '</a>';
    584602                } else {
     
    587605
    588606                if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {
    589                         $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>". __( 'Edit' ) . '</a>';
     607                        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
    590608
    591609                        $format = '<a data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s" aria-label="%s" href="#">%s</a>';
     
    599617                $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
    600618
    601                 $i = 0;
     619                $i    = 0;
    602620                $out .= '<div class="row-actions">';
    603621                foreach ( $actions as $action => $link ) {
     
    606624
    607625                        // Reply and quickedit need a hide-if-no-js span when not added with ajax
    608                         if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() )
     626                        if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) {
    609627                                $action .= ' hide-if-no-js';
    610                         elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {
    611                                 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )
     628                        } elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {
     629                                if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {
    612630                                        $action .= ' approve';
    613                                 else
     631                                } else {
    614632                                        $action .= ' unapprove';
     633                                }
    615634                        }
    616635
     
    625644
    626645        /**
    627          *
    628646         * @param WP_Comment $comment The comment object.
    629647         */
    630648        public function column_cb( $comment ) {
    631                 if ( $this->user_can ) { ?>
     649                if ( $this->user_can ) {
     650                ?>
    632651                <label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label>
    633652                <input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" />
     
    648667                        if ( $parent ) {
    649668                                $parent_link = esc_url( get_comment_link( $parent ) );
    650                                 $name = get_comment_author( $parent );
     669                                $name        = get_comment_author( $parent );
    651670                                printf(
    652671                                        /* translators: %s: comment link */
     
    658677
    659678                comment_text( $comment );
    660                 if ( $this->user_can ) { ?>
     679                if ( $this->user_can ) {
     680                ?>
    661681                <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
    662                 <textarea class="comment" rows="1" cols="1"><?php
     682                <textarea class="comment" rows="1" cols="1">
     683                <?php
    663684                        /** This filter is documented in wp-admin/includes/comment.php */
    664685                        echo esc_textarea( apply_filters( 'comment_edit_pre', $comment->comment_content ) );
    665                 ?></textarea>
     686                ?>
     687                </textarea>
    666688                <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
    667689                <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
     
    674696
    675697        /**
    676          *
    677698         * @global string $comment_status
    678699         *
     
    689710                }
    690711
    691                 echo "<strong>"; comment_author( $comment ); echo '</strong><br />';
     712                echo '<strong>';
     713                comment_author( $comment );
     714                echo '</strong><br />';
    692715                if ( ! empty( $author_url_display ) ) {
    693716                        printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );
     
    706729                        $author_ip = get_comment_author_IP( $comment );
    707730                        if ( $author_ip ) {
    708                                 $author_ip_url = add_query_arg( array( 's' => $author_ip, 'mode' => 'detail' ), admin_url( 'edit-comments.php' ) );
     731                                $author_ip_url = add_query_arg(
     732                                        array(
     733                                                's'    => $author_ip,
     734                                                'mode' => 'detail',
     735                                        ), admin_url( 'edit-comments.php' )
     736                                );
    709737                                if ( 'spam' === $comment_status ) {
    710738                                        $author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
     
    716744
    717745        /**
    718          *
    719746         * @param WP_Comment $comment The comment object.
    720747         */
    721748        public function column_date( $comment ) {
    722749                /* translators: 1: comment date, 2: comment time */
    723                 $submitted = sprintf( __( '%1$s at %2$s' ),
     750                $submitted = sprintf(
     751                        __( '%1$s at %2$s' ),
    724752                        /* translators: comment date format. See https://secure.php.net/date */
    725753                        get_comment_date( __( 'Y/m/d' ), $comment ),
     
    728756
    729757                echo '<div class="submitted-on">';
    730                 if ( 'approved' === wp_get_comment_status( $comment ) && ! empty ( $comment->comment_post_ID ) ) {
     758                if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
    731759                        printf(
    732760                                '<a href="%s">%s</a>',
     
    741769
    742770        /**
    743          *
    744771         * @param WP_Comment $comment The comment object.
    745772         */
     
    751778                }
    752779
    753                 if ( isset( $this->pending_count[$post->ID] ) ) {
    754                         $pending_comments = $this->pending_count[$post->ID];
     780                if ( isset( $this->pending_count[ $post->ID ] ) ) {
     781                        $pending_comments = $this->pending_count[ $post->ID ];
    755782                } else {
    756783                        $_pending_count_temp = get_pending_comments_num( array( $post->ID ) );
    757                         $pending_comments = $this->pending_count[$post->ID] = $_pending_count_temp[$post->ID];
     784                        $pending_comments    = $this->pending_count[ $post->ID ] = $_pending_count_temp[ $post->ID ];
    758785                }
    759786
    760787                if ( current_user_can( 'edit_post', $post->ID ) ) {
    761                         $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";
     788                        $post_link  = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";
    762789                        $post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
    763790                } else {
     
    779806
    780807        /**
    781          *
    782808         * @param WP_Comment $comment     The comment object.
    783809         * @param string     $column_name The custom column's name.
Note: See TracChangeset for help on using the changeset viewer.