MigrationHelper::migrate_country_states()public staticWC 1.0

Migrate state codes in all the required places in the database, needed after they change for a given country.

Метод класса: MigrationHelper{}

Хуков нет.


true|false. True if there are more records that need to be migrated, false otherwise.


$result = MigrationHelper::migrate_country_states( $country_code, $old_to_new_states_mapping ): bool;
$country_code(строка) (обязательный)
The country that has the states for which the migration is needed.
$old_to_new_states_mapping(массив) (обязательный)
An associative array where keys are the old state codes and values are the new state codes.

Код MigrationHelper::migrate_country_states() WC 8.9.3

public static function migrate_country_states( string $country_code, array $old_to_new_states_mapping ): bool {
	$more_remaining = self::migrate_country_states_for_orders( $country_code, $old_to_new_states_mapping );
	if ( ! $more_remaining ) {
		self::migrate_country_states_for_misc_data( $country_code, $old_to_new_states_mapping );
	return $more_remaining;