Skip to main content

Submissions

Form submissions are stored in a custom database table (wp_cf_submissions) for fast querying and flexible management. The admin interface provides card-based views, status tracking, bulk actions, CSV export, and email replies.

Database Table

Table: wp_cf_submissions

Column Type Description
id INT Primary key
form_id INT Form post ID
data LONGTEXT JSON-encoded field data
ip_address VARCHAR Submitter's IP address
user_agent TEXT Browser user agent string
referer_url TEXT Page URL where form was submitted
is_spam TINYINT 1 if flagged as spam, 0 otherwise
status VARCHAR Submission status
draft_token VARCHAR Token for save-and-resume
current_step INT Current step for multi-step forms
submitted_at TIMESTAMP When the submission was created
modified_at TIMESTAMP When the submission was last modified

Statuses

Status Constant Description
new Submission::STATUS_NEW Fresh submission, not yet viewed
draft Submission::STATUS_DRAFT Saved but not submitted (save-and-resume)
partial Submission::STATUS_PARTIAL Multi-step form, partially completed
read Submission::STATUS_READ Viewed by an admin
replied Submission::STATUS_REPLIED Admin has replied via email
archived Submission::STATUS_ARCHIVED Archived/closed

Admin Interface

Per-Form Submissions

Navigate to Core Forms > [Form Name] > Submissions tab to see submissions for a specific form.

All Submissions

Navigate to Core Forms > All Submissions for a global view across all forms. Uses the AllSubmissions and AllSubmissionsTable classes.

Card-Based View

Submissions are displayed in a card layout showing: - Submission ID and timestamp - Status badge - Field data preview - Quick actions (view, reply, archive, delete)

Submission Editor

Click a submission to open the detail view (SubmissionEditor), which shows: - All submitted field data - File upload links - IP address and user agent - Submission history and status changes - Action logs for this submission - Reply form

Bulk Actions

The submissions table supports bulk actions: - Mark as read - Archive - Delete - Mark as spam / Not spam

CSV Export

Export submissions via the Data Exporter extension:

  1. Go to the form's Submissions tab
  2. Click Export CSV
  3. All submissions (or filtered set) are downloaded as a CSV file

The export includes all field data columns plus submission metadata (ID, status, timestamp, IP).

Reply to Submissions

Reply to a submitter directly from the admin via SubmissionReply:

  1. Open a submission in the editor
  2. Type your reply message
  3. Click Send Reply

The reply is sent as an email and the submission status changes to replied. Reply history is stored using the Reply class.

REST API

List Submissions

GET /wp-json/cf/v1/submissions
GET /wp-json/cf/v1/forms/{form_id}/submissions

Parameters: per_page, page, status, search.

Get Single Submission

GET /wp-json/cf/v1/submissions/{id}

Update Submission

PATCH /wp-json/cf/v1/submissions/{id}

Body: { "status": "archived" }

Delete Submission

DELETE /wp-json/cf/v1/submissions/{id}

All endpoints require the edit_forms capability.

PHP Functions

// Get a single submission
$submission = cf_get_form_submission( $submission_id );

// Get all submissions for a form
$submissions = cf_get_form_submissions( $form_id );

// Create a submission from a database row
$submission = Submission::from_object( $row );

// Check if submission is a draft
if ( $submission->is_draft() ) {
    // Handle partial submission
}

The Submission Object

$submission->id;            // INT - Primary key
$submission->form_id;       // INT - Form post ID
$submission->data;          // ARRAY - Field data
$submission->ip_address;    // STRING
$submission->user_agent;    // STRING
$submission->referer_url;   // STRING
$submission->is_spam;       // BOOL
$submission->status;        // STRING - One of the STATUS_* constants
$submission->draft_token;   // STRING|NULL
$submission->current_step;  // INT - For multi-step forms
$submission->submitted_at;  // STRING - Datetime
$submission->modified_at;   // STRING|NULL - Datetime

Related