function template_preprocess_paragraphs_actions

Prepares variables for paragraphs_actions component.

Default template: paragraphs-actions.html.twig.

Parameters

array $variables: An associative array containing:

  • actions: An array of default action buttons.
  • dropdown_actions: An array of buttons for dropdown.

File

paragraphs/paragraphs.module, line 382
Contains paragraphs.module

Code

function template_preprocess_paragraphs_actions(&$variables) {

  // Define variables for the template.
  $variables += [
    'actions' => [],
    'dropdown_actions' => [],
  ];
  $element = $variables['element'];
  if (!empty($element['actions'])) {
    $variables['actions'] = $element['actions'];
  }
  if (!empty($element['dropdown_actions'])) {
    $variables['dropdown_actions'] = $element['dropdown_actions'];
  }
}