EC_REGISTER::define_trigger()

Define and register the trigger by pushing it into the Automator object


Source Source

File: src/integrations/event-tickets/triggers/ec-register.php

	public function define_trigger() {



		$trigger = array(
			'author'              => Automator()->get_author_name( $this->trigger_code ),
			'support_link'        => Automator()->get_author_support_link( $this->trigger_code, 'integration/the-events-calendar/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			/* translators: Logged-in trigger - The Events Calendar */
			'sentence'            => sprintf( esc_attr__( 'A user registers for {{an event:%1$s}}', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - The Events Calendar */
			'select_option_name'  => esc_attr__( 'A user registers for {{an event}}', 'uncanny-automator' ),
			'action'              => [
				'event_tickets_rsvp_tickets_generated_for_product',
				'event_tickets_woocommerce_tickets_generated_for_product',
				'event_tickets_tpp_tickets_generated_for_product',
			],
			'priority'            => 10,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'user_registered' ),
			'options'             => [
				Automator()->helpers->recipe->event_tickets->options->all_ec_events(),
			],
		);

		Automator()->register->trigger( $trigger );

		return;
	}