Description
This plugin is an addon for Contact Form 7 that lets you list Colombian departments and cities. To list departments use: [dycccf7_state department]. To list cities use: [dycccf7_city city]. The city field automatically filters its options based on the department selected in the same form.
Features
- Two form-tag types: department dropdown and city dropdown.
- The city list updates automatically to match the selected department.
- Server-side validation confirms the submitted department and city actually belong to the official list, not just that the field isn’t empty.
- Script and data are only loaded on pages where the form actually uses these fields.
- Works correctly with multiple form instances on the same page.
Screenshots
![The [dycccf7_state] and [dycccf7_city] form-tags in the Contact Form 7 editor.](https://ps.w.org/departamentos-y-ciudades-de-colombia-para-contact-form-7/assets/screenshot-1.png?rev=2785003)
[dycccf7_state] and [dycccf7_city] form-tags in the Contact Form 7 editor.
Installation
The plugin can be installed in two ways.
Manual installation
- Download and upload the plugin files to the
/wp-content/plugins/departamentos-y-ciudades-de-colombia-para-contact-form-7directory. - Activate the plugin through the “Plugins” screen in WordPress.
WordPress interface installation
- Open the Plugins screen in your WordPress admin and click “Add New”.
- In the search box, type “Departamentos y Ciudades de Colombia para CF7” and press Enter.
- Click “Install” to install the plugin.
- Activate the plugin.
FAQ
-
How do I add the departments list?
-
Use the following form-tag in the Contact Form 7 editor:
[dycccf7_state department] -
Can I use the departments list on its own?
-
Yes, just use the
[dycccf7_state department]form-tag. -
Can I use the cities list on its own?
-
No, the department form-tag is required for the city field to work.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Departamentos y Ciudades de Colombia para Contact Form 7” is open source software. The following people have contributed to this plugin.
Contributors“Departamentos y Ciudades de Colombia para Contact Form 7” has been translated into 3 locales. Thank you to the translators for their contributions.
Translate “Departamentos y Ciudades de Colombia para Contact Form 7” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3.1
- Fixed: the plugin’s text domain now matches its slug, and internal function names use a consistent prefix.
- Removed the bundled translation files; translations are now handled entirely through translate.wordpress.org.
1.3.0
- Fixed: forms with more than one instance of the department/city fields no longer collide by sharing the same id; each instance now works independently.
- Fixed: the dropdowns now reset correctly when the form reloads or is added dynamically to the page (AJAX submissions, popups, etc.).
- Fixed: the
id:option from the CF7 tag editor is now respected and reflected in the HTML. - Fixed: the city field no longer renders if the form does not also include a department field (previously it stayed permanently disabled and unusable).
- Security: added server-side validation so the submitted department and city actually match the official list (previously only checked that the field wasn’t empty).
- Performance: the script and department/city data now only load on pages where the form actually uses these fields, instead of on the whole site.
- Performance: Colombia’s data was centralized into a single JSON file, avoiding duplication between PHP and JavaScript.
- Added translation support: the plugin’s base language is now English, with Spanish translations included (es_ES and es_CO).
1.2.0
- Code refactor.
- Added a check for the required CF7 plugin.
- Fixed an error shown when the field is required.
1.0.0
- Initial release.
