Is it possible to register hooks dynamically? I.e. not by hardcoding the hook handler into your code.
For instance, I'm writing a module and would like to add an option to some content type creation pages. I know this can be done using the
hook_form_FORM_ID_alter hook, but since I don't know what node types will exist in the drupal installation I obviously can't hardcode the hooks.
Or will I have to use
hook_form_BASE_FORM_ID_alter and check whether the option should be shown for that form? I'd really, REALLY would want to avoid that, since it's a really icky solution.
Or am I approaching this the wrong way?