Contact Forms Manager for Listeo: Developer Guide
Developer guide for form mapping storage, Contact Form 7 post meta, listing type filters, admin capability overrides, AJAX flows, and safe template customization.
Architecture overview
The plugin integrates Listeo listing context with Contact Form 7. It stores mapping settings in WordPress options, reads listing type/category metadata, and can create or update CF7 form posts and CF7 mail meta from the admin interface.
cfm_listeo_form_mappings.cfm_listeo_ai_settings.cfm_listeo_admin_capability.cfm_listeo_listing_types.Contact Form 7 data
When creating or updating forms, the plugin works with Contact Form 7 post meta such as _form, _mail, _mail_2, _additional_settings, _locale, and _hash. If you customize CF7 forms programmatically, use CF7-compatible APIs and keep mail arrays valid.
Listeo context
The plugin reads listing data such as _listing_type and _email. If your theme or importer uses non-standard fields, create a compatibility layer that normalizes listing type and email data before the form mapping runs.
Filters
| Filter | Use |
|---|---|
cfm_listeo_admin_capability | Change the capability required to access plugin admin pages. Audit carefully before lowering permissions. |
cfm_listeo_listing_types | Add or adjust listing type labels/options used by the mapping interface. |
listingpilot_hub_render_paths | ListingPilot Hub integration path filter. Use only for hub rendering compatibility. |
AJAX actions
| Action | Purpose |
|---|---|
cfm_listeo_ai_generate | Generate draft form content from the AI workflow. |
cfm_listeo_ai_save | Save generated form output. |
cfm_listeo_get_form_data | Retrieve form data for admin editing. |
cfm_listeo_activate_license, cfm_listeo_deactivate_license, cfm_listeo_check_updates | Reserved license/update actions. Do not override or call from custom code. |
Safe template customization
Prefer CSS and theme-level layout changes around the form area. If you need to alter form selection logic, create a small custom plugin that adjusts mapping inputs or listing type filters. Avoid editing plugin files directly because updates will overwrite changes.
Capability warnings
The plugin can create and modify Contact Form 7 forms and mail settings. If you allow non-administrators into the manager, they may be able to alter recipients and message content. Only lower cfm_listeo_admin_capability after testing roles on staging.
Test checklist
- Mappings resolve correctly for default, listing type, and category scenarios.
- Generated CF7 forms contain valid field tags.
- Mail recipients, reply-to headers, and message bodies are correct.
- Listing email fallback works only when the listing has a valid email.
- Admin capability changes do not expose settings to untrusted users.
- License and update flows remain untouched.