Form_Manager::fetch_from_db( int $form_id )

Internal method to fetch a form from the database.

Description

See also

Parameters

$form_id

(int) (Required) ID of the form to fetch.

Return

(awsmug\Torro_Forms\DB_Objects\Forms\WP_Post|null) Post object of the form, or null if not found.

Source

File: src/db-objects/forms/form-manager.php

	protected function fetch_from_db( $form_id ) {
		$post = get_post( $form_id );
		if ( ! $post || $this->get_prefix() . 'form' !== $post->post_type ) {
			return null;
		}

		// TODO: Remove this logic in the future.
		$this->legacy_upgrades->maybe_upgrade_legacy_form_meta( $post->ID );

		return $post;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.