Automattic\WooCommerce\Internal\OrderReviews

Endpoint::render_404privateWC 1.0

Mark the current request as a 404 and load the theme's 404 template.

Fails closed on every gating check so a stale or tampered link cannot disclose order existence.

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

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->render_404(): void;

Код Endpoint::render_404() WC 11.0.1

private function render_404(): void {
	global $wp_query;

	$wp_query->set_404();
	status_header( 404 );
	nocache_headers();

	$template = get_query_template( '404' );
	if ( ! empty( $template ) && file_exists( $template ) ) {
		include $template;
		return;
	}

	// Fallback when the active theme has no 404 template: emit a minimal
	// page so the response body isn't empty.
	printf(
		'<!doctype html><html><head><meta charset="utf-8"><title>%1$s</title></head><body><h1>%1$s</h1></body></html>',
		esc_html__( 'Page not found', 'woocommerce' )
	);
}