ANON_EM_REGISTER::define_trigger()

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


Source Source

File: src/integrations/events-manager/triggers/anon-em-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/events-manager/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			'type'                => 'anonymous',
			/* translators: Logged-in trigger - The Events Manager */
			'sentence'            => sprintf( esc_attr__( 'An attendee registers for {{an event:%1$s}}', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - The Events Manager */
			'select_option_name'  => esc_attr__( 'An attendee registers for {{an event}}', 'uncanny-automator' ),
			'action'              => 'em_bookings_added',
			'priority'            => 99,
			'accepted_args'       => 1,
			'validation_function' => array( $this, 'attendee_registered_for_event' ),
			'options'             => array(
				Automator()->helpers->recipe->events_manager->options->all_em_events(
					null,
					$this->trigger_meta,
					array(
						'any_option' => true,
					)
				),
			),
		);

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