Make WordPress Core

Ticket #29991: 29991.6.diff

File 29991.6.diff, 4.0 KB (added by bradt, 10 years ago)

Previous patch was missing CSS.

  • wp-admin/css/list-tables.css

    diff --git src/wp-admin/css/list-tables.css src/wp-admin/css/list-tables.css
    index 6e54796..acf896b 100644
    strong .post-com-count:after { 
    7474        float: left;
    7575}
    7676
     77.comment-post-link {
     78        display: block;
     79}
     80
    7781/* comments */
    7882
    7983.commentlist li {
    table.fixed { 
    267271    width: 74px;
    268272}
    269273
    270 .fixed .column-comment .comment-author {
     274.fixed .column-comment .comment-author,
     275.fixed .column-comment .comment-response {
    271276        display: none;
    272277}
    273278
    div.action-links, 
    15741579        .users .column-email,
    15751580        .users .column-name,
    15761581        .sites .column-registered,
    1577         .sites .column-users {
     1582        .sites .column-users,
     1583        .comments .column-response {
    15781584                display: none;
    15791585        }
    15801586
    1581         .fixed .column-comment .comment-author {
     1587        .fixed .column-comment .comment-author,
     1588        .fixed .column-comment .comment-response {
    15821589                display: block;
    15831590        }
    15841591
     1592        .fixed .column-comment .comment-response {
     1593                margin-top: 0.6em;
     1594        }
     1595
     1596        .fixed .column-comment .response-links {
     1597                float: none;
     1598        }
     1599
     1600        .fixed .column-comment .comment-post-link {
     1601                display: inline;
     1602                white-space: nowrap;
     1603                text-overflow: ellipsis;
     1604        }
     1605
     1606        .fixed .column-comment .post-com-count {
     1607                display: inline-block;
     1608                margin-left: 0.5em;
     1609        }
     1610
     1611        #commentsdiv .inside .row-actions,
     1612        .comment .row-actions {
     1613                line-height: 26px;
     1614        }
     1615
     1616        .comment .row-actions > span {
     1617                margin-right: 0.5em;
     1618        }
     1619
     1620        .comment .row-actions a {
     1621                white-space: nowrap;
     1622        }
     1623
     1624        .comment .row-actions .sep {
     1625                margin-right: 0.5em;
     1626        }
     1627
    15851628        /* Posts */
    15861629        .column-title {
    15871630                width: 85%;
  • wp-admin/includes/class-wp-comments-list-table.php

    diff --git src/wp-admin/includes/class-wp-comments-list-table.php src/wp-admin/includes/class-wp-comments-list-table.php
    index 3814f98..2eb6dab 100644
    class WP_Comments_List_Table extends WP_List_Table { 
    489489                        echo '<div class="row-actions">';
    490490                        foreach ( $actions as $action => $link ) {
    491491                                ++$i;
    492                                 ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
     492                                ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = '&nbsp;<span class="sep">|</span> ';
    493493
    494494                                // Reply and quickedit need a hide-if-no-js span when not added with ajax
    495495                                if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') )
    class WP_Comments_List_Table extends WP_List_Table { 
    505505                        }
    506506                        echo '</div>';
    507507                }
     508
     509                $pending_comments = get_pending_comments_num( $post->ID );
     510
     511                echo '<div class="comment-response">';
     512                        _e( 'In Response To:', 'post title' );
     513                        echo ' ' . $this->get_comment_post_link();
     514                        $this->comments_bubble( $post->ID, $pending_comments );
     515                echo '</div>';
    508516        }
    509517
    510518        public function column_author( $comment ) {
    class WP_Comments_List_Table extends WP_List_Table { 
    542550                return get_comment_date( __( 'Y/m/d \a\t g:ia' ) );
    543551        }
    544552
     553        protected function get_comment_post_link() {
     554                if ( current_user_can( 'edit_post', get_the_ID() ) ) {
     555                        $post_link = "<a class='comment-post-link' href='" . get_edit_post_link( get_the_ID() ) . "'>";
     556                        $post_link .= get_the_title( get_the_ID() ) . '</a>';
     557                } else {
     558                        $post_link = get_the_title( get_the_ID() );
     559                }
     560
     561                return $post_link;
     562        }
     563
    545564        public function column_response() {
    546565                $post = get_post();
    547566
    class WP_Comments_List_Table extends WP_List_Table { 
    552571                        $pending_comments = $this->pending_count[$post->ID] = $_pending_count_temp[$post->ID];
    553572                }
    554573
    555                 if ( current_user_can( 'edit_post', $post->ID ) ) {
    556                         $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
    557                         $post_link .= get_the_title( $post->ID ) . '</a>';
    558                 } else {
    559                         $post_link = get_the_title( $post->ID );
    560                 }
    561 
    562574                echo '<div class="response-links"><span class="post-com-count-wrapper">';
    563                 echo $post_link . '<br />';
     575                echo $this->get_comment_post_link();
    564576                $this->comments_bubble( $post->ID, $pending_comments );
    565577                echo '</span> ';
    566578                $post_type_object = get_post_type_object( $post->post_type );