Members::is_user_invited( int $user_id, int $form_id )

Checks whether a user has been previously invited to a form.

Description

See also

Parameters

$user_id

(int) (Required) User ID.

$form_id

(int) (Required) Form ID.

Return

(bool) True if the user has been invited, false otherwise.

Source

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

	protected function is_user_invited( $user_id, $form_id ) {
		$meta_key = $this->module->manager()->get_prefix() . 'invited_users';

		$data = $this->module->manager()->forms()->get_meta( $form_id, $meta_key );
		if ( ! is_array( $data ) ) {
			return false;
		}

		$data = array_map( 'absint', $data );

		if ( ! in_array( $user_id, $data, true ) ) {
			return false;
		}

		return true;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.