WPJM_SUBMITJOB::define_trigger()

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


Source Source

File: src/integrations/wp-job-manager/triggers/wpjm-submitjob.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-job-manager/' ),
			'integration'         => self::$integration,
			'code'                => $this->trigger_code,
			/* translators: Logged-in trigger - WP Job Manager */
			'sentence'            => sprintf( esc_attr__( 'A user submits a {{specific type of:%1$s}} job', 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - WP Job Manager */
			'select_option_name'  => esc_attr__( 'A user submits a {{specific type of}} job', 'uncanny-automator' ),
			'action'              => 'transition_post_status',
			'priority'            => 20,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'job_manager_job_submitted' ),
			'options'             => [
				Automator()->helpers->recipe->wp_job_manager->options->list_wpjm_job_types(),
			],
		);

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