35. Post Submission | Form Forge - Build Forms with AI in Seconds
Download Log in

35. Post Submission

Developer Guide

Create WordPress posts or custom post types from form submissions. PRO feature.

Form Settings

json
{
  "settings": {
    "post_submission_enabled": true,
    "post_submission_type": "post",
    "post_submission_status": "draft",
    "post_title_field": "field_1",
    "post_content_field": "field_4"
  }
}

Post Meta

Each created post gets linking metadata:

php
update_post_meta( $new_post_id, '_formforge_submission_id', $submission_id );
update_post_meta( $new_post_id, '_formforge_form_id', $form->id );

User Registration

json
{
  "settings": {
    "create_user": true,
    "user_email_field": "email",
    "user_name_field": "full_name",
    "user_role": "subscriber"
  }
}

The handler reads user_email_field first, falls back to the first email field, creates a user with a random password when the email does not already exist, assigns the allowed role, and sends the WordPress new user notification. Duplicate emails are ignored rather than creating a second user or failing the visitor’s submission.

Mapped post title and content values are normalized through FORMFORGE_Value_Formatter, so scalar fields, lists, file arrays, and nested associative values are converted to readable text before insertion. If no content field is mapped, the fallback body renders every submitted field as escaped HTML with line breaks preserved.

Forge AI Assistant Online

Hi! I'm the Form Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs