Automattic\WooCommerce\Database\Migrations
MigrationHelper::migrate_country_states()
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() MigrationHelper::migrate country states WC 8.7.0
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; }