wp/wp-admin/includes/class-wp-post-comments-list-table.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 21 48c4eec2b7e6
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
    16  * @see WP_Comments_List_Table
    16  * @see WP_Comments_List_Table
    17  */
    17  */
    18 class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
    18 class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
    19 
    19 
    20 	/**
    20 	/**
    21 	 *
       
    22 	 * @return array
    21 	 * @return array
    23 	 */
    22 	 */
    24 	protected function get_column_info() {
    23 	protected function get_column_info() {
    25 		return array(
    24 		return array(
    26 			array(
    25 			array(
    27 				'author'   => __( 'Author' ),
    26 				'author'  => __( 'Author' ),
    28 				'comment'  => _x( 'Comment', 'column name' ),
    27 				'comment' => _x( 'Comment', 'column name' ),
    29 			),
    28 			),
    30 			array(),
    29 			array(),
    31 			array(),
    30 			array(),
    32 			'comment',
    31 			'comment',
    33 		);
    32 		);
    34 	}
    33 	}
    35 
    34 
    36 	/**
    35 	/**
    37 	 *
       
    38 	 * @return array
    36 	 * @return array
    39 	 */
    37 	 */
    40 	protected function get_table_classes() {
    38 	protected function get_table_classes() {
    41 		$classes = parent::get_table_classes();
    39 		$classes   = parent::get_table_classes();
    42 		$classes[] = 'wp-list-table';
    40 		$classes[] = 'wp-list-table';
    43 		$classes[] = 'comments-box';
    41 		$classes[] = 'comments-box';
    44 		return $classes;
    42 		return $classes;
    45 	}
    43 	}
    46 
    44 
    47 	/**
    45 	/**
    48 	 *
       
    49 	 * @param bool $output_empty
    46 	 * @param bool $output_empty
    50 	 */
    47 	 */
    51 	public function display( $output_empty = false ) {
    48 	public function display( $output_empty = false ) {
    52 		$singular = $this->_args['singular'];
    49 		$singular = $this->_args['singular'];
    53 
    50 
    54 		wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
    51 		wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
    55 ?>
    52 		?>
    56 <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
    53 <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
    57 	<tbody id="the-comment-list"<?php
    54 	<tbody id="the-comment-list"
       
    55 		<?php
    58 		if ( $singular ) {
    56 		if ( $singular ) {
    59 			echo " data-wp-lists='list:$singular'";
    57 			echo " data-wp-lists='list:$singular'";
    60 		} ?>>
    58 		}
    61 		<?php if ( ! $output_empty ) {
    59 		?>
       
    60 		>
       
    61 		<?php
       
    62 		if ( ! $output_empty ) {
    62 			$this->display_rows_or_placeholder();
    63 			$this->display_rows_or_placeholder();
    63 		} ?>
    64 		}
       
    65 		?>
    64 	</tbody>
    66 	</tbody>
    65 </table>
    67 </table>
    66 <?php
    68 		<?php
    67 	}
    69 	}
    68 
    70 
    69 	/**
    71 	/**
    70 	 *
       
    71 	 * @param bool $comment_status
    72 	 * @param bool $comment_status
    72 	 * @return int
    73 	 * @return int
    73 	 */
    74 	 */
    74 	public function get_per_page( $comment_status = false ) {
    75 	public function get_per_page( $comment_status = false ) {
    75 		return 10;
    76 		return 10;