WordPress.org

Make WordPress Core

Changeset 34504


Ignore:
Timestamp:
09/24/2015 05:26:54 PM (5 years ago)
Author:
wonderboymusic
Message:

Comments: add date column to WP_Comments_List_Table to allow sorting and to break out the date/time from the comment content column.

Props jshreve.
Fixes #15520.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r34356 r34504  
    387387}
    388388
     389#comments-form .fixed .column-date {
     390    width: 14%;
     391}
     392
    389393#commentsdiv.postbox .inside {
    390394    margin: 0;
  • trunk/src/wp-admin/edit-comments.php

    r34132 r34504  
    152152        '<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .
    153153        '<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
    154         '<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says &#8220;Submitted on,&#8221; followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
     154        '<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
    155155        '<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' .
     156        '<p>' . __( 'In the <strong>Submitted On</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' .
    156157        '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
    157158) );
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r34424 r34504  
    400400        }
    401401
     402        $columns['date'] = _x( 'Submitted On', 'column name' );
     403
    402404        return $columns;
    403405    }
     
    410412        return array(
    411413            'author'   => 'comment_author',
    412             'response' => 'comment_post_ID'
     414            'response' => 'comment_post_ID',
     415            'date'     => 'comment_date'
    413416        );
    414417    }
     
    622625     */
    623626    public function column_comment( $comment ) {
    624         $comment_url = esc_url( get_comment_link( $comment ) );
    625 
    626627        echo '<div class="comment-author">';
    627628            $this->column_author( $comment );
    628629        echo '</div>';
    629 
    630         echo '<div class="submitted-on">';
    631         /* translators: 2: comment date, 3: comment time */
    632         printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
    633             /* translators: comment date format. See http://php.net/date */
    634             get_comment_date( __( 'Y/m/d' ), $comment ),
    635             get_comment_date( get_option( 'time_format' ), $comment )
    636         );
    637630
    638631        if ( $comment->comment_parent ) {
     
    643636                printf(
    644637                    /* translators: %s: comment link */
    645                     ' | ' . __( 'In reply to %s.' ),
     638                    __( 'In reply to %s.' ),
    646639                    '<a href="' . $parent_link . '">' . $name . '</a>'
    647640                );
     
    649642        }
    650643
    651         echo '</div>';
    652644        comment_text( $comment );
    653645        if ( $this->user_can ) { ?>
     
    709701
    710702    /**
    711      *
    712      * @return string
     703     * @access public
    713704     */
    714705    public function column_date( $comment ) {
    715         return get_comment_date( __( 'Y/m/d \a\t g:i a' ), $comment );
     706        $comment_url = esc_url( get_comment_link( $comment ) );
     707        echo '<div class="submitted-on">';
     708        /* translators: 2: comment date, 3: comment time */
     709        printf( __( '<a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
     710            /* translators: comment date format. See http://php.net/date */
     711            get_comment_date( __( 'Y/m/d' ), $comment ),
     712            get_comment_date( get_option( 'time_format' ), $comment )
     713        );
     714        echo '</div>';
    716715    }
    717716
Note: See TracChangeset for help on using the changeset viewer.