MP_PURCHASEPRODUCTONETIME::define_trigger()
Define and register the trigger by pushing it into the Automator object
Source
File: src/integrations/memberpress/triggers/mp-purchaseproductonetime.php
public function define_trigger() { $trigger = array( 'author' => Automator()->get_author_name(), 'support_link' => Automator()->get_author_support_link( $this->trigger_code, 'integration/memberpress/' ), 'integration' => self::$integration, 'code' => $this->trigger_code, /* translators: Logged-in trigger - MemberPress */ 'sentence' => sprintf( esc_attr__( 'A user purchases {{a one-time subscription product:%1$s}}', 'uncanny-automator' ), $this->trigger_meta ), /* translators: Logged-in trigger - MemberPress */ 'select_option_name' => esc_attr__( 'A user purchases {{a one-time subscription product}}', 'uncanny-automator' ), 'action' => 'mepr-event-transaction-completed', 'priority' => 20, 'accepted_args' => 1, 'validation_function' => array( $this, 'mp_product_purchased' ), 'options' => [ Automator()->helpers->recipe->memberpress->options->all_memberpress_products_onetime( null, $this->trigger_meta, [ 'uo_include_any' => true ] ), ], ); Automator()->register->trigger( $trigger ); }
Expand full source code Collapse full source code View on Github