Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::get_in_reply_to_review_text()privateWC 1.0

Gets the in-reply-to-review text.

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

No Hooks.

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->get_in_reply_to_review_text( $reply ) : string;
$reply(WP_Comment|mixed) (required)
Reply to review.

Code of ReviewsListTable::get_in_reply_to_review_text() WC 7.1.0

private function get_in_reply_to_review_text( $reply ) : string {

	$review = $reply->comment_parent ? get_comment( $reply->comment_parent ) : null;

	if ( ! $review ) {
		return '';
	}

	$parent_review_link = get_comment_link( $review );
	$review_author_name = get_comment_author( $review );

	return sprintf(
		/* translators: %s: Parent review link with review author name. */
		ent2ncr( __( 'In reply to %s.', 'woocommerce' ) ),
		'<a href="' . esc_url( $parent_review_link ) . '">' . esc_html( $review_author_name ) . '</a>'
	);
}