Timerange::enabled( awsmug\Torro_Forms\DB_Objects\Forms\Form $form )

Checks whether the access control is enabled for a specific form.

Description

See also

Parameters

$form

(awsmug\Torro_Forms\DB_Objects\Forms\Form) (Required) Form object to check.

Return

(bool) True if the access control is enabled, false otherwise.

Source

File: src/modules/access-controls/timerange.php

	public function enabled( $form ) {
		$start = $this->get_form_option( $form->id, 'start' );
		$end   = $this->get_form_option( $form->id, 'end' );

		if ( ! empty( $start ) && '0000-00-00 00:00:00' !== $start ) {
			return true;
		}

		if ( ! empty( $end ) && '0000-00-00 00:00:00' !== $end ) {
			return true;
		}

		return false;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.