Noptin_Abstract_Action::maybe_run( Noptin_Subscriber $subscriber, Noptin_Automation_Rule $rule, array $args )
(Maybe) run the action.
Parameters Parameters
- $subscriber
(Noptin_Subscriber) (Required) The subscriber.
- $rule
(Noptin_Automation_Rule) (Required) The automation rule used to trigger the action.
- $args
(array) (Required) Extra arguments passed to the action.
Source Source
File: includes/automation-rules/actions/class-noptin-abstract-action.php
public function maybe_run( $subscriber, $rule, $args ) { // Ensure that we can run the action. if ( ! $this->can_run( $subscriber, $rule, $args ) ) { return; } // Run the action. $this->run( $subscriber, $rule, $args ); // Update the run counts. $times_run = (int) $rule->times_run + 1; noptin()->automation_rules->update_rule( $rule, compact( 'times_run' ) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.3.0 | Introduced. |