drupal_pre_render_links($element)
Pre-render callback: Collects child links into a single array.
This function can be added as a pre_render callback for a renderable array, usually one which will be themed by links.html.twig. It iterates through all unrendered children of the element, collects any #links properties it finds, merges them into the parent element's #links array, and prevents those children from being rendered separately.
The purpose of this is to allow links to be logically groupe