CF_SUBFORM::define_trigger()

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


Source

File: src/integrations/caldera-forms/triggers/cf-subform.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/caldera-forms/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			/* translators: Logged-in trigger - Caldera Forms */
			'sentence'            => sprintf( esc_attr__( 'User submits {{a form:%1$s}} {{a number of:%2$s}} time(s)', 'uncanny-automator' ), $this->trigger_meta, 'NUMTIMES' ),
			/* translators: Logged-in trigger - Caldera Forms */
			'select_option_name'  => esc_attr__( 'User submits {{a form}}', 'uncanny-automator' ),
			'action'              => 'caldera_forms_submit_complete',
			'priority'            => 99,
			'accepted_args'       => 4,
			'validation_function' => array( $this, 'caldera_forms_submit' ),
			'options'             => [
				Automator()->helpers->recipe->caldera_forms->options->list_caldera_forms_forms(),
				Automator()->helpers->recipe->options->number_of_times(),
			],
		);
		Automator()->register->trigger( $trigger );
	}