Automattic\WooCommerce\Internal\OrderReviews

Endpoint::renderpublicWC 1.0

Render the Review Order body directly. Public so unit tests can drive the rendering path without staging a global request and the rewrite.

Method of the class: Endpoint{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Endpoint = new Endpoint();
$Endpoint->render( $order_id ): void;
$order_id(int) (required)
Order id parsed from the URL.

Endpoint::render() code WC 10.8.1

public function render( int $order_id ): void {
	$order_key = $this->read_order_key();
	$order     = $order_id ? wc_get_order( $order_id ) : false;

	if ( ! $this->is_authorised( $order, $order_key ) ) {
		$this->render_404();
		return;
	}

	if ( $order instanceof WC_Order ) {
		$this->maybe_mark_no_actionable_rows( $order );
	}

	wc_get_template( 'order/customer-review-order.php', array( 'order' => $order ) );
}