Problem/Motivation
There are some inconsistencies between how local tasks and local actions are handled.
For local tasks, there are 2 hooks:
hook_menu_local_tasks_alter()
- this allows local tasks to be altered prior to renderinghook_local_tasks_alter()
- this allows the altering of local task plugins during discovery
For local actions, there is only one hook, and the naming convention is actually the opposite of local tasks:
hook_menu_local_actions_alter()
- allows altering of local action plugins during discovery
Proposed resolution
Introduce a new hook_local_actions_render_alter()
executed prior to rendering.
Rename existing hook_menu_local_tasks_alter()
to hook_local_tasks_render_alter()
for the consistency.
Remaining tasks
Review, commit.
API changes
New hook_local_actions_render_alter()
hook is added.
Existing hook_menu_local_tasks_alter()
hook is deprecated and renamed to hook_local_tasks_render_alter()
.
See the change record for more details - https://www.drupal.org/node/3028611.