Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

AbstractOrderConfirmationBlock::has_valid_order_key()protectedWC 1.0

See if the order key is valid.

Method of the class: AbstractOrderConfirmationBlock{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->has_valid_order_key( $order );
$order(\WC_Order) (required)
Order object.

AbstractOrderConfirmationBlock::has_valid_order_key() code WC 9.0.1

protected function has_valid_order_key( $order ) {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended
	return ! empty( $_GET['key'] ) && $order->key_is_valid( wc_clean( wp_unslash( $_GET['key'] ) ) );
}