Forms management for the PRC Platform:
formcustom post type — reusable, block-composed form definitions- Form blocks —
prc-block/form,form-page,form-submit,form-message,form-captcha,form-message-bindings(form-input-* blocks remain in@prc/block-library) prc-block/synced-formblock — embed a saved form anywhere on the siteprc-block-library/formsdata store — form action registry consumed by the form block editor and downstream pluginsForm_RendererPHP utility — render a form CPT post by ID or slug from PHP (used by Content Gate, account pages, and other plugins)- Response logging — custom
prc_form_responsestable with REST API, unread state, and DataViews admin UI (src/response-admin/) - Abilities API — Jetpack-shaped
prc-block-forms/*tools for VIP MCP; Jetpackjetpack-forms/*abilities are suppressed. Full ability list and unread/spam semantics:docs/form.md. - REST submission handlers —
sendToEmailandlogResponseactions consumed byprc-block/form - Sample forms — optional Forms CPT seeds (e.g. Speaker Request (Sample) at slug
speaker-request) provisioned idempotently oninitviaForm_Sample_Provisioner; markup lives inpatterns/
| Block | Doc |
|---|---|
prc-block/form |
docs/form.md |
prc-block/form-page |
docs/form-page.md |
prc-block/form-submit |
docs/form-submit.md |
prc-block/form-message |
docs/form-message.md |
prc-block/form-captcha |
docs/form-captcha.md |
prc-block/form-message-bindings |
Editor-only binding registration companion |
On first run (and on self-heal when the seed version bumps), @prc/block-forms creates editable sample form posts editors can duplicate or embed with the Synced Form block:
| Slug | Title | Pattern file |
|---|---|---|
speaker-request |
Speaker Request (Sample) | patterns/speaker-request-form.php |
Sample forms are deletable — they are onboarding starters, not runtime dependencies. Update the form's Redirect Target (recipient email for sendToEmail) before going live.
Render a saved form from PHP without placing a synced-form block in content:
use PRC\Platform\Block_Forms\Form_Renderer;
// By slug (post_name on the form CPT).
$html = Form_Renderer::render_by_slug( 'account-login' );
// By post ID.
$html = Form_Renderer::render_by_id( 123 );Uses parse_blocks() + WP_Block::render() (not do_blocks()) so prc-block/form/formPostId context propagates to nested form blocks and submissions tie back to the form CPT.
Synced_Form::render_block_callback() delegates to Form_Renderer::render_by_id().
npx turbo build --filter=@prc/block-forms- Requires
prc-scriptsand should load before@prc/block-library(seeclient-mu-plugins/plugin-loader.php). Consumer plugins that register form actions (prc-user-accounts,prc-email-builder,prc-user-surveys,prc-quiz-builder) declareprc-block-formsinRequires Plugins.