By smustgrave on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
main
Introduced in version:
12.0
Issue links:
Description:
A new hook has been added to the menu_ui module.
/**
* Alter the built menu_link_content entity based on the provided form values.
*
* @param \Drupal\menu_link_content\MenuLinkContentInterface $menu_link_content
* The menu_link_content entity.
* @param array $values
* Values for the menu link.
* @param \Drupal\Core\Entity\EntityInterface $parent
* The parent entity such as the node.
*/
function hook_menu_ui_menu_link_content_build_alter(MenuLinkContentInterface $menu_link_content, array $values, EntityInterface $parent): void {
$menu_link_content->get('enabled')->value = $values['link_enabled'];
}
Impacts:
Site builders, administrators, editors
Themers