Noptin_Abstract_Trigger::trigger( int|object|array|Noptin_Subscriber $subscriber, array $args )
Triggers action callbacks.
Parameters Parameters
- $subscriber
(int|object|array|Noptin_Subscriber) (Required) The subscriber.
- $args
(array) (Required) Extra arguments passed to the action.
Return Return
(void)
Source Source
File: includes/automation-rules/triggers/class-noptin-abstract-trigger.php
public function trigger( $subscriber, $args ) { $subscriber = new Noptin_Subscriber( $subscriber ); foreach ( $this->get_rules() as $rule ) { // Retrieve the action. $action = noptin()->automation_rules->get_action( $rule->action_id ); if ( empty( $action ) ) { continue; } // Prepare the rule. $rule = noptin()->automation_rules->prepare_rule( $rule ); // Ensure that the rule is valid for the provided args. if ( $this->is_rule_valid_for_args( $rule, $args, $subscriber, $action ) ) { $action->maybe_run( $subscriber, $rule, $args ); } } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.2.8 | Introduced. |