Is there a some sort of global preprocessing hook for any link on a Drupal site?
Use case:
I've got an enquiry webform embedded on a node that presets some inputs by URL parameters. Editors can set links to that enquiry node on multiple different places on the site (in navigation menus, inside text fields using LinkIt, in URL fields,...). When this enquiry link is shown on the full view of a node of type "product", I want to automatically add ?product_id=<current_node_id>
to the enquiry link.
Whenever the currently active context is a productcertain node type (e.g. on every full view of a product like "/product/product-idid"), I want all links that are rendered on the page (e.g. menu links, blocks, entity reference field on the product pointing to the enquiry node, etc) to have the product_id appended.
I know how to get the current node id in preprocessing and I do know hook_link_alter
for menus. But I wonder if there is some sort of global hook that captures all links, saving me from creating 453 different hooks doing all the same thing.