Advertising sustains the DA. Ads are hidden for members. Join today

Actions UI module overview

Last updated on
8 January 2023

The Actions UI module provides tasks that can be executed by the website such as unpublishing content, sending an email, or banning a user. Other modules can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions. Actions UI is a core module in Drupal 8 and later.

To configure Actions, navigate to /admin/config/system/actions.

There are two types of Actions: simple and advanced. Simple Actions do not require any additional configuration and are listed here automatically. Advanced Actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an e-mail to a specified address or unpublishing content containing certain words.

Configuring Actions

From the Actions page, you can configure or create actions. To create an advanced action, select the action from the drop-down list in the advanced action section and click the Create button.

Declaring Actions functions

This section is obsolete since https://www.drupal.org/node/2020549 and needs to be rewritten.
Actions functions are declared by modules by implementing hook_action_info(). Modules can cause action functions to run by calling actions_do().

Each Actions function takes two to four arguments:

  1. - $entity: The object that the action acts on, such as a node, comment, or user
  2. - $context: Array of additional information about what triggered the action.
  3. - $a1, $a2: Optional additional information, which can be passed into actions_do() and will be passed along to the actions function.

Help improve this page

Page status: No known problems

You can: