EM_BOOKING_APPROVED::define_trigger()

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


Source Source

File: src/integrations/events-manager/triggers/em-booking-approved.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,
			/* translators: Logged-in trigger - The Events Manager */
			'sentence'            => sprintf( esc_attr__( "A user's booking for {{an event:%1\$s}} is approved", 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - The Events Manager */
			'select_option_name'  => esc_attr__( "A user's booking for {{an event}} is approved", 'uncanny-automator' ),
			'action'              => array( 'em_booking_save', 'em_booking_set_status' ),
			'priority'            => 99,
			'accepted_args'       => 2,
			'validation_function' => array( $this, 'user_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 );
	}