From ea99cad0390e5fffbc9f08a75d8954e029dfc7a9 Mon Sep 17 00:00:00 2001 From: xjm <xjm@65776.no-reply.drupal.org> Date: Fri, 10 Nov 2023 19:08:52 -0600 Subject: [PATCH] Issue #3393955 by quietone, xjm, smustgrave: Correct $suggestions documentation in hook_theme_suggestions_alter() (cherry picked from commit c85f28b7a38e0dcc6deabc9a7b526c5d7584c9c4) --- core/lib/Drupal/Core/Render/theme.api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/lib/Drupal/Core/Render/theme.api.php b/core/lib/Drupal/Core/Render/theme.api.php index 36f1c0969873..58a930a8b953 100644 --- a/core/lib/Drupal/Core/Render/theme.api.php +++ b/core/lib/Drupal/Core/Render/theme.api.php @@ -668,6 +668,7 @@ function hook_theme_suggestions_HOOK(array $variables) { * * In the following example, we provide an alternative template suggestion to * node and taxonomy term templates based on the user being logged in. + * * @code * function MYMODULE_theme_suggestions_alter(array &$suggestions, array $variables, $hook) { * if (\Drupal::currentUser()->isAuthenticated() && in_array($hook, array('node', 'taxonomy_term'))) { @@ -677,8 +678,9 @@ function hook_theme_suggestions_HOOK(array $variables) { * * @endcode * - * @param array $suggestions - * An array of alternate, more specific names for template files. + * @param array &$suggestions + * An array of alternate, more specific names for template files, passed by + * reference. * @param array $variables * An array of variables passed to the theme hook. Note that this hook is * invoked before any variable preprocessing. -- GitLab