woocommerce_migrate_country_states_for_orders_batch_size filter-hookWC 7.2.0

Filters the value of N, where the maximum count of database records that will be updated in one single run of migrate_country_states_for_orders is N2count($old_to_new_states_mapping) if the woocommerce_orders table exists, or N*count($old_to_new_states_mapping) otherwise.

Usage

add_filter( 'woocommerce_migrate_country_states_for_orders_batch_size', 'wp_kama_woocommerce_migrate_country_states_for_orders_batch_size_filter', 10, 3 );

/**
 * Function for `woocommerce_migrate_country_states_for_orders_batch_size` filter-hook.
 * 
 * @param int    $batch_size                Default value for the count of records to update.
 * @param string $country_code              Country code for the update.
 * @param array  $old_to_new_states_mapping Associative array of old to new state codes.
 *
 * @return int
 */
function wp_kama_woocommerce_migrate_country_states_for_orders_batch_size_filter( $batch_size, $country_code, $old_to_new_states_mapping ){

	// filter...
	return $batch_size;
}
$batch_size(int)
Default value for the count of records to update.
$country_code(string)
Country code for the update.
$old_to_new_states_mapping(array)
Associative array of old to new state codes.

Changelog

Since 7.2.0 Introduced.

Where the hook is called

MigrationHelper::migrate_country_states_for_orders()
woocommerce_migrate_country_states_for_orders_batch_size
woocommerce/src/Database/Migrations/MigrationHelper.php 180
$limit      = apply_filters( 'woocommerce_migrate_country_states_for_orders_batch_size', 100, $country_code, $old_to_new_states_mapping );

Where the hook is used in WooCommerce

Usage not found.