Inserts a new submission value into the database.
Description
See also
Parameters
- $submission_id
-
(int) (Required) ID of the submission the value belongs to.
- $element_id
-
(int) (Required) ID of the element the value applies to.
- $field
-
(string) (Required) Slug of the field the value applies to.
- $value
-
(mixed) (Required) Value to set.
Return
(bool|WP_Error) True on success, or error object on failure.
Source
File: src/db-objects/forms/form-frontend-submission-handler.php
protected function insert_submission_value( $submission_id, $element_id, $field, $value ) { $submission_value = $this->form_manager->get_child_manager( 'submissions' )->get_child_manager( 'submission_values' )->create(); $submission_value->submission_id = $submission_id; $submission_value->element_id = $element_id; if ( '_main' !== $field ) { $submission_value->field = $field; } $submission_value->value = $value; return $submission_value->sync_upstream(); }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |