Form_Category_Manager::fetch_from_db( int $form_category_id )

Internal method to fetch a form from the database.

Description

Parameters

$form_category_id

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

Return

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

Source

File: src/db-objects/form-categories/form-category-manager.php

	protected function fetch_from_db( $form_category_id ) {
		$term = get_term( $form_category_id );
		if ( ! $term || is_wp_error( $term ) || $this->get_prefix() . 'form_category' !== $term->taxonomy ) {
			return null;
		}

		return $term;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.