From cb331b40d2c47549b92b99c55dbc6dba9ba7be0c Mon Sep 17 00:00:00 2001 From: pookmish Date: Wed, 6 Dec 2023 01:06:18 +0700 Subject: [PATCH] Adjust conditions (#750) --- themes/stanford_basic/stanford_basic.theme | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/themes/stanford_basic/stanford_basic.theme b/themes/stanford_basic/stanford_basic.theme index a2f3a67fb..ca0d249fd 100755 --- a/themes/stanford_basic/stanford_basic.theme +++ b/themes/stanford_basic/stanford_basic.theme @@ -5,11 +5,12 @@ * Preprocess functions for Stanford Basic. */ -use Drupal\Core\Render\Element; -use Drupal\Core\Cache\CacheableMetadata; -use Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage; use Drupal\Component\Utility\Html; +use Drupal\Core\Block\BlockPluginInterface; +use Drupal\Core\Cache\CacheableMetadata; +use Drupal\Core\Render\Element; use Drupal\Core\Url; +use Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage; /** * Implements hook_library_info_alter(). @@ -227,7 +228,10 @@ function stanford_basic_preprocess_block(&$variables) { } } - if (!isset($variables['configuration']['label_display'])) { + if ( + !isset($variables['configuration']['label_display']) || + $variables['configuration']['label_display'] != BlockPluginInterface::BLOCK_LABEL_VISIBLE + ) { $variables['title_attributes']['aria-hidden'] = 'true'; } }