Skip to content
Snippets Groups Projects
Commit e6cba46a authored by catch's avatar catch
Browse files

Issue #2717541 by msankhala, manish-31, sulfikar_s, Abhijith S, tanubansal,...

Issue #2717541 by msankhala, manish-31, sulfikar_s, Abhijith S, tanubansal, andypost, ashrafabed, alexpott: hook_block_alter documentation missing
parent 32d59119
Branches
Tags
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!16Draft: Resolve #2081585 "History storage"
......@@ -216,6 +216,23 @@ function hook_block_access(\Drupal\block\Entity\Block $block, $operation, \Drupa
return AccessResult::neutral();
}
/**
* Allow modules to alter the block plugin definitions.
*
* @param array[] $definitions
* The array of block definitions, keyed by plugin ID.
*
* @ingroup block_api
*/
function hook_block_alter(&$definitions) {
foreach ($definitions as $id => $definition) {
if (strpos($id, 'system_menu_block:') === 0) {
// Replace $definition properties: id, deriver, class, provider to ones
// provided by this custom module.
}
}
}
/**
* @} End of "addtogroup hooks".
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment