WP_SUBMITPOST::define_trigger()

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


Source Source

File: src/integrations/wp/triggers/wp-submitpost.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/wordpress-core/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			'action'              => 'shutdown',
			'validation_function' => array( $this, 'submit_post' ),
			'options'             => [
				[
					'option_code'        => 'NUMTIMES',
					'label'              => 'Number of Times',
					'input_type'         => 'text',
					// to setup example, lets define the value the child will be based on
					'current_value'      => false,
					'default_value'      => false,
					'validation_type'    => 'integer',
					'validation_message' => 'Please add how many times the page must be submitted.',
				],
			],
		);


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

		return;
	}