[development] Giving form_alter an $op and calling it more than once.

Earl Miles merlin at logrus.com
Tue Apr 18 14:41:34 UTC 2006

Robert Douglass wrote:
> hook_form_additions
> hook_form_alter

Alternatively, you can do what I've done and add an '#after_build' to 
which will do almost exactly what you want.


my_hook_form_alter(...) {
  $form['my_addition'] = array(...stuff...);
  $form['my_addition']['#after_build'] = 'my_function_call'; // or maybe 
the key => args notation once after_build is modified to be an array of 
calls like everything else.

The downside of course is that you can only have one #after_build...per 
form element. But each form element can have one.

More information about the development mailing list