function claro_preprocess_entity_add_list

Same name and namespace in other branches
  1. 9 core/themes/claro/claro.theme \claro_preprocess_entity_add_list()
  2. 8.9.x core/themes/claro/claro.theme \claro_preprocess_entity_add_list()
  3. 10 core/themes/claro/claro.theme \claro_preprocess_entity_add_list()

Implements template_preprocess_HOOK() for entity_add_list.

File

core/themes/claro/claro.theme, line 202

Code

function claro_preprocess_entity_add_list(&$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.