CAFE Forms
Front-end forms built from your field groups. A form creates a post, or edits a post, a user (profile), a term or the global options, with the same fields, validation and storage as the edit screens in wp-admin.
cafe_dynamic_form( [
'id' => 'new-event',
'field_groups' => [ 'group_event_details' ],
'post_type' => 'event',
'post_fields' => [ 'title' ],
] );
There is no second field builder and no second storage: a form only chooses which field groups to show and what to save. Change a field in its field group and every form using it changes too.
Pages
| Page | What it covers |
|---|---|
| Getting started | Your first form in five minutes (admin or PHP) |
| Creating posts | Post type, title/content/excerpt, categories, status, visitors |
| Editing objects | Posts, the signed-in user's profile, terms, global options |
| Fields | Which field types work in forms, and how |
| Layout | Labels, widths, tabs, sections and styling |
| Validation | Field checks, form-wide checks, what "all or nothing" means |
| Security | Signed settings, nonces, permissions, what the browser can never change |
| Media | Image, File, Gallery and Video fields in forms |
| Collections | Collection, Section Builder, Field Set and Clone in forms |
| Relationships | Post Object, Relationship, Taxonomy and User pickers |
| AJAX | Sending without reloading, and the no-JavaScript fallback |
| REST / headless | Describing, validating and submitting forms over REST |
| WPML | Forms on multilingual sites |
| Elementor | The "CAFE Form" widget |
| Hooks | Every form hook with examples |
| Developer API | Functions, arguments and results |
| Examples | Complete recipes |
| Troubleshooting | "The form does not show", "nothing is saved", … |
| Performance | Queries, assets, large forms |
What a form does, in order
render → the field groups' fields (same HTML as edit screens) + signed settings + nonce
submit → settings verified → nonce → who may use the form → only the form's fields
→ every field validated (+ cafe_dynamic_form_validate)
→ one database transaction: the post (create forms) + every CAFE value
→ success message, or redirect
Nothing is saved unless everything is valid.
Known limits
- Conditional logic is not evaluated yet, not in forms and not on edit screens. Fields with conditions are always shown.
- Only posts can be created. Users, terms and options can be edited, not created (use WordPress registration for new users).
- File uploads from the computer go through the WordPress media library, so
media fields are only shown to people who may upload files
(
upload_files). Visitors do not get media fields. See Media. - Browser QA of every field type in every theme is not automated; see Troubleshooting for what to check on your site.