Make WordPress Core

Ticket #29991: 29991.5.diff

File 29991.5.diff, 2.3 KB (added by gregrickaby, 10 years ago)

Fixes "undefined variable" errors

  • wp-admin/includes/class-wp-comments-list-table.php

     
    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') )
     
    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 ) {
     
    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
     
    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 );