ELEM_SUBMITFORM::match_condition( array $form_id, array $recipes = null, string $trigger_meta = null, string $trigger_code = null )

Matching Form id because its not an integer.


Parameters Parameters

$form_id

(array) (Required) .

$recipes

(array) (Optional) .

Default value: null

$trigger_meta

(string) (Optional) .

Default value: null

$trigger_code

(string) (Optional) .

Default value: null


Top ↑

Return Return

(array|bool)


Source Source

File: src/integrations/elementor/triggers/elem-submitform.php

	public function match_condition( $form_id, $recipes = null, $trigger_meta = null, $trigger_code = null ) {

		if ( null === $recipes ) {
			return false;
		}

		$recipe_ids     = array();
		$entry_to_match = $form_id;

		foreach ( $recipes as $recipe ) {
			foreach ( $recipe['triggers'] as $trigger ) {
				if ( key_exists( $trigger_meta, $trigger['meta'] ) && (string) $trigger['meta'][ $trigger_meta ] === (string) $entry_to_match ) {
					$recipe_ids[ $recipe['ID'] ] = $recipe['ID'];
					break;
				}
			}
		}

		if ( ! empty( $recipe_ids ) ) {
			return [ 'recipe_ids' => $recipe_ids, 'result' => true ];
		}

		return false;
	}