WordPress at Your Fingertips
function is not described

wc_transaction_query() WC 2.5.0

Run a MySQL transaction query, if supported.

No Hooks.

Return

null. Nothing.

Usage

wc_transaction_query( $type, $force );
$type(string)
Types: start (default), commit, rollback.
Default: 'start'
$force(true|false)
use of transactions.
Default: false

Changelog

Since 2.5.0 Introduced.

Code of wc_transaction_query() WC 5.6.0

function wc_transaction_query( $type = 'start', $force = false ) {
	global $wpdb;

	$wpdb->hide_errors();

	wc_maybe_define_constant( 'WC_USE_TRANSACTIONS', true );

	if ( Constants::is_true( 'WC_USE_TRANSACTIONS' ) || $force ) {
		switch ( $type ) {
			case 'commit':
				$wpdb->query( 'COMMIT' );
				break;
			case 'rollback':
				$wpdb->query( 'ROLLBACK' );
				break;
			default:
				$wpdb->query( 'START TRANSACTION' );
				break;
		}
	}
}