WordPress.org

Make WordPress Core

Ticket #15520: commentcolumn.diff

File commentcolumn.diff, 4.5 KB (added by jshreve, 3 years ago)

Breaks out the submitted on text to its own sortable column

  • wp-admin/edit-comments.php

     
    112112add_contextual_help( $current_screen, '<p>' . __( 'You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>' . 
    113113        '<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' . 
    114114        '<p>' . __( 'In the Author 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>' . 
    115         '<p>' . __( 'In the Comment 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.' ) . '</p>' . 
     115        '<p>' . __( 'In the Comment column, the on-hover action links will appear that will allow you to manage that comment.' ) . '</p>' . 
    116116        '<p>' . __( 'In the In Response To 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 &#8220;#&#8221; permalink symbol below leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' . 
     117        '<p>' . __( 'In the Submitted On column, the date and time the comment was left on your site appears. Clicking the date and time will take you to that comment on your live site.' ) . '</p>' .  
    117118        '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.' ) . '</p>' . 
    118119        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    119120        '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' . 
  • wp-admin/includes/class-wp-comments-list-table.php

     
    241241 
    242242                if ( 'single' !== $mode ) 
    243243                        $columns['response'] = _x( 'In Response To', 'column name' ); 
     244                         
     245                $columns['date'] = _x( 'Submitted On', 'column name' ); 
    244246 
    245247                return $columns; 
    246248        } 
     
    249251                return array( 
    250252                        'author'   => 'comment_author', 
    251253                        'comment'  => 'comment_content', 
    252                         'response' => 'comment_post_ID' 
     254                        'response' => 'comment_post_ID', 
     255                        'date'     => 'comment_date' 
    253256                ); 
    254257        } 
    255258 
     
    310313 
    311314                $user_can = $this->user_can; 
    312315 
    313                 $comment_url = esc_url( get_comment_link( $comment->comment_ID ) ); 
    314  
    315316                $ptime = date( 'G', strtotime( $comment->comment_date ) ); 
    316317                if ( ( abs( time() - $ptime ) ) < 86400 ) 
    317318                        $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) ); 
     
    333334                        $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" ); 
    334335                } 
    335336 
    336                 echo '<div class="submitted-on">'; 
    337                 /* translators: 2: comment date, 3: comment time */ 
    338                 printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $comment_url, 
    339                         /* translators: comment date format. See http://php.net/date */ get_comment_date( __( 'Y/m/d' ) ), 
    340                         /* translators: comment time format. See http://php.net/date */ get_comment_date( get_option( 'time_format' ) ) ); 
    341  
    342337                if ( $comment->comment_parent ) { 
    343338                        $parent = get_comment( $comment->comment_parent ); 
    344339                        $parent_link = esc_url( get_comment_link( $comment->comment_parent ) ); 
     
    456451        } 
    457452 
    458453        function column_date( $comment ) { 
    459                 return get_comment_date( __( 'Y/m/d \a\t g:ia' ) ); 
     454                return sprintf( __( '<div class="submitted-on"><a href="%1$s">%2$s at %3$s</a></div>' ), esc_url( get_comment_link( $comment->comment_ID ) ), 
     455                        /* translators: comment date format. See http://php.net/date */ get_comment_date( __( 'Y/m/d' ) ), 
     456                        /* translators: comment time format. See http://php.net/date */ get_comment_date( get_option( 'time_format' ) ) ); 
    460457        } 
    461458 
    462459        function column_response( $comment ) {