Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::delete_order_withdrawal_inbox_note_for_order │ public │ WC 1.0

Delete the withdrawal request inbox notification associated with an order.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

$OrderWithdrawalFormProcessor = new OrderWithdrawalFormProcessor();
$OrderWithdrawalFormProcessor->delete_order_withdrawal_inbox_note_for_order( $order ): void;
$order(int|WC_Order) (required)
Order ID or order object.

OrderWithdrawalFormProcessor::delete_order_withdrawal_inbox_note_for_order() code WC 11.1.2

public function delete_order_withdrawal_inbox_note_for_order( $order ): void {
	if ( $order instanceof WC_Order ) {
		$order_id = $order->get_id();
	} elseif ( is_int( $order ) ) {
		if ( ! OrderUtil::is_order( $order ) ) {
			return;
		}

		$order_id = $order;
	} else {
		return;
	}

	if ( 0 >= $order_id ) {
		return;
	}

	try {
		Notes::delete_notes_with_name( self::INBOX_NOTE_NAME_PREFIX . $order_id );
	} catch ( Throwable $e ) {
		$this->log_inbox_note_error( $e, $order_id );
	}
}