Skip to content

Commit 7aed5c1

Browse files
authored
Update starterkit readme file
Update starterkit readme file to align with latest changes in https://www.drupal.org/project/wxt/issues/3310485
1 parent c157eea commit 7aed5c1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

starterkits/wxt/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,20 @@ wxt:
7777
<?php
7878

7979
/**
80-
* Implements hook_theme_suggestions_HOOK_alter for blocks.
80+
* Implements hook_theme_suggestions_HOOK_alter().
8181
*/
8282
function 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

0 commit comments

Comments
 (0)