wc_product_pre_lock_on_sku filter-hookWC 9.3.0

Filter to bail early on the SKU lock query.

Usage

add_filter( 'wc_product_pre_lock_on_sku', 'wp_kama_wc_product_pre_lock_on_sku_filter', 10, 2 );

/**
 * Function for `wc_product_pre_lock_on_sku` filter-hook.
 * 
 * @param bool|null  $locked  Set to a boolean value to short-circuit the SKU lock query.
 * @param WC_Product $product The product being created.
 *
 * @return bool|null
 */
function wp_kama_wc_product_pre_lock_on_sku_filter( $locked, $product ){

	// filter...
	return $locked;
}
$locked(true|false|null)
Set to a boolean value to short-circuit the SKU lock query.
$product(WC_Product)
The product being created.

Changelog

Since 9.3.0 Introduced.

Where the hook is called

WC_Product_Data_Store_CPT::obtain_lock_on_sku_for_concurrent_requests()
wc_product_pre_lock_on_sku
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 143
$locked = apply_filters( 'wc_product_pre_lock_on_sku', null, $product );

Where the hook is used in WooCommerce

Usage not found.