Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::column_comment()protectedWC 1.0

Renders the review column.

Method of the class: ReviewsListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->column_comment( $item ) : void;
$item(WP_Comment|mixed) (required)
Review or reply being rendered.

Notes

ReviewsListTable::column_comment() code WC 8.7.0

<?php
protected function column_comment( $item ) : void {

	$in_reply_to = $this->get_in_reply_to_review_text( $item );

	ob_start();

	if ( $in_reply_to ) {
		echo $in_reply_to . '<br><br>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	}

	printf(
		'%1$s%2$s%3$s',
		'<div class="comment-text">',
		get_comment_text( $item->comment_ID ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		'</div>'
	);

	if ( $this->current_user_can_edit_review ) {
		?>
		<div id="inline-<?php echo esc_attr( $item->comment_ID ); ?>" class="hidden">
			<textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( $item->comment_content ); ?></textarea>
			<div class="author-email"><?php echo esc_attr( $item->comment_author_email ); ?></div>
			<div class="author"><?php echo esc_attr( $item->comment_author ); ?></div>
			<div class="author-url"><?php echo esc_attr( $item->comment_author_url ); ?></div>
			<div class="comment_status"><?php echo esc_html( $item->comment_approved ); ?></div>
		</div>
		<?php
	}

	echo $this->filter_column_output( 'comment', ob_get_clean(), $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}