*/ public static function default_write_map(): array { return array( Tax_Id_Types::TYPE_EU_VAT => '_billing_vat_number', Tax_Id_Types::TYPE_GB_VAT => '_billing_vat_number', Tax_Id_Types::TYPE_SA_VAT => '_billing_vat_number', Tax_Id_Types::TYPE_AU_ABN => '_billing_vat_number', Tax_Id_Types::TYPE_CA_GST_HST => '_billing_vat_number', Tax_Id_Types::TYPE_US_EIN => '_billing_vat_number', Tax_Id_Types::TYPE_OTHER => '_billing_vat_number', Tax_Id_Types::TYPE_BR_CPF => '_billing_cpf', Tax_Id_Types::TYPE_BR_CNPJ => '_billing_cnpj', Tax_Id_Types::TYPE_IN_GST => '_billing_gstin', Tax_Id_Types::TYPE_IT_CF => '_billing_cf', Tax_Id_Types::TYPE_IT_PIVA => '_billing_piva', Tax_Id_Types::TYPE_ES_NIF => '_billing_nif', Tax_Id_Types::TYPE_AR_CUIT => '_billing_cuit', ); } /** * User-configured per-type overrides for the write map. * * Reads from the `tax_ids.write_map` settings tree, including the legacy * `general.tax_ids.write_map` fallback provided by Settings. Invalid types * or empty keys are silently dropped. * * @return array */ public static function get_overrides(): array { $raw = Settings::instance()->tax_id_write_map(); $out = array(); foreach ( $raw as $type => $meta_key ) { if ( ! \is_string( $type ) || ! Tax_Id_Types::is_valid_type( $type ) ) { continue; } if ( ! \is_string( $meta_key ) || '' === $meta_key ) { continue; } $out[ $type ] = $meta_key; } return $out; } }