Form_Frontend_Output_Handler::maybe_get_form_content( string $content )

Appends the content for a form if conditions are met.

Description

Parameters

$content

(string) (Required) Post content.

Return

(string) Post content including form content, if the current post is a form.

Source

File: src/db-objects/forms/form-frontend-output-handler.php

	public function maybe_get_form_content( $content ) {
		$form = $this->form_manager->get( get_the_ID() );
		if ( ! $form ) {
			return $content;
		}

		$submission = null;
		if ( isset( $_GET['torro_submission_id'] ) ) {
			$submission = $this->form_manager->get_child_manager( 'submissions' )->get( absint( $_GET['torro_submission_id'] ) );
			if ( $submission && $submission->form_id !== $form->id ) {
				$submission = null;
			}
		}

		ob_start();
		$this->render_form_content( $form, $submission );
		return ob_get_clean() . $content;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.