ANON_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.
Contents
Parameters Parameters
- $form_id
-
(Required) .
- $recipes
-
(Optional) .
Default value: null
- $trigger_meta
-
(Optional) .
Default value: null
- $trigger_code
-
(Optional) .
Default value: null
Return Return
(array|bool)
Source Source
File: src/integrations/elementor/triggers/anon-elem-submitform.php
public function match_condition( $form_id, $recipes = null, $trigger_meta = null, $trigger_code = null ) { if ( null === $recipes ) { return false; } $recipe_ids = []; $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[ $trigger['ID'] ] = $recipe['ID']; } } } if ( ! empty( $recipe_ids ) ) { return [ 'recipe_ids' => $recipe_ids, 'result' => true ]; } return false; }
Expand full source code Collapse full source code View on Github