BDB_SETUSERSTATUS::define_action()

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


Source Source

File: src/integrations/buddyboss/actions/bdb-setuserstatus.php

	public function define_action() {

		$action = array(
			'author'             => Automator()->get_author_name(),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/buddyboss/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - BuddyBoss */
			'sentence'           => sprintf( esc_attr__( "Set the user's status to {{a specific status:%1\$s}}", 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - BuddyBoss */
			'select_option_name' => esc_attr__( "Set the user's status to {{a specific status}}", 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'set_user_status' ),
			'options'            => array(
				Automator()->helpers->recipe->field->select( array(
					'option_code' => $this->action_meta,
					'label'       => esc_attr__( 'Status', 'uncanny-automator' ),
					'options'     => array( 'active' => 'Active', 'suspend' => 'Suspend' ),
				) ),
			),
		);

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