The Block Form Alter module provides functions to alter block forms consistently across implementing plugins:
hook_block_plugin_form_alter()
hook_block_type_form_alter()
Block forms are rendered by implementing plugins, which may require duplicate code in some instances where a developer desires to alter a given block form. This is particularly true when altering forms rendered by Layout Builder.
Supported Modules
- Block (core)
- Block Content (core)
- Layout Builder (core)
hook_block_plugin_form_alter()
The hook_block_plugin_form_alter()
function allows for block forms to be targeted by plugin id. Block forms rendered by the 'block_content' and 'inline_block' plugins must be altered with hook_block_type_form_alter()
. See block_form_alter.api.php for details.
hook_block_type_form_alter()
The hook_block_type_form_alter()
function modifies block forms rendered by both Block Content ('block_content' plugin) and Layout Builder ('inline_block' plugin). See block_form_alter.api.php for details.
Related Core Issue
Project information
- Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Developer Tools
- 5,104 sites report using this module
- Created by Chris Burge on , updated
- Drupal 10 is here!
Drupal 10 ready!
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.