Make WordPress Core


Ignore:
Timestamp:
12/22/2010 07:03:43 PM (15 years ago)
Author:
ryan
Message:

Fix comment manipulation on edit post screen. Props garyc40. fixes #15876

File:
1 edited

Legend:

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

    r17103 r17113  
    3030
    3131        parent::WP_List_Table( array(
    32             'plural' => 'comments'
     32            'plural' => 'comments',
     33            'singular' => 'comment',
    3334        ) );
    3435    }
     
    6768
    6869        $page = $this->get_pagenum();
    69 
    70         $start = ( $page - 1 ) * $comments_per_page;
     70       
     71        if ( isset( $_REQUEST['start'] ) ) {
     72            $start = $_REQUEST['start'];
     73        } else {
     74            $start = ( $page - 1 ) * $comments_per_page;
     75        }
    7176       
    7277        if ( $doing_ajax && isset( $_REQUEST['offset'] ) ) {
     
    503508class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
    504509
    505     function get_columns() {
    506         return array(
     510    function get_column_info() {
     511        $this->_column_headers = array(
     512            array(
    507513            'author'   => __( 'Author' ),
    508514            'comment'  => _x( 'Comment', 'column name' ),
     515            ),
     516            array(),
     517            array(),
    509518        );
    510     }
    511 
    512     function get_sortable_columns() {
    513         return array();
     519       
     520        return $this->_column_headers;
     521    }
     522   
     523    function get_table_classes() {
     524        $classes = parent::get_table_classes();
     525        $classes[] = 'comments-box';
     526        return $classes;
     527    }
     528   
     529    function display( $output_empty = false ) {
     530        extract( $this->_args );
     531?>
     532<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;">
     533    <tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
     534        <?php if ( ! $output_empty ) $this->display_rows_or_placeholder(); ?>
     535    </tbody>
     536</table>
     537<?php
    514538    }
    515539}
Note: See TracChangeset for help on using the changeset viewer.