Module::handle( awsmug\Torro_Forms\DB_Objects\Submissions\Submission $submission, awsmug\Torro_Forms\DB_Objects\Forms\Form $form )

Handles the action for a specific form submission.

Description

See also

Parameters

$submission

(awsmug\Torro_Forms\DB_Objects\Submissions\Submission) (Required) Submission to handle by the action.

$form

(awsmug\Torro_Forms\DB_Objects\Forms\Form) (Required) Form the submission applies to.

Source

File: src/modules/actions/module.php

	protected function handle( $submission, $form ) {
		foreach ( $this->submodules as $slug => $action ) {
			if ( ! $action->enabled( $form ) ) {
				continue;
			}

			$action_result = $action->handle( $submission, $form );

			if ( is_wp_error( $action_result ) ) {
				foreach ( $action_result->get_error_messages() as $error_message ) {
					/* translators: 1: form ID, 2: submission ID, 3: log message */
					$this->module->manager()->logger()->error( sprintf( _x( 'Form %1$s Submission %2$s: %3$s', 'submission process log', 'torro-forms' ), $form->id, $submission->id, $error_message ), $this->logging_context );
				}
			}
		}
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.