WP_USERROLE::define_action()

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


Source Source

File: src/integrations/wp/actions/wp-userrole.php

	public function define_action() {



		$action = array(
			'author'             => Automator()->get_author_name( $this->action_code ),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/wordpress-core/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - WordPress */
			'sentence'           => sprintf( esc_attr__( "Change the user's role to {{a new role:%1\$s}}", 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - WordPress */
			'select_option_name' => esc_attr__( "Change the user's role to {{a new role}}", 'uncanny-automator' ),
			'priority'           => 11,
			'accepted_args'      => 3,
			'execution_function' => array( $this, 'user_role' ),
			'options'            => [
				Automator()->helpers->recipe->wp->options->wp_user_roles(),
			],
		);

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