Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
AbstractOrderConfirmationBlock::has_valid_order_key()
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() AbstractOrderConfirmationBlock::has valid order key code WC 9.8.2
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'] ) ) ); }