Skip to content
Snippets Groups Projects
Commit 8afa3d1a 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

(cherry picked from commit e6cba46a)
parent 2022aa5e
No related branches found
No related tags found
5 merge requests!1285Issue #3240655 by elfakhar Aligne the active border,!541Issue #3123070: Fix 'PSR2.Classes.PropertyDeclaration.Underscore' coding standard,!463Resolve #3205025 "Class align center for media",!386Allow multiple vocabularies in the taxonomy filter,!308Issue #3118206: Remote media does not validate provider
......@@ -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