Automattic\WooCommerce\Internal\Admin\ProductReviews

Reviews::render_reviews_list_table()publicWC 1.0

Renders the Reviews page.

Метод класса: Reviews{}

Return

null. Nothing.

Usage

$Reviews = new Reviews();
$Reviews->render_reviews_list_table() : void;

Code of Reviews::render_reviews_list_table() WC 7.1.0

<?php
public function render_reviews_list_table() : void {

	$this->reviews_list_table->prepare_items();

	ob_start();

	?>
	<div class="wrap">
		<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>

		<?php $this->reviews_list_table->views(); ?>

		<form id="reviews-filter" method="get">
			<?php $page = isset( $_REQUEST['page'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) : static::MENU_SLUG; ?>

			<input type="hidden" name="page" value="<?php echo esc_attr( $page ); ?>" />
			<input type="hidden" name="post_type" value="product" />
			<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', true ) ); ?>" />

			<?php $this->reviews_list_table->search_box( __( 'Search Reviews', 'woocommerce' ), 'reviews' ); ?>

			<?php $this->reviews_list_table->display(); ?>
		</form>
	</div>
	<?php
	wp_comment_reply( '-1', true, 'detail' );
	wp_comment_trashnotice();

	/**
	 * Filters the contents of the product reviews list table output.
	 *
	 * @since 6.7.0
	 *
	 * @param string           $output             The HTML output of the list table.
	 * @param ReviewsListTable $reviews_list_table The reviews list table instance.
	 */
	echo apply_filters( 'woocommerce_product_reviews_list_table', ob_get_clean(), $this->reviews_list_table ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}