WordPress at a glance
function is not described

wc_release_stock_for_order() WC 4.3.0

Release held stock for an order.

Hooks from the function
Return

null. Nothing.

Usage

wc_release_stock_for_order( $order );
$order(\WC_Order|int) (required)
Order ID or instance.

Changelog

Since 4.3.0 Introduced.

Code of wc_release_stock_for_order() WC 5.3.0

<?php
function wc_release_stock_for_order( $order ) {
	/**
	 * Filter: woocommerce_hold_stock_for_checkout
	 * Allows enable/disable hold stock functionality on checkout.
	 *
	 * @since 4.3.0
	 * @param bool $enabled Default to true if managing stock globally.
	 */
	if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {
		return;
	}

	$order = $order instanceof WC_Order ? $order : wc_get_order( $order );

	if ( $order ) {
		( new \Automattic\WooCommerce\Checkout\Helpers\ReserveStock() )->release_stock_for_order( $order );
	}
}