File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 7777<?php
7878
7979/**
80- * Implements hook_theme_suggestions_HOOK_alter for blocks .
80+ * Implements hook_theme_suggestions_HOOK_alter() .
8181 */
8282function THEMENAME_theme_suggestions_block_alter(&$suggestions, $variables) {
83-
8483 // Load theme suggestions for blocks from parent theme.
85- foreach ($suggestions as &$suggestion) {
86- $suggestion = str_replace('THEMENAME_', 'wxt_bootstrap_', $suggestion);
84+ // https://www.drupal.org/project/wxt/issues/3310485#comment-14715969
85+ for ($i = 0; $i < count($suggestions); $i++) {
86+ if (str_contains($suggestions[$i], 'THEMENAME_')) {
87+ $new_suggestions = [
88+ str_replace('THEMENAME_', '', $suggestions[$i]),
89+ str_replace('THEMENAME_', 'wxt_bootstrap_', $suggestions[$i]),
90+ ];
91+ array_splice($suggestions, $i, 0, $new_suggestions);
92+ $i += 2;
93+ }
8794 }
8895}
8996
You can’t perform that action at this time.
0 commit comments