Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

AbstractOrderConfirmationBlock::is_current_customer_order()protectedWC 1.0

See if the current logged in user ID matches the given order customer ID.

Returns false for logged-out customers.

Method of the class: AbstractOrderConfirmationBlock{}

No Hooks.

Returns

true|false.

Usage

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

AbstractOrderConfirmationBlock::is_current_customer_order() code WC 9.8.4

protected function is_current_customer_order( $order ) {
	return $this->is_customer_order( $order ) && $order->get_user_id() === get_current_user_id();
}