Commit 8afa3d1a authored by catch's avatar catch

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

(cherry picked from commit e6cba46a)
parent 2022aa5e
......@@ -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".
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment