hook_block_build_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block)
Provide a block plugin specific block_build alteration.
In this hook name, BASE_BLOCK_ID refers to the block implementation's plugin id, regardless of whether the plugin supports derivatives. For example, for the \Drupal\system\Plugin\Block\SystemPoweredByBlock block, this would be 'system_powered_by_block' as per that class's annotation. And for the \Drupal\system\Plugin\Block\SystemMenuBlock block, it would be 'system_menu_block' as per that class's annotation, regardless of which menu the derived block is for.
array $build: A renderable array of data, only containing #cache.
\Drupal\Core\Block\BlockPluginInterface $block: The block plugin instance.
Entity CRUD, editing, and view hooks
function hook_block_build_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { // Explicitly enable placeholdering of the specific block. $build['#create_placeholder'] = TRUE; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!block!block.api.php/function/hook_block_build_BASE_BLOCK_ID_alter/8.1.x