function ClaroHooks::preprocessEntityAddList

Same name and namespace in other branches
  1. main core/themes/claro/src/Hook/ClaroHooks.php \Drupal\claro\Hook\ClaroHooks::preprocessEntityAddList()

Implements hook_preprocess_HOOK() for entity_add_list.

Attributes

#[Hook('preprocess_entity_add_list')]

File

core/themes/claro/src/Hook/ClaroHooks.php, line 174

Class

ClaroHooks
Hook implementations for claro.

Namespace

Drupal\claro\Hook

Code

public function preprocessEntityAddList(&$variables) : void {
  // Remove description if empty.
  foreach ($variables['bundles'] as $type_id => $values) {
    if (isset($values['description']['#markup']) && empty($values['description']['#markup'])) {
      $variables['bundles'][$type_id]['description'] = [];
    }
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.