Noptin_Abstract_Action::maybe_run( Noptin_Subscriber $subscriber, Noptin_Automation_Rule $rule, array $args )

(Maybe) run the action.

Parameters Parameters


(Noptin_Subscriber) (Required) The subscriber.


(Noptin_Automation_Rule) (Required) The automation rule used to trigger the action.


(array) (Required) Extra arguments passed to the action.

Top ↑

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 ) ) {

        // 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' ) );


Top ↑

Changelog Changelog


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation