class BlockContentThemeSuggestionsTestThemeHooks
Hook implementations for block_content_theme_suggestions_test.
Hierarchy
- class \Drupal\block_content_theme_suggestions_test\Hook\BlockContentThemeSuggestionsTestThemeHooks
Expanded class hierarchy of BlockContentThemeSuggestionsTestThemeHooks
File
-
core/
modules/ block_content/ tests/ modules/ block_content_theme_suggestions_test/ src/ Hook/ BlockContentThemeSuggestionsTestThemeHooks.php, line 13
Namespace
Drupal\block_content_theme_suggestions_test\HookView source
class BlockContentThemeSuggestionsTestThemeHooks {
/**
* Implements hook_preprocess_block().
*/
public function preprocessBlock(&$variables) : void {
$block_content = $variables['elements']['content']['#block_content'] ?? NULL;
if ($block_content instanceof BlockContentInterface) {
$variables['label'] = $block_content->label();
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
BlockContentThemeSuggestionsTestThemeHooks::preprocessBlock | public | function | Implements hook_preprocess_block(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.