| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * List Table API: WP_Post_Comments_List_Table class | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package WordPress | 
					
						
							|  |  |  |  * @subpackage Administration | 
					
						
							|  |  |  |  * @since 4.4.0 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Core class used to implement displaying post comments in a list table. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @since 3.1.0 | 
					
						
							|  |  |  |  * @access private | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @see WP_Comments_List_Table | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class WP_Post_Comments_List_Table extends WP_Comments_List_Table { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @return array | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	protected function get_column_info() { | 
					
						
							|  |  |  | 		return array( | 
					
						
							|  |  |  | 			array( | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 				'author'  => __( 'Author' ), | 
					
						
							|  |  |  | 				'comment' => _x( 'Comment', 'column name' ), | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | 			), | 
					
						
							|  |  |  | 			array(), | 
					
						
							|  |  |  | 			array(), | 
					
						
							|  |  |  | 			'comment', | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @return array | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	protected function get_table_classes() { | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 		$classes   = parent::get_table_classes(); | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | 		$classes[] = 'wp-list-table'; | 
					
						
							|  |  |  | 		$classes[] = 'comments-box'; | 
					
						
							|  |  |  | 		return $classes; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param bool $output_empty | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	public function display( $output_empty = false ) { | 
					
						
							|  |  |  | 		$singular = $this->_args['singular']; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 		wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' ); | 
					
						
							|  |  |  | 		?>
 | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;"> | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 	<tbody id="the-comment-list" | 
					
						
							|  |  |  | 		<?php | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | 		if ( $singular ) { | 
					
						
							|  |  |  | 			echo " data-wp-lists='list:$singular'"; | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		?>
 | 
					
						
							|  |  |  | 		> | 
					
						
							|  |  |  | 		<?php | 
					
						
							|  |  |  | 		if ( ! $output_empty ) { | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | 			$this->display_rows_or_placeholder(); | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		?>
 | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | 	</tbody> | 
					
						
							|  |  |  | </table> | 
					
						
							| 
									
										
										
										
											2019-04-16 20:56:22 +01:00
										 |  |  | 		<?php | 
					
						
							| 
									
										
										
										
											2019-03-12 09:27:46 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param bool $comment_status | 
					
						
							|  |  |  | 	 * @return int | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	public function get_per_page( $comment_status = false ) { | 
					
						
							|  |  |  | 		return 10; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |