WPUM_USERREGISTER::define_trigger()

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


Source Source

File: src/integrations/wp-user-manager/triggers/wpum-userregister.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/wp-user-manager/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			/* translators: Logged-in trigger - WP User Manager */
			'sentence'            => sprintf( __( 'A user registers with {{a form:%1$s}}', 'uncanny-automator' ),
				$this->trigger_meta ),
			/* translators: Logged-in trigger - WP User Manager */
			'select_option_name'  => __( 'A user registers with {{a form}}', 'uncanny-automator' ),
			'action'              => 'wpum_after_registration',
			'priority'            => 99,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'wpum_register_user' ),
			'options'             => [
				Automator()->helpers->recipe->wp_user_manager->options->get_all_forms(
					__( 'Form', 'uncanny-automator' ), $this->trigger_meta, [ 'is_any' => true ] ),
			],
		);

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