{"id":51156023,"url":"https://github.com/izzygld/full-state-name-for-gravity-forms","last_synced_at":"2026-06-26T10:30:41.115Z","repository":{"id":358968970,"uuid":"1243912921","full_name":"izzygld/full-state-name-for-gravity-forms","owner":"izzygld","description":"WordPress plugin that ensures Gravity Forms Address State sub-field (X.4) merge tags always render the full state name (e.g. New Jersey) instead of a 2-letter code (NJ).","archived":false,"fork":false,"pushed_at":"2026-05-19T20:05:11.000Z","size":246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T23:44:36.169Z","etag":null,"topics":["gravity-forms","gravity-forms-addon","merge-tags","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/izzygld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-19T19:38:06.000Z","updated_at":"2026-05-19T20:05:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/izzygld/full-state-name-for-gravity-forms","commit_stats":null,"previous_names":["izzygld/full-state-name-for-gravity-forms"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/izzygld/full-state-name-for-gravity-forms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izzygld%2Ffull-state-name-for-gravity-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izzygld%2Ffull-state-name-for-gravity-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izzygld%2Ffull-state-name-for-gravity-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izzygld%2Ffull-state-name-for-gravity-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izzygld","download_url":"https://codeload.github.com/izzygld/full-state-name-for-gravity-forms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izzygld%2Ffull-state-name-for-gravity-forms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34813782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gravity-forms","gravity-forms-addon","merge-tags","wordpress","wordpress-plugin"],"created_at":"2026-06-26T10:30:41.003Z","updated_at":"2026-06-26T10:30:41.100Z","avatar_url":"https://github.com/izzygld.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Full State Name for Gravity Forms\n\n[![License: GPL v2](https://img.shields.io/badge/License-GPLv2-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/gpl-2.0)\n\nA Gravity Forms add-on that fixes an inconsistency where the Address field's \"State / Province\" sub-input (input `X.4`) sometimes resolves to a 2-letter abbreviation (`NJ`) instead of the full state name (`New Jersey`) when used in merge tags.\n\n---\n\n## The Problem\n\nDepending on the form, the active add-on, and the code path, Gravity Forms' Address \"State / Province\" sub-input (`X.4`) sometimes resolves to a 2-letter code (`NJ`) and sometimes to the full label (`New Jersey`) when used in:\n\n- `{all_fields}` merge tag\n- `{Address (State / Province):X.4}` merge tag\n- Notifications \u0026 confirmations\n- URL query strings used to pre-populate another Gravity Form (the second form's State dropdown won't match `NJ` against its option value `New Jersey`, so the field stays blank)\n\n## The Solution\n\nThis plugin hooks into `gform_merge_tag_filter` and, **only when the merge tag targets an Address State sub-input (`X.4`) and the value is exactly two letters**, expands it back to the full state name Gravity Forms uses in its Address dropdown.\n\n---\n\n## Key Features\n\n| Feature | What it does |\n|---|---|\n| **Targeted** | Only Address `X.4` sub-inputs are touched — nothing else |\n| **Safe** | Only acts on exact 2-letter strings; full names + other text pass through |\n| **Zero config** | Activate the plugin and the fix is live |\n| **Filterable map** | `fsn_gf_state_map` filter to add non-US regions or translated labels |\n| **Filterable output** | `fsn_gf_expanded_state_name` filter for per-replacement customization |\n\n## How It Works\n\n```\n{Address:3.4} merge tag value = \"NJ\"\n                ↓\ngform_merge_tag_filter fires\n                ↓\nFSN_GF_Expander detects:\n   • field is Address\n   • input_id ends in .4\n   • value matches /^[A-Za-z]{2}$/\n                ↓\nFSN_GF_State_Map::code_to_name(\"NJ\") → \"New Jersey\"\n                ↓\nmerge tag now renders as \"New Jersey\"\n```\n\n## Coverage\n\nAll US states (50), DC, US territories (PR, GU, VI, AS, MP), and military mailing regions (AA, AE, AP) — **59 entries** that match the default Gravity Forms Address state options exactly.\n\n---\n\n## Requirements\n\n- WordPress 5.8+\n- PHP 7.4+\n- Gravity Forms 2.5+\n\n## Installation\n\n1. Download or clone this repository\n2. Upload the `full-state-name-for-gravity-forms` folder to `/wp-content/plugins/`\n3. Activate the plugin through the **Plugins** menu in WordPress\n4. Done — no settings page, no configuration\n\n## Project Structure\n\n```\nfull-state-name-for-gravity-forms/\n├── class-fsn-gf-addon.php             # Main GFAddOn subclass\n├── full-state-name-for-gravity-forms.php  # Plugin bootstrap\n├── includes/\n│   ├── class-state-code-map.php       # 2-letter → full name map (filterable)\n│   └── class-state-name-expander.php  # gform_merge_tag_filter handler\n├── languages/\n└── readme.txt\n```\n\n## Extending\n\n### Add or replace state entries (e.g. for non-US regions)\n\n```php\nadd_filter( 'fsn_gf_state_map', function ( $map ) {\n    $map['ON'] = 'Ontario';\n    $map['QC'] = 'Quebec';\n    return $map;\n} );\n```\n\n### Customize the expanded value before it replaces the merge tag\n\n```php\nadd_filter( 'fsn_gf_expanded_state_name', function ( $full, $code, $field, $input_id ) {\n    if ( $code === 'NY' ) {\n        return 'New York State';\n    }\n    return $full;\n}, 10, 4 );\n```\n\n## License\n\nGPL-2.0-or-later — same as Gravity Forms and WordPress itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizzygld%2Ffull-state-name-for-gravity-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizzygld%2Ffull-state-name-for-gravity-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizzygld%2Ffull-state-name-for-gravity-forms/lists"}