WP_USERROLEUPDATED::define_trigger()

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


Source Source

File: src/integrations/wp/triggers/wp-userroleupdated.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,
			'meta'                => $this->trigger_meta,
			/* translators: Logged-in trigger - WordPress Core */
			'sentence'            => sprintf( __( "A user's role changes to {{a specific role:%1\$s}}", 'uncanny-automator' ), $this->trigger_meta ),
			/* translators: Logged-in trigger - WordPress Core */
			'select_option_name'  => __( "A user's role changes to {{a specific role}}", 'uncanny-automator' ),
			'action'              => 'set_user_role',
			'priority'            => 90,
			'accepted_args'       => 3,
			'validation_function' => array( $this, 'set_user_role' ),
			'options_group'       => array(),
			'options'             => array(
				Automator()->helpers->recipe->wp->options->wp_user_roles(),
			),
		);

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